Liferay.Loader.define("document-library-video@1.0.47/js/utils/hooks",["module","exports","require","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","./validateUrl"],(function(e,t,r){var n;window;Object.defineProperty(t,"__esModule",{value:!0}),t.useDLVideoExternalShortcutFields=function({getDLVideoExternalShortcutFieldsURL:e,namespace:t,url:r}){const[n,d]=(0,u.useState)(""),[s,c]=(0,u.useState)(null),[i,f]=(0,u.useState)(!1),b=(0,a.useIsMounted)(),[h]=function(e,t){const r=(0,u.useRef)((0,o.debounce)(e,t));return[r.current,()=>(0,o.cancelDebounce)(r.current)]}((r=>{(0,o.fetch)((0,o.addParams)({["".concat(t,"dlVideoExternalShortcutURL")]:r},e)).then((e=>e.json())).then((e=>{b()&&(f(!1),c(e))})).catch((()=>{b()&&(f(!1),c(null),d(Liferay.Language.get("sorry,-this-platform-is-not-supported")))}))}),500);return(0,u.useEffect)((()=>{d(null),r&&(0,l.default)(r)?(f(!0),h(r)):(f(!1),c(null))}),[h,r]),{error:n,fields:s,loading:i}};var a=r("@liferay/frontend-js-react-web"),o=r("frontend-js-web"),u=r("liferay!frontend-js-react-web$react"),l=(n=r("./validateUrl"))&&n.__esModule?n:{default:n}}));
//# sourceMappingURL=hooks.js.map