function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,s)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}AUI.add("liferay-portlet-url",(e=>{const r=e.Lang,t=function PortletURL(t,s,n){const a=this;a.params={},a.reservedParams={doAsGroupId:null,doAsUserId:null,doAsUserLanguageId:null,p_auth:null,p_auth_secret:null,p_f_id:null,p_j_a_id:null,p_l_id:null,p_l_reset:null,p_p_auth:null,p_p_cacheability:null,p_p_i_id:null,p_p_id:null,p_p_isolated:null,p_p_lifecycle:null,p_p_mode:null,p_p_resource_id:null,p_p_state:null,p_p_state_rcv:null,p_p_static:null,p_p_url_type:null,p_p_width:null,p_t_lifecycle:null,p_v_l_s_g_id:null,refererGroupId:null,refererPlid:null,saveLastPath:null,scroll:null},n||(n=themeDisplay.getPortalURL()+themeDisplay.getPathMain()+"/portal/layout?p_l_id="+themeDisplay.getPlid()),a.options={basePortletURL:n,escapeXML:null,secure:null},e.each(s,((e,t)=>{r.isValue(e)&&(a._isReservedParam(t)?a.reservedParams[t]=e:a.params[t]=e)})),t&&a.setLifecycle(t)};t.prototype={_isReservedParam(r){let t=!1;return e.each(this.reservedParams,((e,s)=>{s===r&&(t=!0)})),t},setCopyCurrentRenderParameters(){return this},setDoAsGroupId(e){return this.reservedParams.doAsGroupId=e,this},setDoAsUserId(e){return this.reservedParams.doAsUserId=e,this},setEncrypt(){return this},setEscapeXML(e){return this.options.escapeXML=e,this},setLifecycle(e){const r=this.reservedParams;return e===t.ACTION_PHASE?(r.p_auth=Liferay.authToken,r.p_p_lifecycle=t.ACTION_PHASE):e===t.RENDER_PHASE?r.p_p_lifecycle=t.RENDER_PHASE:e===t.RESOURCE_PHASE&&(r.p_p_lifecycle=t.RESOURCE_PHASE,r.p_p_cacheability="cacheLevelPage"),this},setName(e){return this.setParameter("javax.portlet.action",e),this},setParameter(e,r){const t=this;return t._isReservedParam(e)?t.reservedParams[e]=r:t.params[e]=r,t},setParameters(r){const t=this;return e.each(r,((e,r)=>{t.setParameter(r,e)})),t},setPlid(e){return this.reservedParams.p_l_id=e,this},setPortletConfiguration(){return this},setPortletId(e){return this.reservedParams.p_p_id=e,this},setPortletMode(e){return this.reservedParams.p_p_mode=e,this},setResourceId(e){return this.reservedParams.p_p_resource_id=e,this},setSecure(e){return this.options.secure=e,this},setWindowState(e){return this.reservedParams.p_p_state=e,this},toString(){const e=this,t=e.options,s={};Object.entries(e.reservedParams).forEach((([e,r])=>{null!=r&&(s[e]=r)}));const n=_objectSpread(_objectSpread({},e.params),s),a=Liferay.Util.PortletURL.createPortletURL(t.basePortletURL,n);return t.secure&&(a.protocol="https:"),t.escapeXML&&(a.href=r.String.escapeHTML(a.href)),a.toString()}},e.mix(t,{ACTION_PHASE:"1",RENDER_PHASE:"0",RESOURCE_PHASE:"2",createActionURL:function createActionURL(){return new t(t.ACTION_PHASE)},createRenderURL:function createRenderURL(){return new t(t.RENDER_PHASE)},createResourceURL:function createResourceURL(){return new t(t.RESOURCE_PHASE)},createURL:function createURL(e,r){return new t(null,r,e)}}),Liferay.PortletURL=t}),"",{requires:["aui-base"]});
//# sourceMappingURL=portlet_url.js.map