Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/app/hooks/app_hooks/useBackURL",["module","exports","require","liferay!frontend-js-react-web$react","../../contexts/StoreContext","../../selectors/selectSegmentsExperienceId"],(function(e,t,r){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function useBackURL(){const[e,t]=(0,o.useMemo)((()=>{const e=document.querySelector(".lfr-back-link");try{return[e,new URL(null==e?void 0:e.href)]}catch(e){return[]}}),[]),r=(0,n.useSelector)(a.default);(0,o.useEffect)((()=>{if(e&&t&&r){t.searchParams.set("segmentsExperienceId",r),e.href=t.toString();const o=new URL(window.location.href);o.searchParams.has("p_l_back_url")&&(o.searchParams.set("p_l_back_url",t.toString()),window.history.replaceState(null,document.title,o.toString()))}}),[e,t,r])};var o=r("liferay!frontend-js-react-web$react"),n=r("../../contexts/StoreContext"),a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("../../selectors/selectSegmentsExperienceId"))}));
//# sourceMappingURL=useBackURL.js.map