@entur-partner/common 11.2.6 → 11.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionBar.d.ts +4 -4
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +154 -1469
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/ActionBar.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type ReactNode } from "react";
|
|
|
3
3
|
interface ActionBarProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const ActionBarLeft: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const ActionBarRight: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const ActionBar: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {
|
|
6
|
+
export declare const ActionBarLeft: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const ActionBarRight: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ActionBar: ({ children }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react/jsx-runtime`),u=require(`@entur-partner/util`),d=require(`react`);d=c(d,1);let f=require(`@entur/menu`),p=require(`@entur/button`),m=require(`@entur/modal`),h=require(`@entur/typography`),g=require(`@entur/alert`),_=require(`@entur/expand`),v=require(`@entur/form`),y=require(`@entur/dropdown`),b=require(`@entur/icons`);var x=({children:e})=>(0,l.jsx)(`div`,{className:`eps-action-bar-left`,children:e}),S=({children:e})=>(0,l.jsx)(`div`,{className:`eps-action-bar-right`,children:e}),C=({children:e})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`eps-action-bar-padding`}),(0,l.jsx)(`div`,{className:`eps-action-bar`,children:e})]}),w=c(o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),T=({date:e,locale:t,as:n=`main`,hideTime:r,...i})=>(0,l.jsx)(n,{...i,children:r?(0,u.localeDate)(e,t):(0,u.localeDateTime)(e,t)});function E(e,t){if(Array.isArray(t)){let n=[];return t[0]&&n.push(e+t[0]),t[1]&&n.push(`${e}${t[1]}-lg`),t[2]&&n.push(`${e}${t[2]}-xl`),n}return[e+t]}var D=({as:e=`div`,children:t,contrast:n,paddingTop:r,paddingRight:i,paddingBottom:a,paddingLeft:o,paddingX:s,paddingY:c,padding:u,marginTop:d,marginRight:f,marginBottom:p,marginLeft:m,marginX:h,marginY:g,margin:_,display:v,justifyContent:y,alignItems:b,maxWidth:x,width:S,background:C,color:T,flexDirection:D,flexWrap:O,className:k,...A})=>{let j=[],M=r||c||u,N=a||c||u,P=o||s||u,ee=i||s||u,te=d||g||_,F=p||g||_,ne=m||h||_,re=f||h||_;return n&&j.push(`eds-contrast`),M&&j.push(...E(`eps-pt-`,M)),N&&j.push(...E(`eps-pb-`,N)),P&&j.push(...E(`eps-pl-`,P)),ee&&j.push(...E(`eps-pr-`,ee)),te&&j.push(...E(`eps-mt-`,te)),F&&j.push(...E(`eps-mb-`,F)),ne&&j.push(...E(`eps-ml-`,ne)),re&&j.push(...E(`eps-mr-`,re)),v&&j.push(...E(`eps-`,v)),y&&j.push(...E(`eps-justify-`,y)),b&&j.push(...E(`eps-items-`,b)),x&&j.push(...E(`eps-max-w-`,x)),S&&j.push(...E(`eps-w-`,S)),T&&j.push(`eps-color-${T}`),C&&j.push(`eps-bg-${C}`),D&&j.push(...E(`eps-flex-`,D)),O&&j.push(...E(`eps-flex-wrap-`,O)),(0,l.jsx)(e,{className:(0,w.default)(j,k),...A,children:t})},O=({children:e,space:t,className:n})=>{let r=d.Children.toArray(e);return r.length<=1?(0,l.jsx)(l.Fragment,{children:r}):(0,l.jsx)(`div`,{className:n,children:r.map((e,n)=>n===r.length-1?(0,l.jsx)(`div`,{children:e},n):(0,l.jsx)(D,{paddingBottom:t,children:e},n))})},k=({items:e,locale:t,className:n,...r})=>(0,l.jsx)(`div`,{className:(0,w.default)(`ep-audit-info`,n),...r,children:e.map(({label:e,value:n})=>(0,l.jsxs)(O,{space:`small`,children:[(0,l.jsx)(`div`,{className:`ep-audit-info-label`,children:e}),(0,l.jsx)(`div`,{children:(0,u.isDate)(n)||(0,u.isDateString)(n)?(0,l.jsx)(T,{date:n,locale:t}):(0,l.jsx)(`span`,{children:n})})]},n.toString()))});function A(e,t){if(e===!1||e==null)throw Error(t)}function j(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function M({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function N(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function P(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r){let i=L((typeof t==`string`?N(t):t).pathname||`/`,n);if(i==null)return null;let a=F(e);re(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=he(i);o=pe(a[e],t,r)}return o}function te(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function F(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;A(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=R([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(A(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),F(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:de(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ne(e.path))a(e,t,!0,n)}),t}function ne(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ne(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function re(e){e.sort((e,t)=>e.score===t.score?fe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ie=/^:[\w-]+$/,ae=3,oe=2,se=1,ce=10,le=-2,ue=e=>e===`*`;function de(e,t){let n=e.split(`/`),r=n.length;return n.some(ue)&&(r+=le),t&&(r+=oe),n.filter(e=>!ue(e)).reduce((e,t)=>e+(ie.test(t)?ae:t===``?se:ce),r)}function fe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function pe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=I({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=I({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:R([a,u.pathname]),pathnameBase:Ce(R([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=R([a,u.pathnameBase]))}return o}function I(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(e,t=!1,n=!0){j(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function he(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return j(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ge=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:we(r),hash:Te(i)}}function ve(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xe(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Se(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},A(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),A(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),A(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var R=e=>e.join(`/`).replace(/\/\/+/g,`/`),Ce=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),we=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Te=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ee=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function De(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Oe(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ae(e,t){let n=e;if(typeof n!=`string`||!ge.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ke)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{j(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var je=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(je);var Me=[`GET`,...je];new Set(Me);var Ne={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},z=d.createContext(null);z.displayName=`DataRouter`;var B=d.createContext(null);B.displayName=`DataRouterState`;var Pe=d.createContext(!1);function Fe(){return d.useContext(Pe)}var Ie=d.createContext({isTransitioning:!1});Ie.displayName=`ViewTransition`;var Le=d.createContext(new Map);Le.displayName=`Fetchers`;var Re=d.createContext(null);Re.displayName=`Await`;var V=d.createContext(null);V.displayName=`Navigation`;var H=d.createContext(null);H.displayName=`Location`;var U=d.createContext({outlet:null,matches:[],isDataRoute:!1});U.displayName=`Route`;var ze=d.createContext(null);ze.displayName=`RouteError`;var Be=`REACT_ROUTER_ERROR`,Ve=`REDIRECT`,He=`ROUTE_ERROR_RESPONSE`;function Ue(e){if(e.startsWith(`${Be}:${Ve}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function We(e){if(e.startsWith(`${Be}:${He}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ee(t.status,t.statusText,t.data)}catch{}}function Ge(e,{relative:t}={}){A(W(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=d.useContext(V),{hash:i,pathname:a,search:o}=K(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:R([n,a])),r.createHref({pathname:s,search:o,hash:i})}function W(){return d.useContext(H)!=null}function G(){return A(W(),`useLocation() may be used only in the context of a <Router> component.`),d.useContext(H).location}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){d.useContext(V).static||d.useLayoutEffect(e)}function Je(){let{isDataRoute:e}=d.useContext(U);return e?mt():Ye()}function Ye(){A(W(),`useNavigate() may be used only in the context of a <Router> component.`);let e=d.useContext(z),{basename:t,navigator:n}=d.useContext(V),{matches:r}=d.useContext(U),{pathname:i}=G(),a=JSON.stringify(xe(r)),o=d.useRef(!1);return qe(()=>{o.current=!0}),d.useCallback((r,s={})=>{if(j(o.current,Ke),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Se(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:R([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}d.createContext(null);function K(e,{relative:t}={}){let{matches:n}=d.useContext(U),{pathname:r}=G(),i=JSON.stringify(xe(n));return d.useMemo(()=>Se(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Xe(e,t,n){A(W(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=d.useContext(V),{matches:i}=d.useContext(U),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;gt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
-
|
|
3
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=G(),f;if(t){let e=typeof t==`string`?N(t):t;A(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=u;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=P(e,{pathname:m});j(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),j(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=rt(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:R([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:R([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?d.createElement(H.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...f},navigationType:`POP`}},g):g}function Ze(){let e=dt(),t=De(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=d.createElement(d.Fragment,null,d.createElement(`p`,null,`💿 Hey developer 👋`),d.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,d.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,d.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),d.createElement(d.Fragment,null,d.createElement(`h2`,null,`Unexpected Application Error!`),d.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?d.createElement(`pre`,{style:i},n):null,o)}var Qe=d.createElement(Ze,null),$e=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=We(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:d.createElement(U.Provider,{value:this.props.routeContext},d.createElement(ze.Provider,{value:e,children:this.props.component}));return this.context?d.createElement(tt,{error:e},t):t}};$e.contextType=Pe;var et=new WeakMap;function tt({children:e,error:t}){let{basename:n}=d.useContext(V);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ue(t.digest);if(e){let r=et.get(t);if(r)throw r;let i=Ae(e.location,n);if(ke&&!et.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw et.set(t,n),n}return d.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function nt({routeContext:e,match:t,children:n}){let r=d.useContext(z);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(U.Provider,{value:e},n)}function rt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);A(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Oe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,f=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||Qe,o&&(s<0&&c===0?(gt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:e,d.createElement(nt,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?d.createElement($e,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function it(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function at(e){let t=d.useContext(z);return A(t,it(e)),t}function q(e){let t=d.useContext(B);return A(t,it(e)),t}function ot(e){let t=d.useContext(U);return A(t,it(e)),t}function st(e){let t=ot(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ct(){return st(`useRouteId`)}function lt(){return q(`useNavigation`).navigation}function ut(){let{matches:e,loaderData:t}=q(`useMatches`);return d.useMemo(()=>e.map(e=>te(e,t)),[e,t])}function dt(){let e=d.useContext(ze),t=q(`useRouteError`),n=st(`useRouteError`);return e===void 0?t.errors?.[n]:e}var ft=0;function pt(e){let{router:t,basename:n}=at(`useBlocker`),r=q(`useBlocker`),[i,a]=d.useState(``),o=d.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:L(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:L(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return d.useEffect(()=>{let e=String(++ft);return a(e),()=>t.deleteBlocker(e)},[t]),d.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Ne}function mt(){let{router:e}=at(`useNavigate`),t=st(`useNavigate`),n=d.useRef(!1);return qe(()=>{n.current=!0}),d.useCallback(async(r,i={})=>{j(n.current,Ke),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ht={};function gt(e,t,n){!t&&!ht[e]&&(ht[e]=!0,j(!1,n))}d.useOptimistic,d.memo(_t);function _t({routes:e,future:t,state:n,isStatic:r,onError:i}){return Xe(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function vt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){A(!W(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=d.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:f=``,state:p=null,key:m=`default`,unstable_mask:h}=n,g=d.useMemo(()=>{let e=L(l,s);return e==null?null:{location:{pathname:e,search:u,hash:f,state:p,key:m,unstable_mask:h},navigationType:r}},[s,l,u,f,p,m,r,h]);return j(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(V.Provider,{value:c},d.createElement(H.Provider,{children:t,value:g}))}d.Component;var J=`get`,Y=`application/x-www-form-urlencoded`;function X(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function yt(e){return X(e)&&e.tagName.toLowerCase()===`button`}function bt(e){return X(e)&&e.tagName.toLowerCase()===`form`}function xt(e){return X(e)&&e.tagName.toLowerCase()===`input`}function St(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t===`_self`)&&!St(e)}var wt=null;function Tt(){if(wt===null)try{new FormData(document.createElement(`form`),0),wt=!1}catch{wt=!0}return wt}var Et=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Dt(e){return e!=null&&!Et.has(e)?(j(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Y}"`),null):e}function Ot(e,t){let n,r,i,a,o;if(bt(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||J,i=Dt(e.getAttribute(`enctype`))||Y,a=new FormData(e)}else if(yt(e)||xt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||J,i=Dt(e.getAttribute(`formenctype`))||Dt(o.getAttribute(`enctype`))||Y,a=new FormData(o,e),!Tt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(X(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=J,r=null,i=Y,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var kt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},At=/[&><\u2028\u2029]/g;function jt(e){return e.replace(At,e=>kt[e])}function Mt(e,t){if(e===!1||e==null)throw Error(t)}function Nt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&L(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Pt(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ft(e){return e!=null&&typeof e.page==`string`}function It(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Lt(e,t,n){return Ht((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(It).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Rt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function zt(e,t,{includeHydrateFallback:n}={}){return Bt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Bt(e){return[...new Set(e)]}function Vt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ht(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ft(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Vt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ut(){let e=d.useContext(z);return Mt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Wt(){let e=d.useContext(B);return Mt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Gt=d.createContext(void 0);Gt.displayName=`FrameworkContext`;function Kt(){let e=d.useContext(Gt);return Mt(e,`You must render this element inside a <HydratedRouter> element`),e}function qt(e,t){let n=d.useContext(Gt),[r,i]=d.useState(!1),[a,o]=d.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),d.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Z(s,m),onBlur:Z(c,h),onMouseEnter:Z(l,m),onMouseLeave:Z(u,h),onTouchStart:Z(f,m)}]:[a,p,{}]:[!1,p,{}]}function Z(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Jt({page:e,...t}){let n=Fe(),{router:r}=Ut(),i=d.useMemo(()=>P(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?d.createElement(Xt,{page:e,matches:i,...t}):d.createElement(Zt,{page:e,matches:i,...t}):null}function Yt(e){let{manifest:t,routeModules:n}=Kt(),[r,i]=d.useState([]);return d.useEffect(()=>{let r=!1;return Lt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Xt({page:e,matches:t,...n}){let r=G(),{future:i}=Kt(),{basename:a}=Ut(),o=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Nt(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return d.createElement(d.Fragment,null,o.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Zt({page:e,matches:t,...n}){let r=G(),{future:i,manifest:a,routeModules:o}=Kt(),{basename:s}=Ut(),{loaderData:c,matches:l}=Wt(),u=d.useMemo(()=>Rt(e,t,l,a,r,`data`),[e,t,l,a,r]),f=d.useMemo(()=>Rt(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Nt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=d.useMemo(()=>zt(f,a),[f,a]),h=Yt(f);return d.createElement(d.Fragment,null,p.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>d.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>d.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Qt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}d.Component;var $t=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{$t&&(window.__reactRouterVersion=`7.14.0`)}catch{}function en({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=d.useState({action:n.action,location:n.location}),o=d.useCallback(e=>{r===!1?a(e):d.startTransition(()=>a(e))},[r]);return d.useLayoutEffect(()=>n.listen(o),[n,o]),d.createElement(vt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}en.displayName=`unstable_HistoryRouter`;var tn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nn=d.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=d.useContext(V),y=typeof l==`string`&&tn.test(l),b=Ae(l,g);l=b.to;let x=Ge(l,{relative:r}),S=G(),C=null;if(o){let e=Se(o,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:R([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=qt(n,m),D=un(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=d.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Qt(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?d.createElement(d.Fragment,null,A,d.createElement(Jt,{page:x})):A});nn.displayName=`Link`;var rn=d.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=K(a,{relative:c.relative}),f=G(),p=d.useContext(B),{navigator:m,basename:h}=d.useContext(V),g=p!=null&&bn(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=L(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return d.createElement(nn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});rn.displayName=`NavLink`;var an=d.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=J,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=d.useContext(V),_=pn(),v=mn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&tn.test(s);return d.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?d.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});an.displayName=`Form`;function on({getKey:e,storageKey:t,...n}){let r=d.useContext(Gt),{basename:i}=d.useContext(V),a=G(),o=ut();vn({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!r||!e)return null;let t=_n(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return d.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${jt(JSON.stringify(t||hn))}, ${jt(JSON.stringify(s))})`}})}on.displayName=`ScrollRestoration`;function sn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cn(e){let t=d.useContext(z);return A(t,sn(e)),t}function ln(e){let t=d.useContext(B);return A(t,sn(e)),t}function un(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Je(),f=G(),p=K(e,{relative:o});return d.useCallback(m=>{if(Ct(m,t)){m.preventDefault();let t=n===void 0?M(f)===M(p):n,h=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?d.startTransition(()=>h()):h()}},[f,u,p,n,r,i,t,e,a,o,s,c,l])}var dn=0,fn=()=>`__${String(++dn)}__`;function pn(){let{router:e}=cn(`useSubmit`),{basename:t}=d.useContext(V),n=ct(),r=e.fetch,i=e.navigate;return d.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ot(e,t);a.navigate===!1?await r(a.fetcherKey||fn(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function mn(e,{relative:t}={}){let{basename:n}=d.useContext(V),r=d.useContext(U);A(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...K(e||`.`,{relative:t})},o=G();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:R([n,a.pathname])),M(a)}var hn=`react-router-scroll-positions`,gn={};function _n(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:L(e.pathname,n)||e.pathname},t)),i??=e.key,i}function vn({getKey:e,storageKey:t}={}){let{router:n}=cn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ln(`useScrollRestoration`),{basename:a}=d.useContext(V),o=G(),s=ut(),c=lt();d.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),yn(d.useCallback(()=>{if(c.state===`idle`){let t=_n(o,s,a,e);gn[t]=window.scrollY}try{sessionStorage.setItem(t||hn,JSON.stringify(gn))}catch(e){j(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(d.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||hn);e&&(gn=JSON.parse(e))}catch{}},[t]),d.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(gn,()=>window.scrollY,e?(t,n)=>_n(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),d.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{j(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function yn(e,t){let{capture:n}=t||{};d.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function bn(e,{relative:t}={}){let n=d.useContext(Ie);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=cn(`useViewTransitionState`),i=K(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return I(i.pathname,o)!=null||I(i.pathname,a)!=null}var xn=({prependBreadcrumbItem:e,pathname:t,onBreadcrumbLookup:n})=>{let r=(0,u.splitUrlPath)(t).map(e=>({title:n(e),path:e})).filter(({title:e})=>e!==void 0),i=r.map(({title:e,path:t},n)=>n===r.length-1?(0,l.jsx)(f.BreadcrumbItem,{as:`span`,children:e},t):(0,l.jsx)(f.BreadcrumbItem,{as:nn,to:t,children:e},t));return e?(0,l.jsx)(f.BreadcrumbNavigation,{children:[e,...i]}):(0,l.jsx)(f.BreadcrumbNavigation,{children:i})},Sn=({isOpen:e=!1,children:t,message:n,size:r=`medium`,buttons:i,onConfirm:a,messages:o,onClose:s,onDismiss:c,...d})=>{let f=t||n,g=s||c;return(0,l.jsxs)(m.Modal,{size:r,open:e,onDismiss:g,...d,children:[(0,u.isString)(f)?(0,l.jsx)(h.Paragraph,{children:f}):(0,l.jsx)(D,{paddingBottom:`medium`,children:f}),(0,l.jsx)(p.ButtonGroup,{children:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.SecondaryButton,{onClick:g,"data-testid":`cancel-modal-button`,children:o.cancel}),(0,l.jsx)(p.PrimaryButton,{onClick:a,"data-testid":`confirm-modal-button`,children:o.confirm})]}):i})]})},Cn=({as:e=`main`,className:t,children:n})=>(0,l.jsx)(e,{className:(0,w.default)([`eps-content`,t]),children:n}),Q=function(e){return e.Local=`local`,e.Development=`dev`,e.Staging=`staging`,e.Production=`prod`,e}({}),wn={[Q.Local]:`#B482FB`,[Q.Development]:`#5AC39A`,[Q.Staging]:`#FFCA28`},Tn=e=>wn[e],En={[Q.Local]:`Local`,[Q.Development]:`Dev`,[Q.Staging]:`Staging`,[Q.Production]:`Prod`},Dn=e=>En[e],On=({title:e,accentColor:t=`#FF5959`,...n})=>(0,l.jsxs)(`svg`,{width:257,height:37,viewBox:`0 0 257 37`,...n,children:[(0,l.jsx)(`title`,{children:e}),(0,l.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,children:[(0,l.jsx)(`path`,{fill:`#FFF`,d:`M0 .231V25.72h18.745v-4.318H4.869v-6.163h12.31v-4.318H4.87V4.55h13.876V.231z`}),(0,l.jsx)(`path`,{fill:t,d:`M0 36.408h45.253v-4.32H0z`}),(0,l.jsx)(`path`,{fill:`#FFF`,d:`M40.384.231v15.425L23.656.231h-.521V25.72h4.869V10.573L44.732 25.72h.521V.23zM69.25 15.238h-7.267v21.17h-4.87v-21.17H49.81V10.92h19.44zM83.863 36.86c-1.646 0-3.142-.255-4.486-.765-1.345-.51-2.493-1.23-3.443-2.159-.95-.928-1.687-2.054-2.208-3.378-.522-1.323-.783-2.797-.783-4.422V10.92h4.869v15.216c0 1.277.209 2.333.626 3.169.417.836.933 1.497 1.548 1.985a5.346 5.346 0 001.982 1.01c.707.186 1.339.278 1.895.278.557 0 1.188-.092 1.896-.279a5.35 5.35 0 001.982-1.01c.614-.487 1.13-1.148 1.548-1.984.417-.836.625-1.892.625-3.169V10.92h4.87v15.216c0 1.625-.256 3.1-.766 4.422-.51 1.324-1.24 2.45-2.19 3.378-.952.929-2.1 1.648-3.444 2.159-1.344.51-2.851.766-4.52.766M104.21 24.047h5.546c1.016 0 1.854-.127 2.513-.383.658-.255 1.179-.592 1.56-1.01.381-.418.641-.888.78-1.41.138-.522.208-1.05.208-1.584 0-.627-.099-1.207-.295-1.741a3.718 3.718 0 00-.901-1.393c-.405-.394-.924-.708-1.56-.94-.636-.232-1.404-.348-2.305-.348h-5.546v8.81zm0 4.248v8.113h-4.87V10.92h11.567c1.3 0 2.49.215 3.57.644 1.08.43 2.004 1.033 2.77 1.81a8.287 8.287 0 011.794 2.787c.43 1.079.645 2.257.645 3.534 0 .952-.128 1.874-.383 2.768-.256.894-.61 1.7-1.063 2.42a7.32 7.32 0 01-1.672 1.863 5.929 5.929 0 01-2.178 1.096l6.339 8.566h-5.808l-5.893-8.113h-4.818z`}),(0,l.jsx)(`g`,{fill:t,children:(0,l.jsx)(`path`,{d:`M141.051 23.448h5.628c4.185 0 5.989-1.984 5.989-4.942 0-2.742-1.515-4.618-5.989-4.618h-5.628v9.56zm0 3.067v9.776h-3.571V10.75h9.632c6.674 0 9.127 3.211 9.127 7.54 0 4.979-3.102 8.226-9.2 8.226h-5.988zM169.695 28.715c-1.371-.288-2.958-.505-4.401-.505-2.85 0-4.041 1.263-4.041 3.139s1.407 2.706 3.463 2.706c2.49 0 4.979-1.443 4.979-4.221v-1.119zm-4.293-2.958c1.551 0 3.174.253 4.293.469v-.83c0-2.525-1.154-3.896-4.33-3.896-2.164 0-3.824.866-4.942 2.092l-2.02-2.272c1.732-1.66 3.644-2.598 7.07-2.598 5.052 0 7.469 1.876 7.469 7.215v10.354h-3.211V34.02h-.108c-1.082 1.767-3.211 2.705-5.592 2.705-3.32 0-6.241-1.66-6.241-5.303 0-3.103 1.912-5.664 7.612-5.664zM178.965 19.191h3.211v2.886h.108c.938-1.984 2.922-3.355 5.231-3.355.47 0 .938.036 1.335.144l-.144 3.14a6.77 6.77 0 00-1.552-.181c-3.246 0-4.798 2.633-4.798 5.483v8.983h-3.39v-17.1zM199.961 36.291h-1.912c-4.004 0-5.988-.938-5.988-5.772v-8.55h-2.778V19.19h2.778v-4.654h3.355v4.654h4.473v2.778h-4.473v7.973c0 3.427 1.587 3.535 3.319 3.535h1.226v2.814zM219.767 36.291h-3.391V26.84c0-2.778-1.083-5.375-4.257-5.375-3.14 0-5.268 2.597-5.268 6.169v8.658h-3.391v-17.1h3.32v2.814h.143c.794-1.623 3.067-3.283 5.99-3.283 4.941 0 6.854 3.644 6.854 8.081v9.488zM227.847 26.262h10.57c0-2.597-2.272-4.726-5.087-4.726-2.922 0-5.014 1.948-5.483 4.726zm-.036 2.453c.397 3.355 2.633 5.195 5.844 5.195 2.778 0 4.618-1.623 5.484-2.67l2.164 1.804c-1.37 1.913-4.365 3.716-8.045 3.716-4.942 0-8.73-3.535-8.73-8.55 0-5.195 3.752-9.488 8.983-9.488 5.303 0 8.009 4.365 8.009 8.19 0 .649-.036 1.226-.072 1.803H227.81zM246.245 19.191h3.21v2.886h.109c.938-1.984 2.922-3.355 5.231-3.355.469 0 .938.036 1.335.144l-.145 3.14a6.77 6.77 0 00-1.551-.181c-3.247 0-4.798 2.633-4.798 5.483v8.983h-3.391v-17.1z`})})]})]}),kn=({as:e=`nav`,className:t,altText:n,environment:r})=>(0,l.jsx)(e,{className:(0,w.default)([`eps-logo-wrapper`,t]),children:(0,l.jsx)(On,{title:n,className:`logo`,accentColor:r!==void 0&&r!==Q.Production?Tn(r):void 0})}),An=`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,jn=class extends d.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.handleError?.(e,t)}render(){let{error:e}=this.state,{fallback:t,children:n}=this.props;return e?(0,u.isFunction)(t)?t({retry:()=>this.setState({error:null}),error:e}):e.name===`NotFoundError`&&e.message===An?(0,l.jsx)(Nn,{}):t:n}},Mn=`EP::locale`;function Nn(){let e=localStorage.getItem(Mn),t=e===`nb`||e===`nb-NO`;return(0,l.jsx)(D,{maxWidth:`large`,children:(0,l.jsxs)(g.BannerAlertBox,{variant:`info`,title:t?`En ny versjon av nettsiden er tilgjengelig.`:`A new version of the website is available.`,children:[(0,l.jsx)(D,{paddingBottom:`medium`,children:(0,l.jsx)(h.Paragraph,{margin:`none`,children:t?`Vennligst oppdater.`:`Please refresh.`})}),(0,l.jsx)(p.PrimaryButton,{onClick:()=>window.location.reload(),children:t?`Oppdater`:`Refresh`})]})})}var Pn=({title:e,inputComponent:t,languages:n,values:r,onChange:i,name:a,variant:o,feedback:s,...c})=>{let u=(e,t)=>{let n={...r};t===``||!t?delete n[e]:n[e]=t,i(n)};return(0,l.jsx)(_.ExpandablePanel,{title:e,defaultOpen:!0,contentStyle:{padding:`4px 4px 4px 4px`,marginTop:`16px`,marginBottom:`16px`},children:(0,l.jsx)(O,{space:`medium`,children:n.map(({value:n,label:i,required:d})=>(0,l.jsx)(t,{"data-testid":`multi-lang-input-${a}-${n}`,label:d?`${i}*`:i,variant:o?.(n),feedback:s?.(n),name:a,onChange:e=>{u(n,e.target.value)},value:r[n]||``,...c},e+n))})})};function Fn(e){return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.[`VITE_APP_${e}`]===`true`||window.localStorage?.getItem(e)===`true`||window.localStorage?.getItem(`VITE_APP_${e}`)===`true`}function In(e){return Fn(e)}var Ln=({children:e,flag:t})=>Fn(t)?(0,l.jsx)(l.Fragment,{children:e}):null,Rn=({amount:e,as:t=`span`,...n})=>{let r=Number(e)||0,i=new Intl.NumberFormat(`nb-NO`,{maximumFractionDigits:2,minimumFractionDigits:2}).format(r);return(0,l.jsx)(t,{...n,children:i})},zn=({language:e,options:t,className:n,onChange:r,...i})=>{let a=(0,w.default)(`eps-language-select`,n);return(0,l.jsx)(`div`,{...i,className:a,children:(0,l.jsx)(v.SegmentedControl,{onChange:e=>{(0,u.assertIsDefined)(e),typeof e==`string`&&r(e)},selectedValue:e,children:t.map(e=>(0,l.jsxs)(v.SegmentedChoice,{value:e.value,children:[e.label,e.required&&(0,l.jsx)(`span`,{className:`asterisk-margin`,children:`*`})]},e.value))})})},Bn=e=>(0,l.jsx)(h.Link,{...e,as:nn,children:e.children}),Vn=({children:e,className:t,...n})=>(0,l.jsx)(h.Link,{...n,as:`button`,className:(0,w.default)(`eps-link-button`,t),children:e}),Hn=({as:e=`nav`,className:t,children:n})=>(0,l.jsx)(e,{className:(0,w.default)([`eds-contrast`,`eps-menu`,t]),children:n}),Un=({className:e,inputComponent:t,alertLabel:n,alertLevel:r,name:i,languages:a,values:o,onChange:s,defaultLanguage:c=`nob`,label:u=``,onBlur:f=()=>{},...p})=>{let[m,h]=(0,d.useState)(c),g=(0,w.default)(`multi-language-input`,e),_=o[m],v=e=>{e.persist();let t=e.currentTarget;setTimeout(()=>{t&&!t.contains(document.activeElement)&&f(e)},0)},y=e=>{h(e)},b=e=>{let t=Object.assign({},o);e===``||!e?delete t[m]:t[m]=e,s(t)};return(0,l.jsx)(`div`,{className:g,tabIndex:0,onBlur:v,"data-testid":`multi-lang-input-${i}`,children:(0,l.jsxs)(O,{space:`extraSmall`,children:[(0,l.jsx)(zn,{language:m,options:a,onChange:e=>y(e)}),(0,l.jsx)(t,{label:u,variant:r,feedback:n,name:i,className:`language-item`,onChange:e=>b(e.target.value),value:_||``,...p})]})})},Wn=({label:e,organisations:t,onChange:n,selectedOrganisationId:r,...i})=>{let[a,o]=(0,d.useState)();return(0,d.useEffect)(()=>{o(t.find(e=>e.organisationId===r))},[r,t]),(0,l.jsx)(y.SearchableDropdown,{label:e,items:[...t.sort((e,t)=>e.tradingName.localeCompare(t.tradingName,`nb`)).map(e=>({value:e.organisationId,label:e.tradingName}))],selectedItem:a?{value:a.organisationId,label:a.tradingName}:null,onChange:e=>{e&&n(e.value)},clearable:!1,...i})},Gn=({collectionSize:e,pageSize:t,onPageChange:n,currentPage:r})=>(0,l.jsx)(f.Pagination,{pageCount:Math.ceil(e/t),currentPage:r,onPageChange:e=>{n(e)}}),Kn=({title:e,suffix:t})=>{(0,d.useEffect)(()=>{t?document.title=`${e}${t}`:document.title=e},[e,t])},qn=({pathname:e,onBreadcrumbLookup:t,appTitle:n=`Entur Partner`})=>{let r=(0,u.splitUrlPath)(e).map(e=>({title:t(e),path:e})).filter(({title:e})=>e!==void 0).map(({title:e})=>e).reverse().join(` | `);return Kn({title:r?`${r} | ${n}`:n}),null},Jn=({children:e,fallback:t=null,permissions:n,oneOf:r=[],all:i=[]})=>{let a=(0,u.hasAllPermissions)(i,n),o=(0,u.hasOneOfPermissions)(r,n);return(0,l.jsx)(l.Fragment,{children:a&&o?e:t})},Yn=({children:e,shouldBlockNavigation:t,...n})=>{(0,u.assertIsDefined)(W()?!0:void 0,`RouteLeavingGuard must be used within a data router.`);let r=pt(({currentLocation:e,nextLocation:n})=>e.pathname!==n.pathname&&t(n));return(0,l.jsx)(Sn,{onDismiss:()=>{r.state===`blocked`&&r.reset()},open:r.state===`blocked`,onConfirm:()=>{r.state===`blocked`&&r.proceed()},...n,children:e})},Xn=({active:e=!1,label:t=``,aggressiveInactive:n,showBullet:r,center:i})=>{let a=(0,w.default)(`eps-status-label__bullet`,{active:e,aggressive:n});return(0,l.jsxs)(`div`,{className:(0,w.default)(`eps-status-label`,{center:i}),children:[r&&(0,l.jsx)(`div`,{className:a}),(0,l.jsx)(`div`,{children:t})]})},Zn=({as:e=`span`,children:t,fontSize:n,color:r,lineHeight:i,fontWeight:a,className:o,...s})=>{let c=[];return n&&c.push(...E(`eps-font-size-`,n)),i&&c.push(...E(`eps-line-height-`,i)),a&&c.push(`eps-font-weight-${a}`),(0,l.jsx)(D,{as:e,color:r,className:(0,w.default)(c,o),...s,children:t})},Qn=({children:e,className:t,...n})=>(0,l.jsx)(p.Button,{variant:`primary`,...n,className:(0,w.default)(`eps-unbutton`,t),children:e});function $n(e,t,n=window){let r=(0,d.useRef)(null);(0,d.useEffect)(()=>{r.current=t},[t]),(0,d.useEffect)(()=>{if(!n?.addEventListener)return;let t=(e=>r.current?.(e));return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}},[e,n])}var $=e=>(0,l.jsx)(`button`,{className:(0,w.default)(e.className,`eps-overflow-menu__item`),role:`menuitem`,...e}),er=({locale:e,onClick:t})=>(0,l.jsxs)($,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(b.CookieIcon,{size:`1rem`,inline:!0})}),e===`en-GB`?`Cookie settings`:`Cookieinstillinger`]});function tr(e,t,n){(0,d.useEffect)(()=>{let r=r=>{nr(e.current,r)||nr(t.current,r)||n()};return document.addEventListener(`mousedown`,r),document.addEventListener(`touchstart`,r),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`touchstart`,r)}},[e,t,n])}function nr(e,t){return e?e.contains(t.target)?!0:t.composed&&t.composedPath?!!t.composedPath().find(t=>t===window?!1:e.contains(t)):!1:!1}var rr=({className:e,children:t,userName:n,open:r,onOpenChange:i,environment:a,...o})=>{let s=(0,w.default)(`eps-overflow-menu__group`,{"eps-overflow-menu__group--open":r}),c=(0,d.useRef)(null),u=(0,d.useRef)(null);return tr(c,u,()=>i(!1)),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(p.SecondaryButton,{className:(0,w.default)(`eps-overflow-menu__button`,e),onClick:()=>i(!r),"aria-haspopup":!0,"aria-expanded":r,ref:u,...o,children:(0,l.jsxs)(`div`,{className:`eps-overflow-menu__button-contents`,children:[(0,l.jsx)(`span`,{className:`eds-overflow-menu__user-icon`,children:(0,l.jsx)(b.UserIcon,{inline:!0})}),(0,l.jsxs)(h.Heading6,{margin:`none`,as:`span`,children:[n,a!==void 0&&a!==Q.Production&&(0,l.jsxs)(`span`,{style:{color:Tn(a)},children:[` `,`(`,Dn(a),`)`]})]}),(0,l.jsx)(`span`,{className:`eps-arrow-icon`,children:(0,l.jsx)(b.DownArrowIcon,{inline:!0})})]})}),r&&(0,l.jsx)(`div`,{className:s,role:`menu`,ref:c,children:t})]})},ir=({locale:e,onLocaleChange:t})=>(0,l.jsx)(l.Fragment,{children:e===`en-GB`?(0,l.jsxs)($,{onClick:()=>{t(`nb-NO`)},className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`eps-overflow-menu__icon-margin`,children:(0,l.jsx)(b.NorwayIcon,{size:`1rem`,inline:!0})}),`Bytt til norsk`]}):(0,l.jsxs)($,{onClick:()=>{t(`en-GB`)},className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`eps-overflow-menu__icon-margin`,children:(0,l.jsx)(b.UKIcon,{size:`1rem`,inline:!0})}),`Switch to English`]})}),ar=({onClick:e,locale:t})=>(0,l.jsxs)($,{onClick:e,"data-testid":`user-menu-logout`,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(b.LogOutIcon,{size:`1rem`,inline:!0})}),t===`en-GB`?`Log out `:`Logg ut`]}),or=({locale:e,onClick:t})=>(0,l.jsxs)($,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(b.UserIcon,{size:`1rem`,inline:!0})}),e===`en-GB`?`My profile`:`Min profil`]}),sr=({locale:e,onClick:t})=>(0,l.jsxs)($,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(b.ChannelsIcon,{className:`eps-version-icon`,size:`1rem`,inline:!0})}),e===`en-GB`?`Version`:`Versjon`]}),cr=({className:e,onLogout:t,onLocaleChange:n,userName:r,locale:i,environment:a,showVersionItem:o,showMyProfileItem:s,showCookieSettingsItem:c,onNavigateToMyProfile:u,onCookieSettingsOpen:f=()=>{},onVersionItemClick:p})=>{let[m,h]=(0,d.useState)(!1);return(0,l.jsx)(`div`,{id:`eps-user-menu`,children:(0,l.jsx)(rr,{open:m,onOpenChange:h,className:(0,w.default)([`eps-user-menu__trigger-button`,e]),userName:r,environment:a,children:(0,l.jsxs)(`div`,{id:`eps-overflow-menu`,children:[(0,l.jsx)(ir,{locale:i,onLocaleChange:e=>{n(e),h(!1)}}),o&&(0,l.jsx)(sr,{locale:i,onClick:()=>{p?.(),h(!1)}}),s&&(0,l.jsx)(or,{locale:i,onClick:()=>{u(),h(!1)}}),c&&(0,l.jsx)(er,{locale:i,onClick:()=>{f(),h(!1)}}),(0,l.jsx)(ar,{locale:i,onClick:()=>{t(),h(!1)}})]})})})};exports.ActionBar=C,exports.ActionBarLeft=x,exports.ActionBarRight=S,exports.AuditInfo=k,exports.Box=D,exports.Breadcrumbs=xn,exports.ConfirmModal=Sn,exports.Content=Cn,exports.EnturPartnerLogo=kn,exports.EnturPartnerLogoSvg=On,exports.Environment=Q,exports.ErrorBoundary=jn,exports.ExpandableMultiLanguageInput=Pn,exports.FeatureToggle=Ln,exports.FormatCurrencyAmount=Rn,exports.FormatDateTime=T,exports.LanguageSelect=zn,exports.Link=Bn,exports.LinkButton=Vn,exports.Menu=Hn,exports.MultiLanguageInput=Un,exports.OrganisationDropDown=Wn,exports.PageTitle=qn,exports.Pager=Gn,exports.PermissionCheck=Jn,exports.RouteLeavingGuard=Yn,exports.Stack=O,exports.StatusLabel=Xn,exports.Text=Zn,exports.Unbutton=Qn,exports.UserMenu=cr,exports.featureFlag=Fn,exports.getColorForEnvironment=Tn,exports.getHumanReadableEnvironment=Dn,exports.responsiveProp=E,exports.useDocumentTitle=Kn,exports.useEventListener=$n,exports.useFeatureToggle=In;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react/jsx-runtime`),u=require(`@entur-partner/util`),d=require(`react`),f=require(`@entur/menu`),p=require(`react-router-dom`),m=require(`@entur/button`),h=require(`@entur/modal`),g=require(`@entur/typography`),_=require(`@entur/alert`),v=require(`@entur/expand`),y=require(`@entur/form`),b=require(`@entur/dropdown`),x=require(`@entur/icons`);var S=({children:e})=>(0,l.jsx)(`div`,{className:`eps-action-bar-left`,children:e}),C=({children:e})=>(0,l.jsx)(`div`,{className:`eps-action-bar-right`,children:e}),w=({children:e})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`eps-action-bar-padding`}),(0,l.jsx)(`div`,{className:`eps-action-bar`,children:e})]}),T=c(o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),E=({date:e,locale:t,as:n=`main`,hideTime:r,...i})=>(0,l.jsx)(n,{...i,children:r?(0,u.localeDate)(e,t):(0,u.localeDateTime)(e,t)});function D(e,t){if(Array.isArray(t)){let n=[];return t[0]&&n.push(e+t[0]),t[1]&&n.push(`${e}${t[1]}-lg`),t[2]&&n.push(`${e}${t[2]}-xl`),n}return[e+t]}var O=({as:e=`div`,children:t,contrast:n,paddingTop:r,paddingRight:i,paddingBottom:a,paddingLeft:o,paddingX:s,paddingY:c,padding:u,marginTop:d,marginRight:f,marginBottom:p,marginLeft:m,marginX:h,marginY:g,margin:_,display:v,justifyContent:y,alignItems:b,maxWidth:x,width:S,background:C,color:w,flexDirection:E,flexWrap:O,className:k,...A})=>{let j=[],M=r||c||u,N=a||c||u,P=o||s||u,F=i||s||u,I=d||g||_,L=p||g||_,R=m||h||_,z=f||h||_;return n&&j.push(`eds-contrast`),M&&j.push(...D(`eps-pt-`,M)),N&&j.push(...D(`eps-pb-`,N)),P&&j.push(...D(`eps-pl-`,P)),F&&j.push(...D(`eps-pr-`,F)),I&&j.push(...D(`eps-mt-`,I)),L&&j.push(...D(`eps-mb-`,L)),R&&j.push(...D(`eps-ml-`,R)),z&&j.push(...D(`eps-mr-`,z)),v&&j.push(...D(`eps-`,v)),y&&j.push(...D(`eps-justify-`,y)),b&&j.push(...D(`eps-items-`,b)),x&&j.push(...D(`eps-max-w-`,x)),S&&j.push(...D(`eps-w-`,S)),w&&j.push(`eps-color-${w}`),C&&j.push(`eps-bg-${C}`),E&&j.push(...D(`eps-flex-`,E)),O&&j.push(...D(`eps-flex-wrap-`,O)),(0,l.jsx)(e,{className:(0,T.default)(j,k),...A,children:t})},k=({children:e,space:t,className:n})=>{let r=d.Children.toArray(e);return r.length<=1?(0,l.jsx)(l.Fragment,{children:r}):(0,l.jsx)(`div`,{className:n,children:r.map((e,n)=>n===r.length-1?(0,l.jsx)(`div`,{children:e},n):(0,l.jsx)(O,{paddingBottom:t,children:e},n))})},A=({items:e,locale:t,className:n,...r})=>(0,l.jsx)(`div`,{className:(0,T.default)(`ep-audit-info`,n),...r,children:e.map(({label:e,value:n})=>(0,l.jsxs)(k,{space:`small`,children:[(0,l.jsx)(`div`,{className:`ep-audit-info-label`,children:e}),(0,l.jsx)(`div`,{children:(0,u.isDate)(n)||(0,u.isDateString)(n)?(0,l.jsx)(E,{date:n,locale:t}):(0,l.jsx)(`span`,{children:n})})]},n.toString()))}),j=({prependBreadcrumbItem:e,pathname:t,onBreadcrumbLookup:n})=>{let r=(0,u.splitUrlPath)(t).map(e=>({title:n(e),path:e})).filter(({title:e})=>e!==void 0),i=r.map(({title:e,path:t},n)=>n===r.length-1?(0,l.jsx)(f.BreadcrumbItem,{as:`span`,children:e},t):(0,l.jsx)(f.BreadcrumbItem,{as:p.Link,to:t,children:e},t));return e?(0,l.jsx)(f.BreadcrumbNavigation,{children:[e,...i]}):(0,l.jsx)(f.BreadcrumbNavigation,{children:i})},M=({isOpen:e=!1,children:t,message:n,size:r=`medium`,buttons:i,onConfirm:a,messages:o,onClose:s,onDismiss:c,...d})=>{let f=t||n,p=s||c;return(0,l.jsxs)(h.Modal,{size:r,open:e,onDismiss:p,...d,children:[(0,u.isString)(f)?(0,l.jsx)(g.Paragraph,{children:f}):(0,l.jsx)(O,{paddingBottom:`medium`,children:f}),(0,l.jsx)(m.ButtonGroup,{children:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.SecondaryButton,{onClick:p,"data-testid":`cancel-modal-button`,children:o.cancel}),(0,l.jsx)(m.PrimaryButton,{onClick:a,"data-testid":`confirm-modal-button`,children:o.confirm})]}):i})]})},N=({as:e=`main`,className:t,children:n})=>(0,l.jsx)(e,{className:(0,T.default)([`eps-content`,t]),children:n}),P=function(e){return e.Local=`local`,e.Development=`dev`,e.Staging=`staging`,e.Production=`prod`,e}({}),F={[P.Local]:`#B482FB`,[P.Development]:`#5AC39A`,[P.Staging]:`#FFCA28`},I=e=>F[e],L={[P.Local]:`Local`,[P.Development]:`Dev`,[P.Staging]:`Staging`,[P.Production]:`Prod`},R=e=>L[e],z=({title:e,accentColor:t=`#FF5959`,...n})=>(0,l.jsxs)(`svg`,{width:257,height:37,viewBox:`0 0 257 37`,...n,children:[(0,l.jsx)(`title`,{children:e}),(0,l.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,children:[(0,l.jsx)(`path`,{fill:`#FFF`,d:`M0 .231V25.72h18.745v-4.318H4.869v-6.163h12.31v-4.318H4.87V4.55h13.876V.231z`}),(0,l.jsx)(`path`,{fill:t,d:`M0 36.408h45.253v-4.32H0z`}),(0,l.jsx)(`path`,{fill:`#FFF`,d:`M40.384.231v15.425L23.656.231h-.521V25.72h4.869V10.573L44.732 25.72h.521V.23zM69.25 15.238h-7.267v21.17h-4.87v-21.17H49.81V10.92h19.44zM83.863 36.86c-1.646 0-3.142-.255-4.486-.765-1.345-.51-2.493-1.23-3.443-2.159-.95-.928-1.687-2.054-2.208-3.378-.522-1.323-.783-2.797-.783-4.422V10.92h4.869v15.216c0 1.277.209 2.333.626 3.169.417.836.933 1.497 1.548 1.985a5.346 5.346 0 001.982 1.01c.707.186 1.339.278 1.895.278.557 0 1.188-.092 1.896-.279a5.35 5.35 0 001.982-1.01c.614-.487 1.13-1.148 1.548-1.984.417-.836.625-1.892.625-3.169V10.92h4.87v15.216c0 1.625-.256 3.1-.766 4.422-.51 1.324-1.24 2.45-2.19 3.378-.952.929-2.1 1.648-3.444 2.159-1.344.51-2.851.766-4.52.766M104.21 24.047h5.546c1.016 0 1.854-.127 2.513-.383.658-.255 1.179-.592 1.56-1.01.381-.418.641-.888.78-1.41.138-.522.208-1.05.208-1.584 0-.627-.099-1.207-.295-1.741a3.718 3.718 0 00-.901-1.393c-.405-.394-.924-.708-1.56-.94-.636-.232-1.404-.348-2.305-.348h-5.546v8.81zm0 4.248v8.113h-4.87V10.92h11.567c1.3 0 2.49.215 3.57.644 1.08.43 2.004 1.033 2.77 1.81a8.287 8.287 0 011.794 2.787c.43 1.079.645 2.257.645 3.534 0 .952-.128 1.874-.383 2.768-.256.894-.61 1.7-1.063 2.42a7.32 7.32 0 01-1.672 1.863 5.929 5.929 0 01-2.178 1.096l6.339 8.566h-5.808l-5.893-8.113h-4.818z`}),(0,l.jsx)(`g`,{fill:t,children:(0,l.jsx)(`path`,{d:`M141.051 23.448h5.628c4.185 0 5.989-1.984 5.989-4.942 0-2.742-1.515-4.618-5.989-4.618h-5.628v9.56zm0 3.067v9.776h-3.571V10.75h9.632c6.674 0 9.127 3.211 9.127 7.54 0 4.979-3.102 8.226-9.2 8.226h-5.988zM169.695 28.715c-1.371-.288-2.958-.505-4.401-.505-2.85 0-4.041 1.263-4.041 3.139s1.407 2.706 3.463 2.706c2.49 0 4.979-1.443 4.979-4.221v-1.119zm-4.293-2.958c1.551 0 3.174.253 4.293.469v-.83c0-2.525-1.154-3.896-4.33-3.896-2.164 0-3.824.866-4.942 2.092l-2.02-2.272c1.732-1.66 3.644-2.598 7.07-2.598 5.052 0 7.469 1.876 7.469 7.215v10.354h-3.211V34.02h-.108c-1.082 1.767-3.211 2.705-5.592 2.705-3.32 0-6.241-1.66-6.241-5.303 0-3.103 1.912-5.664 7.612-5.664zM178.965 19.191h3.211v2.886h.108c.938-1.984 2.922-3.355 5.231-3.355.47 0 .938.036 1.335.144l-.144 3.14a6.77 6.77 0 00-1.552-.181c-3.246 0-4.798 2.633-4.798 5.483v8.983h-3.39v-17.1zM199.961 36.291h-1.912c-4.004 0-5.988-.938-5.988-5.772v-8.55h-2.778V19.19h2.778v-4.654h3.355v4.654h4.473v2.778h-4.473v7.973c0 3.427 1.587 3.535 3.319 3.535h1.226v2.814zM219.767 36.291h-3.391V26.84c0-2.778-1.083-5.375-4.257-5.375-3.14 0-5.268 2.597-5.268 6.169v8.658h-3.391v-17.1h3.32v2.814h.143c.794-1.623 3.067-3.283 5.99-3.283 4.941 0 6.854 3.644 6.854 8.081v9.488zM227.847 26.262h10.57c0-2.597-2.272-4.726-5.087-4.726-2.922 0-5.014 1.948-5.483 4.726zm-.036 2.453c.397 3.355 2.633 5.195 5.844 5.195 2.778 0 4.618-1.623 5.484-2.67l2.164 1.804c-1.37 1.913-4.365 3.716-8.045 3.716-4.942 0-8.73-3.535-8.73-8.55 0-5.195 3.752-9.488 8.983-9.488 5.303 0 8.009 4.365 8.009 8.19 0 .649-.036 1.226-.072 1.803H227.81zM246.245 19.191h3.21v2.886h.109c.938-1.984 2.922-3.355 5.231-3.355.469 0 .938.036 1.335.144l-.145 3.14a6.77 6.77 0 00-1.551-.181c-3.247 0-4.798 2.633-4.798 5.483v8.983h-3.391v-17.1z`})})]})]}),B=({as:e=`nav`,className:t,altText:n,environment:r})=>(0,l.jsx)(e,{className:(0,T.default)([`eps-logo-wrapper`,t]),children:(0,l.jsx)(z,{title:n,className:`logo`,accentColor:r!==void 0&&r!==P.Production?I(r):void 0})}),V=`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,ee=class extends d.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.handleError?.(e,t)}render(){let{error:e}=this.state,{fallback:t,children:n}=this.props;return e?(0,u.isFunction)(t)?t({retry:()=>this.setState({error:null}),error:e}):e.name===`NotFoundError`&&e.message===V?(0,l.jsx)(ne,{}):t:n}},te=`EP::locale`;function ne(){let e=localStorage.getItem(te),t=e===`nb`||e===`nb-NO`;return(0,l.jsx)(O,{maxWidth:`large`,children:(0,l.jsxs)(_.BannerAlertBox,{variant:`info`,title:t?`En ny versjon av nettsiden er tilgjengelig.`:`A new version of the website is available.`,children:[(0,l.jsx)(O,{paddingBottom:`medium`,children:(0,l.jsx)(g.Paragraph,{margin:`none`,children:t?`Vennligst oppdater.`:`Please refresh.`})}),(0,l.jsx)(m.PrimaryButton,{onClick:()=>window.location.reload(),children:t?`Oppdater`:`Refresh`})]})})}var re=({title:e,inputComponent:t,languages:n,values:r,onChange:i,name:a,variant:o,feedback:s,...c})=>{let u=(e,t)=>{let n={...r};t===``||!t?delete n[e]:n[e]=t,i(n)};return(0,l.jsx)(v.ExpandablePanel,{title:e,defaultOpen:!0,contentStyle:{padding:`4px 4px 4px 4px`,marginTop:`16px`,marginBottom:`16px`},children:(0,l.jsx)(k,{space:`medium`,children:n.map(({value:n,label:i,required:d})=>(0,l.jsx)(t,{"data-testid":`multi-lang-input-${a}-${n}`,label:d?`${i}*`:i,variant:o?.(n),feedback:s?.(n),name:a,onChange:e=>{u(n,e.target.value)},value:r[n]||``,...c},e+n))})})};function H(e){return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.[`VITE_APP_${e}`]===`true`||window.localStorage?.getItem(e)===`true`||window.localStorage?.getItem(`VITE_APP_${e}`)===`true`}function U(e){return H(e)}var W=({children:e,flag:t})=>H(t)?(0,l.jsx)(l.Fragment,{children:e}):null,G=({amount:e,as:t=`span`,...n})=>{let r=Number(e)||0,i=new Intl.NumberFormat(`nb-NO`,{maximumFractionDigits:2,minimumFractionDigits:2}).format(r);return(0,l.jsx)(t,{...n,children:i})},K=({language:e,options:t,className:n,onChange:r,...i})=>{let a=(0,T.default)(`eps-language-select`,n);return(0,l.jsx)(`div`,{...i,className:a,children:(0,l.jsx)(y.SegmentedControl,{onChange:e=>{(0,u.assertIsDefined)(e),typeof e==`string`&&r(e)},selectedValue:e,children:t.map(e=>(0,l.jsxs)(y.SegmentedChoice,{value:e.value,children:[e.label,e.required&&(0,l.jsx)(`span`,{className:`asterisk-margin`,children:`*`})]},e.value))})})},q=e=>(0,l.jsx)(g.Link,{...e,as:p.Link,children:e.children}),J=({children:e,className:t,...n})=>(0,l.jsx)(g.Link,{...n,as:`button`,className:(0,T.default)(`eps-link-button`,t),children:e}),Y=({as:e=`nav`,className:t,children:n})=>(0,l.jsx)(e,{className:(0,T.default)([`eds-contrast`,`eps-menu`,t]),children:n}),ie=({className:e,inputComponent:t,alertLabel:n,alertLevel:r,name:i,languages:a,values:o,onChange:s,defaultLanguage:c=`nob`,label:u=``,onBlur:f=()=>{},...p})=>{let[m,h]=(0,d.useState)(c),g=(0,T.default)(`multi-language-input`,e),_=o[m],v=e=>{e.persist();let t=e.currentTarget;setTimeout(()=>{t&&!t.contains(document.activeElement)&&f(e)},0)},y=e=>{h(e)},b=e=>{let t=Object.assign({},o);e===``||!e?delete t[m]:t[m]=e,s(t)};return(0,l.jsx)(`div`,{className:g,tabIndex:0,onBlur:v,"data-testid":`multi-lang-input-${i}`,children:(0,l.jsxs)(k,{space:`extraSmall`,children:[(0,l.jsx)(K,{language:m,options:a,onChange:e=>y(e)}),(0,l.jsx)(t,{label:u,variant:r,feedback:n,name:i,className:`language-item`,onChange:e=>b(e.target.value),value:_||``,...p})]})})},ae=({label:e,organisations:t,onChange:n,selectedOrganisationId:r,...i})=>{let[a,o]=(0,d.useState)();return(0,d.useEffect)(()=>{o(t.find(e=>e.organisationId===r))},[r,t]),(0,l.jsx)(b.SearchableDropdown,{label:e,items:[...t.sort((e,t)=>e.tradingName.localeCompare(t.tradingName,`nb`)).map(e=>({value:e.organisationId,label:e.tradingName}))],selectedItem:a?{value:a.organisationId,label:a.tradingName}:null,onChange:e=>{e&&n(e.value)},clearable:!1,...i})},oe=({collectionSize:e,pageSize:t,onPageChange:n,currentPage:r})=>(0,l.jsx)(f.Pagination,{pageCount:Math.ceil(e/t),currentPage:r,onPageChange:e=>{n(e)}}),X=({title:e,suffix:t})=>{(0,d.useEffect)(()=>{t?document.title=`${e}${t}`:document.title=e},[e,t])},se=({pathname:e,onBreadcrumbLookup:t,appTitle:n=`Entur Partner`})=>{let r=(0,u.splitUrlPath)(e).map(e=>({title:t(e),path:e})).filter(({title:e})=>e!==void 0).map(({title:e})=>e).reverse().join(` | `);return X({title:r?`${r} | ${n}`:n}),null},ce=({children:e,fallback:t=null,permissions:n,oneOf:r=[],all:i=[]})=>{let a=(0,u.hasAllPermissions)(i,n),o=(0,u.hasOneOfPermissions)(r,n);return(0,l.jsx)(l.Fragment,{children:a&&o?e:t})},le=({children:e,shouldBlockNavigation:t,...n})=>{(0,u.assertIsDefined)((0,p.useInRouterContext)()?!0:void 0,`RouteLeavingGuard must be used within a data router.`);let r=(0,p.useBlocker)(({currentLocation:e,nextLocation:n})=>e.pathname!==n.pathname&&t(n));return(0,l.jsx)(M,{onDismiss:()=>{r.state===`blocked`&&r.reset()},open:r.state===`blocked`,onConfirm:()=>{r.state===`blocked`&&r.proceed()},...n,children:e})},ue=({active:e=!1,label:t=``,aggressiveInactive:n,showBullet:r,center:i})=>{let a=(0,T.default)(`eps-status-label__bullet`,{active:e,aggressive:n});return(0,l.jsxs)(`div`,{className:(0,T.default)(`eps-status-label`,{center:i}),children:[r&&(0,l.jsx)(`div`,{className:a}),(0,l.jsx)(`div`,{children:t})]})},de=({as:e=`span`,children:t,fontSize:n,color:r,lineHeight:i,fontWeight:a,className:o,...s})=>{let c=[];return n&&c.push(...D(`eps-font-size-`,n)),i&&c.push(...D(`eps-line-height-`,i)),a&&c.push(`eps-font-weight-${a}`),(0,l.jsx)(O,{as:e,color:r,className:(0,T.default)(c,o),...s,children:t})},fe=({children:e,className:t,...n})=>(0,l.jsx)(m.Button,{variant:`primary`,...n,className:(0,T.default)(`eps-unbutton`,t),children:e});function pe(e,t,n=window){let r=(0,d.useRef)(null);(0,d.useEffect)(()=>{r.current=t},[t]),(0,d.useEffect)(()=>{if(!n?.addEventListener)return;let t=(e=>r.current?.(e));return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}},[e,n])}var Z=e=>(0,l.jsx)(`button`,{className:(0,T.default)(e.className,`eps-overflow-menu__item`),role:`menuitem`,...e}),me=({locale:e,onClick:t})=>(0,l.jsxs)(Z,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(x.CookieIcon,{size:`1rem`,inline:!0})}),e===`en-GB`?`Cookie settings`:`Cookieinstillinger`]});function Q(e,t,n){(0,d.useEffect)(()=>{let r=r=>{$(e.current,r)||$(t.current,r)||n()};return document.addEventListener(`mousedown`,r),document.addEventListener(`touchstart`,r),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`touchstart`,r)}},[e,t,n])}function $(e,t){return e?e.contains(t.target)?!0:t.composed&&t.composedPath?!!t.composedPath().find(t=>t===window?!1:e.contains(t)):!1:!1}var he=({className:e,children:t,userName:n,open:r,onOpenChange:i,environment:a,...o})=>{let s=(0,T.default)(`eps-overflow-menu__group`,{"eps-overflow-menu__group--open":r}),c=(0,d.useRef)(null),u=(0,d.useRef)(null);return Q(c,u,()=>i(!1)),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(m.SecondaryButton,{className:(0,T.default)(`eps-overflow-menu__button`,e),onClick:()=>i(!r),"aria-haspopup":!0,"aria-expanded":r,ref:u,...o,children:(0,l.jsxs)(`div`,{className:`eps-overflow-menu__button-contents`,children:[(0,l.jsx)(`span`,{className:`eds-overflow-menu__user-icon`,children:(0,l.jsx)(x.UserIcon,{inline:!0})}),(0,l.jsxs)(g.Heading6,{margin:`none`,as:`span`,children:[n,a!==void 0&&a!==P.Production&&(0,l.jsxs)(`span`,{style:{color:I(a)},children:[` `,`(`,R(a),`)`]})]}),(0,l.jsx)(`span`,{className:`eps-arrow-icon`,children:(0,l.jsx)(x.DownArrowIcon,{inline:!0})})]})}),r&&(0,l.jsx)(`div`,{className:s,role:`menu`,ref:c,children:t})]})},ge=({locale:e,onLocaleChange:t})=>(0,l.jsx)(l.Fragment,{children:e===`en-GB`?(0,l.jsxs)(Z,{onClick:()=>{t(`nb-NO`)},className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`eps-overflow-menu__icon-margin`,children:(0,l.jsx)(x.NorwayIcon,{size:`1rem`,inline:!0})}),`Bytt til norsk`]}):(0,l.jsxs)(Z,{onClick:()=>{t(`en-GB`)},className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`eps-overflow-menu__icon-margin`,children:(0,l.jsx)(x.UKIcon,{size:`1rem`,inline:!0})}),`Switch to English`]})}),_e=({onClick:e,locale:t})=>(0,l.jsxs)(Z,{onClick:e,"data-testid":`user-menu-logout`,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(x.LogOutIcon,{size:`1rem`,inline:!0})}),t===`en-GB`?`Log out `:`Logg ut`]}),ve=({locale:e,onClick:t})=>(0,l.jsxs)(Z,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(x.UserIcon,{size:`1rem`,inline:!0})}),e===`en-GB`?`My profile`:`Min profil`]}),ye=({locale:e,onClick:t})=>(0,l.jsxs)(Z,{onClick:t,className:`eps-overflow-menu__item`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,children:(0,l.jsx)(x.ChannelsIcon,{className:`eps-version-icon`,size:`1rem`,inline:!0})}),e===`en-GB`?`Version`:`Versjon`]}),be=({className:e,onLogout:t,onLocaleChange:n,userName:r,locale:i,environment:a,showVersionItem:o,showMyProfileItem:s,showCookieSettingsItem:c,onNavigateToMyProfile:u,onCookieSettingsOpen:f=()=>{},onVersionItemClick:p})=>{let[m,h]=(0,d.useState)(!1);return(0,l.jsx)(`div`,{id:`eps-user-menu`,children:(0,l.jsx)(he,{open:m,onOpenChange:h,className:(0,T.default)([`eps-user-menu__trigger-button`,e]),userName:r,environment:a,children:(0,l.jsxs)(`div`,{id:`eps-overflow-menu`,children:[(0,l.jsx)(ge,{locale:i,onLocaleChange:e=>{n(e),h(!1)}}),o&&(0,l.jsx)(ye,{locale:i,onClick:()=>{p?.(),h(!1)}}),s&&(0,l.jsx)(ve,{locale:i,onClick:()=>{u(),h(!1)}}),c&&(0,l.jsx)(me,{locale:i,onClick:()=>{f(),h(!1)}}),(0,l.jsx)(_e,{locale:i,onClick:()=>{t(),h(!1)}})]})})})};exports.ActionBar=w,exports.ActionBarLeft=S,exports.ActionBarRight=C,exports.AuditInfo=A,exports.Box=O,exports.Breadcrumbs=j,exports.ConfirmModal=M,exports.Content=N,exports.EnturPartnerLogo=B,exports.EnturPartnerLogoSvg=z,exports.Environment=P,exports.ErrorBoundary=ee,exports.ExpandableMultiLanguageInput=re,exports.FeatureToggle=W,exports.FormatCurrencyAmount=G,exports.FormatDateTime=E,exports.LanguageSelect=K,exports.Link=q,exports.LinkButton=J,exports.Menu=Y,exports.MultiLanguageInput=ie,exports.OrganisationDropDown=ae,exports.PageTitle=se,exports.Pager=oe,exports.PermissionCheck=ce,exports.RouteLeavingGuard=le,exports.Stack=k,exports.StatusLabel=ue,exports.Text=de,exports.Unbutton=fe,exports.UserMenu=be,exports.featureFlag=H,exports.getColorForEnvironment=I,exports.getHumanReadableEnvironment=R,exports.responsiveProp=D,exports.useDocumentTitle=X,exports.useEventListener=pe,exports.useFeatureToggle=U;
|
|
4
2
|
//# sourceMappingURL=index.cjs.map
|