2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));function n(e){if(Array.isArray(e))return e}function r(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,o=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){return n(e)||r(e,t)||i(e,t)||l()}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t){for(var r=[],o=0;o<t.length;o++){var i=t[o];if(i){var l=s(i);if("string"===l||"number"===l)r.push(i);else if("object"===l){var u=Array.isArray(i)?i:Object.entries(i).map((function(e){var t=a(e,2);return t[1]?t[0]:null}));r=u.length?r.concat(u.filter((function(e){return!!e}))):r}}}return r.join(" ")}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw i}}}}function h(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g=function(){function e(){c(this,e)}return d(e,null,[{key:"innerWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)}return 0}},{key:"width",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),t}return 0}},{key:"getWindowScrollTop",value:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},{key:"getOuterWidth",value:function(e,t){if(e){var n=e.offsetWidth||e.getBoundingClientRect().width;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getOuterHeight",value:function(e,t){if(e){var n=e.offsetHeight||e.getBoundingClientRect().height;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientHeight",value:function(e,t){if(e){var n=e.clientHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientWidth",value:function(e,t){if(e){var n=e.clientWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getViewport",value:function(){var e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}},{key:"getOffset",value:function(e){if(e){var t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(e){if(e)for(var t=e.parentNode.childNodes,n=0,r=0;r<t.length;r++){if(t[r]===e)return n;1===t[r].nodeType&&n++}return-1}},{key:"addMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.add(n[r]);else for(var o=t.split(" "),i=0;i<o.length;i++)e.className+=" "+o[i]}},{key:"removeMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.remove(n[r]);else for(var o=t.split(" "),i=0;i<o.length;i++)e.className=e.className.replace(new RegExp("(^|\\b)"+o[i].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(e,t){e&&t&&(e.classList?e.classList.add(t):e.className+=" "+t)}},{key:"removeClass",value:function(e,t){e&&t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(e,t){if(e)return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}},{key:"find",value:function(e,t){return e?Array.from(e.querySelectorAll(t)):[]}},{key:"findSingle",value:function(e,t){return e?e.querySelector(t):null}},{key:"getHeight",value:function(e){if(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)}return 0}},{key:"getWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)}return 0}},{key:"alignOverlay",value:function(t,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t&&n&&("self"===r?this.relativePosition(t,n):(o&&(t.style.minWidth=e.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(e,t){if(e){var n,r,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=o.height,l=o.width,a=t.offsetHeight,s=t.offsetWidth,u=t.getBoundingClientRect(),c=this.getWindowScrollTop(),f=this.getWindowScrollLeft(),d=this.getViewport();u.top+a+i>d.height?((n=u.top+c-i)<0&&(n=c),e.style.transformOrigin="bottom"):(n=a+u.top+c,e.style.transformOrigin="top"),r=u.left+s+l>d.width?Math.max(0,u.left+f+s-l):u.left+f,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"relativePosition",value:function(e,t){if(e){var n,r,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=t.offsetHeight,l=t.getBoundingClientRect(),a=this.getViewport();l.top+i+o.height>a.height?(l.top+(n=-1*o.height)<0&&(n=-1*l.top),e.style.transformOrigin="bottom"):(n=i,e.style.transformOrigin="top"),r=o.width>a.width?-1*l.left:l.left+o.width>a.width?-1*(l.left+o.width-a.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",l=arguments.length>4?arguments[4]:void 0,a=n.getBoundingClientRect(),s=this.getViewport(),u=o.split(" "),c=i.split(" "),f=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},d={my:{x:f(u[0]),y:f(u[1]||u[0]),offsetX:f(u[0],!0),offsetY:f(u[1]||u[0],!0)},at:{x:f(c[0]),y:f(c[1]||c[0]),offsetX:f(c[0],!0),offsetY:f(c[1]||c[0],!0)}},p={left:function(){return d.my.offsetX+d.at.offsetX+a.left+("left"===d.my.x?0:-1*("center"===d.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return d.my.offsetY+d.at.offsetY+a.top+("top"===d.my.y?0:-1*("center"===d.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},h={count:{x:0,y:0},left:function(){var n=p.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,d.my.x="left",d.at.x="right",d.my.offsetX*=-1,d.at.offsetX*=-1,this.right())},right:function(){var r=p.left()+e.getOuterWidth(n),o=e.getWindowScrollLeft();t.style.left=r+o+"px",2===this.count.x?(t.style.left=s.width-e.getOuterWidth(t)+o+"px",this.count.x=0):r+e.getOuterWidth(t)>s.width&&(this.count.x++,d.my.x="right",d.at.x="left",d.my.offsetX*=-1,d.at.offsetX*=-1,this.left())},top:function(){var n=p.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,d.my.y="top",d.at.y="bottom",d.my.offsetY*=-1,d.at.offsetY*=-1,this.bottom())},bottom:function(){var r=p.top()+e.getOuterHeight(n),o=e.getWindowScrollTop();t.style.top=r+o+"px",2===this.count.y?(t.style.left=s.height-e.getOuterHeight(t)+o+"px",this.count.y=0):r+e.getOuterHeight(n)>s.height&&(this.count.y++,d.my.y="bottom",d.at.y="top",d.my.offsetY*=-1,d.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var o=p.top()+e.getOuterHeight(n)/2;t.style.top=o+e.getWindowScrollTop()+"px",o<0?this.bottom():o+e.getOuterHeight(n)>s.height&&this.top()}else{var i=p.left()+e.getOuterWidth(n)/2;t.style.left=i+e.getWindowScrollLeft()+"px",i<0?this.left():i+e.getOuterWidth(t)>s.width&&this.right()}}};h[d.at.x]("x"),h[d.at.y]("y"),this.isFunction(l)&&l(d)}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=[];if(e){var n,r=this.getParents(e),o=/(auto|scroll)/,i=function(e){var t=e?getComputedStyle(e):null;return t&&(o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY")))},l=p(r);try{for(l.s();!(n=l.n()).done;){var a=n.value,s=1===a.nodeType&&a.dataset.scrollselectors;if(s){var u,c=p(s.split(","));try{for(c.s();!(u=c.n()).done;){var f=this.findSingle(a,u.value);f&&i(f)&&t.push(f)}}catch(e){c.e(e)}finally{c.f()}}9!==a.nodeType&&i(a)&&t.push(a)}}catch(e){l.e(e)}finally{l.f()}}return t}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0;!function o(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))}()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,o=setInterval((function(){(n-=r)<=0&&(n=0,clearInterval(o)),e.style.opacity=n}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":s(HTMLElement))?e instanceof HTMLElement:e&&"object"===s(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,o=getComputedStyle(e).getPropertyValue("paddingTop"),i=o?parseFloat(o):0,l=e.getBoundingClientRect(),a=t.getBoundingClientRect().top+document.body.scrollTop-(l.top+document.body.scrollTop)-r-i,s=e.scrollTop,u=e.clientHeight,c=this.getOuterHeight(t);a<0?e.scrollTop=s+a:a+c>u&&(e.scrollTop=s+a-u+c)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"isVisible",value:function(e){return e&&null!=e.offsetParent}},{key:"isExist",value:function(e){return null!=e&&e.nodeName&&e.parentNode}},{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"getFocusableElements",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r)),i=[],l=p(o);try{for(l.s();!(n=l.n()).done;){var a=n.value;"none"!==getComputedStyle(a).display&&"hidden"!==getComputedStyle(a).visibility&&i.push(a)}}catch(e){l.e(e)}finally{l.f()}return i}},{key:"getFirstFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[0]:null}},{key:"getLastFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[r.length-1]:null}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var o=getComputedStyle(e),i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.overflow=o.overflow,i.style.width=o.width,i.style.height=o.height,i.style.padding=o.padding,i.style.border=o.border,i.style.overflowWrap=o.overflowWrap,i.style.whiteSpace=o.whiteSpace,i.style.lineHeight=o.lineHeight,i.innerHTML=t.replace(/\r\n|\r|\n/g,"<br />");var l=document.createElement("span");l.textContent=r,i.appendChild(l);var a=document.createTextNode(n);i.appendChild(a),document.body.appendChild(i);var s=l.offsetLeft,u=l.offsetTop,c=l.clientHeight;return document.body.removeChild(i),{left:Math.abs(s-e.scrollLeft),top:Math.abs(u-e.scrollTop)+c}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(e,t,n){e[t].apply(e,n)}},{key:"isClickable",value:function(e){var t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return"INPUT"===t||"TEXTAREA"===t||"BUTTON"===t||"A"===t||"INPUT"===n||"TEXTAREA"===n||"BUTTON"===n||"A"===n||this.hasClass(e,"p-button")||this.hasClass(e.parentElement,"p-button")||this.hasClass(e.parentElement,"p-checkbox")||this.hasClass(e.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(e,t){if("string"==typeof t)e.style.cssText=this.style;else for(var n in this.style)e.style[n]=t[n]}},{key:"exportCSV",value:function(t,n){var r=new Blob([t],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n+".csv"):e.saveAs({name:n+".csv",src:URL.createObjectURL(r)})||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}},{key:"saveAs",value:function(e){if(e){var t=document.createElement("a");if(void 0!==t.download){var n=e.name;return t.setAttribute("href",e.src),t.setAttribute("download",n),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}},{key:"createInlineStyle",value:function(e){var t=document.createElement("style");try{e||(e=process.env.REACT_APP_CSS_NONCE)}catch(e){}return e&&t.setAttribute("nonce",e),document.head.appendChild(t),t}},{key:"removeInlineStyle",value:function(e){if(this.isExist(e)){try{document.head.removeChild(e)}catch(e){}e=null}return e}}]),e}(),v=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};c(this,e),this.element=t,this.listener=n}return d(e,[{key:"bindScrollListener",value:function(){this.scrollableParents=g.getScrollableParents(this.element);for(var e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].addEventListener("scroll",this.listener)}},{key:"unbindScrollListener",value:function(){if(this.scrollableParents)for(var e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].removeEventListener("scroll",this.listener)}},{key:"destroy",value:function(){this.unbindScrollListener(),this.element=null,this.listener=null,this.scrollableParents=null}}]),e}();function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(){function e(){c(this,e)}return d(e,null,[{key:"equals",value:function(e,t,n){return n&&e&&"object"===s(e)&&t&&"object"===s(t)?this.resolveFieldData(e,n)===this.resolveFieldData(t,n):this.deepEquals(e,t)}},{key:"deepEquals",value:function(e,t){if(e===t)return!0;if(e&&t&&"object"==s(e)&&"object"==s(t)){var n,r,o,i=Array.isArray(e),l=Array.isArray(t);if(i&&l){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[n],t[n]))return!1;return!0}if(i!==l)return!1;var a=e instanceof Date,u=t instanceof Date;if(a!==u)return!1;if(a&&u)return e.getTime()===t.getTime();var c=e instanceof RegExp,f=t instanceof RegExp;if(c!==f)return!1;if(c&&f)return e.toString()===t.toString();var d=Object.keys(e);if((r=d.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,d[n]))return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[o=d[n]],t[o]))return!1;return!0}return e!=e&&t!=t}},{key:"resolveFieldData",value:function(e,t){if(e&&Object.keys(e).length&&t){if(this.isFunction(t))return t(e);if(-1===t.indexOf("."))return e[t];for(var n=t.split("."),r=e,o=0,i=n.length;o<i;++o){if(null==r)return null;r=r[n[o]]}return r}return null}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"findDiffKeys",value:function(e,t){return e&&t?Object.keys(e).filter((function(e){return!t.hasOwnProperty(e)})).reduce((function(t,n){return t[n]=e[n],t}),{}):{}}},{key:"reorderArray",value:function(e,t,n){var r;if(e&&t!==n){if(n>=e.length)for(r=n-e.length;1+r--;)e.push(void 0);e.splice(n,0,e.splice(t,1)[0])}}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?t.findIndex(n?function(t){return r.equals(t,e,n)}:function(t){return t===e}):-1}},{key:"getJSXElement",value:function(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 this.isFunction(e)?e.apply(void 0,n):e}},{key:"getPropValue",value:function(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 this.isFunction(e)?e.apply(void 0,n):e}},{key:"getRefElement",value:function(e){return e?"object"===s(e)&&e.hasOwnProperty("current")?e.current:e:null}},{key:"removeAccents",value:function(e){return e&&e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"===s(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}}]),e}();function k(){return k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=function(){function e(){c(this,e)}return d(e,null,[{key:"getJSXIcon",value:function(e,n,r){var o=null;if(e){var i=s(e),l=u(n.className,"string"===i&&e);if(o=t.default.createElement("span",k({},n,{className:l})),"string"!==i){var a=O({iconProps:n,element:o},r);return x.getJSXElement(e,a)}}return o}}]),e}(),S=0;function A(e){if(Array.isArray(e))return o(e)}function P(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function j(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e){return A(e)||P(e)||i(e)||j()}var F,L,W,H,D=(F=[],L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=H(e,t,n),o=r.value+(r.key===e?0:n)+1;return F.push({key:e,value:o}),o},W=function(e,t){return H(e,t).value},H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return T(F).reverse().find((function(n){return!!t||n.key===e}))||{key:e,value:n}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n,r){t&&(t.style.zIndex=String(L(e,n,r)))},clear:function(e){var t;e&&(t=D.get(e),F=F.filter((function(e){return e.value!==t})),e.style.zIndex="")},getCurrent:function(e,t){return W(e,t)}});exports.ConnectedOverlayScrollHandler=v,exports.DomHandler=g,exports.EventBus=function(){var e=new Map;return{on:function(t,n){var r=e.get(t);r?r.push(n):r=[n],e.set(t,r)},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){var r=e.get(t);r&&r.slice().forEach((function(e){return e(n)}))}}},exports.IconUtils=C,exports.ObjectUtils=x,exports.UniqueComponentId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_";return S++,"".concat(e).concat(S)},exports.ZIndexUtils=D,exports.classNames=u,exports.mask=function(e,t){var n,r,o,i,l,a,s,u,c,f,d,p;t=w(w({},{mask:null,slotChar:"_",autoClear:!0,unmask:!1,readOnly:!1,onComplete:null,onChange:null,onFocus:null,onBlur:null}),t);var h=function(t,n){var r,o,i;if(e.offsetParent&&e===document.activeElement)return"number"!=typeof t?(e.setSelectionRange?(o=e.selectionStart,i=e.selectionEnd):document.selection&&document.selection.createRange&&(i=(o=0-(r=document.selection.createRange()).duplicate().moveStart("character",-1e5))+r.text.length),{begin:o,end:i}):(o=t,i="number"==typeof n?n:o,void(e.setSelectionRange?e.setSelectionRange(o,i):e.createTextRange&&((r=e.createTextRange()).collapse(!0),r.moveEnd("character",i),r.moveStart("character",o),r.select())))},y=function(){for(var e=i;e<=s;e++)if(n[e]&&d[e]===v(e))return!1;return!0},v=function(e){return t.slotChar.charAt(e<t.slotChar.length?e:0)},m=function(){return t.unmask?H():e&&e.value},b=function(e){for(;++e<o&&!n[e];);return e},x=function(e){for(;--e>=0&&!n[e];);return e},k=function(e,t){var r,l;if(!(e<0)){for(r=e,l=b(t);r<o;r++)if(n[r]){if(!(l<o&&n[r].test(d[l])))break;d[r]=d[l],d[l]=v(l),l=b(l)}j(),h(Math.max(i,e))}},E=function(e){var t,r,i,l;for(t=e,r=v(e);t<o;t++)if(n[t]){if(i=b(t),l=d[t],d[t]=r,!(i<o&&n[i].test(l)))break;r=l}},O=function(r){var l=e.value,a=h();if(u&&u.length&&u.length>l.length){for(T(!0);a.begin>0&&!n[a.begin-1];)a.begin--;if(0===a.begin)for(;a.begin<i&&!n[a.begin];)a.begin++;h(a.begin,a.begin)}else{for(T(!0);a.begin<o&&!n[a.begin];)a.begin++;h(a.begin,a.begin)}t.onComplete&&y()&&t.onComplete({originalEvent:r,value:m()})},C=function(n){if(T(),D(n),t.onBlur&&t.onBlur(n),e.value!==c){var r=document.createEvent("HTMLEvents");r.initEvent("change",!0,!1),e.dispatchEvent(r)}},S=function(n){if(!t.readOnly){var r,o,i,l=n.which||n.keyCode,a=/iphone/i.test(g.getUserAgent());u=e.value,8===l||46===l||a&&127===l?((i=(r=h()).end)-(o=r.begin)==0&&(o=46!==l?x(o):i=b(o-1),i=46===l?b(i):i),P(o,i),k(o,i-1),D(n),n.preventDefault()):13===l?(C(n),D(n)):27===l&&(e.value=c,h(0,T()),D(n),n.preventDefault())}},A=function(e){if(!t.readOnly){var r,i,l,a,u=e.which||e.keyCode,c=h();if(!(e.ctrlKey||e.altKey||e.metaKey||u<32)){if(u&&13!==u){if(c.end-c.begin!=0&&(P(c.begin,c.end),k(c.begin,c.end-1)),(r=b(c.begin-1))<o&&(i=String.fromCharCode(u),n[r].test(i))){if(E(r),d[r]=i,j(),l=b(r),/android/i.test(g.getUserAgent())){setTimeout((function(){h(l)}),0)}else h(l);c.begin<=s&&(a=y())}e.preventDefault()}D(e),t.onComplete&&a&&t.onComplete({originalEvent:e,value:m()})}}},P=function(e,t){var r;for(r=e;r<t&&r<o;r++)n[r]&&(d[r]=v(r))},j=function(){e.value=d.join("")},T=function(l){var a,s,u,c=e.value,f=-1;for(a=0,u=0;a<o;a++)if(n[a]){for(d[a]=v(a);u++<c.length;)if(s=c.charAt(u-1),n[a].test(s)){d[a]=s,f=a;break}if(u>c.length){P(a+1,o);break}}else d[a]===c.charAt(u)&&u++,a<r&&(f=a);return l?j():f+1<r?t.autoClear||d.join("")===p?(e.value&&(e.value=""),P(0,o)):j():(j(),e.value=e.value.substring(0,f+1)),r?a:i},F=function(n){var r;t.readOnly||(clearTimeout(f),c=e.value,r=T(),f=setTimeout((function(){e===document.activeElement&&(j(),r===t.mask.replace("?","").length?h(0,r):h(r))}),10),t.onFocus&&t.onFocus(n))},L=function(e){a?O(e):W(e)},W=function(e){if(!t.readOnly){var n=T(!0);h(n),D(e),t.onComplete&&y()&&t.onComplete({originalEvent:e,value:m()})}},H=function(){for(var e=[],t=0;t<d.length;t++){var r=d[t];n[t]&&r!==v(t)&&e.push(r)}return e.join("")},D=function(e){if(t.onChange){var n=m().replace(t.slotChar,"");t.onChange({originalEvent:e,value:p!==n?n:""})}},R=function(){e.addEventListener("focus",F),e.addEventListener("blur",C),e.addEventListener("keydown",S),e.addEventListener("keypress",A),e.addEventListener("input",L),e.addEventListener("paste",W)},I=function(){n=[],r=t.mask.length,o=t.mask.length,i=null,l={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var e=g.getUserAgent();a=/chrome/i.test(e)&&/android/i.test(e);for(var u=t.mask.split(""),c=0;c<u.length;c++){var f=u[c];"?"===f?(o--,r=c):l[f]?(n.push(new RegExp(l[f])),null===i&&(i=n.length-1),c<r&&(s=n.length-1)):n.push(null)}d=[];for(var h=0;h<u.length;h++){var y=u[h];"?"!==y&&d.push(l[y]?v(h):y)}p=d.join("")};return e&&t.mask&&(I(),R()),{init:I,bindEvents:R,unbindEvents:function(){e.removeEventListener("focus",F),e.removeEventListener("blur",C),e.removeEventListener("keydown",S),e.removeEventListener("keypress",A),e.removeEventListener("input",L),e.removeEventListener("paste",W)},updateModel:D,getValue:m}};
|