import{h}from"./index-67f7ec52.js";import{b as fromNullable,n as none,m as map,i as isNone}from"./index-6869168f.js";import{_ as _function}from"./Option-53ef163a.js";import{i as iframe}from"./iframe-d1a2bbb3.js";var ManagePageRouteName="manage";var AddBenefitPageRouteName="manage/add";var EditBenefitPageRouteName="manage/edit";var AdminPageRouteName="admin";var renderManagePageRoutes=function(e,t){var a=[h("stencil-route",{url:t+"/"+AddBenefitPageRouteName,routeRender:function(e){return h("ap-ben-edit-benefit-page",null)},exact:true}),h("stencil-route",{url:t+"/"+EditBenefitPageRouteName+"/:benefitId",routeRender:function(e){return h("ap-ben-edit-benefit-page",{benefitId:fromNullable(e.match.params["benefitId"])})},exact:true}),h("stencil-route",{url:t+"/"+ManagePageRouteName+"/:match?",routeRender:function(e){return h("ap-ben-manage-page",Object.assign({},e))}})];var n=[h("stencil-route",{url:t+"/"+AdminPageRouteName,routeRender:function(e){return h("ap-ben-role-management-page",null)},exact:true})];switch(e){case"accountAdmin":return a.concat(n);case"accountEditor":return a;default:return[]}};var NavigationService=function(){function e(){this._baseUrl=none;this._history=none}e.prototype.navigateInternally=function(e){var t=""+this.baseUrl+this.toRouteWithLeadingSlash(e);iframe.navigation(t);this.history.value.push(t)};e.prototype.toRouteWithLeadingSlash=function(e){return e.length>0&&e[0]==="/"?e:"/"+e};Object.defineProperty(e.prototype,"baseUrl",{get:function(){if(isNone(this._baseUrl)){throw Error("Base URL is missing.")}return this._baseUrl.value},set:function(e){this._baseUrl=_function.pipe(fromNullable(e),map((function(e){return e.replace(/\/$/,"")})))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"history",{get:function(){if(isNone(this._history)){throw Error("Router history is missing.")}return this._history},set:function(e){this._history=e},enumerable:false,configurable:true});return e}();var navigationService=new NavigationService;export{AddBenefitPageRouteName as A,EditBenefitPageRouteName as E,ManagePageRouteName as M,navigationService as n,renderManagePageRoutes as r};