"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../datasource/utils/utils.js"),f=require("../utils/utils.js"),p=(g,w)=>{const{pageAction:e}=g,d=l.DataSourceUtils.getVariableData(),s=l.DataSourceUtils.replaceStringVariables(e.parameter,d),n=s?f.EventUtils.urlParamToJson(s):null;let t=e.target;if(!t&&e.pageId&&(window.location.href.includes("/sharing")&&(window.location.href.includes("/#")?t=`/#/proto/${e.pageId}/sharing`:t=`/proto/${e.pageId}/sharing`),window.location.href.includes("/release")&&(window.location.href.includes("/#")?t=`/#/release/${e.pageId}`:t=`/release/${e.pageId}`)),!t)return;const a=new URL(t,window.location.origin);if(n){const r=a.toString().indexOf("/#/");if(r!==-1){const i=a.toString().substring(0,r),o=a.toString().substring(r),c=new URLSearchParams;Object.entries(n).forEach(([u,h])=>{c.append(u,h)}),window.location.href=`${i}${o}?${c.toString()}`}else Object.entries(n).forEach(([i,o])=>{a.searchParams.append(i,o)}),window.location.href=a.toString()}else window.location.href=a.toString()};exports.executePageAction=p;
