/*! For license information please see utils.js.LICENSE.txt */
!function(){"use strict";var e={react:function(e){e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var u=t[r]={exports:{}};return e[r](u,u.exports,n),u.exports}n.d=function(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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){n.r(r),n.d(r,{ElementorError:function(){return t},createError:function(){return o},debounce:function(){return c},ensureError:function(){return u},useDebounceState:function(){return l}});var e=n("react"),t=class extends Error{context;code;constructor(e,{code:t,context:n=null,cause:r=null}){super(e,{cause:r}),this.context=n,this.code=t}},o=({code:e,message:n})=>class extends t{constructor({cause:t,context:r}={}){super(n,{cause:t,code:e,context:r})}},u=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})};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 l(t={}){const{delay:n=300,initialValue:r=""}=t,[o,u]=(0,e.useState)(r),[l,i]=(0,e.useState)(r),a=(0,e.useRef)(null);(0,e.useEffect)((()=>()=>{a.current?.cancel?.()}),[]);const s=(0,e.useCallback)((e=>{a.current?.cancel?.(),a.current=c((()=>{u(e)}),n),a.current()}),[n]);return{debouncedValue:o,inputValue:l,handleChange:e=>{i(e),s(e)},setInputValue:i}}}(),(window.elementorV2=window.elementorV2||{}).utils=r}(),window.elementorV2.utils?.init?.();