@wavemaker/app-runtime-wm-build 11.5.4-rc.5516 → 11.5.4-rc.5517

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.
@@ -1736,7 +1736,7 @@ i.version="2.30.1",o(Zn),i.fn=uo,i.min=er,i.max=tr,i.now=nr,i.utc=m,i.unix=co,i.
1736
1736
  function(e,t){var n,r,i;!function(o,s){"use strict";r=[],void 0===(i="function"==typeof(n=function(e){return function(t){var n="3.4.4";function r(){t.arrayAccessForm=t.arrayAccessForm||"none",t.emptyNodeForm=t.emptyNodeForm||"text",t.jsAttributeFilter=t.jsAttributeFilter,t.jsAttributeConverter=t.jsAttributeConverter,t.attributeConverters=t.attributeConverters||[],t.datetimeAccessFormPaths=t.datetimeAccessFormPaths||[],t.arrayAccessFormPaths=t.arrayAccessFormPaths||[],t.xmldomOptions=t.xmldomOptions||{},void 0===t.enableToStringFunc&&(t.enableToStringFunc=!0),void 0===t.skipEmptyTextNodesForObj&&(t.skipEmptyTextNodesForObj=!0),void 0===t.stripWhitespaces&&(t.stripWhitespaces=!0),void 0===t.useDoubleQuotes&&(t.useDoubleQuotes=!0),void 0===t.ignoreRoot&&(t.ignoreRoot=!1),void 0===t.escapeMode&&(t.escapeMode=!0),void 0===t.attributePrefix&&(t.attributePrefix="_"),void 0===t.selfClosingElements&&(t.selfClosingElements=!0),void 0===t.keepCData&&(t.keepCData=!1),void 0===t.keepText&&(t.keepText=!1),void 0===t.jsDateUTC&&(t.jsDateUTC=!1)}function i(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|^\n+|(\s|\n)+$/g,"")}),"function"!=typeof Date.prototype.toISOString&&(Date.prototype.toISOString=function(){var t=1e3;return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/t).toFixed(3)).slice(2,5)+"Z"})}t=t||{},r(),i();var o={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function s(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!==t||(t=e.nodeName),t}function a(e){return e.prefix}function l(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"):e}function u(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&amp;/g,"&")}function c(e,n,r){if("property"===t.arrayAccessForm)e[n]instanceof Array?e[n+"_asArray"]=e[n]:e[n+"_asArray"]=[e[n]];if(!(e[n]instanceof Array)&&t.arrayAccessFormPaths.length>0){for(var i=!1,o=0;o<t.arrayAccessFormPaths.length;o++){var s=t.arrayAccessFormPaths[o];if("string"==typeof s){if(s===r){i=!0;break}}else if(s instanceof RegExp){if(s.test(r)){i=!0;break}}else if("function"==typeof s&&s(n,r)){i=!0;break}}i&&(e[n]=[e[n]])}}function d(e){var t=60,n=e.split(/[-T:+Z]/g),r=new Date(n[0],n[1]-1,n[2]),i=n[5].split(".");if(r.setHours(n[3],n[4],i[0]),i.length>1&&r.setMilliseconds(i[1]),n[6]&&n[7]){var o=n[6]*t+Number(n[7]);o=0+("-"===(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*o:o),r.setMinutes(r.getMinutes()-o-r.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())));return r}function h(e,n,r){if(t.datetimeAccessFormPaths.length>0)for(var i=r.split(".#")[0],o=0;o<t.datetimeAccessFormPaths.length;o++){var s=t.datetimeAccessFormPaths[o];if("string"==typeof s){if(s===i)return d(e)}else if(s instanceof RegExp){if(s.test(i))return d(e)}else if("function"==typeof s&&s(i))return d(e)}return e}function p(e){for(var n={},r=e.childNodes,i=0;i<r.length;i++){var a=r.item(i);if(a.nodeType===o.ELEMENT_NODE){var l=s(a);t.ignoreRoot?n=m(a,l):n[l]=m(a,l)}}return n}function f(e,n){for(var r={__cnt:0},i=e.childNodes,l=0;l<i.length;l++){var d=i.item(l),p=s(d);d.nodeType!==o.COMMENT_NODE&&(r.__cnt++,null==r[p]?(r[p]=m(d,n+"."+p),c(r,p,n+"."+p)):(r[p]instanceof Array||(r[p]=[r[p]],c(r,p,n+"."+p)),r[p][r[p].length]=m(d,n+"."+p)))}for(var f=0;f<e.attributes.length;f++){var g=e.attributes.item(f);r.__cnt++;for(var v=g.value,y=0;y<t.attributeConverters.length;y++){var _=t.attributeConverters[y];_.test.call(null,g.name,g.value)&&(v=_.convert.call(null,g.name,g.value))}r[t.attributePrefix+g.name]=v}var b=a(e);return b&&(r.__cnt++,r.__prefix=b),r["#text"]&&(r.__text=r["#text"],r.__text instanceof Array&&(r.__text=r.__text.join("\n")),t.escapeMode&&(r.__text=u(r.__text)),t.stripWhitespaces&&(r.__text=r.__text.trim()),delete r["#text"],"property"===t.arrayAccessForm&&delete r["#text_asArray"],r.__text=h(r.__text,"#text",n+".#text")),r.hasOwnProperty("#cdata-section")&&(r.__cdata=r["#cdata-section"],delete r["#cdata-section"],"property"===t.arrayAccessForm&&delete r["#cdata-section_asArray"]),1===r.__cnt&&r.__text&&!t.keepText?r=r.__text:0===r.__cnt&&"text"===t.emptyNodeForm?r="":r.__cnt>1&&void 0!==r.__text&&t.skipEmptyTextNodesForObj&&(t.stripWhitespaces&&""===r.__text||""===r.__text.trim())&&delete r.__text,delete r.__cnt,t.keepCData||r.hasOwnProperty("__text")||!r.hasOwnProperty("__cdata")||1!==Object.keys(r).length?(t.enableToStringFunc&&(r.__text||r.__cdata)&&(r.toString=function(){return(this.__text?this.__text:"")+(this.__cdata?this.__cdata:"")}),r):r.__cdata?r.__cdata:""}function m(e,t){return e.nodeType===o.DOCUMENT_NODE?p(e):e.nodeType===o.ELEMENT_NODE?f(e,t):e.nodeType===o.TEXT_NODE||e.nodeType===o.CDATA_SECTION_NODE?e.nodeValue:null}function g(e,n,r,i){var o="<"+(e&&e.__prefix?e.__prefix+":":"")+n;if(r)for(var s=0;s<r.length;s++){var a=r[s],u=e[a];t.escapeMode&&(u=l(u)),o+=" "+a.substr(t.attributePrefix.length)+"=",t.useDoubleQuotes?o+='"'+u+'"':o+="'"+u+"'"}return o+=i?" />":">"}function v(e,t){return"</"+(e&&e.__prefix?e.__prefix+":":"")+t+">"}function y(e,t){return-1!==e.indexOf(t,e.length-t.length)}function _(e,n){return!!("property"===t.arrayAccessForm&&y(n.toString(),"_asArray")||0===n.toString().indexOf(t.attributePrefix)||0===n.toString().indexOf("__")||e[n]instanceof Function)}function b(e){var t=0;if(e instanceof Object)for(var n in e)_(e,n)||t++;return t}function w(e){var n=[];if(e instanceof Object)for(var r in e)-1===r.toString().indexOf("__")&&0===r.toString().indexOf(t.attributePrefix)&&n.push(r);return n}function x(e){var n="";return e.__cdata&&(n+="<![CDATA["+e.__cdata+"]]>"),(e.__text||"number"==typeof e.__text||"boolean"==typeof e.__text)&&(t.escapeMode?n+=l(e.__text):n+=e.__text),n}function S(e){var n="";return e instanceof Object?n+=x(e):null!==e&&(t.escapeMode?n+=l(e):n+=e),n}function k(e,t,n){var r="";if(0===e.length)r+=g(e,t,n,!0);else for(var i=0;i<e.length;i++)r+=T(e[i],t,w(e[i]));return r}function T(e,n,r){var i="";if(t.jsAttributeFilter&&t.jsAttributeFilter.call(null,n,e))return i;if(t.jsAttributeConverter&&(e=t.jsAttributeConverter.call(null,n,e)),null!=e&&""!==e||!t.selfClosingElements)if("object"==typeof e)if("[object Array]"===Object.prototype.toString.call(e))i+=k(e,n,r);else if(e instanceof Date)i+=g(e,n,r,!1),i+=t.jsDateUTC?e.toUTCString():e.toISOString(),i+=v(e,n);else{b(e)>0||"number"==typeof e.__text||"boolean"==typeof e.__text||e.__text||e.__cdata?(i+=g(e,n,r,!1),i+=E(e),i+=v(e,n)):t.selfClosingElements?i+=g(e,n,r,!0):(i+=g(e,n,r,!1),i+=v(e,n))}else i+=g(e,n,r,!1),i+=S(e),i+=v(e,n);else i+=g(e,n,r,!0);return i}function E(e){var t="";if(b(e)>0)for(var n in e)if(!_(e,n)){var r=e[n];t+=T(r,n,w(r))}return t+=S(e)}function D(n){if(void 0===n)return null;if("string"!=typeof n)return null;var r=null,i=null;if(e)i=(r=new e(t.xmldomOptions)).parseFromString(n,"text/xml");else if(window&&window.DOMParser){r=new window.DOMParser;var o=null;if(!(window.ActiveXObject||"ActiveXObject"in window)&&document.all&&!document.addEventListener)try{o=r.parseFromString("INVALID","text/xml").childNodes[0].namespaceURI}catch(e){o=null}try{i=r.parseFromString(n,"text/xml"),null!==o&&i.getElementsByTagNameNS(o,"parsererror").length>0&&(i=null)}catch(e){i=null}}else 0===n.indexOf("<?")&&(n=n.substr(n.indexOf("?>")+2)),(i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(n);return i}this.asArray=function(e){return null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?d(e):e},this.xml2dom=function(e){return D(e)},this.dom2js=function(e){return m(e,null)},this.js2dom=function(e){return D(this.js2xml(e))},this.xml2js=function(e){var t=D(e);return null!=t?this.dom2js(t):null},this.js2xml=function(e){return E(e)},this.getVersion=function(){return n}}})?n.apply(t,r):n)||(e.exports=i)}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";
1737
1737
  /*!******************!*\
1738
1738
  !*** ./index.ts ***!
1739
- \******************/n.r(r),n.d(r,{$rootScope:()=>e.$rootScope,ApiAwareVariable:()=>o.ApiAwareVariable,BaseAction:()=>i.BaseAction,CONSTANTS:()=>e.CONSTANTS,CrudVariable:()=>u.CrudVariable,DB_CONSTANTS:()=>e.DB_CONSTANTS,LVService:()=>d.LVService,LiveVariable:()=>c.LiveVariable,LiveVariableUtils:()=>h.LiveVariableUtils,ModelVariable:()=>a.ModelVariable,SWAGGER_CONSTANTS:()=>e.SWAGGER_CONSTANTS,ServiceVariable:()=>l.ServiceVariable,TEST:()=>p,TimerAction:()=>s.TimerAction,VARIABLE_CONSTANTS:()=>e.VARIABLE_CONSTANTS,VARIABLE_URLS:()=>e.VARIABLE_URLS,WS_CONSTANTS:()=>e.WS_CONSTANTS,appManager:()=>t.appManager,debounceVariableCall:()=>t.debounceVariableCall,decodeData:()=>t.decodeData,dialogService:()=>t.dialogService,formatDate:()=>t.formatDate,formatExportExpression:()=>t.formatExportExpression,generateConnectionParams:()=>d.generateConnectionParams,getBlob:()=>t.getBlob,getErrMessage:()=>t.getErrMessage,getEvaluatedOrderBy:()=>t.getEvaluatedOrderBy,getTarget:()=>t.getTarget,getTargetNodeKey:()=>t.getTargetNodeKey,getTargetObj:()=>t.getTargetObj,httpService:()=>t.httpService,initiateCallback:()=>t.initiateCallback,internalBoundNodeMap:()=>t.internalBoundNodeMap,isFileUploadSupported:()=>t.isFileUploadSupported,metadataService:()=>t.metadataService,navigationService:()=>t.navigationService,oauthService:()=>t.oauthService,parseConfig:()=>d.parseConfig,routerService:()=>t.routerService,securityService:()=>t.securityService,setInput:()=>t.setInput,setValueToNode:()=>t.setValueToNode,toasterService:()=>t.toasterService,updateInternalNodes:()=>t.updateInternalNodes,wmSetDependency:()=>t.wmSetDependency});var e=n(/*! ./src/constants/variables.constants */"./src/constants/variables.constants.ts"),t=n(/*! ./src/util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! ./src/model/base-action */"./src/model/base-action.ts"),o=n(/*! ./src/model/variable/api-aware-variable */"./src/model/variable/api-aware-variable.ts"),s=n(/*! ./src/model/action/timer-action */"./src/model/action/timer-action.ts"),a=n(/*! ./src/model/variable/model-variable */"./src/model/variable/model-variable.ts"),l=n(/*! ./src/model/variable/service-variable */"./src/model/variable/service-variable.ts"),u=n(/*! ./src/model/variable/crud-variable */"./src/model/variable/crud-variable.ts"),c=n(/*! ./src/model/variable/live-variable */"./src/model/variable/live-variable.ts"),d=(n(/*! ./src/types/http-client.service */"./src/types/http-client.service.ts"),n(/*! ./src/util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts")),h=n(/*! ./src/util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts"),p=(n(/*! ./src/types/date-formatter */"./src/types/date-formatter.ts"),"hello from variables")})(),r})())),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IMask={})}(this,(function(e){"use strict";function t(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new n.InputMask(e,t)}class r{constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}function i(e){return"string"==typeof e||e instanceof String}n.ChangeDetails=r;const o="NONE",s="LEFT",a="FORCE_LEFT",l="RIGHT",u="FORCE_RIGHT";function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function d(e){return Array.isArray(e)?e:[e,new r]}function h(e,t){if(t===e)return!0;var n,r=Array.isArray(t),i=Array.isArray(e);if(r&&i){if(t.length!=e.length)return!1;for(n=0;n<t.length;n++)if(!h(t[n],e[n]))return!1;return!0}if(r!=i)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){var o=t instanceof Date,s=e instanceof Date;if(o&&s)return t.getTime()==e.getTime();if(o!=s)return!1;var a=t instanceof RegExp,l=e instanceof RegExp;if(a&&l)return t.toString()==e.toString();if(a!=l)return!1;var u=Object.keys(t);for(n=0;n<u.length;n++)if(!Object.prototype.hasOwnProperty.call(e,u[n]))return!1;for(n=0;n<u.length;n++)if(!h(e[u[n]],t[u[n]]))return!1;return!0}return!(!t||!e||"function"!=typeof t||"function"!=typeof e)&&t.toString()===e.toString()}class p{constructor(e,t,n,r){for(this.value=e,this.cursorPos=t,this.oldValue=n,this.oldSelection=r;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?o:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?s:l}}class f{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;this.value=e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class m{constructor(e){this._value="",this._update(Object.assign({},m.DEFAULTS,e)),this.isInitialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e)}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{input:!0};return this.reset(),this.append(e,t,""),this.doCommit(),this.value}get unmaskedValue(){return this.value}set unmaskedValue(e){this.reset(),this.append(e,{},""),this.doCommit()}get typedValue(){return this.doParse(this.value)}set typedValue(e){this.value=this.doFormat(e)}get rawInputValue(){return this.extractInput(0,this.value.length,{raw:!0})}set rawInputValue(e){this.reset(),this.append(e,{raw:!0},""),this.doCommit()}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return Math.min(this.value.length,t-e)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(e,t)}extractTail(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new f(this.extractInput(e,t),e)}appendTail(e){return i(e)&&(e=new f(String(e))),e.appendTo(this)}_appendCharRaw(e){return e?(this._value+=e,new r({inserted:e,rawInserted:e})):new r}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=this.state;let o;if([e,o]=d(this.doPrepare(e,t)),o=o.aggregate(this._appendCharRaw(e,t)),o.inserted){let e,s=!1!==this.doValidate(t);if(s&&null!=n){const t=this.state;!0===this.overwrite&&(e=n.state,n.unshift(this.value.length-o.tailShift));let r=this.appendTail(n);s=r.rawInserted===n.toString(),s&&r.inserted||"shift"!==this.overwrite||(this.state=t,e=n.state,n.shift(),r=this.appendTail(n),s=r.rawInserted===n.toString()),s&&r.inserted&&(this.state=t)}s||(o=new r,this.state=i,n&&e&&(n.state=e))}return o}_appendPlaceholder(){return new r}_appendEager(){return new r}append(e,t,n){if(!i(e))throw new Error("value should be string");const o=new r,s=i(n)?new f(String(n)):n;null!=t&&t.tail&&(t._beforeTailState=this.state);for(let n=0;n<e.length;++n){const r=this._appendChar(e[n],t,s);if(!r.rawInserted&&!this.doSkipInvalid(e[n],t,s))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&o.aggregate(this._appendEager()),null!=s&&(o.tailShift+=this.appendTail(s).tailShift),o}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,e)+this.value.slice(t),new r}withValueRefresh(e){if(this._refreshing||!this.isInitialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==n&&0===n.indexOf(this.value)&&this.append(n.slice(this.value.length),{},""),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this.isInitialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e){return this.skipInvalid}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(e,this,t):e}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}doFormat(e){return this.format?this.format(e,this):e}doParse(e){return this.parse?this.parse(e,this):e}splice(e,t,n,i){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{input:!0};const d=e+t,h=this.extractTail(d),p=!0===this.eager||"remove"===this.eager;let f;p&&(i=function(e){switch(e){case s:return a;case l:return u;default:return e}}(i),f=this.extractInput(0,d,{raw:!0}));let m=e;const g=new r;if(i!==o&&(m=this.nearestInputPos(e,t>1&&0!==e&&!p?o:i),g.tailShift=m-e),g.aggregate(this.remove(m)),p&&i!==o&&f===this.rawInputValue)if(i===a){let e;for(;f===this.rawInputValue&&(e=this.value.length);)g.aggregate(new r({tailShift:-1})).aggregate(this.remove(e-1))}else i===u&&h.unshift();return g.aggregate(this.append(n,c,h))}maskEquals(e){return this.mask===e}typedValueEquals(e){const t=this.typedValue;return e===t||m.EMPTY_VALUES.includes(e)&&m.EMPTY_VALUES.includes(t)||this.doFormat(e)===this.doFormat(this.typedValue)}}function g(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?n.MaskedRegExp:i(e)?n.MaskedPattern:e instanceof Date||e===Date?n.MaskedDate:e instanceof Number||"number"==typeof e||e===Number?n.MaskedNumber:Array.isArray(e)||e===Array?n.MaskedDynamic:n.Masked&&e.prototype instanceof n.Masked?e:e instanceof n.Masked?e.constructor:e instanceof Function?n.MaskedFunction:(console.warn("Mask not found for mask",e),n.Masked)}function v(e){if(n.Masked&&e instanceof n.Masked)return e;const t=(e=Object.assign({},e)).mask;if(n.Masked&&t instanceof n.Masked)return t;const r=g(t);if(!r)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new r(e)}m.DEFAULTS={format:String,parse:e=>e,skipInvalid:!0},m.EMPTY_VALUES=[void 0,null,""],n.Masked=m,n.createMask=v;const y=["parent","isOptional","placeholderChar","displayChar","lazy","eager"],_={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class b{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a}=e,l=t(e,y);this.masked=v(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===e&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new r}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isFilled)return new r;const n=this.masked.state,i=this.masked._appendChar(e,t);return i.inserted&&!1===this.doValidate(t)&&(i.inserted=i.rawInserted="",this.masked.state=n),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=Boolean(i.inserted),i}append(){return this.masked.append(...arguments)}_appendPlaceholder(){const e=new r;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new r}extractTail(){return this.masked.extractTail(...arguments)}appendTail(){return this.masked.appendTail(...arguments)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(e,t,n)}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const n=this.value.length,r=Math.min(Math.max(e,0),n);switch(t){case s:case a:return this.isComplete?r:0;case l:case u:return this.isComplete?r:n;default:return r}}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(e,t).length}doValidate(){return this.masked.doValidate(...arguments)&&(!this.parent||this.parent.doValidate(...arguments))}doCommit(){this.masked.doCommit()}get state(){return{masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}}class w{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new r}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const n=this._value.length;switch(t){case s:case a:return 0;default:return n}}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._isRawInput?t-e:0}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new r;if(this.isFilled)return n;const i=!0===this.eager||"append"===this.eager,o=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!i)&&!t.tail;return o&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=o&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new r;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return arguments.length>1&&void 0!==arguments[1]||this.value.length,new f("")}appendTail(e){return i(e)&&(e=new f(String(e))),e.appendTo(this)}append(e,t,n){const r=this._appendChar(e[0],t);return null!=n&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_isRawInput:this._isRawInput}}set state(e){Object.assign(this,e)}}const x=["chunks"];class S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;i(e)&&(e=new f(String(e)));const t=this.chunks[this.chunks.length-1],n=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof f)n?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof S){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof n.MaskedPattern))return new f(this.toString()).appendTo(e);const t=new r;for(let n=0;n<this.chunks.length&&!t.skip;++n){const r=this.chunks[n],i=e._mapPosToBlock(e.value.length),o=r.stop;let s;if(null!=o&&(!i||i.index<=o)){if(r instanceof S||e._stops.indexOf(o)>=0){const n=e._appendPlaceholder(o);t.aggregate(n)}s=r instanceof S&&e._blocks[o]}if(s){const n=s.appendTail(r);n.skip=!1,t.aggregate(n),e._value+=n.inserted;const i=r.toString().slice(n.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(r.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map((e=>e.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n}=e,r=t(e,x);Object.assign(this,r),this.chunks=n.map((e=>{const t="chunks"in e?new S:new f;return t.state=e,t}))}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";const t=null!=e?e-this.from:e;let n=0;for(;n<this.chunks.length;){const e=this.chunks[n],r=e.unshift(t);if(e.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class k{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return this.state=e,e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.value.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null===(t=this.block)||void 0===t?void 0:t.value.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,a),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,s),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,s),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,u),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,o),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,o),!0}))}}class T extends m{_update(e){e.mask&&(e.validate=t=>t.search(e.mask)>=0),super._update(e)}}n.MaskedRegExp=T;const E=["_blocks"];class D extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.definitions=Object.assign({},_,e.definitions),super(Object.assign({},D.DEFAULTS,e))}_update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};let t=this.mask;if(!t||!e)return;let r=!1,i=!1;for(let a=0;a<t.length;++a){var o,s;if(this.blocks){const e=t.slice(a),n=Object.keys(this.blocks).filter((t=>0===e.indexOf(t)));n.sort(((e,t)=>t.length-e.length));const r=n[0];if(r){const e=v(Object.assign({parent:this,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite},this.blocks[r]));e&&(this._blocks.push(e),this._maskedBlocks[r]||(this._maskedBlocks[r]=[]),this._maskedBlocks[r].push(this._blocks.length-1)),a+=r.length-1;continue}}let l=t[a],u=l in e;if(l===D.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===l||"}"===l){r=!r;continue}if("["===l||"]"===l){i=!i;continue}if(l===D.ESCAPE_CHAR){if(++a,l=t[a],!l)break;u=!1}const c=null===(o=e[l])||void 0===o||!o.mask||(null===(s=e[l])||void 0===s?void 0:s.mask.prototype)instanceof n.Masked?{mask:e[l]}:e[l],d=u?new b(Object.assign({parent:this,isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},c)):new w({char:l,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}get state(){return Object.assign({},super.state,{_blocks:this._blocks.map((e=>e.state))})}set state(e){const{_blocks:n}=e,r=t(e,E);this._blocks.forEach(((e,t)=>e.state=n[t])),super.state=r}reset(){super.reset(),this._blocks.forEach((e=>e.reset()))}get isComplete(){return this._blocks.every((e=>e.isComplete))}get isFilled(){return this._blocks.every((e=>e.isFilled))}get isFixed(){return this._blocks.every((e=>e.isFixed))}get isOptional(){return this._blocks.every((e=>e.isOptional))}doCommit(){this._blocks.forEach((e=>e.doCommit())),super.doCommit()}get unmaskedValue(){return this._blocks.reduce(((e,t)=>e+t.unmaskedValue),"")}set unmaskedValue(e){super.unmaskedValue=e}get value(){return this._blocks.reduce(((e,t)=>e+t.value),"")}set value(e){super.value=e}get displayValue(){return this._blocks.reduce(((e,t)=>e+t.displayValue),"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new r;let n=null===(e=this._mapPosToBlock(this.value.length))||void 0===e?void 0:e.index;if(null==n)return t;this._blocks[n].isFilled&&++n;for(let e=n;e<this._blocks.length;++e){const n=this._blocks[e]._appendEager();if(!n.inserted)break;t.aggregate(n)}return t}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this._mapPosToBlock(this.value.length),i=new r;if(!n)return i;for(let r=n.index;;++r){var o,s;const n=this._blocks[r];if(!n)break;const a=n._appendChar(e,Object.assign({},t,{_beforeTailState:null===(o=t._beforeTailState)||void 0===o||null===(s=o._blocks)||void 0===s?void 0:s[r]})),l=a.skip;if(i.aggregate(a),l||a.rawInserted)break}return i}extractTail(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;const n=new S;return e===t||this._forEachBlocksInRange(e,t,((e,t,r,i)=>{const o=e.extractTail(r,i);o.stop=this._findStopBefore(t),o.from=this._blockStartPos(t),o instanceof S&&(o.blockIndex=t),n.extend(o)})),n}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return"";let r="";return this._forEachBlocksInRange(e,t,((e,t,i,o)=>{r+=e.extractInput(i,o,n)})),r}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const r=this._stops[n];if(!(r<=e))break;t=r}return t}_appendPlaceholder(e){const t=new r;if(this.lazy&&null==e)return t;const n=this._mapPosToBlock(this.value.length);if(!n)return t;const i=n.index,o=null!=e?e:this._blocks.length;return this._blocks.slice(i,o).forEach((n=>{if(!n.lazy||null!=e){const e=null!=n._blocks?[n._blocks.length]:[],r=n._appendPlaceholder(...e);this._value+=r.inserted,t.aggregate(r)}})),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const r=this._blocks[n],i=t.length;if(t+=r.value,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce(((e,t)=>e+t.value.length),0)}_forEachBlocksInRange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;const r=this._mapPosToBlock(e);if(r){const e=this._mapPosToBlock(t),i=e&&r.index===e.index,o=r.offset,s=e&&i?e.offset:this._blocks[r.index].value.length;if(n(this._blocks[r.index],r.index,o,s),e&&!i){for(let t=r.index+1;t<e.index;++t)n(this._blocks[t],t,0,this._blocks[t].value.length);n(this._blocks[e.index],e.index,0,e.offset)}}}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n.aggregate(e.remove(r,i))})),n}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(!this._blocks.length)return 0;const n=new k(this,e);if(t===o)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.value.length);if(t===s||t===a){if(t===s){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===s){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e)return n.pos;if(n.popState(),n.ok&&n.pos<=e)return n.pos;n.popState()}return n.ok?n.pos:t===a?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}return t===l||t===u?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===u?this.value.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(e,s)))):e}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=0;return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n+=e.totalInputPositions(r,i)})),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map((e=>this._blocks[e])):[]}}D.DEFAULTS={lazy:!0,placeholderChar:"_"},D.STOP_CHAR="`",D.ESCAPE_CHAR="\\",D.InputDefinition=b,D.FixedDefinition=w,n.MaskedPattern=D;class C extends D{get _matchFrom(){return this.maxLength-String(this.from).length}_update(e){e=Object.assign({to:this.to||0,from:this.from||0,maxLength:this.maxLength||0},e);let t=String(e.to).length;null!=e.maxLength&&(t=Math.max(t,e.maxLength)),e.maxLength=t;const n=String(e.from).padStart(t,"0"),r=String(e.to).padStart(t,"0");let i=0;for(;i<r.length&&r[i]===n[i];)++i;e.mask=r.slice(0,i).replace(/0/g,"\\0")+"0".repeat(t-i),super._update(e)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",n="";const[,r,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(r.length)+i,n="9".repeat(r.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepare(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if([e,t]=d(super.doPrepare(e.replace(/\D/g,""),n)),!this.autofix||!e)return e;const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0");let o=this.value+e;if(o.length>this.maxLength)return"";const[s,a]=this.boundaries(o);return Number(a)<this.from?r[o.length-1]:Number(s)>this.to?"pad"===this.autofix&&o.length<this.maxLength?["",t.aggregate(this.append(r[o.length-1]+e,n))]:i[o.length-1]:e}doValidate(){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[t,n]=this.boundaries(e);return this.from<=Number(n)&&Number(t)<=this.to&&super.doValidate(...arguments)}}n.MaskedRange=C;class M extends D{constructor(e){super(Object.assign({},M.DEFAULTS,e))}_update(e){e.mask===Date&&delete e.mask,e.pattern&&(e.mask=e.pattern);const t=e.blocks;e.blocks=Object.assign({},M.GET_DEFAULT_BLOCKS()),e.min&&(e.blocks.Y.from=e.min.getFullYear()),e.max&&(e.blocks.Y.to=e.max.getFullYear()),e.min&&e.max&&e.blocks.Y.from===e.blocks.Y.to&&(e.blocks.m.from=e.min.getMonth()+1,e.blocks.m.to=e.max.getMonth()+1,e.blocks.m.from===e.blocks.m.to&&(e.blocks.d.from=e.min.getDate(),e.blocks.d.to=e.max.getDate())),Object.assign(e.blocks,this.blocks,t),Object.keys(e.blocks).forEach((t=>{const n=e.blocks[t];!("autofix"in n)&&"autofix"in e&&(n.autofix=e.autofix)})),super._update(e)}doValidate(){const e=this.date;return super.doValidate(...arguments)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}M.DEFAULTS={pattern:"d{.}`m{.}`Y",format:e=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:e=>{const[t,n,r]=e.split(".");return new Date(r,n-1,t)}},M.GET_DEFAULT_BLOCKS=()=>({d:{mask:C,from:1,to:31,maxLength:2},m:{mask:C,from:1,to:12,maxLength:2},Y:{mask:C,from:1900,to:9999}}),n.MaskedDate=M;class A{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch(e){}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch(e){}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch(e){}}_unsafeSelect(e,t){}get isActive(){return!1}bindEvents(e){}unbindEvents(){}}n.MaskElement=A;class I extends A{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,t,n;return null!==(e=null===(t=(n=this.input).getRootNode)||void 0===t?void 0:t.call(n))&&void 0!==e?e:document}get isActive(){return this.input===this.rootElement.activeElement}get _unsafeSelectionStart(){return this.input.selectionStart}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}bindEvents(e){Object.keys(e).forEach((t=>this._toggleEventHandler(I.EVENTS_MAP[t],e[t])))}unbindEvents(){Object.keys(this._handlers).forEach((e=>this._toggleEventHandler(e)))}_toggleEventHandler(e,t){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),t&&(this.input.addEventListener(e,t),this._handlers[e]=t)}}I.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},n.HTMLMaskElement=I;class L extends I{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n<r?n:r}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n>r?n:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const r=this.rootElement,i=r.getSelection&&r.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent}set value(e){this.input.textContent=e}}n.HTMLContenteditableMaskElement=L;const O=["mask"];class N{constructor(e,t){this.el=e instanceof A?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new L(e):new I(e),this.masked=v(t),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}get mask(){return this.masked.mask}maskEquals(e){var t;return null==e||(null===(t=this.masked)||void 0===t?void 0:t.maskEquals(e))}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof n.Masked)&&this.masked.constructor===g(e))return void this.masked.updateOptions({mask:e});const t=v({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=this._listeners[e];i&&i.forEach((e=>e(...n)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,t=this.masked.value,n=this.displayValue,r=this.unmaskedValue!==e||this.value!==t;this._unmaskedValue=e,this._value=t,this.el.value!==n&&(this.el.value=n),r&&this._fireChangeEvents()}updateOptions(e){const{mask:n}=e,r=t(e,O),i=!this.maskEquals(n),o=!h(this.masked,r);i&&(this.mask=n),o&&this.masked.updateOptions(r),(i||o)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,s))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const t=new p(this.el.value,this.cursorPos,this.displayValue,this._selection),n=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:o;let s=this.masked.nearestInputPos(t.startChangePos+r,i);i!==o&&(s=this.masked.nearestInputPos(s,o)),this.updateControl(),this.updateCursor(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}n.InputMask=N;class R extends D{_update(e){e.enum&&(e.mask="*".repeat(e.enum[0].length)),super._update(e)}doValidate(){return this.enum.some((e=>e.indexOf(this.unmaskedValue)>=0))&&super.doValidate(...arguments)}}n.MaskedEnum=R;class P extends m{constructor(e){super(Object.assign({},P.DEFAULTS,e))}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"(".concat(c(this.radix),"\\d{0,").concat(this.scale,"})?"):"")+"$";this._numberRegExp=new RegExp(e+"\\d*"+t),this._mapToRadixRegExp=new RegExp("[".concat(this.mapToRadix.map(c).join(""),"]"),"g"),this._thousandsSeparatorRegExp=new RegExp(c(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e);const[n,r]=d(super.doPrepare(e,t));return e&&!n&&(r.skip=!0),[n,r]}_separatorsCount(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return super._appendCharRaw(e,t);const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=super._appendCharRaw(e,t);this._value=this._insertThousandsSeparators(this._value);const o=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return i.tailShift+=(s-r)*this.thousandsSeparator.length,i.skip=!i.rawInserted&&e===this.thousandsSeparator,i}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;[e,t]=this._adjustRangeWithSeparators(e,t);const n=this.value.slice(0,e),i=this.value.slice(t),o=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+i));const s=this._separatorsCountFromSlice(n);return new r({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case o:case s:case a:{const n=this._findSeparatorAround(e-1);if(n>=0){const r=n+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===a)return n}break}case l:case u:{const t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doValidate(e){let t=Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));if(t){const e=this.number;t=t&&!isNaN(e)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return t&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.doFormat(t));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,((e,t,n,r)=>t+r)),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===P.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,P.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.doParse(this.unmaskedValue)}set typedValue(e){this.rawInputValue=this.doFormat(e).replace(P.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}typedValueEquals(e){return(super.typedValueEquals(e)||P.EMPTY_VALUES.includes(e)&&P.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}P.UNMASKED_RADIX=".",P.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:[P.UNMASKED_RADIX],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},P.EMPTY_VALUES=[...m.EMPTY_VALUES,0],n.MaskedNumber=P;class F extends m{_update(e){e.mask&&(e.validate=e.mask),super._update(e)}}n.MaskedFunction=F;const j=["compiledMasks","currentMaskRef","currentMask"],Y=["mask"];class H extends m{constructor(e){super(Object.assign({},H.DEFAULTS,e)),this.currentMask=null}_update(e){super._update(e),"mask"in e&&(this.compiledMasks=Array.isArray(e.mask)?e.mask.map((e=>v(e))):[])}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,o=this.rawInputValue,s=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:o,a=o.slice(s.length),l=this.currentMask,u=new r,c=null==l?void 0:l.state;if(this.currentMask=this.doDispatch(e,Object.assign({},t),n),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),s){const e=this.currentMask.append(s,{raw:!0});u.tailShift=e.inserted.length-i.length}a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=c;return u}_appendPlaceholder(){const e=this._applyDispatch(...arguments);return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch(...arguments);return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new r;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return Object.assign({},e,{_beforeTailState:(null===(t=e._beforeTailState)||void 0===t?void 0:t.currentMaskRef)===this.currentMask&&(null===(n=e._beforeTailState)||void 0===n?void 0:n.currentMask)||e._beforeTailState})}doDispatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,r]=d(super.doPrepare(e,t));if(this.currentMask){let e;[n,e]=d(super.doPrepare(n,this.currentMaskFlags(t))),r=r.aggregate(e)}return[n,r]}reset(){var e;null===(e=this.currentMask)||void 0===e||e.reset(),this.compiledMasks.forEach((e=>e.reset()))}get value(){return this.currentMask?this.currentMask.value:""}set value(e){super.value=e}get unmaskedValue(){return this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.currentMask?this.currentMask.typedValue:""}set typedValue(e){let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.isFilled)}remove(){const e=new r;return this.currentMask&&e.aggregate(this.currentMask.remove(...arguments)).aggregate(this._applyDispatch()),e}get state(){var e;return Object.assign({},super.state,{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((e=>e.state)),currentMaskRef:this.currentMask,currentMask:null===(e=this.currentMask)||void 0===e?void 0:e.state})}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i}=e,o=t(e,j);this.compiledMasks.forEach(((e,t)=>e.state=n[t])),null!=r&&(this.currentMask=r,this.currentMask.state=i),super.state=o}extractInput(){return this.currentMask?this.currentMask.extractInput(...arguments):""}extractTail(){return this.currentMask?this.currentMask.extractTail(...arguments):super.extractTail(...arguments)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(){return this.currentMask?this.currentMask.nearestInputPos(...arguments):super.nearestInputPos(...arguments)}get overwrite(){return this.currentMask?this.currentMask.overwrite:super.overwrite}set overwrite(e){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}get eager(){return this.currentMask?this.currentMask.eager:super.eager}set eager(e){console.warn('"eager" option is not available in dynamic mask, use this option in siblings')}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:super.skipInvalid}set skipInvalid(e){(this.isInitialized||e!==m.DEFAULTS.skipInvalid)&&console.warn('"skipInvalid" option is not available in dynamic mask, use this option in siblings')}maskEquals(e){return Array.isArray(e)&&this.compiledMasks.every(((n,r)=>{if(!e[r])return;const i=e[r],{mask:o}=i;return h(n,t(i,Y))&&n.maskEquals(o)}))}typedValueEquals(e){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.typedValueEquals(e))}}H.DEFAULTS={dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,o=t.compiledMasks.map(((o,s)=>{const l=t.currentMask===o,u=l?o.value.length:o.nearestInputPos(o.value.length,a);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(u),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(u,o.nearestInputPos(o.value.length,a)))}}));return o.sort(((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions)),t.compiledMasks[o[0].index]}},n.MaskedDynamic=H;const V={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V.MASKED;const r=v(e);return e=>r.runIsolated((r=>(r[t]=e,r[n])))}function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return B(...n)(e)}n.PIPE_TYPE=V,n.createPipe=B,n.pipe=U;try{globalThis.IMask=n}catch(e){}e.ChangeDetails=r,e.HTMLContenteditableMaskElement=L,e.HTMLMaskElement=I,e.InputMask=N,e.MaskElement=A,e.Masked=m,e.MaskedDate=M,e.MaskedDynamic=H,e.MaskedEnum=R,e.MaskedFunction=F,e.MaskedNumber=P,e.MaskedPattern=D,e.MaskedRange=C,e.MaskedRegExp=T,e.PIPE_TYPE=V,e.createMask=v,e.createPipe=B,e.default=n,e.pipe=U,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("imask")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms","imask"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).angularIMask={},e.ng.common,e.ng.core,e.ng.forms,e.IMask)}(this,(function(e,t,n,r,i){"use strict";var o,s,a=(o=n,s=Object.create(null),o&&Object.keys(o).forEach((function(e){if("default"!==e){var t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:function(){return o[e]}})}})),s.default=o,Object.freeze(s));class l{}l.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:l,deps:[],target:a.\u0275\u0275FactoryTarget.Injectable}),l.\u0275prov=a.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:l,providedIn:"root"}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:l,decorators:[{type:n.Injectable,args:[{providedIn:"root"}]}]});const u={provide:r.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((()=>d)),multi:!0},c=e=>e.nativeElement;class d{constructor(e,t,r,i,o){this._elementRef=e,this._renderer=t,this._factory=r,this._platformId=i,this._compositionMode=o,this.onTouched=()=>{},this.onChange=()=>{},this.imaskElement=c,this.accept=new n.EventEmitter,this.complete=new n.EventEmitter,this._viewInitialized=!1,this._composing=!1,this._writing=!1,null==this._compositionMode&&(this._compositionMode=!this._isAndroid())}get element(){return this.imaskElement(this._elementRef,this)}get maskValue(){return this.maskRef?"typed"===this.unmask?this.maskRef.typedValue:this.unmask?this.maskRef.unmaskedValue:this.maskRef.value:this.element.value}set maskValue(e){this.maskRef?"typed"===this.unmask?this.maskRef.typedValue=e:this.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e:this._renderer.setProperty(this.element,"value",e)}ngAfterViewInit(){this.imask&&this.initMask(),this._viewInitialized=!0}ngOnChanges(e){e.elementRef&&!this.imaskElement&&(this.imaskElement=c),e.imask&&this._viewInitialized&&(this.imask?this.maskRef?this.maskRef.updateOptions(this.imask):(this.initMask(),this.onChange(this.maskValue)):this.destroyMask())}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}ngOnDestroy(){this.destroyMask(),this.accept.complete(),this.complete.complete()}beginWrite(e){this._writing=!0,this._writingValue=e}endWrite(){return this._writing=!1,this._writingValue}writeValue(e){e=null==e?"":e,this.maskRef?(this.beginWrite(e),(this.maskValue!==e||"string"!=typeof e&&""===this.maskRef.value&&!this.maskRef.el.isActive)&&(this.maskValue=e)):this._renderer.setProperty(this.element,"value",e)}_onAccept(){const e=this.maskValue;this._writing&&e===this.endWrite()||(this.onChange(e),this.accept.emit(e))}_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(e){this._renderer.setProperty(this.element,"disabled",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}_handleInput(e){this.maskRef||(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this._handleInput(e)}_isAndroid(){return t.isPlatformBrowser(this._platformId)&&/android (\d+)/.test(navigator.userAgent.toLowerCase())}}d.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:d,deps:[{token:a.ElementRef},{token:a.Renderer2},{token:l},{token:n.PLATFORM_ID},{token:r.COMPOSITION_BUFFER_MODE,optional:!0}],target:a.\u0275\u0275FactoryTarget.Directive}),d.\u0275dir=a.\u0275\u0275ngDeclareDirective({minVersion:"12.0.0",version:"13.1.3",type:d,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:[u],exportAs:["imask"],usesOnChanges:!0,ngImport:a}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:d,decorators:[{type:n.Directive,args:[{selector:"[imask]",exportAs:"imask",host:{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},providers:[u]}]}],ctorParameters:function(){return[{type:a.ElementRef},{type:a.Renderer2},{type:l},{type:void 0,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[r.COMPOSITION_BUFFER_MODE]}]}]},propDecorators:{imask:[{type:n.Input}],unmask:[{type:n.Input}],imaskElement:[{type:n.Input}],accept:[{type:n.Output}],complete:[{type:n.Output}]}});class h{transform(...e){return i.pipe(...e)}}h.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:h,deps:[],target:a.\u0275\u0275FactoryTarget.Pipe}),h.\u0275pipe=a.\u0275\u0275ngDeclarePipe({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:h,name:"imask"}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:h,decorators:[{type:n.Pipe,args:[{name:"imask"}]}]});class p{create(e,t){return i(e,t)}}p.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:p,deps:[],target:a.\u0275\u0275FactoryTarget.Injectable}),p.\u0275prov=a.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:p,providedIn:"root"}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:p,decorators:[{type:n.Injectable,args:[{providedIn:"root"}]}]});class f{}f.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:f,deps:[],target:a.\u0275\u0275FactoryTarget.NgModule}),f.\u0275mod=a.\u0275\u0275ngDeclareNgModule({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:f,declarations:[d],imports:[t.CommonModule],exports:[d]}),f.\u0275inj=a.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:f,providers:[{provide:l,useClass:p}],imports:[[t.CommonModule]]}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:f,decorators:[{type:n.NgModule,args:[{imports:[t.CommonModule],declarations:[d],providers:[{provide:l,useClass:p}],exports:[d]}]}]});class m{}m.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:m,deps:[],target:a.\u0275\u0275FactoryTarget.NgModule}),m.\u0275mod=a.\u0275\u0275ngDeclareNgModule({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:m,declarations:[h],imports:[t.CommonModule,f],exports:[h,f]}),m.\u0275inj=a.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:m,imports:[[t.CommonModule,f],f]}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:a,type:m,decorators:[{type:n.NgModule,args:[{imports:[t.CommonModule,f],declarations:[h],exports:[h,f]}]}]}),Object.defineProperty(e,"PIPE_TYPE",{enumerable:!0,get:function(){return i.PIPE_TYPE}}),Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return i.pipe}}),e.IMaskDirective=d,e.IMaskDirectiveModule=f,e.IMaskFactory=l,e.IMaskModule=m,e.IMaskPipe=h,e.MASKEDINPUT_VALUE_ACCESSOR=u})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jmespath={})}(this,(function(e){"use strict";const t=e=>null!==e&&"[object Object]"===Object.prototype.toString.call(e),n=(e,r)=>{if(e===r)return!0;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t+=1)if(!n(e[t],r[t]))return!1;return!0}if(t(e)&&t(r)){const t=Object.entries(e),i=new Set(Object.keys(r));if(t.length!==i.size)return!1;for(const[e,o]of t){if(!n(o,r[e]))return!1;i.delete(e)}return 0===i.size}return!1},r=e=>{if(""===e||!1===e||null==e)return!0;if(Array.isArray(e)&&0===e.length)return!0;if(t(e)){for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},i=e=>e>="0"&&e<="9"||"-"===e;var o;!function(e){e.TOK_EOF="EOF",e.TOK_UNQUOTEDIDENTIFIER="UnquotedIdentifier",e.TOK_QUOTEDIDENTIFIER="QuotedIdentifier",e.TOK_RBRACKET="Rbracket",e.TOK_RPAREN="Rparen",e.TOK_COMMA="Comma",e.TOK_COLON="Colon",e.TOK_RBRACE="Rbrace",e.TOK_NUMBER="Number",e.TOK_CURRENT="Current",e.TOK_ROOT="Root",e.TOK_EXPREF="Expref",e.TOK_PIPE="Pipe",e.TOK_OR="Or",e.TOK_AND="And",e.TOK_EQ="EQ",e.TOK_GT="GT",e.TOK_LT="LT",e.TOK_GTE="GTE",e.TOK_LTE="LTE",e.TOK_NE="NE",e.TOK_FLATTEN="Flatten",e.TOK_STAR="Star",e.TOK_FILTER="Filter",e.TOK_DOT="Dot",e.TOK_NOT="Not",e.TOK_LBRACE="Lbrace",e.TOK_LBRACKET="Lbracket",e.TOK_LPAREN="Lparen",e.TOK_LITERAL="Literal"}(o||(o={}));const s={"(":o.TOK_LPAREN,")":o.TOK_RPAREN,"*":o.TOK_STAR,",":o.TOK_COMMA,".":o.TOK_DOT,":":o.TOK_COLON,"@":o.TOK_CURRENT,$:o.TOK_ROOT,"]":o.TOK_RBRACKET,"{":o.TOK_LBRACE,"}":o.TOK_RBRACE},a={"!":!0,"<":!0,"=":!0,">":!0},l={"\t":!0,"\n":!0,"\r":!0," ":!0};const u=new class{constructor(){this._current=0}tokenize(e){const t=[];let n,r,u;for(this._current=0;this._current<e.length;)if((c=e[this._current])>="a"&&c<="z"||c>="A"&&c<="Z"||"_"===c)n=this._current,r=this.consumeUnquotedIdentifier(e),t.push({start:n,type:o.TOK_UNQUOTEDIDENTIFIER,value:r});else if(void 0!==s[e[this._current]])t.push({start:this._current,type:s[e[this._current]],value:e[this._current]}),this._current+=1;else if(i(e[this._current]))u=this.consumeNumber(e),t.push(u);else if("["===e[this._current])u=this.consumeLBracket(e),t.push(u);else if('"'===e[this._current])n=this._current,r=this.consumeQuotedIdentifier(e),t.push({start:n,type:o.TOK_QUOTEDIDENTIFIER,value:r});else if("'"===e[this._current])n=this._current,r=this.consumeRawStringLiteral(e),t.push({start:n,type:o.TOK_LITERAL,value:r});else if("`"===e[this._current]){n=this._current;const r=this.consumeLiteral(e);t.push({start:n,type:o.TOK_LITERAL,value:r})}else if(void 0!==a[e[this._current]])u=this.consumeOperator(e),u&&t.push(u);else if(void 0!==l[e[this._current]])this._current+=1;else if("&"===e[this._current])n=this._current,this._current+=1,"&"===e[this._current]?(this._current+=1,t.push({start:n,type:o.TOK_AND,value:"&&"})):t.push({start:n,type:o.TOK_EXPREF,value:"&"});else{if("|"!==e[this._current]){const t=new Error(`Unknown character: ${e[this._current]}`);throw t.name="LexerError",t}n=this._current,this._current+=1,"|"===e[this._current]?(this._current+=1,t.push({start:n,type:o.TOK_OR,value:"||"})):t.push({start:n,type:o.TOK_PIPE,value:"|"})}var c;return t}consumeUnquotedIdentifier(e){const t=this._current;for(this._current+=1;this._current<e.length&&((n=e[this._current])>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||"_"===n);)this._current+=1;var n;return e.slice(t,this._current)}consumeQuotedIdentifier(e){const t=this._current;this._current+=1;const n=e.length;for(;'"'!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&'"'!==e[t+1]?t+=1:t+=2,this._current=t}return this._current+=1,JSON.parse(e.slice(t,this._current))}consumeRawStringLiteral(e){const t=this._current;this._current+=1;const n=e.length;for(;"'"!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&"'"!==e[t+1]?t+=1:t+=2,this._current=t}this._current+=1;return e.slice(t+1,this._current-1).replace("\\'","'")}consumeNumber(e){const t=this._current;this._current+=1;const n=e.length;for(;i(e[this._current])&&this._current<n;)this._current+=1;return{start:t,value:parseInt(e.slice(t,this._current),10),type:o.TOK_NUMBER}}consumeLBracket(e){const t=this._current;return this._current+=1,"?"===e[this._current]?(this._current+=1,{start:t,type:o.TOK_FILTER,value:"[?"}):"]"===e[this._current]?(this._current+=1,{start:t,type:o.TOK_FLATTEN,value:"[]"}):{start:t,type:o.TOK_LBRACKET,value:"["}}consumeOperator(e){const t=this._current,n=e[t];return this._current+=1,"!"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_NE,value:"!="}):{start:t,type:o.TOK_NOT,value:"!"}:"<"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_LTE,value:"<="}):{start:t,type:o.TOK_LT,value:"<"}:">"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_GTE,value:">="}):{start:t,type:o.TOK_GT,value:">"}:"="===n&&"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_EQ,value:"=="}):void 0}consumeLiteral(e){this._current+=1;const t=this._current,n=e.length;for(;"`"!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&"`"!==e[t+1]?t+=1:t+=2,this._current=t}let r=e.slice(t,this._current).trimLeft();r=r.replace("\\`","`");const i=this.looksLikeJSON(r)?JSON.parse(r):JSON.parse(`"${r}"`);return this._current+=1,i}looksLikeJSON(e){if(""===e)return!1;if('[{"'.includes(e[0]))return!0;if(["true","false","null"].includes(e))return!0;if("-0123456789".includes(e[0]))try{return JSON.parse(e),!0}catch(e){return!1}return!1}},c={[o.TOK_EOF]:0,[o.TOK_UNQUOTEDIDENTIFIER]:0,[o.TOK_QUOTEDIDENTIFIER]:0,[o.TOK_RBRACKET]:0,[o.TOK_RPAREN]:0,[o.TOK_COMMA]:0,[o.TOK_RBRACE]:0,[o.TOK_NUMBER]:0,[o.TOK_CURRENT]:0,[o.TOK_EXPREF]:0,[o.TOK_ROOT]:0,[o.TOK_PIPE]:1,[o.TOK_OR]:2,[o.TOK_AND]:3,[o.TOK_EQ]:5,[o.TOK_GT]:5,[o.TOK_LT]:5,[o.TOK_GTE]:5,[o.TOK_LTE]:5,[o.TOK_NE]:5,[o.TOK_FLATTEN]:9,[o.TOK_STAR]:20,[o.TOK_FILTER]:21,[o.TOK_DOT]:40,[o.TOK_NOT]:45,[o.TOK_LBRACE]:50,[o.TOK_LBRACKET]:55,[o.TOK_LPAREN]:60};const d=new class{constructor(){this.index=0,this.tokens=[]}parse(e){this.loadTokens(e),this.index=0;const t=this.expression(0);if(this.lookahead(0)!==o.TOK_EOF){const e=this.lookaheadToken(0);this.errorToken(e,`Unexpected token type: ${e.type}, value: ${e.value}`)}return t}loadTokens(e){this.tokens=[...u.tokenize(e),{type:o.TOK_EOF,value:"",start:e.length}]}expression(e){const t=this.lookaheadToken(0);this.advance();let n=this.nud(t),r=this.lookahead(0);for(;e<c[r];)this.advance(),n=this.led(r,n),r=this.lookahead(0);return n}lookahead(e){return this.tokens[this.index+e].type}lookaheadToken(e){return this.tokens[this.index+e]}advance(){this.index+=1}nud(e){let t,n,r;switch(e.type){case o.TOK_LITERAL:return{type:"Literal",value:e.value};case o.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:e.value};case o.TOK_QUOTEDIDENTIFIER:const i={type:"Field",name:e.value};if(this.lookahead(0)===o.TOK_LPAREN)throw new Error("Quoted identifier not allowed for function names.");return i;case o.TOK_NOT:return n=this.expression(c.Not),{type:"NotExpression",children:[n]};case o.TOK_STAR:return t={type:"Identity"},n=this.lookahead(0)===o.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(c.Star),{type:"ValueProjection",children:[t,n]};case o.TOK_FILTER:return this.led(e.type,{type:"Identity"});case o.TOK_LBRACE:return this.parseMultiselectHash();case o.TOK_FLATTEN:return t={type:o.TOK_FLATTEN,children:[{type:"Identity"}]},n=this.parseProjectionRHS(c.Flatten),{type:"Projection",children:[t,n]};case o.TOK_LBRACKET:return this.lookahead(0)===o.TOK_NUMBER||this.lookahead(0)===o.TOK_COLON?(n=this.parseIndexExpression(),this.projectIfSlice({type:"Identity"},n)):this.lookahead(0)===o.TOK_STAR&&this.lookahead(1)===o.TOK_RBRACKET?(this.advance(),this.advance(),n=this.parseProjectionRHS(c.Star),{children:[{type:"Identity"},n],type:"Projection"}):this.parseMultiselectList();case o.TOK_CURRENT:return{type:o.TOK_CURRENT};case o.TOK_ROOT:return{type:o.TOK_ROOT};case o.TOK_EXPREF:return r=this.expression(c.Expref),{type:"ExpressionReference",children:[r]};case o.TOK_LPAREN:const s=[];for(;this.lookahead(0)!==o.TOK_RPAREN;)this.lookahead(0)===o.TOK_CURRENT?(r={type:o.TOK_CURRENT},this.advance()):r=this.expression(0),s.push(r);return this.match(o.TOK_RPAREN),s[0];default:this.errorToken(e)}}led(e,t){let n;switch(e){case o.TOK_DOT:const r=c.Dot;return this.lookahead(0)!==o.TOK_STAR?(n=this.parseDotRHS(r),{type:"Subexpression",children:[t,n]}):(this.advance(),n=this.parseProjectionRHS(r),{type:"ValueProjection",children:[t,n]});case o.TOK_PIPE:return n=this.expression(c.Pipe),{type:o.TOK_PIPE,children:[t,n]};case o.TOK_OR:return n=this.expression(c.Or),{type:"OrExpression",children:[t,n]};case o.TOK_AND:return n=this.expression(c.And),{type:"AndExpression",children:[t,n]};case o.TOK_LPAREN:const i=t.name,s=[];let a;for(;this.lookahead(0)!==o.TOK_RPAREN;)this.lookahead(0)===o.TOK_CURRENT?(a={type:o.TOK_CURRENT},this.advance()):a=this.expression(0),this.lookahead(0)===o.TOK_COMMA&&this.match(o.TOK_COMMA),s.push(a);this.match(o.TOK_RPAREN);return{name:i,type:"Function",children:s};case o.TOK_FILTER:const l=this.expression(0);return this.match(o.TOK_RBRACKET),n=this.lookahead(0)===o.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(c.Filter),{type:"FilterProjection",children:[t,n,l]};case o.TOK_FLATTEN:return{type:"Projection",children:[{type:o.TOK_FLATTEN,children:[t]},this.parseProjectionRHS(c.Flatten)]};case o.TOK_EQ:case o.TOK_NE:case o.TOK_GT:case o.TOK_GTE:case o.TOK_LT:case o.TOK_LTE:return this.parseComparator(t,e);case o.TOK_LBRACKET:const u=this.lookaheadToken(0);return u.type===o.TOK_NUMBER||u.type===o.TOK_COLON?(n=this.parseIndexExpression(),this.projectIfSlice(t,n)):(this.match(o.TOK_STAR),this.match(o.TOK_RBRACKET),n=this.parseProjectionRHS(c.Star),{type:"Projection",children:[t,n]});default:return this.errorToken(this.lookaheadToken(0))}}match(e){if(this.lookahead(0)!==e){const t=this.lookaheadToken(0);this.errorToken(t,`Expected ${e}, got: ${t.type}`)}else this.advance()}errorToken(e,t=""){const n=new Error(t||`Invalid token (${e.type}): "${e.value}"`);throw n.name="ParserError",n}parseIndexExpression(){if(this.lookahead(0)===o.TOK_COLON||this.lookahead(1)===o.TOK_COLON)return this.parseSliceExpression();const e={type:"Index",value:this.lookaheadToken(0).value};return this.advance(),this.match(o.TOK_RBRACKET),e}projectIfSlice(e,t){const n={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{children:[n,this.parseProjectionRHS(c.Star)],type:"Projection"}:n}parseSliceExpression(){const e=[null,null,null];let t=0,n=this.lookahead(0);for(;n!==o.TOK_RBRACKET&&t<3;){if(n===o.TOK_COLON)t+=1,this.advance();else if(n===o.TOK_NUMBER)e[t]=this.lookaheadToken(0).value,this.advance();else{const e=this.lookaheadToken(0);this.errorToken(e,`Syntax error, unexpected token: ${e.value}(${e.type})`)}n=this.lookahead(0)}return this.match(o.TOK_RBRACKET),{children:e,type:"Slice"}}parseComparator(e,t){return{type:"Comparator",name:t,children:[e,this.expression(c[t])]}}parseDotRHS(e){const t=this.lookahead(0);if([o.TOK_UNQUOTEDIDENTIFIER,o.TOK_QUOTEDIDENTIFIER,o.TOK_STAR].includes(t))return this.expression(e);if(t===o.TOK_LBRACKET)return this.match(o.TOK_LBRACKET),this.parseMultiselectList();if(t===o.TOK_LBRACE)return this.match(o.TOK_LBRACE),this.parseMultiselectHash();const n=this.lookaheadToken(0);this.errorToken(n,`Syntax error, unexpected token: ${n.value}(${n.type})`)}parseProjectionRHS(e){if(c[this.lookahead(0)]<10)return{type:"Identity"};if(this.lookahead(0)===o.TOK_LBRACKET)return this.expression(e);if(this.lookahead(0)===o.TOK_FILTER)return this.expression(e);if(this.lookahead(0)===o.TOK_DOT)return this.match(o.TOK_DOT),this.parseDotRHS(e);const t=this.lookaheadToken(0);this.errorToken(t,`Syntax error, unexpected token: ${t.value}(${t.type})`)}parseMultiselectList(){const e=[];for(;this.lookahead(0)!==o.TOK_RBRACKET;){const t=this.expression(0);if(e.push(t),this.lookahead(0)===o.TOK_COMMA&&(this.match(o.TOK_COMMA),this.lookahead(0)===o.TOK_RBRACKET))throw new Error("Unexpected token Rbracket")}return this.match(o.TOK_RBRACKET),{type:"MultiSelectList",children:e}}parseMultiselectHash(){const e=[],t=[o.TOK_UNQUOTEDIDENTIFIER,o.TOK_QUOTEDIDENTIFIER];let n,r,i;for(;;){if(n=this.lookaheadToken(0),!t.includes(n.type))throw new Error(`Expecting an identifier token, got: ${n.type}`);if(r=n.value,this.advance(),this.match(o.TOK_COLON),i=this.expression(0),e.push({value:i,type:"KeyValuePair",name:r}),this.lookahead(0)===o.TOK_COMMA)this.match(o.TOK_COMMA);else if(this.lookahead(0)===o.TOK_RBRACE){this.match(o.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:e}}};var h;!function(e){e[e.TYPE_NUMBER=0]="TYPE_NUMBER",e[e.TYPE_ANY=1]="TYPE_ANY",e[e.TYPE_STRING=2]="TYPE_STRING",e[e.TYPE_ARRAY=3]="TYPE_ARRAY",e[e.TYPE_OBJECT=4]="TYPE_OBJECT",e[e.TYPE_BOOLEAN=5]="TYPE_BOOLEAN",e[e.TYPE_EXPREF=6]="TYPE_EXPREF",e[e.TYPE_NULL=7]="TYPE_NULL",e[e.TYPE_ARRAY_NUMBER=8]="TYPE_ARRAY_NUMBER",e[e.TYPE_ARRAY_STRING=9]="TYPE_ARRAY_STRING"}(h||(h={}));class p{constructor(e){this.TYPE_NAME_TABLE={[h.TYPE_NUMBER]:"number",[h.TYPE_ANY]:"any",[h.TYPE_STRING]:"string",[h.TYPE_ARRAY]:"array",[h.TYPE_OBJECT]:"object",[h.TYPE_BOOLEAN]:"boolean",[h.TYPE_EXPREF]:"expression",[h.TYPE_NULL]:"null",[h.TYPE_ARRAY_NUMBER]:"Array<number>",[h.TYPE_ARRAY_STRING]:"Array<string>"},this.functionAbs=([e])=>Math.abs(e),this.functionAvg=([e])=>{let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length},this.functionCeil=([e])=>Math.ceil(e),this.functionContains=e=>{const[t,n]=e;return t.includes(n)},this.functionEndsWith=e=>{const[t,n]=e;return t.includes(n,t.length-n.length)},this.functionFloor=([e])=>Math.floor(e),this.functionJoin=e=>{const[t,n]=e;return n.join(t)},this.functionKeys=([e])=>Object.keys(e),this.functionLength=([e])=>t(e)?Object.keys(e).length:e.length,this.functionMap=e=>{if(!this._interpreter)return[];const t=[],n=this._interpreter,r=e[0],i=e[1];for(let e=0;e<i.length;e+=1)t.push(n.visit(r,i[e]));return t},this.functionMax=([e])=>{if(!e.length)return null;if(this.getTypeName(e[0])===h.TYPE_NUMBER)return Math.max(...e);const t=e;let n=t[0];for(let e=1;e<t.length;e+=1)n.localeCompare(t[e])<0&&(n=t[e]);return n},this.functionMaxBy=e=>{const t=e[1],n=e[0],r=this.createKeyFunction(t,[h.TYPE_NUMBER,h.TYPE_STRING]);let i,o,s=-1/0;for(let e=0;e<n.length;e+=1)o=r&&r(n[e]),void 0!==o&&o>s&&(s=o,i=n[e]);return i},this.functionMerge=e=>{let t={};for(let n=0;n<e.length;n+=1){const r=e[n];t=Object.assign(t,r)}return t},this.functionMin=([e])=>{if(!e.length)return null;if(this.getTypeName(e[0])===h.TYPE_NUMBER)return Math.min(...e);const t=e;let n=t[0];for(let e=1;e<t.length;e+=1)t[e].localeCompare(n)<0&&(n=t[e]);return n},this.functionMinBy=e=>{const t=e[1],n=e[0],r=this.createKeyFunction(t,[h.TYPE_NUMBER,h.TYPE_STRING]);let i,o,s=1/0;for(let e=0;e<n.length;e+=1)o=r&&r(n[e]),void 0!==o&&o<s&&(s=o,i=n[e]);return i},this.functionNotNull=e=>{for(let t=0;t<e.length;t+=1)if(this.getTypeName(e[t])!==h.TYPE_NULL)return e[t];return null},this.functionReverse=([e])=>{if(this.getTypeName(e)===h.TYPE_STRING){const t=e;let n="";for(let e=t.length-1;e>=0;e-=1)n+=t[e];return n}const t=e.slice(0);return t.reverse(),t},this.functionSort=([e])=>[...e].sort(),this.functionSortBy=e=>{if(!this._interpreter)return[];const t=e[0].slice(0);if(0===t.length)return t;const n=this._interpreter,r=e[1],i=this.getTypeName(n.visit(r,t[0]));if(void 0!==i&&![h.TYPE_NUMBER,h.TYPE_STRING].includes(i))throw new Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[i]})`);const o=[];for(let e=0;e<t.length;e+=1)o.push([e,t[e]]);o.sort(((e,t)=>{const o=n.visit(r,e[1]),s=n.visit(r,t[1]);if(this.getTypeName(o)!==i)throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(o)]}`);if(this.getTypeName(s)!==i)throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(s)]}`);return o>s?1:o<s?-1:e[0]-t[0]}));for(let e=0;e<o.length;e+=1)t[e]=o[e][1];return t},this.functionStartsWith=([e,t])=>e.startsWith(t),this.functionSum=([e])=>e.reduce(((e,t)=>e+t),0),this.functionToArray=([e])=>this.getTypeName(e)===h.TYPE_ARRAY?e:[e],this.functionToNumber=([e])=>{const t=this.getTypeName(e);let n;return t===h.TYPE_NUMBER?e:t!==h.TYPE_STRING||(n=+e,isNaN(n))?null:n},this.functionToString=([e])=>this.getTypeName(e)===h.TYPE_STRING?e:JSON.stringify(e),this.functionType=([e])=>{switch(this.getTypeName(e)){case h.TYPE_NUMBER:return"number";case h.TYPE_STRING:return"string";case h.TYPE_ARRAY:return"array";case h.TYPE_OBJECT:return"object";case h.TYPE_BOOLEAN:return"boolean";case h.TYPE_EXPREF:return"expref";case h.TYPE_NULL:return"null";default:return}},this.functionValues=([e])=>Object.values(e),this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[h.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[h.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[h.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY]},{types:[h.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[h.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[h.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY,h.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[h.TYPE_EXPREF]},{types:[h.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[h.TYPE_ARRAY_NUMBER,h.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[h.TYPE_OBJECT],variadic:!0}]},min:{_func:this.functionMin,_signature:[{types:[h.TYPE_ARRAY_NUMBER,h.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[h.TYPE_ANY],variadic:!0}]},reverse:{_func:this.functionReverse,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[h.TYPE_ARRAY_STRING,h.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[h.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[h.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[h.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[h.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[h.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[h.TYPE_OBJECT]}]}},this._interpreter=e}registerFunction(e,t,n){if(e in this.functionTable)throw new Error(`Function already defined: ${e}()`);this.functionTable[e]={_func:t.bind(this),_signature:n}}callFunction(e,t){const n=this.functionTable[e];if(void 0===n)throw new Error(`Unknown function: ${e}()`);return this.validateArgs(e,t,n._signature),n._func.call(this,t)}validateInputSignatures(e,t){for(let n=0;n<t.length;n+=1)if("variadic"in t[n]&&n!==t.length-1)throw new Error(`ArgumentError: ${e}() 'variadic' argument ${n+1} must occur last`)}validateArgs(e,t,n){var r,i;let o;this.validateInputSignatures(e,n);const s=n.filter((e=>{var t;return null!==(t=!e.optional)&&void 0!==t&&t})).length,a=null!==(i=null===(r=n[n.length-1])||void 0===r?void 0:r.variadic)&&void 0!==i&&i,l=t.length<s,u=t.length>n.length,c=l&&(!a&&s>1||a)?"at least ":"";if(a&&l||!a&&(l||u))throw o=n.length>1,new Error(`ArgumentError: ${e}() takes ${c}${s} argument${o?"s":""} but received ${t.length}`);let d,h,p;for(let r=0;r<n.length;r+=1){let i;for(p=!1,d=n[r].types,h=this.getTypeName(t[r]),i=0;i<d.length;i+=1)if(void 0!==h&&this.typeMatches(h,d[i],t[r])){p=!0;break}if(!p&&void 0!==h){const t=d.map((e=>this.TYPE_NAME_TABLE[e])).join(" | ");throw new Error(`TypeError: ${e}() expected argument ${r+1} to be type (${t}) but received type ${this.TYPE_NAME_TABLE[h]} instead.`)}}}typeMatches(e,t,n){if(t===h.TYPE_ANY)return!0;if(t!==h.TYPE_ARRAY_STRING&&t!==h.TYPE_ARRAY_NUMBER&&t!==h.TYPE_ARRAY)return e===t;if(t===h.TYPE_ARRAY)return e===h.TYPE_ARRAY;if(e===h.TYPE_ARRAY){let e;t===h.TYPE_ARRAY_NUMBER?e=h.TYPE_NUMBER:t===h.TYPE_ARRAY_STRING&&(e=h.TYPE_STRING);for(let t=0;t<n.length;t+=1){const r=this.getTypeName(n[t]);if(void 0!==r&&void 0!==e&&!this.typeMatches(r,e,n[t]))return!1}return!0}return!1}getTypeName(e){switch(Object.prototype.toString.call(e)){case"[object String]":return h.TYPE_STRING;case"[object Number]":return h.TYPE_NUMBER;case"[object Array]":return h.TYPE_ARRAY;case"[object Boolean]":return h.TYPE_BOOLEAN;case"[object Null]":return h.TYPE_NULL;case"[object Object]":return e.jmespathType===o.TOK_EXPREF?h.TYPE_EXPREF:h.TYPE_OBJECT;default:return}}createKeyFunction(e,t){if(!this._interpreter)return;const n=this._interpreter;return r=>{const i=n.visit(e,r);if(!t.includes(this.getTypeName(i))){const e=`TypeError: expected one of (${t.map((e=>this.TYPE_NAME_TABLE[e])).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(i)]}`;throw new Error(e)}return i}}}const f=new class{constructor(){this._rootValue=null,this.runtime=new p(this)}search(e,t){return this._rootValue=t,this.visit(e,t)}visit(e,i){let s,a,l,u,c,d,h,p,f,m,g;switch(e.type){case"Field":return null===i?null:t(i)?(d=i[e.name],void 0===d?null:d):null;case"Subexpression":for(l=this.visit(e.children[0],i),m=1;m<e.children.length;m+=1)if(l=this.visit(e.children[1],l),null===l)return null;return l;case"IndexExpression":return h=this.visit(e.children[0],i),p=this.visit(e.children[1],h),p;case"Index":if(!Array.isArray(i))return null;let v=e.value;return v<0&&(v=i.length+v),l=i[v],void 0===l&&(l=null),l;case"Slice":if(!Array.isArray(i))return null;const y=[...e.children],_=this.computeSliceParams(i.length,y),[b,w,x]=_;if(l=[],x>0)for(m=b;m<w;m+=x)l.push(i[m]);else for(m=b;m>w;m+=x)l.push(i[m]);return l;case"Projection":if(g=this.visit(e.children[0],i),!Array.isArray(g))return null;for(f=[],m=0;m<g.length;m+=1)a=this.visit(e.children[1],g[m]),null!==a&&f.push(a);return f;case"ValueProjection":if(g=this.visit(e.children[0],i),!t(g))return null;f=[];const S=Object.values(g);for(m=0;m<S.length;m+=1)a=this.visit(e.children[1],S[m]),null!==a&&f.push(a);return f;case"FilterProjection":if(g=this.visit(e.children[0],i),!Array.isArray(g))return null;const k=[],T=[];for(m=0;m<g.length;m+=1)s=this.visit(e.children[2],g[m]),r(s)||k.push(g[m]);for(let t=0;t<k.length;t+=1)a=this.visit(e.children[1],k[t]),null!==a&&T.push(a);return T;case"Comparator":switch(u=this.visit(e.children[0],i),c=this.visit(e.children[1],i),e.name){case o.TOK_EQ:l=n(u,c);break;case o.TOK_NE:l=!n(u,c);break;case o.TOK_GT:l=u>c;break;case o.TOK_GTE:l=u>=c;break;case o.TOK_LT:l=u<c;break;case o.TOK_LTE:l=u<=c;break;default:throw new Error(`Unknown comparator: ${e.name}`)}return l;case o.TOK_FLATTEN:const E=this.visit(e.children[0],i);if(!Array.isArray(E))return null;let D=[];for(m=0;m<E.length;m+=1)a=E[m],Array.isArray(a)?D=[...D,...a]:D.push(a);return D;case"Identity":return i;case"MultiSelectList":if(null===i)return null;for(f=[],m=0;m<e.children.length;m+=1)f.push(this.visit(e.children[m],i));return f;case"MultiSelectHash":if(null===i)return null;let C;for(f={},m=0;m<e.children.length;m+=1)C=e.children[m],f[C.name]=this.visit(C.value,i);return f;case"OrExpression":return s=this.visit(e.children[0],i),r(s)&&(s=this.visit(e.children[1],i)),s;case"AndExpression":return u=this.visit(e.children[0],i),r(u)?u:this.visit(e.children[1],i);case"NotExpression":return u=this.visit(e.children[0],i),r(u);case"Literal":return e.value;case o.TOK_PIPE:return h=this.visit(e.children[0],i),this.visit(e.children[1],h);case o.TOK_CURRENT:return i;case o.TOK_ROOT:return this._rootValue;case"Function":const M=[];for(let t=0;t<e.children.length;t+=1)M.push(this.visit(e.children[t],i));return this.runtime.callFunction(e.name,M);case"ExpressionReference":const A=e.children[0];return A.jmespathType=o.TOK_EXPREF,A;default:throw new Error(`Unknown node type: ${e.type}`)}}computeSliceParams(e,t){let[n,r,i]=t;if(null===i)i=1;else if(0===i){const e=new Error("Invalid slice, step cannot be 0");throw e.name="RuntimeError",e}const o=i<0;return n=null===n?o?e-1:0:this.capSliceRange(e,n,i),r=null===r?o?-1:e:this.capSliceRange(e,r,i),[n,r,i]}capSliceRange(e,t,n){let r=t;return r<0?(r+=e,r<0&&(r=n<0?-1:0)):r>=e&&(r=n<0?e-1:e),r}},m=h.TYPE_ANY,g=h.TYPE_ARRAY,v=h.TYPE_ARRAY_NUMBER,y=h.TYPE_ARRAY_STRING,_=h.TYPE_BOOLEAN,b=h.TYPE_EXPREF,w=h.TYPE_NULL,x=h.TYPE_NUMBER,S=h.TYPE_OBJECT,k=h.TYPE_STRING;function T(e){return d.parse(e)}function E(e){return u.tokenize(e)}const D=(e,t,n)=>{f.runtime.registerFunction(e,t,n)};function C(e,t){const n=d.parse(t);return f.search(n,e)}const M=f,A={compile:T,registerFunction:D,search:C,tokenize:E,TreeInterpreter:M,TYPE_ANY:m,TYPE_ARRAY_NUMBER:v,TYPE_ARRAY_STRING:y,TYPE_ARRAY:g,TYPE_BOOLEAN:_,TYPE_EXPREF:b,TYPE_NULL:w,TYPE_NUMBER:x,TYPE_OBJECT:S,TYPE_STRING:k};e.TYPE_ANY=m,e.TYPE_ARRAY=g,e.TYPE_ARRAY_NUMBER=v,e.TYPE_ARRAY_STRING=y,e.TYPE_BOOLEAN=_,e.TYPE_EXPREF=b,e.TYPE_NULL=w,e.TYPE_NUMBER=x,e.TYPE_OBJECT=S,e.TYPE_STRING=k,e.TreeInterpreter=M,e.compile=T,e.default=A,e.jmespath=A,e.registerFunction=D,e.search=C,e.tokenize=E,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/animations"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).collapse={},e.ng.core,e.ng.animations)}(this,(function(e,t,n){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=r(t),o=r(n);const s="400ms cubic-bezier(0.4,0.0,0.2,1)",a=[n.style({height:0,visibility:"hidden"}),n.animate(s,n.style({height:"*",visibility:"visible"}))],l=[n.style({height:"*",visibility:"visible"}),n.animate(s,n.style({height:0,visibility:"hidden"}))];class u{constructor(e,n,r){this._el=e,this._renderer=n,this.collapsed=new t.EventEmitter,this.collapses=new t.EventEmitter,this.expanded=new t.EventEmitter,this.expands=new t.EventEmitter,this.isExpanded=!0,this.collapseNewValue=!0,this.isCollapsed=!1,this.isCollapse=!0,this.isCollapsing=!1,this.isAnimated=!1,this._display="block",this._stylesLoaded=!1,this._COLLAPSE_ACTION_NAME="collapse",this._EXPAND_ACTION_NAME="expand",this._factoryCollapseAnimation=r.build(l),this._factoryExpandAnimation=r.build(a)}set display(e){this._display=e,"none"!==e?this.isAnimated?this.toggle():this.show():this.hide()}set collapse(e){this.collapseNewValue=e,this._player&&!this._isAnimationDone||(this.isExpanded=e,this.toggle())}get collapse(){return this.isExpanded}ngAfterViewChecked(){this._stylesLoaded=!0,this._player&&this._isAnimationDone&&(this._player.reset(),this._renderer.setStyle(this._el.nativeElement,"height","*"))}toggle(){this.isExpanded?this.hide():this.show()}hide(){this.isCollapsing=!0,this.isExpanded=!1,this.isCollapsed=!0,this.isCollapsing=!1,this.collapses.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._COLLAPSE_ACTION_NAME)((()=>{this._isAnimationDone=!0,this.collapseNewValue!==this.isCollapsed&&this.isAnimated?this.show():(this.collapsed.emit(this),this._renderer.setStyle(this._el.nativeElement,"display","none"))}))}show(){this._renderer.setStyle(this._el.nativeElement,"display",this._display),this.isCollapsing=!0,this.isExpanded=!0,this.isCollapsed=!1,this.isCollapsing=!1,this.expands.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._EXPAND_ACTION_NAME)((()=>{this._isAnimationDone=!0,this.collapseNewValue!==this.isCollapsed&&this.isAnimated?this.hide():(this.expanded.emit(this),this._renderer.removeStyle(this._el.nativeElement,"overflow"))}))}animationRun(e,t){if(!e||!this._stylesLoaded)return e=>e();this._renderer.setStyle(this._el.nativeElement,"overflow","hidden"),this._renderer.addClass(this._el.nativeElement,"collapse");const n=t===this._EXPAND_ACTION_NAME?this._factoryExpandAnimation:this._factoryCollapseAnimation;return this._player&&this._player.reset(),this._player=n.create(this._el.nativeElement),this._player.play(),e=>{var t;return null===(t=this._player)||void 0===t?void 0:t.onDone(e)}}}u.\u0275fac=i.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:u,deps:[{token:i.ElementRef},{token:i.Renderer2},{token:o.AnimationBuilder}],target:i.\u0275\u0275FactoryTarget.Directive}),u.\u0275dir=i.\u0275\u0275ngDeclareDirective({minVersion:"14.0.0",version:"14.0.6",type:u,selector:"[collapse]",inputs:{display:"display",isAnimated:"isAnimated",collapse:"collapse"},outputs:{collapsed:"collapsed",collapses:"collapses",expanded:"expanded",expands:"expands"},host:{properties:{"class.collapse":"this.isCollapse","class.in":"this.isExpanded","class.show":"this.isExpanded","attr.aria-hidden":"this.isCollapsed","class.collapsing":"this.isCollapsing"}},exportAs:["bs-collapse"],ngImport:i}),i.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:u,decorators:[{type:t.Directive,args:[{selector:"[collapse]",exportAs:"bs-collapse",host:{"[class.collapse]":"true"}}]}],ctorParameters:function(){return[{type:i.ElementRef},{type:i.Renderer2},{type:o.AnimationBuilder}]},propDecorators:{collapsed:[{type:t.Output}],collapses:[{type:t.Output}],expanded:[{type:t.Output}],expands:[{type:t.Output}],isExpanded:[{type:t.HostBinding,args:["class.in"]},{type:t.HostBinding,args:["class.show"]}],isCollapsed:[{type:t.HostBinding,args:["attr.aria-hidden"]}],isCollapse:[{type:t.HostBinding,args:["class.collapse"]}],isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],display:[{type:t.Input}],isAnimated:[{type:t.Input}],collapse:[{type:t.Input}]}});class c{static forRoot(){return{ngModule:c,providers:[]}}}c.\u0275fac=i.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c,deps:[],target:i.\u0275\u0275FactoryTarget.NgModule}),c.\u0275mod=i.\u0275\u0275ngDeclareNgModule({minVersion:"14.0.0",version:"14.0.6",ngImport:i,type:c,declarations:[u],exports:[u]}),c.\u0275inj=i.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c}),i.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c,decorators:[{type:t.NgModule,args:[{declarations:[u],exports:[u]}]}]}),e.CollapseDirective=u,e.CollapseModule=c})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).chronos={})}(this,(function(e){"use strict";function t(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function n(e){return"string"==typeof e}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e){return e&&e.getTime&&!isNaN(e.getTime())}function o(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e){return void 0===e}function d(e){const n=+e;let r=0;return 0!==n&&isFinite(n)&&(r=t(n)),r}const h={},p={date:"day",hour:"hours",minute:"minutes",second:"seconds",millisecond:"milliseconds"};function f(e,t){const n=e.toLowerCase();let r=e;n in p&&(r=p[n]),h[n]=h[`${n}s`]=h[t]=r}function m(e){return n(e)?h[e]||h[e.toLowerCase()]:void 0}const g=0,v=1,y=2,_=3,b=4,w=5,x=6,S=7,k=8;function T(e,t,n){const r=`${Math.abs(e)}`,i=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}const E={},D={},C=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;function M(e,t,n,r){e&&(D[e]=r),t&&(D[t[0]]=function(){return T(r.apply(null,arguments),t[1],t[2])}),n&&(D[n]=function(t,n){return n.locale.ordinal(r.apply(null,arguments),e)})}function A(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function I(e,t,n){const r=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(r.getUTCFullYear())&&r.setUTCFullYear(e),r}function L(e,t=0,n=1,r=0,i=0,o=0,s=0){const a=new Date(e,t,n,r,i,o,s);return e<100&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function O(e,t=!1){return t?e.getUTCHours():e.getHours()}function N(e,t=!1){return t?e.getUTCMinutes():e.getMinutes()}function R(e,t=!1){return t?e.getUTCSeconds():e.getSeconds()}function P(e,t=!1){return t?e.getUTCMilliseconds():e.getMilliseconds()}function F(e,t=!1){return t?e.getUTCDay():e.getDay()}function j(e,t=!1){return t?e.getUTCDate():e.getDate()}function Y(e,t=!1){return t?e.getUTCMonth():e.getMonth()}function H(e,t=!1){return t?e.getUTCFullYear():e.getFullYear()}function V(e,t){return!(!e||!t)&&(B(e,t)&&Y(e)===Y(t))}function B(e,t){return!(!e||!t)&&H(e)===H(t)}const U=/\d/,z=/\d\d/,q=/\d{3}/,W=/\d{4}/,$=/[+-]?\d{6}/,G=/\d\d?/,K=/\d\d\d\d?/,Z=/\d\d\d\d\d\d?/,X=/\d{1,3}/,J=/\d{1,4}/,Q=/[+-]?\d{1,6}/,ee=/\d+/,te=/[+-]?\d+/,ne=/Z|[+-]\d\d(?::?\d\d)?/gi,re=/[+-]?\d+(\.\d{1,3})?/,ie=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function se(e,t,n){o(t)?oe[e]=t:oe[e]=function(e,r){return e&&n?n:t}}function ae(e,t){return l(oe,e)?oe[e](!1,t):new RegExp(le(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,((e,t,n,r,i)=>t||n||r||i))))}function le(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}const ue={};function ce(e,t){const r=n(e)?[e]:e;let i=t;if(s(t)&&(i=function(e,n,r){return n[t]=d(e),r}),a(r)&&o(i)){let e;for(e=0;e<r.length;e++)ue[r[e]]=i}}function de(e,t){ce(e,(function(e,n,r,i){return r._w=r._w||{},t(e,r._w,r,i)}))}function he(e,t,n){return null!=t&&l(ue,e)&&ue[e](t,n._a,n,e),n}function pe(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function fe(e,t){return t.locale.getFullYear?t.locale.getFullYear(e,t.isUTC).toString():H(e,t.isUTC).toString()}function me(e){return d(e)+(d(e)>68?1900:2e3)}function ge(e){return ve(e)?366:365}function ve(e){return e%4==0&&e%100!=0||e%400==0}function ye(e,t){if(isNaN(e)||isNaN(t))return NaN;const n=(t%(r=12)+r)%r;var r;return 1===n?ve(e+(t-n)/12)?29:28:31-n%7%2}const _e={year:0,month:0,day:0,hour:0,minute:0,seconds:0};function be(e,t){return s(t)?t:e}function we(e,t,n){const r=Math.min(j(e),ye(H(e),t));return n?e.setUTCMonth(t,r):e.setMonth(t,r),e}function xe(e,t,n){return n?e.setUTCDate(t):e.setDate(t),e}function Se(e){return new Date(e.getTime())}function ke(e,t,r){const i=Se(e);switch(t){case"year":we(i,0,r);case"quarter":case"month":xe(i,1,r);case"week":case"isoWeek":case"day":case"date":!function(e,t,n){n?e.setUTCHours(t):e.setHours(t)}(i,0,r);case"hours":!function(e,t,n){n?e.setUTCMinutes(t):e.setMinutes(t)}(i,0,r);case"minutes":!function(e,t,n){n?e.setUTCSeconds(t):e.setSeconds(t)}(i,0,r);case"seconds":!function(e,t,n){n?e.setUTCMilliseconds(t):e.setMilliseconds(t)}(i,0,r)}return"week"===t&&function(e,t,n={}){const r=un(e,n.locale,n.isUTC);rn(e,t-r,"day")}(i,0,{isUTC:r}),"isoWeek"===t&&function(e,t,r={}){const i=function(e,t=ct()){if(n(e))return t.weekdaysParse(e)%7||7;return s(e)&&isNaN(e)?null:e}(t,r.locale);an(e,ln(e)%7?i:i-7)}
1739
+ \******************/n.r(r),n.d(r,{$rootScope:()=>e.$rootScope,ApiAwareVariable:()=>o.ApiAwareVariable,BaseAction:()=>i.BaseAction,CONSTANTS:()=>e.CONSTANTS,CrudVariable:()=>u.CrudVariable,DB_CONSTANTS:()=>e.DB_CONSTANTS,LVService:()=>d.LVService,LiveVariable:()=>c.LiveVariable,LiveVariableUtils:()=>h.LiveVariableUtils,ModelVariable:()=>a.ModelVariable,SWAGGER_CONSTANTS:()=>e.SWAGGER_CONSTANTS,ServiceVariable:()=>l.ServiceVariable,TEST:()=>p,TimerAction:()=>s.TimerAction,VARIABLE_CONSTANTS:()=>e.VARIABLE_CONSTANTS,VARIABLE_URLS:()=>e.VARIABLE_URLS,WS_CONSTANTS:()=>e.WS_CONSTANTS,appManager:()=>t.appManager,debounceVariableCall:()=>t.debounceVariableCall,decodeData:()=>t.decodeData,dialogService:()=>t.dialogService,formatDate:()=>t.formatDate,formatExportExpression:()=>t.formatExportExpression,generateConnectionParams:()=>d.generateConnectionParams,getBlob:()=>t.getBlob,getErrMessage:()=>t.getErrMessage,getEvaluatedOrderBy:()=>t.getEvaluatedOrderBy,getTarget:()=>t.getTarget,getTargetNodeKey:()=>t.getTargetNodeKey,getTargetObj:()=>t.getTargetObj,httpService:()=>t.httpService,initiateCallback:()=>t.initiateCallback,internalBoundNodeMap:()=>t.internalBoundNodeMap,isFileUploadSupported:()=>t.isFileUploadSupported,metadataService:()=>t.metadataService,navigationService:()=>t.navigationService,oauthService:()=>t.oauthService,parseConfig:()=>d.parseConfig,routerService:()=>t.routerService,securityService:()=>t.securityService,setInput:()=>t.setInput,setValueToNode:()=>t.setValueToNode,toasterService:()=>t.toasterService,updateInternalNodes:()=>t.updateInternalNodes,wmSetDependency:()=>t.wmSetDependency});var e=n(/*! ./src/constants/variables.constants */"./src/constants/variables.constants.ts"),t=n(/*! ./src/util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),i=n(/*! ./src/model/base-action */"./src/model/base-action.ts"),o=n(/*! ./src/model/variable/api-aware-variable */"./src/model/variable/api-aware-variable.ts"),s=n(/*! ./src/model/action/timer-action */"./src/model/action/timer-action.ts"),a=n(/*! ./src/model/variable/model-variable */"./src/model/variable/model-variable.ts"),l=n(/*! ./src/model/variable/service-variable */"./src/model/variable/service-variable.ts"),u=n(/*! ./src/model/variable/crud-variable */"./src/model/variable/crud-variable.ts"),c=n(/*! ./src/model/variable/live-variable */"./src/model/variable/live-variable.ts"),d=(n(/*! ./src/types/http-client.service */"./src/types/http-client.service.ts"),n(/*! ./src/util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts")),h=n(/*! ./src/util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts"),p=(n(/*! ./src/types/date-formatter */"./src/types/date-formatter.ts"),"hello from variables")})(),r})())),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IMask={})}(this,(function(e){"use strict";function t(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new n.InputMask(e,t)}class r{constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}function i(e){return"string"==typeof e||e instanceof String}n.ChangeDetails=r;const o="NONE",s="LEFT",a="FORCE_LEFT",l="RIGHT",u="FORCE_RIGHT";function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function d(e){return Array.isArray(e)?e:[e,new r]}function h(e,t){if(t===e)return!0;var n,r=Array.isArray(t),i=Array.isArray(e);if(r&&i){if(t.length!=e.length)return!1;for(n=0;n<t.length;n++)if(!h(t[n],e[n]))return!1;return!0}if(r!=i)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){var o=t instanceof Date,s=e instanceof Date;if(o&&s)return t.getTime()==e.getTime();if(o!=s)return!1;var a=t instanceof RegExp,l=e instanceof RegExp;if(a&&l)return t.toString()==e.toString();if(a!=l)return!1;var u=Object.keys(t);for(n=0;n<u.length;n++)if(!Object.prototype.hasOwnProperty.call(e,u[n]))return!1;for(n=0;n<u.length;n++)if(!h(e[u[n]],t[u[n]]))return!1;return!0}return!(!t||!e||"function"!=typeof t||"function"!=typeof e)&&t.toString()===e.toString()}class p{constructor(e,t,n,r){for(this.value=e,this.cursorPos=t,this.oldValue=n,this.oldSelection=r;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?o:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?s:l}}class f{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;this.value=e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class m{constructor(e){this._value="",this._update(Object.assign({},m.DEFAULTS,e)),this.isInitialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e)}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{input:!0};return this.reset(),this.append(e,t,""),this.doCommit(),this.value}get unmaskedValue(){return this.value}set unmaskedValue(e){this.reset(),this.append(e,{},""),this.doCommit()}get typedValue(){return this.doParse(this.value)}set typedValue(e){this.value=this.doFormat(e)}get rawInputValue(){return this.extractInput(0,this.value.length,{raw:!0})}set rawInputValue(e){this.reset(),this.append(e,{raw:!0},""),this.doCommit()}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return Math.min(this.value.length,t-e)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(e,t)}extractTail(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new f(this.extractInput(e,t),e)}appendTail(e){return i(e)&&(e=new f(String(e))),e.appendTo(this)}_appendCharRaw(e){return e?(this._value+=e,new r({inserted:e,rawInserted:e})):new r}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=this.state;let o;if([e,o]=d(this.doPrepare(e,t)),o=o.aggregate(this._appendCharRaw(e,t)),o.inserted){let e,s=!1!==this.doValidate(t);if(s&&null!=n){const t=this.state;!0===this.overwrite&&(e=n.state,n.unshift(this.value.length-o.tailShift));let r=this.appendTail(n);s=r.rawInserted===n.toString(),s&&r.inserted||"shift"!==this.overwrite||(this.state=t,e=n.state,n.shift(),r=this.appendTail(n),s=r.rawInserted===n.toString()),s&&r.inserted&&(this.state=t)}s||(o=new r,this.state=i,n&&e&&(n.state=e))}return o}_appendPlaceholder(){return new r}_appendEager(){return new r}append(e,t,n){if(!i(e))throw new Error("value should be string");const o=new r,s=i(n)?new f(String(n)):n;null!=t&&t.tail&&(t._beforeTailState=this.state);for(let n=0;n<e.length;++n){const r=this._appendChar(e[n],t,s);if(!r.rawInserted&&!this.doSkipInvalid(e[n],t,s))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&o.aggregate(this._appendEager()),null!=s&&(o.tailShift+=this.appendTail(s).tailShift),o}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,e)+this.value.slice(t),new r}withValueRefresh(e){if(this._refreshing||!this.isInitialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==n&&0===n.indexOf(this.value)&&this.append(n.slice(this.value.length),{},""),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this.isInitialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e){return this.skipInvalid}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(e,this,t):e}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}doFormat(e){return this.format?this.format(e,this):e}doParse(e){return this.parse?this.parse(e,this):e}splice(e,t,n,i){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{input:!0};const d=e+t,h=this.extractTail(d),p=!0===this.eager||"remove"===this.eager;let f;p&&(i=function(e){switch(e){case s:return a;case l:return u;default:return e}}(i),f=this.extractInput(0,d,{raw:!0}));let m=e;const g=new r;if(i!==o&&(m=this.nearestInputPos(e,t>1&&0!==e&&!p?o:i),g.tailShift=m-e),g.aggregate(this.remove(m)),p&&i!==o&&f===this.rawInputValue)if(i===a){let e;for(;f===this.rawInputValue&&(e=this.value.length);)g.aggregate(new r({tailShift:-1})).aggregate(this.remove(e-1))}else i===u&&h.unshift();return g.aggregate(this.append(n,c,h))}maskEquals(e){return this.mask===e}typedValueEquals(e){const t=this.typedValue;return e===t||m.EMPTY_VALUES.includes(e)&&m.EMPTY_VALUES.includes(t)||this.doFormat(e)===this.doFormat(this.typedValue)}}function g(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?n.MaskedRegExp:i(e)?n.MaskedPattern:e instanceof Date||e===Date?n.MaskedDate:e instanceof Number||"number"==typeof e||e===Number?n.MaskedNumber:Array.isArray(e)||e===Array?n.MaskedDynamic:n.Masked&&e.prototype instanceof n.Masked?e:e instanceof n.Masked?e.constructor:e instanceof Function?n.MaskedFunction:(console.warn("Mask not found for mask",e),n.Masked)}function v(e){if(n.Masked&&e instanceof n.Masked)return e;const t=(e=Object.assign({},e)).mask;if(n.Masked&&t instanceof n.Masked)return t;const r=g(t);if(!r)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new r(e)}m.DEFAULTS={format:String,parse:e=>e,skipInvalid:!0},m.EMPTY_VALUES=[void 0,null,""],n.Masked=m,n.createMask=v;const y=["parent","isOptional","placeholderChar","displayChar","lazy","eager"],_={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class b{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a}=e,l=t(e,y);this.masked=v(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===e&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new r}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isFilled)return new r;const n=this.masked.state,i=this.masked._appendChar(e,t);return i.inserted&&!1===this.doValidate(t)&&(i.inserted=i.rawInserted="",this.masked.state=n),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=Boolean(i.inserted),i}append(){return this.masked.append(...arguments)}_appendPlaceholder(){const e=new r;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new r}extractTail(){return this.masked.extractTail(...arguments)}appendTail(){return this.masked.appendTail(...arguments)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(e,t,n)}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const n=this.value.length,r=Math.min(Math.max(e,0),n);switch(t){case s:case a:return this.isComplete?r:0;case l:case u:return this.isComplete?r:n;default:return r}}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(e,t).length}doValidate(){return this.masked.doValidate(...arguments)&&(!this.parent||this.parent.doValidate(...arguments))}doCommit(){this.masked.doCommit()}get state(){return{masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}}class w{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new r}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const n=this._value.length;switch(t){case s:case a:return 0;default:return n}}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._isRawInput?t-e:0}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new r;if(this.isFilled)return n;const i=!0===this.eager||"append"===this.eager,o=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!i)&&!t.tail;return o&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=o&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new r;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return arguments.length>1&&void 0!==arguments[1]||this.value.length,new f("")}appendTail(e){return i(e)&&(e=new f(String(e))),e.appendTo(this)}append(e,t,n){const r=this._appendChar(e[0],t);return null!=n&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_isRawInput:this._isRawInput}}set state(e){Object.assign(this,e)}}const x=["chunks"];class S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;i(e)&&(e=new f(String(e)));const t=this.chunks[this.chunks.length-1],n=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof f)n?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof S){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof n.MaskedPattern))return new f(this.toString()).appendTo(e);const t=new r;for(let n=0;n<this.chunks.length&&!t.skip;++n){const r=this.chunks[n],i=e._mapPosToBlock(e.value.length),o=r.stop;let s;if(null!=o&&(!i||i.index<=o)){if(r instanceof S||e._stops.indexOf(o)>=0){const n=e._appendPlaceholder(o);t.aggregate(n)}s=r instanceof S&&e._blocks[o]}if(s){const n=s.appendTail(r);n.skip=!1,t.aggregate(n),e._value+=n.inserted;const i=r.toString().slice(n.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(r.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map((e=>e.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n}=e,r=t(e,x);Object.assign(this,r),this.chunks=n.map((e=>{const t="chunks"in e?new S:new f;return t.state=e,t}))}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";const t=null!=e?e-this.from:e;let n=0;for(;n<this.chunks.length;){const e=this.chunks[n],r=e.unshift(t);if(e.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class k{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return this.state=e,e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.value.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null===(t=this.block)||void 0===t?void 0:t.value.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,a),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,s),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,s),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,u),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,o),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,o),!0}))}}class T extends m{_update(e){e.mask&&(e.validate=t=>t.search(e.mask)>=0),super._update(e)}}n.MaskedRegExp=T;const E=["_blocks"];class D extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.definitions=Object.assign({},_,e.definitions),super(Object.assign({},D.DEFAULTS,e))}_update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};let t=this.mask;if(!t||!e)return;let r=!1,i=!1;for(let a=0;a<t.length;++a){var o,s;if(this.blocks){const e=t.slice(a),n=Object.keys(this.blocks).filter((t=>0===e.indexOf(t)));n.sort(((e,t)=>t.length-e.length));const r=n[0];if(r){const e=v(Object.assign({parent:this,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite},this.blocks[r]));e&&(this._blocks.push(e),this._maskedBlocks[r]||(this._maskedBlocks[r]=[]),this._maskedBlocks[r].push(this._blocks.length-1)),a+=r.length-1;continue}}let l=t[a],u=l in e;if(l===D.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===l||"}"===l){r=!r;continue}if("["===l||"]"===l){i=!i;continue}if(l===D.ESCAPE_CHAR){if(++a,l=t[a],!l)break;u=!1}const c=null===(o=e[l])||void 0===o||!o.mask||(null===(s=e[l])||void 0===s?void 0:s.mask.prototype)instanceof n.Masked?{mask:e[l]}:e[l],d=u?new b(Object.assign({parent:this,isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},c)):new w({char:l,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}get state(){return Object.assign({},super.state,{_blocks:this._blocks.map((e=>e.state))})}set state(e){const{_blocks:n}=e,r=t(e,E);this._blocks.forEach(((e,t)=>e.state=n[t])),super.state=r}reset(){super.reset(),this._blocks.forEach((e=>e.reset()))}get isComplete(){return this._blocks.every((e=>e.isComplete))}get isFilled(){return this._blocks.every((e=>e.isFilled))}get isFixed(){return this._blocks.every((e=>e.isFixed))}get isOptional(){return this._blocks.every((e=>e.isOptional))}doCommit(){this._blocks.forEach((e=>e.doCommit())),super.doCommit()}get unmaskedValue(){return this._blocks.reduce(((e,t)=>e+t.unmaskedValue),"")}set unmaskedValue(e){super.unmaskedValue=e}get value(){return this._blocks.reduce(((e,t)=>e+t.value),"")}set value(e){super.value=e}get displayValue(){return this._blocks.reduce(((e,t)=>e+t.displayValue),"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new r;let n=null===(e=this._mapPosToBlock(this.value.length))||void 0===e?void 0:e.index;if(null==n)return t;this._blocks[n].isFilled&&++n;for(let e=n;e<this._blocks.length;++e){const n=this._blocks[e]._appendEager();if(!n.inserted)break;t.aggregate(n)}return t}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this._mapPosToBlock(this.value.length),i=new r;if(!n)return i;for(let r=n.index;;++r){var o,s;const n=this._blocks[r];if(!n)break;const a=n._appendChar(e,Object.assign({},t,{_beforeTailState:null===(o=t._beforeTailState)||void 0===o||null===(s=o._blocks)||void 0===s?void 0:s[r]})),l=a.skip;if(i.aggregate(a),l||a.rawInserted)break}return i}extractTail(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;const n=new S;return e===t||this._forEachBlocksInRange(e,t,((e,t,r,i)=>{const o=e.extractTail(r,i);o.stop=this._findStopBefore(t),o.from=this._blockStartPos(t),o instanceof S&&(o.blockIndex=t),n.extend(o)})),n}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return"";let r="";return this._forEachBlocksInRange(e,t,((e,t,i,o)=>{r+=e.extractInput(i,o,n)})),r}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const r=this._stops[n];if(!(r<=e))break;t=r}return t}_appendPlaceholder(e){const t=new r;if(this.lazy&&null==e)return t;const n=this._mapPosToBlock(this.value.length);if(!n)return t;const i=n.index,o=null!=e?e:this._blocks.length;return this._blocks.slice(i,o).forEach((n=>{if(!n.lazy||null!=e){const e=null!=n._blocks?[n._blocks.length]:[],r=n._appendPlaceholder(...e);this._value+=r.inserted,t.aggregate(r)}})),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const r=this._blocks[n],i=t.length;if(t+=r.value,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce(((e,t)=>e+t.value.length),0)}_forEachBlocksInRange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;const r=this._mapPosToBlock(e);if(r){const e=this._mapPosToBlock(t),i=e&&r.index===e.index,o=r.offset,s=e&&i?e.offset:this._blocks[r.index].value.length;if(n(this._blocks[r.index],r.index,o,s),e&&!i){for(let t=r.index+1;t<e.index;++t)n(this._blocks[t],t,0,this._blocks[t].value.length);n(this._blocks[e.index],e.index,0,e.offset)}}}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n.aggregate(e.remove(r,i))})),n}nearestInputPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(!this._blocks.length)return 0;const n=new k(this,e);if(t===o)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.value.length);if(t===s||t===a){if(t===s){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===s){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e)return n.pos;if(n.popState(),n.ok&&n.pos<=e)return n.pos;n.popState()}return n.ok?n.pos:t===a?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}return t===l||t===u?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===u?this.value.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(e,s)))):e}totalInputPositions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=0;return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n+=e.totalInputPositions(r,i)})),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map((e=>this._blocks[e])):[]}}D.DEFAULTS={lazy:!0,placeholderChar:"_"},D.STOP_CHAR="`",D.ESCAPE_CHAR="\\",D.InputDefinition=b,D.FixedDefinition=w,n.MaskedPattern=D;class C extends D{get _matchFrom(){return this.maxLength-String(this.from).length}_update(e){e=Object.assign({to:this.to||0,from:this.from||0,maxLength:this.maxLength||0},e);let t=String(e.to).length;null!=e.maxLength&&(t=Math.max(t,e.maxLength)),e.maxLength=t;const n=String(e.from).padStart(t,"0"),r=String(e.to).padStart(t,"0");let i=0;for(;i<r.length&&r[i]===n[i];)++i;e.mask=r.slice(0,i).replace(/0/g,"\\0")+"0".repeat(t-i),super._update(e)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",n="";const[,r,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(r.length)+i,n="9".repeat(r.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepare(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if([e,t]=d(super.doPrepare(e.replace(/\D/g,""),n)),!this.autofix||!e)return e;const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0");let o=this.value+e;if(o.length>this.maxLength)return"";const[s,a]=this.boundaries(o);return Number(a)<this.from?r[o.length-1]:Number(s)>this.to?"pad"===this.autofix&&o.length<this.maxLength?["",t.aggregate(this.append(r[o.length-1]+e,n))]:i[o.length-1]:e}doValidate(){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[t,n]=this.boundaries(e);return this.from<=Number(n)&&Number(t)<=this.to&&super.doValidate(...arguments)}}n.MaskedRange=C;class M extends D{constructor(e){super(Object.assign({},M.DEFAULTS,e))}_update(e){e.mask===Date&&delete e.mask,e.pattern&&(e.mask=e.pattern);const t=e.blocks;e.blocks=Object.assign({},M.GET_DEFAULT_BLOCKS()),e.min&&(e.blocks.Y.from=e.min.getFullYear()),e.max&&(e.blocks.Y.to=e.max.getFullYear()),e.min&&e.max&&e.blocks.Y.from===e.blocks.Y.to&&(e.blocks.m.from=e.min.getMonth()+1,e.blocks.m.to=e.max.getMonth()+1,e.blocks.m.from===e.blocks.m.to&&(e.blocks.d.from=e.min.getDate(),e.blocks.d.to=e.max.getDate())),Object.assign(e.blocks,this.blocks,t),Object.keys(e.blocks).forEach((t=>{const n=e.blocks[t];!("autofix"in n)&&"autofix"in e&&(n.autofix=e.autofix)})),super._update(e)}doValidate(){const e=this.date;return super.doValidate(...arguments)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}M.DEFAULTS={pattern:"d{.}`m{.}`Y",format:e=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:e=>{const[t,n,r]=e.split(".");return new Date(r,n-1,t)}},M.GET_DEFAULT_BLOCKS=()=>({d:{mask:C,from:1,to:31,maxLength:2},m:{mask:C,from:1,to:12,maxLength:2},Y:{mask:C,from:1900,to:9999}}),n.MaskedDate=M;class A{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch(e){}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch(e){}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch(e){}}_unsafeSelect(e,t){}get isActive(){return!1}bindEvents(e){}unbindEvents(){}}n.MaskElement=A;class I extends A{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,t,n;return null!==(e=null===(t=(n=this.input).getRootNode)||void 0===t?void 0:t.call(n))&&void 0!==e?e:document}get isActive(){return this.input===this.rootElement.activeElement}get _unsafeSelectionStart(){return this.input.selectionStart}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}bindEvents(e){Object.keys(e).forEach((t=>this._toggleEventHandler(I.EVENTS_MAP[t],e[t])))}unbindEvents(){Object.keys(this._handlers).forEach((e=>this._toggleEventHandler(e)))}_toggleEventHandler(e,t){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),t&&(this.input.addEventListener(e,t),this._handlers[e]=t)}}I.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},n.HTMLMaskElement=I;class L extends I{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n<r?n:r}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n>r?n:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const r=this.rootElement,i=r.getSelection&&r.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent}set value(e){this.input.textContent=e}}n.HTMLContenteditableMaskElement=L;const O=["mask"];class N{constructor(e,t){this.el=e instanceof A?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new L(e):new I(e),this.masked=v(t),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}get mask(){return this.masked.mask}maskEquals(e){var t;return null==e||(null===(t=this.masked)||void 0===t?void 0:t.maskEquals(e))}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof n.Masked)&&this.masked.constructor===g(e))return void this.masked.updateOptions({mask:e});const t=v({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=this._listeners[e];i&&i.forEach((e=>e(...n)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,t=this.masked.value,n=this.displayValue,r=this.unmaskedValue!==e||this.value!==t;this._unmaskedValue=e,this._value=t,this.el.value!==n&&(this.el.value=n),r&&this._fireChangeEvents()}updateOptions(e){const{mask:n}=e,r=t(e,O),i=!this.maskEquals(n),o=!h(this.masked,r);i&&(this.mask=n),o&&this.masked.updateOptions(r),(i||o)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,s))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const t=new p(this.el.value,this.cursorPos,this.displayValue,this._selection),n=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:o;let s=this.masked.nearestInputPos(t.startChangePos+r,i);i!==o&&(s=this.masked.nearestInputPos(s,o)),this.updateControl(),this.updateCursor(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}n.InputMask=N;class R extends D{_update(e){e.enum&&(e.mask="*".repeat(e.enum[0].length)),super._update(e)}doValidate(){return this.enum.some((e=>e.indexOf(this.unmaskedValue)>=0))&&super.doValidate(...arguments)}}n.MaskedEnum=R;class P extends m{constructor(e){super(Object.assign({},P.DEFAULTS,e))}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"(".concat(c(this.radix),"\\d{0,").concat(this.scale,"})?"):"")+"$";this._numberRegExp=new RegExp(e+"\\d*"+t),this._mapToRadixRegExp=new RegExp("[".concat(this.mapToRadix.map(c).join(""),"]"),"g"),this._thousandsSeparatorRegExp=new RegExp(c(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e);const[n,r]=d(super.doPrepare(e,t));return e&&!n&&(r.skip=!0),[n,r]}_separatorsCount(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return super._appendCharRaw(e,t);const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=super._appendCharRaw(e,t);this._value=this._insertThousandsSeparators(this._value);const o=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return i.tailShift+=(s-r)*this.thousandsSeparator.length,i.skip=!i.rawInserted&&e===this.thousandsSeparator,i}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;[e,t]=this._adjustRangeWithSeparators(e,t);const n=this.value.slice(0,e),i=this.value.slice(t),o=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+i));const s=this._separatorsCountFromSlice(n);return new r({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case o:case s:case a:{const n=this._findSeparatorAround(e-1);if(n>=0){const r=n+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===a)return n}break}case l:case u:{const t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doValidate(e){let t=Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));if(t){const e=this.number;t=t&&!isNaN(e)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return t&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.doFormat(t));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,((e,t,n,r)=>t+r)),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===P.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,P.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.doParse(this.unmaskedValue)}set typedValue(e){this.rawInputValue=this.doFormat(e).replace(P.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}typedValueEquals(e){return(super.typedValueEquals(e)||P.EMPTY_VALUES.includes(e)&&P.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}P.UNMASKED_RADIX=".",P.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:[P.UNMASKED_RADIX],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},P.EMPTY_VALUES=[...m.EMPTY_VALUES,0],n.MaskedNumber=P;class F extends m{_update(e){e.mask&&(e.validate=e.mask),super._update(e)}}n.MaskedFunction=F;const j=["compiledMasks","currentMaskRef","currentMask"],Y=["mask"];class H extends m{constructor(e){super(Object.assign({},H.DEFAULTS,e)),this.currentMask=null}_update(e){super._update(e),"mask"in e&&(this.compiledMasks=Array.isArray(e.mask)?e.mask.map((e=>v(e))):[])}_appendCharRaw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,o=this.rawInputValue,s=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:o,a=o.slice(s.length),l=this.currentMask,u=new r,c=null==l?void 0:l.state;if(this.currentMask=this.doDispatch(e,Object.assign({},t),n),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),s){const e=this.currentMask.append(s,{raw:!0});u.tailShift=e.inserted.length-i.length}a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=c;return u}_appendPlaceholder(){const e=this._applyDispatch(...arguments);return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch(...arguments);return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new r;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return Object.assign({},e,{_beforeTailState:(null===(t=e._beforeTailState)||void 0===t?void 0:t.currentMaskRef)===this.currentMask&&(null===(n=e._beforeTailState)||void 0===n?void 0:n.currentMask)||e._beforeTailState})}doDispatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,r]=d(super.doPrepare(e,t));if(this.currentMask){let e;[n,e]=d(super.doPrepare(n,this.currentMaskFlags(t))),r=r.aggregate(e)}return[n,r]}reset(){var e;null===(e=this.currentMask)||void 0===e||e.reset(),this.compiledMasks.forEach((e=>e.reset()))}get value(){return this.currentMask?this.currentMask.value:""}set value(e){super.value=e}get unmaskedValue(){return this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.currentMask?this.currentMask.typedValue:""}set typedValue(e){let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.isFilled)}remove(){const e=new r;return this.currentMask&&e.aggregate(this.currentMask.remove(...arguments)).aggregate(this._applyDispatch()),e}get state(){var e;return Object.assign({},super.state,{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((e=>e.state)),currentMaskRef:this.currentMask,currentMask:null===(e=this.currentMask)||void 0===e?void 0:e.state})}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i}=e,o=t(e,j);this.compiledMasks.forEach(((e,t)=>e.state=n[t])),null!=r&&(this.currentMask=r,this.currentMask.state=i),super.state=o}extractInput(){return this.currentMask?this.currentMask.extractInput(...arguments):""}extractTail(){return this.currentMask?this.currentMask.extractTail(...arguments):super.extractTail(...arguments)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(){return this.currentMask?this.currentMask.nearestInputPos(...arguments):super.nearestInputPos(...arguments)}get overwrite(){return this.currentMask?this.currentMask.overwrite:super.overwrite}set overwrite(e){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}get eager(){return this.currentMask?this.currentMask.eager:super.eager}set eager(e){console.warn('"eager" option is not available in dynamic mask, use this option in siblings')}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:super.skipInvalid}set skipInvalid(e){(this.isInitialized||e!==m.DEFAULTS.skipInvalid)&&console.warn('"skipInvalid" option is not available in dynamic mask, use this option in siblings')}maskEquals(e){return Array.isArray(e)&&this.compiledMasks.every(((n,r)=>{if(!e[r])return;const i=e[r],{mask:o}=i;return h(n,t(i,Y))&&n.maskEquals(o)}))}typedValueEquals(e){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.typedValueEquals(e))}}H.DEFAULTS={dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,o=t.compiledMasks.map(((o,s)=>{const l=t.currentMask===o,u=l?o.value.length:o.nearestInputPos(o.value.length,a);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(u),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(u,o.nearestInputPos(o.value.length,a)))}}));return o.sort(((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions)),t.compiledMasks[o[0].index]}},n.MaskedDynamic=H;const V={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V.MASKED;const r=v(e);return e=>r.runIsolated((r=>(r[t]=e,r[n])))}function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return B(...n)(e)}n.PIPE_TYPE=V,n.createPipe=B,n.pipe=U;try{globalThis.IMask=n}catch(e){}e.ChangeDetails=r,e.HTMLContenteditableMaskElement=L,e.HTMLMaskElement=I,e.InputMask=N,e.MaskElement=A,e.Masked=m,e.MaskedDate=M,e.MaskedDynamic=H,e.MaskedEnum=R,e.MaskedFunction=F,e.MaskedNumber=P,e.MaskedPattern=D,e.MaskedRange=C,e.MaskedRegExp=T,e.PIPE_TYPE=V,e.createMask=v,e.createPipe=B,e.default=n,e.pipe=U,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("imask")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms","imask"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).angularIMask={},e.ng.common,e.ng.core,e.ng.forms,e.IMask)}(this,(function(e,t,n,r,i){"use strict";var o,s,a=(o=n,s=Object.create(null),o&&Object.keys(o).forEach((function(e){if("default"!==e){var t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:function(){return o[e]}})}})),s.default=o,Object.freeze(s));class l{create(e,t){return i(e,t)}}l.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:l,deps:[],target:a.\u0275\u0275FactoryTarget.Injectable}),l.\u0275prov=a.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:l,providedIn:"root"}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:l,decorators:[{type:n.Injectable,args:[{providedIn:"root"}]}]});const u=new n.InjectionToken("IMASK_FACTORY",{providedIn:"root",factory:()=>n.inject(l)}),c={provide:r.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((()=>h)),multi:!0},d=e=>e.nativeElement;class h{constructor(){var e;this.onTouched=()=>{},this.onChange=()=>{},this._viewInitialized=!1,this._composing=!1,this._writing=!1,this._elementRef=n.inject(n.ElementRef),this._renderer=n.inject(n.Renderer2),this._factory=n.inject(u),this._platformId=n.inject(n.PLATFORM_ID),this._compositionMode=null!==(e=n.inject(r.COMPOSITION_BUFFER_MODE,{optional:!0}))&&void 0!==e?e:!this._isAndroid(),this.imaskElement=d,this.accept=new n.EventEmitter,this.complete=new n.EventEmitter}get element(){return this.imaskElement(this._elementRef,this)}get maskValue(){return this.maskRef?"typed"===this.unmask?this.maskRef.typedValue:this.unmask?this.maskRef.unmaskedValue:this.maskRef.value:this.element.value}set maskValue(e){this.maskRef?"typed"===this.unmask?this.maskRef.typedValue=e:this.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e:this._renderer.setProperty(this.element,"value",e)}ngAfterViewInit(){this.imask&&this.initMask(),this._viewInitialized=!0}ngOnChanges(e){e.elementRef&&!this.imaskElement&&(this.imaskElement=d),e.imask&&this._viewInitialized&&(this.imask?this.maskRef?this.maskRef.updateOptions(this.imask):(this.initMask(),this.onChange(this.maskValue)):this.destroyMask())}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}ngOnDestroy(){this.destroyMask(),this.accept.complete(),this.complete.complete()}beginWrite(e){this._writing=!0,this._writingValue=e}endWrite(){return this._writing=!1,this._writingValue}writeValue(e){e=null==e&&"typed"!==this.unmask?"":e,this.maskRef?(this.beginWrite(e),this.maskValue=e,this.endWrite()):(this._renderer.setProperty(this.element,"value",e),this._initialValue=e)}_onAccept(){const e=this.maskValue;this._writing&&e===this.endWrite()||(this.onChange(e),this.accept.emit(e))}_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)),null!=this._initialValue&&this.writeValue(this._initialValue),delete this._initialValue}setDisabledState(e){this._renderer.setProperty(this.element,"disabled",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}_handleInput(e){this.maskRef||(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this._handleInput(e)}_isAndroid(){return t.isPlatformBrowser(this._platformId)&&/android (\d+)/.test(navigator.userAgent.toLowerCase())}}h.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:h,deps:[],target:a.\u0275\u0275FactoryTarget.Directive}),h.\u0275dir=a.\u0275\u0275ngDeclareDirective({minVersion:"14.0.0",version:"15.2.9",type:h,isStandalone:!0,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:[c],exportAs:["imask"],usesOnChanges:!0,ngImport:a}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:h,decorators:[{type:n.Directive,args:[{selector:"[imask]",standalone:!0,exportAs:"imask",host:{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},providers:[c]}]}],propDecorators:{imask:[{type:n.Input}],unmask:[{type:n.Input}],imaskElement:[{type:n.Input}],accept:[{type:n.Output}],complete:[{type:n.Output}]}});class p{transform(...e){return i.pipe(...e)}}p.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:p,deps:[],target:a.\u0275\u0275FactoryTarget.Pipe}),p.\u0275pipe=a.\u0275\u0275ngDeclarePipe({minVersion:"14.0.0",version:"15.2.9",ngImport:a,type:p,isStandalone:!0,name:"imask"}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:p,decorators:[{type:n.Pipe,args:[{name:"imask",standalone:!0}]}]});class f{}f.\u0275fac=a.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:f,deps:[],target:a.\u0275\u0275FactoryTarget.NgModule}),f.\u0275mod=a.\u0275\u0275ngDeclareNgModule({minVersion:"14.0.0",version:"15.2.9",ngImport:a,type:f,imports:[h,p],exports:[h,p]}),f.\u0275inj=a.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:f}),a.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:a,type:f,decorators:[{type:n.NgModule,args:[{imports:[h,p],exports:[h,p]}]}]}),Object.defineProperty(e,"PIPE_TYPE",{enumerable:!0,get:function(){return i.PIPE_TYPE}}),Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return i.pipe}}),e.DEFAULT_IMASK_ELEMENT=d,e.DefaultImaskFactory=l,e.IMASK_FACTORY=u,e.IMaskDirective=h,e.IMaskModule=f,e.IMaskPipe=p,e.MASKEDINPUT_VALUE_ACCESSOR=c})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jmespath={})}(this,(function(e){"use strict";const t=e=>null!==e&&"[object Object]"===Object.prototype.toString.call(e),n=(e,r)=>{if(e===r)return!0;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t+=1)if(!n(e[t],r[t]))return!1;return!0}if(t(e)&&t(r)){const t=Object.entries(e),i=new Set(Object.keys(r));if(t.length!==i.size)return!1;for(const[e,o]of t){if(!n(o,r[e]))return!1;i.delete(e)}return 0===i.size}return!1},r=e=>{if(""===e||!1===e||null==e)return!0;if(Array.isArray(e)&&0===e.length)return!0;if(t(e)){for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},i=e=>e>="0"&&e<="9"||"-"===e;var o;!function(e){e.TOK_EOF="EOF",e.TOK_UNQUOTEDIDENTIFIER="UnquotedIdentifier",e.TOK_QUOTEDIDENTIFIER="QuotedIdentifier",e.TOK_RBRACKET="Rbracket",e.TOK_RPAREN="Rparen",e.TOK_COMMA="Comma",e.TOK_COLON="Colon",e.TOK_RBRACE="Rbrace",e.TOK_NUMBER="Number",e.TOK_CURRENT="Current",e.TOK_ROOT="Root",e.TOK_EXPREF="Expref",e.TOK_PIPE="Pipe",e.TOK_OR="Or",e.TOK_AND="And",e.TOK_EQ="EQ",e.TOK_GT="GT",e.TOK_LT="LT",e.TOK_GTE="GTE",e.TOK_LTE="LTE",e.TOK_NE="NE",e.TOK_FLATTEN="Flatten",e.TOK_STAR="Star",e.TOK_FILTER="Filter",e.TOK_DOT="Dot",e.TOK_NOT="Not",e.TOK_LBRACE="Lbrace",e.TOK_LBRACKET="Lbracket",e.TOK_LPAREN="Lparen",e.TOK_LITERAL="Literal"}(o||(o={}));const s={"(":o.TOK_LPAREN,")":o.TOK_RPAREN,"*":o.TOK_STAR,",":o.TOK_COMMA,".":o.TOK_DOT,":":o.TOK_COLON,"@":o.TOK_CURRENT,$:o.TOK_ROOT,"]":o.TOK_RBRACKET,"{":o.TOK_LBRACE,"}":o.TOK_RBRACE},a={"!":!0,"<":!0,"=":!0,">":!0},l={"\t":!0,"\n":!0,"\r":!0," ":!0};const u=new class{constructor(){this._current=0}tokenize(e){const t=[];let n,r,u;for(this._current=0;this._current<e.length;)if((c=e[this._current])>="a"&&c<="z"||c>="A"&&c<="Z"||"_"===c)n=this._current,r=this.consumeUnquotedIdentifier(e),t.push({start:n,type:o.TOK_UNQUOTEDIDENTIFIER,value:r});else if(void 0!==s[e[this._current]])t.push({start:this._current,type:s[e[this._current]],value:e[this._current]}),this._current+=1;else if(i(e[this._current]))u=this.consumeNumber(e),t.push(u);else if("["===e[this._current])u=this.consumeLBracket(e),t.push(u);else if('"'===e[this._current])n=this._current,r=this.consumeQuotedIdentifier(e),t.push({start:n,type:o.TOK_QUOTEDIDENTIFIER,value:r});else if("'"===e[this._current])n=this._current,r=this.consumeRawStringLiteral(e),t.push({start:n,type:o.TOK_LITERAL,value:r});else if("`"===e[this._current]){n=this._current;const r=this.consumeLiteral(e);t.push({start:n,type:o.TOK_LITERAL,value:r})}else if(void 0!==a[e[this._current]])u=this.consumeOperator(e),u&&t.push(u);else if(void 0!==l[e[this._current]])this._current+=1;else if("&"===e[this._current])n=this._current,this._current+=1,"&"===e[this._current]?(this._current+=1,t.push({start:n,type:o.TOK_AND,value:"&&"})):t.push({start:n,type:o.TOK_EXPREF,value:"&"});else{if("|"!==e[this._current]){const t=new Error(`Unknown character: ${e[this._current]}`);throw t.name="LexerError",t}n=this._current,this._current+=1,"|"===e[this._current]?(this._current+=1,t.push({start:n,type:o.TOK_OR,value:"||"})):t.push({start:n,type:o.TOK_PIPE,value:"|"})}var c;return t}consumeUnquotedIdentifier(e){const t=this._current;for(this._current+=1;this._current<e.length&&((n=e[this._current])>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||"_"===n);)this._current+=1;var n;return e.slice(t,this._current)}consumeQuotedIdentifier(e){const t=this._current;this._current+=1;const n=e.length;for(;'"'!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&'"'!==e[t+1]?t+=1:t+=2,this._current=t}return this._current+=1,JSON.parse(e.slice(t,this._current))}consumeRawStringLiteral(e){const t=this._current;this._current+=1;const n=e.length;for(;"'"!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&"'"!==e[t+1]?t+=1:t+=2,this._current=t}this._current+=1;return e.slice(t+1,this._current-1).replace("\\'","'")}consumeNumber(e){const t=this._current;this._current+=1;const n=e.length;for(;i(e[this._current])&&this._current<n;)this._current+=1;return{start:t,value:parseInt(e.slice(t,this._current),10),type:o.TOK_NUMBER}}consumeLBracket(e){const t=this._current;return this._current+=1,"?"===e[this._current]?(this._current+=1,{start:t,type:o.TOK_FILTER,value:"[?"}):"]"===e[this._current]?(this._current+=1,{start:t,type:o.TOK_FLATTEN,value:"[]"}):{start:t,type:o.TOK_LBRACKET,value:"["}}consumeOperator(e){const t=this._current,n=e[t];return this._current+=1,"!"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_NE,value:"!="}):{start:t,type:o.TOK_NOT,value:"!"}:"<"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_LTE,value:"<="}):{start:t,type:o.TOK_LT,value:"<"}:">"===n?"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_GTE,value:">="}):{start:t,type:o.TOK_GT,value:">"}:"="===n&&"="===e[this._current]?(this._current+=1,{start:t,type:o.TOK_EQ,value:"=="}):void 0}consumeLiteral(e){this._current+=1;const t=this._current,n=e.length;for(;"`"!==e[this._current]&&this._current<n;){let t=this._current;"\\"!==e[t]||"\\"!==e[t+1]&&"`"!==e[t+1]?t+=1:t+=2,this._current=t}let r=e.slice(t,this._current).trimLeft();r=r.replace("\\`","`");const i=this.looksLikeJSON(r)?JSON.parse(r):JSON.parse(`"${r}"`);return this._current+=1,i}looksLikeJSON(e){if(""===e)return!1;if('[{"'.includes(e[0]))return!0;if(["true","false","null"].includes(e))return!0;if("-0123456789".includes(e[0]))try{return JSON.parse(e),!0}catch(e){return!1}return!1}},c={[o.TOK_EOF]:0,[o.TOK_UNQUOTEDIDENTIFIER]:0,[o.TOK_QUOTEDIDENTIFIER]:0,[o.TOK_RBRACKET]:0,[o.TOK_RPAREN]:0,[o.TOK_COMMA]:0,[o.TOK_RBRACE]:0,[o.TOK_NUMBER]:0,[o.TOK_CURRENT]:0,[o.TOK_EXPREF]:0,[o.TOK_ROOT]:0,[o.TOK_PIPE]:1,[o.TOK_OR]:2,[o.TOK_AND]:3,[o.TOK_EQ]:5,[o.TOK_GT]:5,[o.TOK_LT]:5,[o.TOK_GTE]:5,[o.TOK_LTE]:5,[o.TOK_NE]:5,[o.TOK_FLATTEN]:9,[o.TOK_STAR]:20,[o.TOK_FILTER]:21,[o.TOK_DOT]:40,[o.TOK_NOT]:45,[o.TOK_LBRACE]:50,[o.TOK_LBRACKET]:55,[o.TOK_LPAREN]:60};const d=new class{constructor(){this.index=0,this.tokens=[]}parse(e){this.loadTokens(e),this.index=0;const t=this.expression(0);if(this.lookahead(0)!==o.TOK_EOF){const e=this.lookaheadToken(0);this.errorToken(e,`Unexpected token type: ${e.type}, value: ${e.value}`)}return t}loadTokens(e){this.tokens=[...u.tokenize(e),{type:o.TOK_EOF,value:"",start:e.length}]}expression(e){const t=this.lookaheadToken(0);this.advance();let n=this.nud(t),r=this.lookahead(0);for(;e<c[r];)this.advance(),n=this.led(r,n),r=this.lookahead(0);return n}lookahead(e){return this.tokens[this.index+e].type}lookaheadToken(e){return this.tokens[this.index+e]}advance(){this.index+=1}nud(e){let t,n,r;switch(e.type){case o.TOK_LITERAL:return{type:"Literal",value:e.value};case o.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:e.value};case o.TOK_QUOTEDIDENTIFIER:const i={type:"Field",name:e.value};if(this.lookahead(0)===o.TOK_LPAREN)throw new Error("Quoted identifier not allowed for function names.");return i;case o.TOK_NOT:return n=this.expression(c.Not),{type:"NotExpression",children:[n]};case o.TOK_STAR:return t={type:"Identity"},n=this.lookahead(0)===o.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(c.Star),{type:"ValueProjection",children:[t,n]};case o.TOK_FILTER:return this.led(e.type,{type:"Identity"});case o.TOK_LBRACE:return this.parseMultiselectHash();case o.TOK_FLATTEN:return t={type:o.TOK_FLATTEN,children:[{type:"Identity"}]},n=this.parseProjectionRHS(c.Flatten),{type:"Projection",children:[t,n]};case o.TOK_LBRACKET:return this.lookahead(0)===o.TOK_NUMBER||this.lookahead(0)===o.TOK_COLON?(n=this.parseIndexExpression(),this.projectIfSlice({type:"Identity"},n)):this.lookahead(0)===o.TOK_STAR&&this.lookahead(1)===o.TOK_RBRACKET?(this.advance(),this.advance(),n=this.parseProjectionRHS(c.Star),{children:[{type:"Identity"},n],type:"Projection"}):this.parseMultiselectList();case o.TOK_CURRENT:return{type:o.TOK_CURRENT};case o.TOK_ROOT:return{type:o.TOK_ROOT};case o.TOK_EXPREF:return r=this.expression(c.Expref),{type:"ExpressionReference",children:[r]};case o.TOK_LPAREN:const s=[];for(;this.lookahead(0)!==o.TOK_RPAREN;)this.lookahead(0)===o.TOK_CURRENT?(r={type:o.TOK_CURRENT},this.advance()):r=this.expression(0),s.push(r);return this.match(o.TOK_RPAREN),s[0];default:this.errorToken(e)}}led(e,t){let n;switch(e){case o.TOK_DOT:const r=c.Dot;return this.lookahead(0)!==o.TOK_STAR?(n=this.parseDotRHS(r),{type:"Subexpression",children:[t,n]}):(this.advance(),n=this.parseProjectionRHS(r),{type:"ValueProjection",children:[t,n]});case o.TOK_PIPE:return n=this.expression(c.Pipe),{type:o.TOK_PIPE,children:[t,n]};case o.TOK_OR:return n=this.expression(c.Or),{type:"OrExpression",children:[t,n]};case o.TOK_AND:return n=this.expression(c.And),{type:"AndExpression",children:[t,n]};case o.TOK_LPAREN:const i=t.name,s=[];let a;for(;this.lookahead(0)!==o.TOK_RPAREN;)this.lookahead(0)===o.TOK_CURRENT?(a={type:o.TOK_CURRENT},this.advance()):a=this.expression(0),this.lookahead(0)===o.TOK_COMMA&&this.match(o.TOK_COMMA),s.push(a);this.match(o.TOK_RPAREN);return{name:i,type:"Function",children:s};case o.TOK_FILTER:const l=this.expression(0);return this.match(o.TOK_RBRACKET),n=this.lookahead(0)===o.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(c.Filter),{type:"FilterProjection",children:[t,n,l]};case o.TOK_FLATTEN:return{type:"Projection",children:[{type:o.TOK_FLATTEN,children:[t]},this.parseProjectionRHS(c.Flatten)]};case o.TOK_EQ:case o.TOK_NE:case o.TOK_GT:case o.TOK_GTE:case o.TOK_LT:case o.TOK_LTE:return this.parseComparator(t,e);case o.TOK_LBRACKET:const u=this.lookaheadToken(0);return u.type===o.TOK_NUMBER||u.type===o.TOK_COLON?(n=this.parseIndexExpression(),this.projectIfSlice(t,n)):(this.match(o.TOK_STAR),this.match(o.TOK_RBRACKET),n=this.parseProjectionRHS(c.Star),{type:"Projection",children:[t,n]});default:return this.errorToken(this.lookaheadToken(0))}}match(e){if(this.lookahead(0)!==e){const t=this.lookaheadToken(0);this.errorToken(t,`Expected ${e}, got: ${t.type}`)}else this.advance()}errorToken(e,t=""){const n=new Error(t||`Invalid token (${e.type}): "${e.value}"`);throw n.name="ParserError",n}parseIndexExpression(){if(this.lookahead(0)===o.TOK_COLON||this.lookahead(1)===o.TOK_COLON)return this.parseSliceExpression();const e={type:"Index",value:this.lookaheadToken(0).value};return this.advance(),this.match(o.TOK_RBRACKET),e}projectIfSlice(e,t){const n={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{children:[n,this.parseProjectionRHS(c.Star)],type:"Projection"}:n}parseSliceExpression(){const e=[null,null,null];let t=0,n=this.lookahead(0);for(;n!==o.TOK_RBRACKET&&t<3;){if(n===o.TOK_COLON)t+=1,this.advance();else if(n===o.TOK_NUMBER)e[t]=this.lookaheadToken(0).value,this.advance();else{const e=this.lookaheadToken(0);this.errorToken(e,`Syntax error, unexpected token: ${e.value}(${e.type})`)}n=this.lookahead(0)}return this.match(o.TOK_RBRACKET),{children:e,type:"Slice"}}parseComparator(e,t){return{type:"Comparator",name:t,children:[e,this.expression(c[t])]}}parseDotRHS(e){const t=this.lookahead(0);if([o.TOK_UNQUOTEDIDENTIFIER,o.TOK_QUOTEDIDENTIFIER,o.TOK_STAR].includes(t))return this.expression(e);if(t===o.TOK_LBRACKET)return this.match(o.TOK_LBRACKET),this.parseMultiselectList();if(t===o.TOK_LBRACE)return this.match(o.TOK_LBRACE),this.parseMultiselectHash();const n=this.lookaheadToken(0);this.errorToken(n,`Syntax error, unexpected token: ${n.value}(${n.type})`)}parseProjectionRHS(e){if(c[this.lookahead(0)]<10)return{type:"Identity"};if(this.lookahead(0)===o.TOK_LBRACKET)return this.expression(e);if(this.lookahead(0)===o.TOK_FILTER)return this.expression(e);if(this.lookahead(0)===o.TOK_DOT)return this.match(o.TOK_DOT),this.parseDotRHS(e);const t=this.lookaheadToken(0);this.errorToken(t,`Syntax error, unexpected token: ${t.value}(${t.type})`)}parseMultiselectList(){const e=[];for(;this.lookahead(0)!==o.TOK_RBRACKET;){const t=this.expression(0);if(e.push(t),this.lookahead(0)===o.TOK_COMMA&&(this.match(o.TOK_COMMA),this.lookahead(0)===o.TOK_RBRACKET))throw new Error("Unexpected token Rbracket")}return this.match(o.TOK_RBRACKET),{type:"MultiSelectList",children:e}}parseMultiselectHash(){const e=[],t=[o.TOK_UNQUOTEDIDENTIFIER,o.TOK_QUOTEDIDENTIFIER];let n,r,i;for(;;){if(n=this.lookaheadToken(0),!t.includes(n.type))throw new Error(`Expecting an identifier token, got: ${n.type}`);if(r=n.value,this.advance(),this.match(o.TOK_COLON),i=this.expression(0),e.push({value:i,type:"KeyValuePair",name:r}),this.lookahead(0)===o.TOK_COMMA)this.match(o.TOK_COMMA);else if(this.lookahead(0)===o.TOK_RBRACE){this.match(o.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:e}}};var h;!function(e){e[e.TYPE_NUMBER=0]="TYPE_NUMBER",e[e.TYPE_ANY=1]="TYPE_ANY",e[e.TYPE_STRING=2]="TYPE_STRING",e[e.TYPE_ARRAY=3]="TYPE_ARRAY",e[e.TYPE_OBJECT=4]="TYPE_OBJECT",e[e.TYPE_BOOLEAN=5]="TYPE_BOOLEAN",e[e.TYPE_EXPREF=6]="TYPE_EXPREF",e[e.TYPE_NULL=7]="TYPE_NULL",e[e.TYPE_ARRAY_NUMBER=8]="TYPE_ARRAY_NUMBER",e[e.TYPE_ARRAY_STRING=9]="TYPE_ARRAY_STRING"}(h||(h={}));class p{constructor(e){this.TYPE_NAME_TABLE={[h.TYPE_NUMBER]:"number",[h.TYPE_ANY]:"any",[h.TYPE_STRING]:"string",[h.TYPE_ARRAY]:"array",[h.TYPE_OBJECT]:"object",[h.TYPE_BOOLEAN]:"boolean",[h.TYPE_EXPREF]:"expression",[h.TYPE_NULL]:"null",[h.TYPE_ARRAY_NUMBER]:"Array<number>",[h.TYPE_ARRAY_STRING]:"Array<string>"},this.functionAbs=([e])=>Math.abs(e),this.functionAvg=([e])=>{let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length},this.functionCeil=([e])=>Math.ceil(e),this.functionContains=e=>{const[t,n]=e;return t.includes(n)},this.functionEndsWith=e=>{const[t,n]=e;return t.includes(n,t.length-n.length)},this.functionFloor=([e])=>Math.floor(e),this.functionJoin=e=>{const[t,n]=e;return n.join(t)},this.functionKeys=([e])=>Object.keys(e),this.functionLength=([e])=>t(e)?Object.keys(e).length:e.length,this.functionMap=e=>{if(!this._interpreter)return[];const t=[],n=this._interpreter,r=e[0],i=e[1];for(let e=0;e<i.length;e+=1)t.push(n.visit(r,i[e]));return t},this.functionMax=([e])=>{if(!e.length)return null;if(this.getTypeName(e[0])===h.TYPE_NUMBER)return Math.max(...e);const t=e;let n=t[0];for(let e=1;e<t.length;e+=1)n.localeCompare(t[e])<0&&(n=t[e]);return n},this.functionMaxBy=e=>{const t=e[1],n=e[0],r=this.createKeyFunction(t,[h.TYPE_NUMBER,h.TYPE_STRING]);let i,o,s=-1/0;for(let e=0;e<n.length;e+=1)o=r&&r(n[e]),void 0!==o&&o>s&&(s=o,i=n[e]);return i},this.functionMerge=e=>{let t={};for(let n=0;n<e.length;n+=1){const r=e[n];t=Object.assign(t,r)}return t},this.functionMin=([e])=>{if(!e.length)return null;if(this.getTypeName(e[0])===h.TYPE_NUMBER)return Math.min(...e);const t=e;let n=t[0];for(let e=1;e<t.length;e+=1)t[e].localeCompare(n)<0&&(n=t[e]);return n},this.functionMinBy=e=>{const t=e[1],n=e[0],r=this.createKeyFunction(t,[h.TYPE_NUMBER,h.TYPE_STRING]);let i,o,s=1/0;for(let e=0;e<n.length;e+=1)o=r&&r(n[e]),void 0!==o&&o<s&&(s=o,i=n[e]);return i},this.functionNotNull=e=>{for(let t=0;t<e.length;t+=1)if(this.getTypeName(e[t])!==h.TYPE_NULL)return e[t];return null},this.functionReverse=([e])=>{if(this.getTypeName(e)===h.TYPE_STRING){const t=e;let n="";for(let e=t.length-1;e>=0;e-=1)n+=t[e];return n}const t=e.slice(0);return t.reverse(),t},this.functionSort=([e])=>[...e].sort(),this.functionSortBy=e=>{if(!this._interpreter)return[];const t=e[0].slice(0);if(0===t.length)return t;const n=this._interpreter,r=e[1],i=this.getTypeName(n.visit(r,t[0]));if(void 0!==i&&![h.TYPE_NUMBER,h.TYPE_STRING].includes(i))throw new Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[i]})`);const o=[];for(let e=0;e<t.length;e+=1)o.push([e,t[e]]);o.sort(((e,t)=>{const o=n.visit(r,e[1]),s=n.visit(r,t[1]);if(this.getTypeName(o)!==i)throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(o)]}`);if(this.getTypeName(s)!==i)throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(s)]}`);return o>s?1:o<s?-1:e[0]-t[0]}));for(let e=0;e<o.length;e+=1)t[e]=o[e][1];return t},this.functionStartsWith=([e,t])=>e.startsWith(t),this.functionSum=([e])=>e.reduce(((e,t)=>e+t),0),this.functionToArray=([e])=>this.getTypeName(e)===h.TYPE_ARRAY?e:[e],this.functionToNumber=([e])=>{const t=this.getTypeName(e);let n;return t===h.TYPE_NUMBER?e:t!==h.TYPE_STRING||(n=+e,isNaN(n))?null:n},this.functionToString=([e])=>this.getTypeName(e)===h.TYPE_STRING?e:JSON.stringify(e),this.functionType=([e])=>{switch(this.getTypeName(e)){case h.TYPE_NUMBER:return"number";case h.TYPE_STRING:return"string";case h.TYPE_ARRAY:return"array";case h.TYPE_OBJECT:return"object";case h.TYPE_BOOLEAN:return"boolean";case h.TYPE_EXPREF:return"expref";case h.TYPE_NULL:return"null";default:return}},this.functionValues=([e])=>Object.values(e),this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[h.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[h.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[h.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY]},{types:[h.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[h.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[h.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY,h.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[h.TYPE_EXPREF]},{types:[h.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[h.TYPE_ARRAY_NUMBER,h.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[h.TYPE_OBJECT],variadic:!0}]},min:{_func:this.functionMin,_signature:[{types:[h.TYPE_ARRAY_NUMBER,h.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[h.TYPE_ANY],variadic:!0}]},reverse:{_func:this.functionReverse,_signature:[{types:[h.TYPE_STRING,h.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[h.TYPE_ARRAY_STRING,h.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[h.TYPE_ARRAY]},{types:[h.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[h.TYPE_STRING]},{types:[h.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[h.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[h.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[h.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[h.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[h.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[h.TYPE_OBJECT]}]}},this._interpreter=e}registerFunction(e,t,n){if(e in this.functionTable)throw new Error(`Function already defined: ${e}()`);this.functionTable[e]={_func:t.bind(this),_signature:n}}callFunction(e,t){const n=this.functionTable[e];if(void 0===n)throw new Error(`Unknown function: ${e}()`);return this.validateArgs(e,t,n._signature),n._func.call(this,t)}validateInputSignatures(e,t){for(let n=0;n<t.length;n+=1)if("variadic"in t[n]&&n!==t.length-1)throw new Error(`ArgumentError: ${e}() 'variadic' argument ${n+1} must occur last`)}validateArgs(e,t,n){var r,i;let o;this.validateInputSignatures(e,n);const s=n.filter((e=>{var t;return null!==(t=!e.optional)&&void 0!==t&&t})).length,a=null!==(i=null===(r=n[n.length-1])||void 0===r?void 0:r.variadic)&&void 0!==i&&i,l=t.length<s,u=t.length>n.length,c=l&&(!a&&s>1||a)?"at least ":"";if(a&&l||!a&&(l||u))throw o=n.length>1,new Error(`ArgumentError: ${e}() takes ${c}${s} argument${o?"s":""} but received ${t.length}`);let d,h,p;for(let r=0;r<n.length;r+=1){let i;for(p=!1,d=n[r].types,h=this.getTypeName(t[r]),i=0;i<d.length;i+=1)if(void 0!==h&&this.typeMatches(h,d[i],t[r])){p=!0;break}if(!p&&void 0!==h){const t=d.map((e=>this.TYPE_NAME_TABLE[e])).join(" | ");throw new Error(`TypeError: ${e}() expected argument ${r+1} to be type (${t}) but received type ${this.TYPE_NAME_TABLE[h]} instead.`)}}}typeMatches(e,t,n){if(t===h.TYPE_ANY)return!0;if(t!==h.TYPE_ARRAY_STRING&&t!==h.TYPE_ARRAY_NUMBER&&t!==h.TYPE_ARRAY)return e===t;if(t===h.TYPE_ARRAY)return e===h.TYPE_ARRAY;if(e===h.TYPE_ARRAY){let e;t===h.TYPE_ARRAY_NUMBER?e=h.TYPE_NUMBER:t===h.TYPE_ARRAY_STRING&&(e=h.TYPE_STRING);for(let t=0;t<n.length;t+=1){const r=this.getTypeName(n[t]);if(void 0!==r&&void 0!==e&&!this.typeMatches(r,e,n[t]))return!1}return!0}return!1}getTypeName(e){switch(Object.prototype.toString.call(e)){case"[object String]":return h.TYPE_STRING;case"[object Number]":return h.TYPE_NUMBER;case"[object Array]":return h.TYPE_ARRAY;case"[object Boolean]":return h.TYPE_BOOLEAN;case"[object Null]":return h.TYPE_NULL;case"[object Object]":return e.jmespathType===o.TOK_EXPREF?h.TYPE_EXPREF:h.TYPE_OBJECT;default:return}}createKeyFunction(e,t){if(!this._interpreter)return;const n=this._interpreter;return r=>{const i=n.visit(e,r);if(!t.includes(this.getTypeName(i))){const e=`TypeError: expected one of (${t.map((e=>this.TYPE_NAME_TABLE[e])).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(i)]}`;throw new Error(e)}return i}}}const f=new class{constructor(){this._rootValue=null,this.runtime=new p(this)}search(e,t){return this._rootValue=t,this.visit(e,t)}visit(e,i){let s,a,l,u,c,d,h,p,f,m,g;switch(e.type){case"Field":return null===i?null:t(i)?(d=i[e.name],void 0===d?null:d):null;case"Subexpression":for(l=this.visit(e.children[0],i),m=1;m<e.children.length;m+=1)if(l=this.visit(e.children[1],l),null===l)return null;return l;case"IndexExpression":return h=this.visit(e.children[0],i),p=this.visit(e.children[1],h),p;case"Index":if(!Array.isArray(i))return null;let v=e.value;return v<0&&(v=i.length+v),l=i[v],void 0===l&&(l=null),l;case"Slice":if(!Array.isArray(i))return null;const y=[...e.children],_=this.computeSliceParams(i.length,y),[b,w,x]=_;if(l=[],x>0)for(m=b;m<w;m+=x)l.push(i[m]);else for(m=b;m>w;m+=x)l.push(i[m]);return l;case"Projection":if(g=this.visit(e.children[0],i),!Array.isArray(g))return null;for(f=[],m=0;m<g.length;m+=1)a=this.visit(e.children[1],g[m]),null!==a&&f.push(a);return f;case"ValueProjection":if(g=this.visit(e.children[0],i),!t(g))return null;f=[];const S=Object.values(g);for(m=0;m<S.length;m+=1)a=this.visit(e.children[1],S[m]),null!==a&&f.push(a);return f;case"FilterProjection":if(g=this.visit(e.children[0],i),!Array.isArray(g))return null;const k=[],T=[];for(m=0;m<g.length;m+=1)s=this.visit(e.children[2],g[m]),r(s)||k.push(g[m]);for(let t=0;t<k.length;t+=1)a=this.visit(e.children[1],k[t]),null!==a&&T.push(a);return T;case"Comparator":switch(u=this.visit(e.children[0],i),c=this.visit(e.children[1],i),e.name){case o.TOK_EQ:l=n(u,c);break;case o.TOK_NE:l=!n(u,c);break;case o.TOK_GT:l=u>c;break;case o.TOK_GTE:l=u>=c;break;case o.TOK_LT:l=u<c;break;case o.TOK_LTE:l=u<=c;break;default:throw new Error(`Unknown comparator: ${e.name}`)}return l;case o.TOK_FLATTEN:const E=this.visit(e.children[0],i);if(!Array.isArray(E))return null;let D=[];for(m=0;m<E.length;m+=1)a=E[m],Array.isArray(a)?D=[...D,...a]:D.push(a);return D;case"Identity":return i;case"MultiSelectList":if(null===i)return null;for(f=[],m=0;m<e.children.length;m+=1)f.push(this.visit(e.children[m],i));return f;case"MultiSelectHash":if(null===i)return null;let C;for(f={},m=0;m<e.children.length;m+=1)C=e.children[m],f[C.name]=this.visit(C.value,i);return f;case"OrExpression":return s=this.visit(e.children[0],i),r(s)&&(s=this.visit(e.children[1],i)),s;case"AndExpression":return u=this.visit(e.children[0],i),r(u)?u:this.visit(e.children[1],i);case"NotExpression":return u=this.visit(e.children[0],i),r(u);case"Literal":return e.value;case o.TOK_PIPE:return h=this.visit(e.children[0],i),this.visit(e.children[1],h);case o.TOK_CURRENT:return i;case o.TOK_ROOT:return this._rootValue;case"Function":const M=[];for(let t=0;t<e.children.length;t+=1)M.push(this.visit(e.children[t],i));return this.runtime.callFunction(e.name,M);case"ExpressionReference":const A=e.children[0];return A.jmespathType=o.TOK_EXPREF,A;default:throw new Error(`Unknown node type: ${e.type}`)}}computeSliceParams(e,t){let[n,r,i]=t;if(null===i)i=1;else if(0===i){const e=new Error("Invalid slice, step cannot be 0");throw e.name="RuntimeError",e}const o=i<0;return n=null===n?o?e-1:0:this.capSliceRange(e,n,i),r=null===r?o?-1:e:this.capSliceRange(e,r,i),[n,r,i]}capSliceRange(e,t,n){let r=t;return r<0?(r+=e,r<0&&(r=n<0?-1:0)):r>=e&&(r=n<0?e-1:e),r}},m=h.TYPE_ANY,g=h.TYPE_ARRAY,v=h.TYPE_ARRAY_NUMBER,y=h.TYPE_ARRAY_STRING,_=h.TYPE_BOOLEAN,b=h.TYPE_EXPREF,w=h.TYPE_NULL,x=h.TYPE_NUMBER,S=h.TYPE_OBJECT,k=h.TYPE_STRING;function T(e){return d.parse(e)}function E(e){return u.tokenize(e)}const D=(e,t,n)=>{f.runtime.registerFunction(e,t,n)};function C(e,t){const n=d.parse(t);return f.search(n,e)}const M=f,A={compile:T,registerFunction:D,search:C,tokenize:E,TreeInterpreter:M,TYPE_ANY:m,TYPE_ARRAY_NUMBER:v,TYPE_ARRAY_STRING:y,TYPE_ARRAY:g,TYPE_BOOLEAN:_,TYPE_EXPREF:b,TYPE_NULL:w,TYPE_NUMBER:x,TYPE_OBJECT:S,TYPE_STRING:k};e.TYPE_ANY=m,e.TYPE_ARRAY=g,e.TYPE_ARRAY_NUMBER=v,e.TYPE_ARRAY_STRING=y,e.TYPE_BOOLEAN=_,e.TYPE_EXPREF=b,e.TYPE_NULL=w,e.TYPE_NUMBER=x,e.TYPE_OBJECT=S,e.TYPE_STRING=k,e.TreeInterpreter=M,e.compile=T,e.default=A,e.jmespath=A,e.registerFunction=D,e.search=C,e.tokenize=E,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/animations"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).collapse={},e.ng.core,e.ng.animations)}(this,(function(e,t,n){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=r(t),o=r(n);const s="400ms cubic-bezier(0.4,0.0,0.2,1)",a=[n.style({height:0,visibility:"hidden"}),n.animate(s,n.style({height:"*",visibility:"visible"}))],l=[n.style({height:"*",visibility:"visible"}),n.animate(s,n.style({height:0,visibility:"hidden"}))];class u{constructor(e,n,r){this._el=e,this._renderer=n,this.collapsed=new t.EventEmitter,this.collapses=new t.EventEmitter,this.expanded=new t.EventEmitter,this.expands=new t.EventEmitter,this.isExpanded=!0,this.collapseNewValue=!0,this.isCollapsed=!1,this.isCollapse=!0,this.isCollapsing=!1,this.isAnimated=!1,this._display="block",this._stylesLoaded=!1,this._COLLAPSE_ACTION_NAME="collapse",this._EXPAND_ACTION_NAME="expand",this._factoryCollapseAnimation=r.build(l),this._factoryExpandAnimation=r.build(a)}set display(e){this._display=e,"none"!==e?this.isAnimated?this.toggle():this.show():this.hide()}set collapse(e){this.collapseNewValue=e,this._player&&!this._isAnimationDone||(this.isExpanded=e,this.toggle())}get collapse(){return this.isExpanded}ngAfterViewChecked(){this._stylesLoaded=!0,this._player&&this._isAnimationDone&&(this._player.reset(),this._renderer.setStyle(this._el.nativeElement,"height","*"))}toggle(){this.isExpanded?this.hide():this.show()}hide(){this.isCollapsing=!0,this.isExpanded=!1,this.isCollapsed=!0,this.isCollapsing=!1,this.collapses.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._COLLAPSE_ACTION_NAME)((()=>{this._isAnimationDone=!0,this.collapseNewValue!==this.isCollapsed&&this.isAnimated?this.show():(this.collapsed.emit(this),this._renderer.setStyle(this._el.nativeElement,"display","none"))}))}show(){this._renderer.setStyle(this._el.nativeElement,"display",this._display),this.isCollapsing=!0,this.isExpanded=!0,this.isCollapsed=!1,this.isCollapsing=!1,this.expands.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._EXPAND_ACTION_NAME)((()=>{this._isAnimationDone=!0,this.collapseNewValue!==this.isCollapsed&&this.isAnimated?this.hide():(this.expanded.emit(this),this._renderer.removeStyle(this._el.nativeElement,"overflow"))}))}animationRun(e,t){if(!e||!this._stylesLoaded)return e=>e();this._renderer.setStyle(this._el.nativeElement,"overflow","hidden"),this._renderer.addClass(this._el.nativeElement,"collapse");const n=t===this._EXPAND_ACTION_NAME?this._factoryExpandAnimation:this._factoryCollapseAnimation;return this._player&&this._player.reset(),this._player=n.create(this._el.nativeElement),this._player.play(),e=>{var t;return null===(t=this._player)||void 0===t?void 0:t.onDone(e)}}}u.\u0275fac=i.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:u,deps:[{token:i.ElementRef},{token:i.Renderer2},{token:o.AnimationBuilder}],target:i.\u0275\u0275FactoryTarget.Directive}),u.\u0275dir=i.\u0275\u0275ngDeclareDirective({minVersion:"14.0.0",version:"14.0.6",type:u,selector:"[collapse]",inputs:{display:"display",isAnimated:"isAnimated",collapse:"collapse"},outputs:{collapsed:"collapsed",collapses:"collapses",expanded:"expanded",expands:"expands"},host:{properties:{"class.collapse":"this.isCollapse","class.in":"this.isExpanded","class.show":"this.isExpanded","attr.aria-hidden":"this.isCollapsed","class.collapsing":"this.isCollapsing"}},exportAs:["bs-collapse"],ngImport:i}),i.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:u,decorators:[{type:t.Directive,args:[{selector:"[collapse]",exportAs:"bs-collapse",host:{"[class.collapse]":"true"}}]}],ctorParameters:function(){return[{type:i.ElementRef},{type:i.Renderer2},{type:o.AnimationBuilder}]},propDecorators:{collapsed:[{type:t.Output}],collapses:[{type:t.Output}],expanded:[{type:t.Output}],expands:[{type:t.Output}],isExpanded:[{type:t.HostBinding,args:["class.in"]},{type:t.HostBinding,args:["class.show"]}],isCollapsed:[{type:t.HostBinding,args:["attr.aria-hidden"]}],isCollapse:[{type:t.HostBinding,args:["class.collapse"]}],isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],display:[{type:t.Input}],isAnimated:[{type:t.Input}],collapse:[{type:t.Input}]}});class c{static forRoot(){return{ngModule:c,providers:[]}}}c.\u0275fac=i.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c,deps:[],target:i.\u0275\u0275FactoryTarget.NgModule}),c.\u0275mod=i.\u0275\u0275ngDeclareNgModule({minVersion:"14.0.0",version:"14.0.6",ngImport:i,type:c,declarations:[u],exports:[u]}),c.\u0275inj=i.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c}),i.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"14.0.6",ngImport:i,type:c,decorators:[{type:t.NgModule,args:[{declarations:[u],exports:[u]}]}]}),e.CollapseDirective=u,e.CollapseModule=c})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).chronos={})}(this,(function(e){"use strict";function t(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function n(e){return"string"==typeof e}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e){return e&&e.getTime&&!isNaN(e.getTime())}function o(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e){return void 0===e}function d(e){const n=+e;let r=0;return 0!==n&&isFinite(n)&&(r=t(n)),r}const h={},p={date:"day",hour:"hours",minute:"minutes",second:"seconds",millisecond:"milliseconds"};function f(e,t){const n=e.toLowerCase();let r=e;n in p&&(r=p[n]),h[n]=h[`${n}s`]=h[t]=r}function m(e){return n(e)?h[e]||h[e.toLowerCase()]:void 0}const g=0,v=1,y=2,_=3,b=4,w=5,x=6,S=7,k=8;function T(e,t,n){const r=`${Math.abs(e)}`,i=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}const E={},D={},C=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;function M(e,t,n,r){e&&(D[e]=r),t&&(D[t[0]]=function(){return T(r.apply(null,arguments),t[1],t[2])}),n&&(D[n]=function(t,n){return n.locale.ordinal(r.apply(null,arguments),e)})}function A(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function I(e,t,n){const r=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(r.getUTCFullYear())&&r.setUTCFullYear(e),r}function L(e,t=0,n=1,r=0,i=0,o=0,s=0){const a=new Date(e,t,n,r,i,o,s);return e<100&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function O(e,t=!1){return t?e.getUTCHours():e.getHours()}function N(e,t=!1){return t?e.getUTCMinutes():e.getMinutes()}function R(e,t=!1){return t?e.getUTCSeconds():e.getSeconds()}function P(e,t=!1){return t?e.getUTCMilliseconds():e.getMilliseconds()}function F(e,t=!1){return t?e.getUTCDay():e.getDay()}function j(e,t=!1){return t?e.getUTCDate():e.getDate()}function Y(e,t=!1){return t?e.getUTCMonth():e.getMonth()}function H(e,t=!1){return t?e.getUTCFullYear():e.getFullYear()}function V(e,t){return!(!e||!t)&&(B(e,t)&&Y(e)===Y(t))}function B(e,t){return!(!e||!t)&&H(e)===H(t)}const U=/\d/,z=/\d\d/,q=/\d{3}/,W=/\d{4}/,$=/[+-]?\d{6}/,G=/\d\d?/,K=/\d\d\d\d?/,Z=/\d\d\d\d\d\d?/,X=/\d{1,3}/,J=/\d{1,4}/,Q=/[+-]?\d{1,6}/,ee=/\d+/,te=/[+-]?\d+/,ne=/Z|[+-]\d\d(?::?\d\d)?/gi,re=/[+-]?\d+(\.\d{1,3})?/,ie=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function se(e,t,n){o(t)?oe[e]=t:oe[e]=function(e,r){return e&&n?n:t}}function ae(e,t){return l(oe,e)?oe[e](!1,t):new RegExp(le(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,((e,t,n,r,i)=>t||n||r||i))))}function le(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}const ue={};function ce(e,t){const r=n(e)?[e]:e;let i=t;if(s(t)&&(i=function(e,n,r){return n[t]=d(e),r}),a(r)&&o(i)){let e;for(e=0;e<r.length;e++)ue[r[e]]=i}}function de(e,t){ce(e,(function(e,n,r,i){return r._w=r._w||{},t(e,r._w,r,i)}))}function he(e,t,n){return null!=t&&l(ue,e)&&ue[e](t,n._a,n,e),n}function pe(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function fe(e,t){return t.locale.getFullYear?t.locale.getFullYear(e,t.isUTC).toString():H(e,t.isUTC).toString()}function me(e){return d(e)+(d(e)>68?1900:2e3)}function ge(e){return ve(e)?366:365}function ve(e){return e%4==0&&e%100!=0||e%400==0}function ye(e,t){if(isNaN(e)||isNaN(t))return NaN;const n=(t%(r=12)+r)%r;var r;return 1===n?ve(e+(t-n)/12)?29:28:31-n%7%2}const _e={year:0,month:0,day:0,hour:0,minute:0,seconds:0};function be(e,t){return s(t)?t:e}function we(e,t,n){const r=Math.min(j(e),ye(H(e),t));return n?e.setUTCMonth(t,r):e.setMonth(t,r),e}function xe(e,t,n){return n?e.setUTCDate(t):e.setDate(t),e}function Se(e){return new Date(e.getTime())}function ke(e,t,r){const i=Se(e);switch(t){case"year":we(i,0,r);case"quarter":case"month":xe(i,1,r);case"week":case"isoWeek":case"day":case"date":!function(e,t,n){n?e.setUTCHours(t):e.setHours(t)}(i,0,r);case"hours":!function(e,t,n){n?e.setUTCMinutes(t):e.setMinutes(t)}(i,0,r);case"minutes":!function(e,t,n){n?e.setUTCSeconds(t):e.setSeconds(t)}(i,0,r);case"seconds":!function(e,t,n){n?e.setUTCMilliseconds(t):e.setMilliseconds(t)}(i,0,r)}return"week"===t&&function(e,t,n={}){const r=un(e,n.locale,n.isUTC);rn(e,t-r,"day")}(i,0,{isUTC:r}),"isoWeek"===t&&function(e,t,r={}){const i=function(e,t=ct()){if(n(e))return t.weekdaysParse(e)%7||7;return s(e)&&isNaN(e)?null:e}(t,r.locale);an(e,ln(e)%7?i:i-7)}
1740
1740
  //! moment.js locale configuration
1741
1741
  //! locale : Arabic [ar]
1742
1742
  //! author : Abdel Said: https://github.com/abdelsaid