Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/app/components/app-hooks/useBackURL",["module","exports","require","liferay!frontend-js-react-web$react","../../contexts/StoreContext","../../selectors/selectSegmentsExperienceId"],(function(e,t,r){var o;window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[e,t]=(0,n.useMemo)((()=>{const e=document.querySelector(".lfr-back-link");try{return[e,new URL(null==e?void 0:e.href)]}catch(e){return[]}}),[]),r=(0,a.useSelector)(c.default);(0,n.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 n=r("liferay!frontend-js-react-web$react"),a=r("../../contexts/StoreContext"),c=(o=r("../../selectors/selectSegmentsExperienceId"))&&o.__esModule?o:{default:o}}));
//# sourceMappingURL=useBackURL.js.map