"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),n=require("uuid"),t=require("../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js");var o=s(e);exports.useDelayedDcFullscreenElemOpen=function(e){var s=e.isOpen,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r.useState(!1),l=o.default(i,2),c=l[0],d=l[1],a=t.useDcFullscreenElemsCoordinator();if(!a)throw new Error("useDelayedDcFullscreenElemOpen must be used within DcFullscreenElemsCoordinatorProvider");var p=a.requestOpen,f=a.requestClose,v=r.useState((function(){return n.v4()})),m=o.default(v,1),D=m[0];return r.useEffect((function(){s?p({setIsOpened:d,id:D},u):f({setIsOpened:d,id:D})}),[s]),r.useEffect((function(){return function(){f({setIsOpened:d,id:D},!0)}}),[]),{delayedIsOpen:c,requestOpen:function(){return p({setIsOpened:d,id:D},u)},requestClose:function(e){return f({setIsOpened:d,id:D},e)}}};
//# sourceMappingURL=useDelayedDcFullscreenElemOpen.js.map
