Current File : /home/mdkeenpw/www/wp-content/plugins/elementor/assets/js/packages/utils/utils.min.js
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ElementorError:function(){return n},createError:function(){return r},debounce:function(){return c},decodeString:function(){return s},encodeString:function(){return l},ensureError:function(){return o},hash:function(){return a},useDebounceState:function(){return i}});class n extends Error{constructor(e,{code:t,context:n=null,cause:r=null}){super(e,{cause:r}),this.context=n,this.code=t}}const r=({code:e,message:t})=>class extends n{constructor({cause:n,context:r}={}){super(t,{cause:n,code:e,context:r})}},o=e=>{if(e instanceof Error)return e;let t,n=null;try{t=JSON.stringify(e)}catch(e){n=e,t="Unable to stringify the thrown value"}return new Error(`Unexpected non-error thrown: ${t}`,{cause:n})};var u=window.React;function c(e,t){let n=null;const r=()=>{n&&(clearTimeout(n),n=null)},o=(...o)=>{r(),n=setTimeout(()=>{e(...o),n=null},t)};return o.flush=(...t)=>{r(),e(...t)},o.cancel=r,o.pending=()=>!!n,o}function i(e={}){const{delay:t=300,initialValue:n=""}=e,[r,o]=(0,u.useState)(n),[i,l]=(0,u.useState)(n),s=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>{s.current?.cancel?.()},[]);const a=(0,u.useCallback)(e=>{s.current?.cancel?.(),s.current=c(()=>{o(e)},t),s.current()},[t]);return{debouncedValue:r,inputValue:i,handleChange:e=>{l(e),a(e)},setInputValue:l}}const l=e=>btoa(e),s=(e,t="")=>{try{return atob(e)}catch{return t}};function a(e){return JSON.stringify(e,(e,t)=>function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}(window.elementorV2=window.elementorV2||{}).utils=t}(),window.elementorV2.utils?.init?.();