@arkitektbedriftene/fe-lib 0.2.10 → 0.2.11
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/package.json +5 -9
- package/vite.config.ts +1 -0
- package/dist/hooks.cjs.js +0 -1
- package/dist/icons.cjs.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/jsx-runtime-1b33e5e6.cjs +0 -27
- package/dist/oidc.cjs.js +0 -1
- package/dist/useLocalStorageState-f72b4add.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkitektbedriftene/fe-lib",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/index.es.js"
|
|
10
|
-
"require": "./dist/index.umd.cjs"
|
|
9
|
+
"import": "./dist/index.es.js"
|
|
11
10
|
},
|
|
12
11
|
"./oidc": {
|
|
13
|
-
"import": "./dist/oidc.es.js"
|
|
14
|
-
"require": "./dist/oidc.umd.cjs"
|
|
12
|
+
"import": "./dist/oidc.es.js"
|
|
15
13
|
},
|
|
16
14
|
"./hooks": {
|
|
17
|
-
"import": "./dist/hooks.es.js"
|
|
18
|
-
"require": "./dist/hooks.umd.cjs"
|
|
15
|
+
"import": "./dist/hooks.es.js"
|
|
19
16
|
},
|
|
20
17
|
"./icons": {
|
|
21
|
-
"import": "./dist/icons.es.js"
|
|
22
|
-
"require": "./dist/icons.umd.js"
|
|
18
|
+
"import": "./dist/icons.es.js"
|
|
23
19
|
}
|
|
24
20
|
},
|
|
25
21
|
"typesVersions": {
|
package/vite.config.ts
CHANGED
package/dist/hooks.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useLocalStorageState-f72b4add.cjs");require("react");exports.useLocalStorageState=e.useLocalStorageState;
|
package/dist/icons.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-1b33e5e6.cjs"),s=require("react");var d={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=s.createContext&&s.createContext(d),i=globalThis&&globalThis.__assign||function(){return i=Object.assign||function(t){for(var r,a=1,l=arguments.length;a<l;a++){r=arguments[a];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])}return t},i.apply(this,arguments)},g=globalThis&&globalThis.__rest||function(t,r){var a={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&r.indexOf(l)<0&&(a[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(t);c<l.length;c++)r.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(t,l[c])&&(a[l[c]]=t[l[c]]);return a};function m(t){return t&&t.map(function(r,a){return s.createElement(r.tag,i({key:a},r.attr),m(r.child))})}function n(t){return function(r){return s.createElement(z,i({attr:i({},t.attr)},r),m(t.child))}}function z(t){var r=function(a){var l=t.attr,c=t.size,v=t.title,f=g(t,["attr","size","title"]),x=c||a.size||"1em",h;return a.className&&(h=a.className),t.className&&(h=(h?h+" ":"")+t.className),s.createElement("svg",i({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,l,f,{className:h,style:i(i({color:t.color||a.color},a.style),t.style),height:x,width:x,xmlns:"http://www.w3.org/2000/svg"}),v&&s.createElement("title",null,v),t.children)};return o!==void 0?s.createElement(o.Consumer,null,function(a){return r(a)}):r(d)}function M(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 6h-3V4c0-1.11-.89-2-2-2H9c-1.11 0-2 .89-2 2v2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zM9 4h6v2H9V4zm11 15H4v-2h16v2zm0-5H4V8h3v2h2V8h6v2h2V8h3v6z"}}]})(t)}function E(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-2.44-2.79.34-3.69-3.61-.82-1.89-3.2L12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 12l2.44 2.79-.34 3.7 3.61.82L8.6 22.5l3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69L23 12zm-12.91 4.72l-3.8-3.81 1.48-1.48 2.32 2.33 5.85-5.87 1.48 1.48-7.33 7.35z"}}]})(t)}function j(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"}}]})(t)}function L(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4-3.2-3.2zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07A8 8 0 0015 4.59V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8z"}}]})(t)}function C(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.32 10.56L8.38 9.5 7.32 8.44l1.06-1.06L10.5 9.5l-2.12 2.12-1.06-1.06zM4.5 9c.03 0 .05.01.08.01A8.002 8.002 0 0112 4c2.19 0 4.16.88 5.61 2.3.15-.6.45-1.29.81-1.96A9.965 9.965 0 0011.99 2c-4.88 0-8.94 3.51-9.81 8.14C2.74 9.44 3.59 9 4.5 9zM21 10.5c-.42 0-.82-.09-1.19-.22.12.55.19 1.13.19 1.72 0 4.42-3.58 8-8 8-3.36 0-6.23-2.07-7.42-5.01-.03 0-.05.01-.08.01-.52 0-1.04-.14-1.5-.4-.32-.18-.59-.42-.82-.7.89 4.61 4.93 8.1 9.8 8.1C17.52 22 22 17.52 22 12c0-.55-.06-1.09-.14-1.62a3.5 3.5 0 01-.86.12zM21 3s-2 2.9-2 4 .9 2 2 2 2-.9 2-2-2-4-2-4zm-5.38 4.38L13.5 9.5l2.12 2.12 1.06-1.06-1.06-1.06 1.06-1.06-1.06-1.06zM8.56 17c.69-1.19 1.97-2 3.44-2s2.75.81 3.44 2h1.68c-.8-2.05-2.79-3.5-5.12-3.5-.87 0-1.7.2-2.43.57L5.99 12c0-.52-.26-1.02-.74-1.29-.72-.41-1.63-.17-2.05.55-.41.72-.17 1.63.55 2.05.48.28 1.05.25 1.49 0l2.97 1.72c-.57.53-1.03 1.21-1.33 1.97h1.68z"}}]})(t)}function H(t){return n({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4 2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1Zm3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1Zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1ZM4 5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1ZM7.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1Zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1ZM4.5 8a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1Zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1Zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1Z"}},{tag:"path",attr:{d:"M2 1a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V1Zm11 0H3v14h3v-2.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5V15h3V1Z"}}]})(t)}function V(t){return n({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64.746 18l20.988 21a33 33 0 0 1-15.42 55.27l18.48 18.48A57 57 0 0 0 102.706 22l-4.002-4H64.746zM52.395 28.39A56.82 56.82 0 0 0 38.485 119l88 87.94a79.82 79.82 0 0 1 7.51-26.33L55.454 102a32.87 32.87 0 0 1 .06-46.48A29.53 29.53 0 0 1 70.876 47l-18.48-18.61zm82.47 25.78c.254 2.307.4 4.64.44 7a73.06 73.06 0 0 1-3.58 23.83l72.82 72.82a33 33 0 0 1-22.55 56.18 24.19 24.19 0 0 0 7.06 18.77l4 4a57 57 0 0 0 28.49-96l-86.68-86.6zm136.649 24.892l-.92 48.862 23.996.453.92-48.861-23.996-.454zm81.998 11.493l-27.662 45.174 20.468 12.533 27.66-45.174-20.466-12.533zm60.017 53.888l-44.71 20.744 10.1 21.772 44.712-20.744-10.102-21.772zM180.895 156.85a63.6 63.6 0 0 0-16.23 9.92 61.718 61.718 0 0 0-4.06 3.71 64.09 64.09 0 0 0-4.28 85.78 65 65 0 0 0 4.4 4.87l92.15 92.15a64.41 64.41 0 0 0 13.71 10.45 73.23 73.23 0 0 1-6.59-37.35l-82.27-82.27a40.9 40.9 0 0 1-2.76-3 39.461 39.461 0 0 1-2.39-3.25 40 40 0 0 1 5-50.41c.8-.8 1.63-1.55 2.48-2.26a40 40 0 0 1 17.46-8.55 16.78 16.78 0 0 0-4.33-7.5l-12.29-12.29zm71.34 7.78a73.52 73.52 0 0 1 1.25 26l17.39 6.37a12 12 0 1 0 8.27-22.49v.03l-26.91-9.91zm137.71 52.036l-.728 23.988 45.638 1.387.729-23.988-45.639-1.387zm-61.148 10.85a12 12 0 0 0-11.332 16.064l18.37 50.52a40.19 40.19 0 0 1-9.44 42.08l-.09.09a40.41 40.41 0 0 1-7.56 5.94 16.73 16.73 0 0 0 1.91 2.31l15.14 15.14a64.81 64.81 0 0 0 7.48-6.42l.09-.09a64.27 64.27 0 0 0 15-67.28l-18.42-50.57a11.94 11.94 0 0 0-2.47-4.05 12.07 12.07 0 0 0-7.48-3.67 12 12 0 0 0-1.198-.064zm-15.442 51.734a57 57 0 0 0-20.85 93.75l4.29 4.29 81 81a77.08 77.08 0 0 1 3.14-30.7v-.05l-52.29-52.29-19.22-19.22a33 33 0 0 1 11-53.85c0-.1-.06-.21-.1-.31l.25.25c.66-.26 1.33-.5 2-.72a.93.93 0 0 0 0-.22c-.42.14-.85.27-1.27.42-.1-.6-.31-1.31-.54-1.97l-7.41-20.38zm64.13 17.5l-.06.06a79.64 79.64 0 0 1 .73 11.37 94 94 0 0 1-.75 10.29 80.74 80.74 0 0 1-2 10.14l52.29 52.29 30.91 30.91a33 33 0 0 1-15.42 55.29l18.48 18.48a57 57 0 0 0 13.91-90.74l-17.09-17.09-81-81zm45.03 101.6a55 55 0 0 0-13.85 10.19 57.05 57.05 0 0 0-.06 80.55l4.9 4.91h33.915l-21.875-21.88a33 33 0 0 1 15.45-55.29l-18.48-18.48z"}}]})(t)}function R(t){return n({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M327.027 65.816L229.79 128.23l9.856 5.397 86.51-55.53 146.735 83.116-84.165 54.023 4.1 2.244v6.848l65.923-42.316 13.836 7.838-79.76 51.195v11.723l64.633-41.487 15.127 8.57-79.76 51.195v11.723l64.633-41.487 15.127 8.57-79.76 51.195v11.723l100.033-64.21-24.828-14.062 24.827-15.937-24.828-14.064 24.827-15.937-23.537-13.333 23.842-15.305-166.135-94.106zm31.067 44.74c-21.038 10.556-49.06 12.342-68.79 4.383l-38.57 24.757 126.903 69.47 36.582-23.48c-14.41-11.376-13.21-28.35 2.942-41.67l-59.068-33.46zM227.504 147.5l-70.688 46.094 135.61 78.066 1.33-.85c2.5-1.61 6.03-3.89 10.242-6.613 8.42-5.443 19.563-12.66 30.674-19.86 16.002-10.37 24.248-15.72 31.916-20.694L227.504 147.5zm115.467 1.17a8.583 14.437 82.068 0 1 .003 0 8.583 14.437 82.068 0 1 8.32 1.945 8.583 14.437 82.068 0 1-.87 12.282 8.583 14.437 82.068 0 1-20.273 1.29 8.583 14.437 82.068 0 1 .87-12.28 8.583 14.437 82.068 0 1 11.95-3.237zm-218.423 47.115L19.143 263.44l23.537 13.333-23.842 15.305 24.828 14.063-24.828 15.938 24.828 14.063-24.828 15.938 166.135 94.106L285.277 381.8V370.08l-99.433 63.824L39.11 350.787l14.255-9.15 131.608 74.547L285.277 351.8V340.08l-99.433 63.824L39.11 320.787l14.255-9.15 131.608 74.547L285.277 321.8V310.08l-99.433 63.824L39.11 290.787l13.27-8.52 132.9 75.28 99.997-64.188v-5.05l-5.48-3.154-93.65 60.11-146.73-83.116 94.76-60.824-9.63-5.543zm20.46 11.78l-46.92 30.115c14.41 11.374 13.21 28.348-2.942 41.67l59.068 33.46c21.037-10.557 49.057-12.342 68.787-4.384l45.965-29.504-123.96-71.358zm229.817 32.19c-8.044 5.217-15.138 9.822-30.363 19.688-11.112 7.203-22.258 14.42-30.69 19.873-4.217 2.725-7.755 5.01-10.278 6.632-.09.06-.127.08-.215.137v85.924l71.547-48.088v-84.166zm-200.99 17.48a8.583 14.437 82.068 0 1 8.32 1.947 8.583 14.437 82.068 0 1-.87 12.28 8.583 14.437 82.068 0 1-20.27 1.29 8.583 14.437 82.068 0 1 .87-12.28 8.583 14.437 82.068 0 1 11.95-3.236z"}}]})(t)}function O(t){return n({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M138.7 25c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zM256 25c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zm117.4 0c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zm-262 67.65c-.2.34-.3.65-.5 1-.9 2.07-1.7 4.36-2.6 6.85 8 9.1 12.7 21.9 12.7 35.5 0 6.6-1.1 13.1-3.2 19 2.4 3.4 4.6 7.2 6.4 11.3.1.2.2.5.3.7h28.3c.1-.2.2-.5.3-.7 1.8-4.2 4-7.9 6.4-11.3-2.1-5.9-3.2-12.4-3.2-19 0-13.7 4.8-26.5 12.7-35.6-.8-2.46-1.6-4.7-2.5-6.75-.2-.35-.3-.66-.5-1-7.1 7.65-16.5 12.35-27.3 12.35s-20.2-4.7-27.3-12.35zm117.3 0c-.2.34-.3.65-.5 1-.9 2.07-1.7 4.36-2.6 6.85 8 9.1 12.7 21.9 12.7 35.5 0 6.6-1.1 13.1-3.2 19 2.4 3.4 4.6 7.2 6.4 11.3.1.2.2.5.3.7h28.4c.1-.2.2-.5.3-.7 1.8-4.1 4-7.9 6.4-11.3-2.1-5.9-3.2-12.4-3.2-19 0-13.6 4.7-26.4 12.7-35.5-.9-2.49-1.7-4.78-2.6-6.85-.2-.35-.3-.66-.5-1C276.2 100.3 266.8 105 256 105s-20.2-4.7-27.3-12.35zm117.4 0c-.2.34-.3.65-.5 1-.9 2.07-1.7 4.36-2.6 6.85 8 9.1 12.7 21.9 12.7 35.5 0 6.6-1.1 13.1-3.2 19 2.4 3.4 4.6 7.2 6.4 11.3.1.2.2.5.3.7h28.3c.1-.2.2-.5.3-.7 1.8-4.2 4-7.9 6.4-11.3-2.1-5.9-3.2-12.4-3.2-19 0-13.7 4.8-26.5 12.7-35.6-.8-2.46-1.6-4.7-2.5-6.75-.2-.35-.3-.66-.5-1-7.1 7.65-16.5 12.35-27.3 12.35s-20.2-4.7-27.3-12.35zM80 105c-11.59 0-23 12.8-23 31s11.41 31 23 31 23-12.8 23-31-11.41-31-23-31zm117.3 0c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zm117.4 0c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zm117.3 0c-11.6 0-23 12.8-23 31s11.4 31 23 31 23-12.8 23-31-11.4-31-23-31zM52.71 172.7c-.17.3-.33.6-.49 1-6.46 14.5-10.34 39-10.97 73.3h77.45c-.6-34.3-4.5-58.8-10.9-73.3-.2-.4-.3-.7-.5-1-7.1 7.6-16.51 12.3-27.3 12.3-10.77 0-20.2-4.7-27.29-12.3zm117.29 0c-.2.3-.3.6-.5 1-6.4 14.5-10.3 39-10.9 73.3H236c-.6-34.3-4.5-58.8-10.9-73.3-.2-.4-.3-.7-.5-1-7.1 7.6-16.5 12.3-27.3 12.3s-20.2-4.7-27.3-12.3zm117.4 0c-.2.3-.3.6-.5 1-6.4 14.5-10.3 39-10.9 73.3h77.4c-.6-34.3-4.5-58.8-10.9-73.3-.2-.4-.3-.7-.5-1-7.1 7.6-16.5 12.3-27.3 12.3s-20.2-4.7-27.3-12.3zm117.3 0c-.2.3-.3.6-.5 1-6.4 14.5-10.3 39-10.9 73.3h77.4c-.6-34.3-4.5-58.8-10.9-73.3-.2-.4-.3-.7-.5-1-7.1 7.6-16.5 12.3-27.3 12.3s-20.2-4.7-27.3-12.3zM25 265v16h462v-16zm16 34v188h206V351.1c-3.4 1.1-6.9 2-10.7 2.9-10.4 2.4-22.2 3.9-33.5 5-6.2.5-12.1.9-17.6 1.2l23.4 46.8H233v9c0 19-9.8 33.7-21.4 43-11.6 9.3-24.6 14-35.6 14s-24-4.7-35.6-14c-11.6-9.3-21.4-24-21.4-43v-9h24.4l23-46.1c-3.9.1-6.4.1-6.4.1v-18c13-.7 27.1-.8 41.2-2 10.7-.9 21.9-2.4 31-4.5 6.4-1.5 11.7-3.6 14.8-5.2V320h18v11.3c3.1 1.6 8.4 3.7 14.8 5.2 9.1 2.1 20.3 3.6 31 4.5 15.3.5 26.2 1.9 41.2 2v18s-2.5 0-6.5-.1l23.1 46.1H393v9c0 19-9.8 33.7-21.4 42.9-11.6 9.3-24.6 14-35.6 14s-24-4.7-35.6-14C288.8 449.7 279 435 279 416v-9h24.4l23.4-46.8c-5.5-.3-11.4-.7-17.6-1.2-11.3-1.1-23.1-2.6-33.5-5-3.8-.9-7.3-1.8-10.7-2.9V487h206V299zm135 83.1L163.6 407h24.8zm160 0L323.6 407h24.8z"}}]})(t)}function I(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.707 2.293a.999.999 0 0 0-1.414 0l-9 9A1 1 0 0 0 3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a.999.999 0 0 0 .707-1.707l-9-9zM18.001 20H6v-9.586l6-6 6 6V15l.001 5z"}},{tag:"path",attr:{d:"M13 10h-2v3H8v2h3v3h2v-3h3v-2h-3z"}}]})(t)}function w(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",stroke:"#000",strokeWidth:"2",d:"M16,16 C16,14.8954305 12.8659932,14 9,14 C5.13400675,14 2,14.8954305 2,16 C2,17.1045695 5.13400675,18 9,18 C12.8659932,18 16,17.1045695 16,16 Z M2,16 L2,20.9367547 C2,22.0762536 5.13400675,23 9,23 C12.8659932,23 16,22.0762537 16,20.9367548 L16,16 M9,5 C4.581722,5 1,5.8954305 1,7 C1,8.1045695 4.581722,9 9,9 M1,7 L1,12.0000002 C1,13.0128881 4.581722,14 9,14 M23,4 C23,2.8954305 19.9004329,2 16.0769231,2 C12.2534133,2 9.15384615,2.8954305 9.15384615,4 C9.15384615,5.1045695 12.2534133,6 16.0769231,6 C19.9004329,6 23,5.1045695 23,4 Z M16,16 C19.8235098,16 23.0000002,15.0128879 23.0000002,14 L23,4 M9.15384615,3.99999999 L9.15384615,14.1660042 M8.99999999,9.00000001 C8.99999999,10.0128879 12.2534135,11 16.0769233,11 C19.9004331,11 23.0000004,10.0128879 23.0000004,9.00000001"}}]})(t)}function u(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",stroke:"#000",strokeWidth:"2",d:"M2,3.99079514 C2,2.89130934 2.89821238,2 3.99079514,2 L20.0092049,2 C21.1086907,2 22,2.89821238 22,3.99079514 L22,20.0092049 C22,21.1086907 21.1017876,22 20.0092049,22 L3.99079514,22 C2.89130934,22 2,21.1017876 2,20.0092049 L2,3.99079514 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18"}}]})(t)}function p(t){return n({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",stroke:"#000",strokeWidth:"2",d:"M3,6 L21,6 L3,6 Z M10,2 L10,4 M14,2 L14,4 M16,12 C18.3736719,13.1826446 20,15.6506255 20,19 L20,23 L4,23 L4,19 C4,15.6457258 5.6310898,13.1754259 8,12 M12,16.5 L12,23 M12,13 C15.3137085,13 18,10.3137085 18,7 C18,3.6862915 15.3137085,1 12,1 C8.6862915,1 6,3.6862915 6,7 C6,10.3137085 8.6862915,13 12,13 Z M8,12 C8,14.209139 9.790861,16 12,16 L12,16 C14.209139,16 16,14.209139 16,12"}}]})(t)}function B(t){return n({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 64c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8v-16zm192.81 248H304c8.84 0 16 7.16 16 16s-7.16 16-16 16h-47.19c-16.45 0-31.27-9.14-38.64-23.86-2.95-5.92-8.09-6.52-10.17-6.52s-7.22.59-10.02 6.19l-7.67 15.34a15.986 15.986 0 0 1-14.31 8.84c-.38 0-.75-.02-1.14-.05-6.45-.45-12-4.75-14.03-10.89L144 354.59l-10.61 31.88c-5.89 17.66-22.38 29.53-41 29.53H80c-8.84 0-16-7.16-16-16s7.16-16 16-16h12.39c4.83 0 9.11-3.08 10.64-7.66l18.19-54.64c3.3-9.81 12.44-16.41 22.78-16.41s19.48 6.59 22.77 16.41l13.88 41.64c19.77-16.19 54.05-9.7 66 14.16 2.02 4.06 5.96 6.5 10.16 6.5zM377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"}}]})(t)}function y(t){return n({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M488 192H336v56c0 39.7-32.3 72-72 72s-72-32.3-72-72V126.4l-64.9 39C107.8 176.9 96 197.8 96 220.2v47.3l-80 46.2C.7 322.5-4.6 342.1 4.3 357.4l80 138.6c8.8 15.3 28.4 20.5 43.7 11.7L231.4 448H368c35.3 0 64-28.7 64-64h16c17.7 0 32-14.3 32-32v-64h8c13.3 0 24-10.7 24-24v-48c0-13.3-10.7-24-24-24zm147.7-37.4L555.7 16C546.9.7 527.3-4.5 512 4.3L408.6 64H306.4c-12 0-23.7 3.4-33.9 9.7L239 94.6c-9.4 5.8-15 16.1-15 27.1V248c0 22.1 17.9 40 40 40s40-17.9 40-40v-88h184c30.9 0 56 25.1 56 56v28.5l80-46.2c15.3-8.9 20.5-28.4 11.7-43.7z"}}]})(t)}function S(t){return n({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M834.7 279.8l61.3-58.9V208H683.7L532.4 586.4 360.3 208H137.7v12.9l71.6 86.6c7 6.4 10.6 15.8 9.7 25.2V673c2.2 12.3-1.7 24.8-10.3 33.7L128 805v12.7h228.6v-12.9l-80.6-98a39.99 39.99 0 0 1-11.1-33.7V378.7l200.7 439.2h23.3l172.6-439.2v349.9c0 9.2 0 11.1-6 17.2l-62.1 60.3V819h301.2v-12.9l-59.9-58.9c-5.2-4-7.9-10.7-6.8-17.2V297a18.1 18.1 0 0 1 6.8-17.2z"}}]})(t)}function b(t){return t.ExternalId==null||t.ExternalId==""?e.jsxRuntimeExports.jsx(u,{}):t.ExternalId.indexOf("SYKELONN")>-1?e.jsxRuntimeExports.jsx(C,{}):t.ExternalId.indexOf("ANSVAR")>-1?e.jsxRuntimeExports.jsx(H,{}):t.ExternalId.indexOf("RETTS")>-1?e.jsxRuntimeExports.jsx(O,{}):t.ExternalId.indexOf("BEHAND")>-1?e.jsxRuntimeExports.jsx(I,{}):t.ExternalId.indexOf("REISE")>-1?e.jsxRuntimeExports.jsx(L,{}):t.ExternalId.indexOf("YRKE")>-1?e.jsxRuntimeExports.jsx(p,{}):t.ExternalId.indexOf("VERDI")>-1?e.jsxRuntimeExports.jsx(R,{}):t.ExternalId.indexOf("TJENESTE")>-1?e.jsxRuntimeExports.jsx(M,{}):t.ExternalId.indexOf("GRUPPELIV")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(y,{})}):t.ExternalId.indexOf("SYKEAV")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(V,{})}):t.ExternalId.indexOf("_MAKS")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(E,{color:"green"})}):t.ExternalId.indexOf("_MEDLEM")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(S,{color:"#B22222"})}):t.ExternalId.indexOf("_PRAKSIS")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(j,{color:"#8cc6ce"})}):t.ExternalId.indexOf("_AY")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(B,{color:"#e8b281"})}):t.ExternalId.indexOf("_TARIFF")>-1?e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(w,{color:"#626FFE "})}):e.jsxRuntimeExports.jsx(u,{})}exports.ProductExternalIdToIcon=b;
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l="Hello From Library!";exports.helloWorld=l;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";const Te=require("react");exports.jsxRuntimeExports={};var ir={get exports(){return exports.jsxRuntimeExports},set exports(R){exports.jsxRuntimeExports=R}},k={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ye;function or(){if(ye)return k;ye=1;var R=Te,S=Symbol.for("react.element"),V=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,F=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function w(h,l,T){var d,g={},_=null,I=null;T!==void 0&&(_=""+T),l.key!==void 0&&(_=""+l.key),l.ref!==void 0&&(I=l.ref);for(d in l)m.call(l,d)&&!A.hasOwnProperty(d)&&(g[d]=l[d]);if(h&&h.defaultProps)for(d in l=h.defaultProps,l)g[d]===void 0&&(g[d]=l[d]);return{$$typeof:S,type:h,key:_,ref:I,props:g,_owner:F.current}}return k.Fragment=V,k.jsx=w,k.jsxs=w,k}var D={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var me;function ur(){return me||(me=1,process.env.NODE_ENV!=="production"&&function(){var R=Te,S=Symbol.for("react.element"),V=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),h=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),H=Symbol.iterator,Oe="@@iterator";function Ce(e){if(e===null||typeof e!="object")return null;var r=H&&e[H]||e[Oe];return typeof r=="function"?r:null}var O=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Pe("error",e,t)}}function Pe(e,r,t){{var n=O.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Se=!1,we=!1,xe=!1,je=!1,ke=!1,X;X=Symbol.for("react.module.reference");function De(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===A||ke||e===F||e===T||e===d||je||e===I||Se||we||xe||typeof e=="object"&&e!==null&&(e.$$typeof===_||e.$$typeof===g||e.$$typeof===w||e.$$typeof===h||e.$$typeof===l||e.$$typeof===X||e.getModuleId!==void 0))}function Fe(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function Z(e){return e.displayName||"Context"}function E(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case V:return"Portal";case A:return"Profiler";case F:return"StrictMode";case T:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var r=e;return Z(r)+".Consumer";case w:var t=e;return Z(t._context)+".Provider";case l:return Fe(e,e.render,"ForwardRef");case g:var n=e.displayName||null;return n!==null?n:E(e.type)||"Memo";case _:{var o=e,u=o._payload,i=o._init;try{return E(i(u))}catch{return null}}}return null}var y=Object.assign,x=0,Q,ee,re,te,ne,ae,ie;function oe(){}oe.__reactDisabledLog=!0;function Ae(){{if(x===0){Q=console.log,ee=console.info,re=console.warn,te=console.error,ne=console.group,ae=console.groupCollapsed,ie=console.groupEnd;var e={configurable:!0,enumerable:!0,value:oe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}x++}}function Ie(){{if(x--,x===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},e,{value:Q}),info:y({},e,{value:ee}),warn:y({},e,{value:re}),error:y({},e,{value:te}),group:y({},e,{value:ne}),groupCollapsed:y({},e,{value:ae}),groupEnd:y({},e,{value:ie})})}x<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var M=O.ReactCurrentDispatcher,U;function W(e,r,t){{if(U===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);U=n&&n[1]||""}return`
|
|
18
|
-
`+U+e}}var B=!1,$;{var We=typeof WeakMap=="function"?WeakMap:Map;$=new We}function ue(e,r){if(!e||B)return"";{var t=$.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=M.current,M.current=null,Ae();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(b){n=b}Reflect.construct(e,[],i)}else{try{i.call()}catch(b){n=b}e.call(i.prototype)}}else{try{throw Error()}catch(b){n=b}e()}}catch(b){if(b&&n&&typeof b.stack=="string"){for(var a=b.stack.split(`
|
|
19
|
-
`),v=n.stack.split(`
|
|
20
|
-
`),s=a.length-1,f=v.length-1;s>=1&&f>=0&&a[s]!==v[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==v[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==v[f]){var p=`
|
|
21
|
-
`+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,p),p}while(s>=1&&f>=0);break}}}finally{B=!1,M.current=u,Ie(),Error.prepareStackTrace=o}var P=e?e.displayName||e.name:"",_e=P?W(P):"";return typeof e=="function"&&$.set(e,_e),_e}function $e(e,r,t){return ue(e,!1)}function Ye(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Y(e,r,t){if(e==null)return"";if(typeof e=="function")return ue(e,Ye(e));if(typeof e=="string")return W(e);switch(e){case T:return W("Suspense");case d:return W("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return $e(e.render);case g:return Y(e.type,r,t);case _:{var n=e,o=n._payload,u=n._init;try{return Y(u(o),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,se={},fe=O.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);fe.setExtraStackFrame(t)}else fe.setExtraStackFrame(null)}function Le(e,r,t,n,o){{var u=Function.call.bind(L);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var v=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(N(o),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in se)&&(se[a.message]=!0,N(o),c("Failed %s type: %s",t,a.message),N(null))}}}var Ne=Array.isArray;function q(e){return Ne(e)}function Ve(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Me(e){try{return le(e),!1}catch{return!0}}function le(e){return""+e}function ce(e){if(Me(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ve(e)),le(e)}var j=O.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},ve,de,J;J={};function Be(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function qe(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Je(e,r){if(typeof e.ref=="string"&&j.current&&r&&j.current.stateNode!==r){var t=E(j.current.type);J[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(j.current.type),e.ref),J[t]=!0)}}function Ge(e,r){{var t=function(){ve||(ve=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ze(e,r){{var t=function(){de||(de=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ke=function(e,r,t,n,o,u,i){var a={$$typeof:S,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function He(e,r,t,n,o){{var u,i={},a=null,v=null;t!==void 0&&(ce(t),a=""+t),qe(r)&&(ce(r.key),a=""+r.key),Be(r)&&(v=r.ref,Je(r,o));for(u in r)L.call(r,u)&&!Ue.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||v){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ge(i,f),v&&ze(i,f)}return Ke(e,a,v,o,n,j.current,i)}}var G=O.ReactCurrentOwner,pe=O.ReactDebugCurrentFrame;function C(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}var z;z=!1;function K(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function ge(){{if(G.current){var e=E(G.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function Xe(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var Ee={};function Ze(e){{var r=ge();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function be(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Ze(r);if(Ee[t])return;Ee[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),C(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),C(null)}}function Re(e,r){{if(typeof e!="object")return;if(q(e))for(var t=0;t<e.length;t++){var n=e[t];K(n)&&be(n,r)}else if(K(e))e._store&&(e._store.validated=!0);else if(e){var o=Ce(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)K(i.value)&&be(i.value,r)}}}function Qe(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===g))t=r.propTypes;else return;if(t){var n=E(r);Le(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var o=E(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function er(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){C(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),C(null);break}}e.ref!==null&&(C(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}}function he(e,r,t,n,o,u){{var i=De(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var v=Xe(o);v?a+=v:a+=ge();var s;e===null?s="null":q(e)?s="array":e!==void 0&&e.$$typeof===S?(s="<"+(E(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=He(e,r,t,o,u);if(f==null)return f;if(i){var p=r.children;if(p!==void 0)if(n)if(q(p)){for(var P=0;P<p.length;P++)Re(p[P],e);Object.freeze&&Object.freeze(p)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Re(p,e)}return e===m?er(f):Qe(f),f}}function rr(e,r,t){return he(e,r,t,!0)}function tr(e,r,t){return he(e,r,t,!1)}var nr=tr,ar=rr;D.Fragment=m,D.jsx=nr,D.jsxs=ar}()),D}(function(R){process.env.NODE_ENV==="production"?R.exports=or():R.exports=ur()})(ir);
|
package/dist/oidc.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("./jsx-runtime-1b33e5e6.cjs"),R=require("react"),Te=require("./useLocalStorageState-f72b4add.cjs");var M=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var n=Function.bind.apply(t,i);return new n}return t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),s}function Ue(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var W={},Pe={get exports(){return W},set exports(e){W=e}};const Ae={},Oe=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"})),qe=Ie(Oe);(function(e,t){(function(s,r){e.exports=r()})(M,function(){var s=s||function(r,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof M<"u"&&M.crypto&&(n=M.crypto),!n&&typeof Ue=="function")try{n=qe}catch{}var o=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function a(){}return function(d){var p;return a.prototype=d,p=new a,a.prototype=null,p}}(),l={},h=l.lib={},g=h.Base=function(){return{extend:function(a){var d=c(this);return a&&d.mixIn(a),(!d.hasOwnProperty("init")||this.init===d.init)&&(d.init=function(){d.$super.init.apply(this,arguments)}),d.init.prototype=d,d.$super=this,d},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var d in a)a.hasOwnProperty(d)&&(this[d]=a[d]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=h.WordArray=g.extend({init:function(a,d){a=this.words=a||[],d!=i?this.sigBytes=d:this.sigBytes=a.length*4},toString:function(a){return(a||w).stringify(this)},concat:function(a){var d=this.words,p=a.words,v=this.sigBytes,b=a.sigBytes;if(this.clamp(),v%4)for(var E=0;E<b;E++){var x=p[E>>>2]>>>24-E%4*8&255;d[v+E>>>2]|=x<<24-(v+E)%4*8}else for(var C=0;C<b;C+=4)d[v+C>>>2]=p[C>>>2];return this.sigBytes+=b,this},clamp:function(){var a=this.words,d=this.sigBytes;a[d>>>2]&=4294967295<<32-d%4*8,a.length=r.ceil(d/4)},clone:function(){var a=g.clone.call(this);return a.words=this.words.slice(0),a},random:function(a){for(var d=[],p=0;p<a;p+=4)d.push(o());return new u.init(d,a)}}),S=l.enc={},w=S.Hex={stringify:function(a){for(var d=a.words,p=a.sigBytes,v=[],b=0;b<p;b++){var E=d[b>>>2]>>>24-b%4*8&255;v.push((E>>>4).toString(16)),v.push((E&15).toString(16))}return v.join("")},parse:function(a){for(var d=a.length,p=[],v=0;v<d;v+=2)p[v>>>3]|=parseInt(a.substr(v,2),16)<<24-v%8*4;return new u.init(p,d/2)}},k=S.Latin1={stringify:function(a){for(var d=a.words,p=a.sigBytes,v=[],b=0;b<p;b++){var E=d[b>>>2]>>>24-b%4*8&255;v.push(String.fromCharCode(E))}return v.join("")},parse:function(a){for(var d=a.length,p=[],v=0;v<d;v++)p[v>>>2]|=(a.charCodeAt(v)&255)<<24-v%4*8;return new u.init(p,d)}},_=S.Utf8={stringify:function(a){try{return decodeURIComponent(escape(k.stringify(a)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(a){return k.parse(unescape(encodeURIComponent(a)))}},m=h.BufferedBlockAlgorithm=g.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(a){typeof a=="string"&&(a=_.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(a){var d,p=this._data,v=p.words,b=p.sigBytes,E=this.blockSize,x=E*4,C=b/x;a?C=r.ceil(C):C=r.max((C|0)-this._minBufferSize,0);var O=C*E,T=r.min(O*4,b);if(O){for(var j=0;j<O;j+=E)this._doProcessBlock(v,j);d=v.splice(0,O),p.sigBytes-=T}return new u.init(d,T)},clone:function(){var a=g.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0});h.Hasher=m.extend({cfg:g.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var d=this._doFinalize();return d},blockSize:16,_createHelper:function(a){return function(d,p){return new a.init(p).finalize(d)}},_createHmacHelper:function(a){return function(d,p){return new y.HMAC.init(a,p).finalize(d)}}});var y=l.algo={};return l}(Math);return s})})(Pe);var X={},Ne={get exports(){return X},set exports(e){X=e}};(function(e,t){(function(s,r){e.exports=r(W)})(M,function(s){return function(r){var i=s,n=i.lib,o=n.WordArray,c=n.Hasher,l=i.algo,h=[],g=[];(function(){function w(y){for(var a=r.sqrt(y),d=2;d<=a;d++)if(!(y%d))return!1;return!0}function k(y){return(y-(y|0))*4294967296|0}for(var _=2,m=0;m<64;)w(_)&&(m<8&&(h[m]=k(r.pow(_,1/2))),g[m]=k(r.pow(_,1/3)),m++),_++})();var u=[],S=l.SHA256=c.extend({_doReset:function(){this._hash=new o.init(h.slice(0))},_doProcessBlock:function(w,k){for(var _=this._hash.words,m=_[0],y=_[1],a=_[2],d=_[3],p=_[4],v=_[5],b=_[6],E=_[7],x=0;x<64;x++){if(x<16)u[x]=w[k+x]|0;else{var C=u[x-15],O=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,T=u[x-2],j=(T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10;u[x]=O+u[x-7]+j+u[x-16]}var B=p&v^~p&b,V=m&y^m&a^y&a,G=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),Q=(p<<26|p>>>6)^(p<<21|p>>>11)^(p<<7|p>>>25),F=E+Q+B+g[x]+u[x],Re=G+V;E=b,b=v,v=p,p=d+F|0,d=a,a=y,y=m,m=F+Re|0}_[0]=_[0]+m|0,_[1]=_[1]+y|0,_[2]=_[2]+a|0,_[3]=_[3]+d|0,_[4]=_[4]+p|0,_[5]=_[5]+v|0,_[6]=_[6]+b|0,_[7]=_[7]+E|0},_doFinalize:function(){var w=this._data,k=w.words,_=this._nDataBytes*8,m=w.sigBytes*8;return k[m>>>5]|=128<<24-m%32,k[(m+64>>>9<<4)+14]=r.floor(_/4294967296),k[(m+64>>>9<<4)+15]=_,w.sigBytes=k.length*4,this._process(),this._hash},clone:function(){var w=c.clone.call(this);return w._hash=this._hash.clone(),w}});i.SHA256=c._createHelper(S),i.HmacSHA256=c._createHmacHelper(S)}(Math),s.SHA256})})(Ne);var z={},je={get exports(){return z},set exports(e){z=e}};(function(e,t){(function(s,r){e.exports=r(W)})(M,function(s){return function(){var r=s,i=r.lib,n=i.WordArray,o=r.enc;o.Base64={stringify:function(l){var h=l.words,g=l.sigBytes,u=this._map;l.clamp();for(var S=[],w=0;w<g;w+=3)for(var k=h[w>>>2]>>>24-w%4*8&255,_=h[w+1>>>2]>>>24-(w+1)%4*8&255,m=h[w+2>>>2]>>>24-(w+2)%4*8&255,y=k<<16|_<<8|m,a=0;a<4&&w+a*.75<g;a++)S.push(u.charAt(y>>>6*(3-a)&63));var d=u.charAt(64);if(d)for(;S.length%4;)S.push(d);return S.join("")},parse:function(l){var h=l.length,g=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var S=0;S<g.length;S++)u[g.charCodeAt(S)]=S}var w=g.charAt(64);if(w){var k=l.indexOf(w);k!==-1&&(h=k)}return c(l,h,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(l,h,g){for(var u=[],S=0,w=0;w<h;w++)if(w%4){var k=g[l.charCodeAt(w-1)]<<w%4*2,_=g[l.charCodeAt(w)]>>>6-w%4*2,m=k|_;u[S>>>2]|=m<<24-S%4*8,S++}return n.create(u,S)}}(),s.enc.Base64})})(je);var Y={},Me={get exports(){return Y},set exports(e){Y=e}};(function(e,t){(function(s,r){e.exports=r(W)})(M,function(s){return s.enc.Utf8})})(Me);function Z(e){this.message=e}Z.prototype=new Error,Z.prototype.name="InvalidCharacterError";var le=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Z("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,r,i=0,n=0,o="";r=t.charAt(n++);~r&&(s=i%4?64*s+r:r,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function He(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(s){return decodeURIComponent(le(s).replace(/(.)/g,function(r,i){var n=i.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch{return le(t)}}function D(e){this.message=e}function We(e,t){if(typeof e!="string")throw new D("Invalid token specified");var s=(t=t||{}).header===!0?0:1;try{return JSON.parse(He(e.split(".")[s]))}catch(r){throw new D("Invalid token specified: "+r.message)}}D.prototype=new Error,D.prototype.name="InvalidTokenError";var Be={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},U,P;exports.Log=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(exports.Log||{});(e=>{function t(){U=3,P=Be}e.reset=t;function s(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");U=i}e.setLevel=s;function r(i){P=i}e.setLogger=r})(exports.Log||(exports.Log={}));var f=class{constructor(e){this._name=e}debug(...e){U>=4&&P.debug(f._format(this._name,this._method),...e)}info(...e){U>=3&&P.info(f._format(this._name,this._method),...e)}warn(...e){U>=2&&P.warn(f._format(this._name,this._method),...e)}error(...e){U>=1&&P.error(f._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const s=new f(`${e}.${t}`);return s.debug("begin"),s}static _format(e,t){const s=`[${e}]`;return t?`${s} ${t}:`:s}static debug(e,...t){U>=4&&P.debug(f._format(e),...t)}static info(e,...t){U>=3&&P.info(f._format(e),...t)}static warn(e,...t){U>=2&&P.warn(f._format(e),...t)}static error(e,...t){U>=1&&P.error(f._format(e),...t)}};exports.Log.reset();var Le="10000000-1000-4000-8000-100000000000",A=class{static _randomWord(){return W.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return Le.replace(/[018]/g,t=>(+t^A._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return A.generateUUIDv4()+A.generateUUIDv4()+A.generateUUIDv4()}static generateCodeChallenge(e){try{const t=X(e);return z.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw f.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const s=Y.parse([e,t].join(":"));return z.stringify(s)}},q=class{constructor(e){this._name=e,this._logger=new f(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},ee=class{static decode(e){try{return We(e)}catch(t){throw f.error("JwtUtils.decode",t),t}}},de=class{static center({...e}){var t,s,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(s=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,s])=>`${t}=${typeof s!="boolean"?s:s?"yes":"no"}`).join(",")}},I=class extends q{constructor(){super(...arguments),this._logger=new f(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-I.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=I.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const s=I.getEpochTime()+e;if(this.expiration===s&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=s;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},te=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,window.location.origin)[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},N=class extends Error{constructor(e,t){var s,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw f.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(s=e.error_description)!=null?s:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null}},J=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},ge=class{constructor(e){this._logger=new f("AccessTokenEvents"),this._expiringTimer=new I("Access token expiring"),this._expiredTimer=new I("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const s=e.expires_in;if(t.debug("access token present, remaining duration:",s),s>0){let i=s-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=s+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},_e=class{constructor(e,t,s,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new f("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=o=>{o.origin===this._frame_origin&&o.source===this._frame.contentWindow&&(o.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):o.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(o.data+" message from check session op iframe"))};const n=new URL(s);this._frame_origin=n.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=n.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},ie=class{constructor(){this._logger=new f("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},ne=class{constructor(e=[],t=null){this._jwtHandler=t,this._logger=new f("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:s,...r}=t;if(!s)return await fetch(e,r);const i=new AbortController,n=setTimeout(()=>i.abort(),s*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(o){throw o instanceof DOMException&&o.name==="AbortError"?new J("Network timed out"):o}finally{clearTimeout(n)}}async getJson(e,{token:t,credentials:s}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t);let n;try{r.debug("url:",e),n=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:s})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",n.status);const o=n.headers.get("Content-Type");if(o&&!this._contentTypes.find(l=>o.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${o??"undefined"}, from URL: ${e}`)),n.ok&&this._jwtHandler&&(o!=null&&o.startsWith("application/jwt")))return await this._jwtHandler(await n.text());let c;try{c=await n.json()}catch(l){throw r.error("Error parsing JSON response",l),n.ok?l:new Error(`${n.statusText} (${n.status})`)}if(!n.ok)throw r.error("Error from server:",c),c.error?new N(c):new Error(`${n.statusText} (${n.status}): ${JSON.stringify(c)}`);return c}async postForm(e,{body:t,basicAuth:s,timeoutInSeconds:r,initCredentials:i}){const n=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};s!==void 0&&(o.Authorization="Basic "+s);let c;try{n.debug("url:",e),c=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:r,credentials:i})}catch(u){throw n.error("Network error"),u}n.debug("HTTP response received, status",c.status);const l=c.headers.get("Content-Type");if(l&&!this._contentTypes.find(u=>l.startsWith(u)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const h=await c.text();let g={};if(h)try{g=JSON.parse(h)}catch(u){throw n.error("Error parsing JSON response",u),c.ok?u:new Error(`${c.statusText} (${c.status})`)}if(!c.ok)throw n.error("Error from server:",g),g.error?new N(g,t):new Error(`${c.statusText} (${c.status}): ${JSON.stringify(g)}`);return g}},pe=class{constructor(e){this._settings=e,this._logger=new f("MetadataService"),this._jsonService=new ne(["application/jwk-set+json"]),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const s=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(s.debug("resolved"),r[e]===void 0){if(t===!0){s.warn("Metadata does not contain optional property");return}s.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const s=await this._jsonService.getJson(t);if(e.debug("got key set",s),!Array.isArray(s.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=s.keys,this._signingKeys}},oe=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new f("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let s=0;s<e;s++){const r=await this._store.key(s);r&&r.indexOf(this._prefix)===0&&t.push(r.substr(this._prefix.length))}return t}},Fe="code",$e="openid",ze="client_secret_post",De="query",Je=60*15,Ke=60*5,ae=class{constructor({authority:e,metadataUrl:t,metadata:s,signingKeys:r,metadataSeed:i,client_id:n,client_secret:o,response_type:c=Fe,scope:l=$e,redirect_uri:h,post_logout_redirect_uri:g,client_authentication:u=ze,prompt:S,display:w,max_age:k,ui_locales:_,acr_values:m,resource:y,response_mode:a=De,filterProtocolClaims:d=!0,loadUserInfo:p=!1,staleStateAgeInSeconds:v=Je,clockSkewInSeconds:b=Ke,userInfoJwtIssuer:E="OP",mergeClaims:x=!1,disablePKCE:C=!1,stateStore:O,refreshTokenCredentials:T,revokeTokenAdditionalContentTypes:j,fetchRequestCredentials:B,refreshTokenAllowedScope:V,extraQueryParams:G={},extraTokenParams:Q={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=s,this.metadataSeed=i,this.signingKeys=r,this.client_id=n,this.client_secret=o,this.response_type=c,this.scope=l,this.redirect_uri=h,this.post_logout_redirect_uri=g,this.client_authentication=u,this.prompt=S,this.display=w,this.max_age=k,this.ui_locales=_,this.acr_values=m,this.resource=y,this.response_mode=a,this.filterProtocolClaims=d??!0,this.loadUserInfo=!!p,this.staleStateAgeInSeconds=v,this.clockSkewInSeconds=b,this.userInfoJwtIssuer=E,this.mergeClaims=!!x,this.disablePKCE=!!C,this.revokeTokenAdditionalContentTypes=j,B&&T&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=B||T||"same-origin",O)this.stateStore=O;else{const F=typeof window<"u"?window.localStorage:new ie;this.stateStore=new oe({store:F})}this.refreshTokenAllowedScope=V,this.extraQueryParams=G,this.extraTokenParams=Q}},Ve=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new f("UserInfoService"),this._getClaimsFromJwt=async s=>{const r=this._logger.create("_getClaimsFromJwt");try{const i=ee.decode(s);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new ne(void 0,this._getClaimsFromJwt)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const s=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",s);const r=await this._jsonService.getJson(s,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},fe=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new f("TokenClient"),this._jsonService=new ne(this._settings.revokeTokenAdditionalContentTypes)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:s=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const n=this._logger.create("exchangeCode");s||n.throw(new Error("A client_id is required")),t||n.throw(new Error("A redirect_uri is required")),i.code||n.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[g,u]of Object.entries(i))u!=null&&o.set(g,u);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw n.throw(new Error("A client_secret is required")),null;c=A.generateBasicAuth(s,r);break;case"client_secret_post":o.append("client_id",s),r&&o.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);n.debug("got token endpoint");const h=await this._jsonService.postForm(l,{body:o,basicAuth:c,initCredentials:this._settings.fetchRequestCredentials});return n.debug("got response"),h}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:s=this._settings.client_secret,scope:r=this._settings.scope,...i}){const n=this._logger.create("exchangeCredentials");t||n.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:r});for(const[g,u]of Object.entries(i))u!=null&&o.set(g,u);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!s)throw n.throw(new Error("A client_secret is required")),null;c=A.generateBasicAuth(t,s);break;case"client_secret_post":o.append("client_id",t),s&&o.append("client_secret",s);break}const l=await this._metadataService.getTokenEndpoint(!1);n.debug("got token endpoint");const h=await this._jsonService.postForm(l,{body:o,basicAuth:c,initCredentials:this._settings.fetchRequestCredentials});return n.debug("got response"),h}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:s=this._settings.client_secret,timeoutInSeconds:r,...i}){const n=this._logger.create("exchangeRefreshToken");t||n.throw(new Error("A client_id is required")),i.refresh_token||n.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[g,u]of Object.entries(i))u!=null&&o.set(g,u);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!s)throw n.throw(new Error("A client_secret is required")),null;c=A.generateBasicAuth(t,s);break;case"client_secret_post":o.append("client_id",t),s&&o.append("client_secret",s);break}const l=await this._metadataService.getTokenEndpoint(!1);n.debug("got token endpoint");const h=await this._jsonService.postForm(l,{body:o,basicAuth:c,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return n.debug("got response"),h}async revoke(e){var t;const s=this._logger.create("revoke");e.token||s.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);s.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[n,o]of Object.entries(e))o!=null&&i.set(n,o);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),s.debug("got response")}},Ge=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],Qe=["sub","iss","aud","exp","iat"],Xe=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new f("ResponseValidator"),this._userInfoService=new Ve(this._settings,this._metadataService),this._tokenClient=new fe(this._settings,this._metadataService)}async validateSigninResponse(e,t){const s=this._logger.create("validateSigninResponse");this._processSigninState(e,t),s.debug("state processed"),await this._processCode(e,t),s.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),s.debug("tokens validated"),await this._processClaims(e,t==null?void 0:t.skipUserInfo,e.isOpenId),s.debug("claims processed")}async validateCredentialsResponse(e,t){const s=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),s.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),s.debug("claims processed")}async validateRefreshResponse(e,t){var s,r;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(s=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const n=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,n),i.debug("claims processed")}validateSignoutResponse(e,t){const s=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&s.throw(new Error("State does not match")),s.debug("state validated"),e.userState=t.data,e.error)throw s.warn("Response was error",e.error),new N(e)}_processSigninState(e,t){var s;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,(s=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new N(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,s=!0){const r=this._logger.create("_processClaims");if(e.profile=this._filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),s&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._mergeClaims(e.profile,this._filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}_mergeClaims(e,t){const s={...e};for(const[r,i]of Object.entries(t))for(const n of Array.isArray(i)?i:[i]){const o=s[r];o?Array.isArray(o)?o.includes(n)||o.push(n):s[r]!==n&&(typeof n=="object"&&this._settings.mergeClaims?s[r]=this._mergeClaims(o,n):s[r]=[o,n]):s[r]=n}return s}_filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let s;Array.isArray(this._settings.filterProtocolClaims)?s=this._settings.filterProtocolClaims:s=Ge;for(const r of s)Qe.includes(r)||delete t[r]}return t}async _processCode(e,t){const s=this._logger.create("_processCode");if(e.code){s.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else s.debug("No code to process")}_validateIdTokenAttributes(e,t){var s;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=ee.decode((s=e.id_token)!=null?s:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const n=ee.decode(t);n.sub!==i.sub&&r.throw(new Error("sub in id_token does not match current sub")),n.auth_time&&n.auth_time!==i.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),n.azp&&n.azp!==i.azp&&r.throw(new Error("azp in id_token does not match original azp")),!n.azp&&i.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},H=class{constructor(e){this.id=e.id||A.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=I.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new f("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return f.createStatic("State","fromStorageString"),new H(JSON.parse(e))}static async clearStaleState(e,t){const s=f.createStatic("State","clearStaleState"),r=I.getEpochTime()-t,i=await e.getAllKeys();s.debug("got keys",i);for(let n=0;n<i.length;n++){const o=i[n],c=await e.get(o);let l=!1;if(c)try{const h=H.fromStorageString(c);s.debug("got item from key:",o,h.created),h.created<=r&&(l=!0)}catch(h){s.error("Error parsing state for key:",o,h),l=!0}else s.debug("no item in storage for key:",o),l=!0;l&&(s.debug("removed item for key:",o),e.remove(o))}}},K=class extends H{constructor(e){super(e),e.code_verifier===!0?this.code_verifier=A.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=A.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new f("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){f.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new K(t)}},Ye=class{constructor({url:e,authority:t,client_id:s,redirect_uri:r,response_type:i,scope:n,state_data:o,response_mode:c,request_type:l,client_secret:h,nonce:g,resource:u,skipUserInfo:S,extraQueryParams:w,extraTokenParams:k,disablePKCE:_,...m}){if(this._logger=new f("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!s)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!n)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new K({data:o,request_type:l,code_verifier:!_,client_id:s,authority:t,redirect_uri:r,response_mode:c,client_secret:h,scope:n,extraTokenParams:k,skipUserInfo:S});const y=new URL(e);y.searchParams.append("client_id",s),y.searchParams.append("redirect_uri",r),y.searchParams.append("response_type",i),y.searchParams.append("scope",n),g&&y.searchParams.append("nonce",g),y.searchParams.append("state",this.state.id),this.state.code_challenge&&(y.searchParams.append("code_challenge",this.state.code_challenge),y.searchParams.append("code_challenge_method","S256")),u&&(Array.isArray(u)?u:[u]).forEach(d=>y.searchParams.append("resource",d));for(const[a,d]of Object.entries({response_mode:c,...m,...w}))d!=null&&y.searchParams.append(a,d.toString());this.url=y.href}},Ze="openid",$=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-I.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+I.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(Ze))||!!this.id_token}},et=class{constructor({url:e,state_data:t,id_token_hint:s,post_logout_redirect_uri:r,extraQueryParams:i,request_type:n}){if(this._logger=new f("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);s&&o.searchParams.append("id_token_hint",s),r&&(o.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new H({data:t,request_type:n}),o.searchParams.append("state",this.state.id)));for(const[c,l]of Object.entries({...i}))l!=null&&o.searchParams.append(c,l.toString());this.url=o.href}},we=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},ve=class{constructor(e){this._logger=new f("OidcClient"),this.settings=new ae(e),this.metadataService=new pe(this.settings),this._validator=new Xe(this.settings,this.metadataService),this._tokenClient=new fe(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:s,request_type:r,id_token_hint:i,login_hint:n,skipUserInfo:o,nonce:c,response_type:l=this.settings.response_type,scope:h=this.settings.scope,redirect_uri:g=this.settings.redirect_uri,prompt:u=this.settings.prompt,display:S=this.settings.display,max_age:w=this.settings.max_age,ui_locales:k=this.settings.ui_locales,acr_values:_=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:a=this.settings.extraQueryParams,extraTokenParams:d=this.settings.extraTokenParams}){const p=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const v=await this.metadataService.getAuthorizationEndpoint();p.debug("Received authorization endpoint",v);const b=new Ye({url:v,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:g,response_type:l,scope:h,state_data:e,prompt:u,display:S,max_age:w,ui_locales:k,id_token_hint:i,login_hint:n,acr_values:_,resource:m,request:t,request_uri:s,extraQueryParams:a,extraTokenParams:d,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:c,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const E=b.state;return await this.settings.stateStore.set(E.id,E.toStorageString()),b}async readSigninResponseState(e,t=!1){const s=this._logger.create("readSigninResponseState"),r=new $(te.readParams(e,this.settings.response_mode));if(!r.state)throw s.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw s.throw(new Error("No matching state found in storage")),null;return{state:K.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:s,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,s),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:s=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),n=new $(new URLSearchParams);return Object.assign(n,i),await this._validator.validateCredentialsResponse(n,s),n}async useRefreshToken({state:e,timeoutInSeconds:t}){var s;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=e.scope;else{const c=this.settings.refreshTokenAllowedScope.split(" ");i=(((s=e.scope)==null?void 0:s.split(" "))||[]).filter(h=>c.includes(h)).join(" ")}const n=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new $(new URLSearchParams);return Object.assign(o,n),r.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:s,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const n=this._logger.create("createSignoutRequest"),o=await this.metadataService.getEndSessionEndpoint();if(!o)throw n.throw(new Error("No end session endpoint")),null;n.debug("Received end session endpoint",o);const c=new et({url:o,id_token_hint:t,post_logout_redirect_uri:r,state_data:e,extraQueryParams:i,request_type:s});await this.clearStaleState();const l=c.state;return l&&(n.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),c}async readSignoutResponseState(e,t=!1){const s=this._logger.create("readSignoutResponseState"),r=new we(te.readParams(e,this.settings.response_mode));if(!r.state){if(s.debug("No state in response"),r.error)throw s.warn("Response was error:",r.error),new N(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw s.throw(new Error("No matching state found in storage")),null;return{state:H.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:s,response:r}=await this.readSignoutResponseState(e,!0);return s?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,s)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),H.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},me=class{constructor(e){this._userManager=e,this._logger=new f("SessionMonitor"),this._start=async t=>{const s=t.session_state;if(!s)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",s,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",s,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(s);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const n=this._userManager.settings.client_id,o=this._userManager.settings.checkSessionIntervalInSeconds,c=this._userManager.settings.stopCheckSessionOnError,l=new _e(this._callback,n,i,o,c);await l.load(),this._checkSessionIFrame=l,l.start(s)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const s=setInterval(async()=>{clearInterval(s);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const s=await this._userManager.querySessionStatus();let r=!0;s&&this._checkSessionIFrame?s.sub===this._sub?(r=!1,this._checkSessionIFrame.start(s.session_state),s.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",s.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",s.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",s.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(s){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",s),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const s={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(s)}}}},L=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-I.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+I.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new f("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return f.createStatic("User","fromStorageString"),new L(JSON.parse(e))}},he="oidc-client",Se=class{constructor(){this._abort=new q("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:s,keepOpen:r}=await new Promise((i,n)=>{const o=c=>{var l;const h=c.data,g=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(c.origin!==g||(h==null?void 0:h.source)!==he)){try{const u=te.readParams(h.url,e.response_mode).get("state");if(u||t.warn("no state found in response url"),c.source!==this._window&&u!==e.state)return}catch{this._dispose(),n(new Error("Invalid response from window"))}i(h)}};window.addEventListener("message",o,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",o,!1)),this._disposeHandlers.add(this._abort.addHandler(c=>{this._dispose(),n(c)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:s}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,s=!1,r=window.location.origin){e.postMessage({source:he,url:t,keepOpen:s},r)}},ye={location:!1,toolbar:!1,height:640},be="_blank",tt=60,st=2,ke=10,Ee=class extends ae{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:s=e.post_logout_redirect_uri,popupWindowFeatures:r=ye,popupWindowTarget:i=be,redirectMethod:n="assign",redirectTarget:o="self",iframeNotifyParentOrigin:c=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:h=e.redirect_uri,silentRequestTimeoutInSeconds:g=ke,automaticSilentRenew:u=!0,validateSubOnSilentRenew:S=!0,includeIdTokenInSilentRenew:w=!1,monitorSession:k=!1,monitorAnonymousSession:_=!1,checkSessionIntervalInSeconds:m=st,query_status_response_type:y="code",stopCheckSessionOnError:a=!0,revokeTokenTypes:d=["access_token","refresh_token"],revokeTokensOnSignout:p=!1,includeIdTokenInSilentSignout:v=!1,accessTokenExpiringNotificationTimeInSeconds:b=tt,userStore:E}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=s,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=n,this.redirectTarget=o,this.iframeNotifyParentOrigin=c,this.iframeScriptOrigin=l,this.silent_redirect_uri=h,this.silentRequestTimeoutInSeconds=g,this.automaticSilentRenew=u,this.validateSubOnSilentRenew=S,this.includeIdTokenInSilentRenew=w,this.monitorSession=k,this.monitorAnonymousSession=_,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=a,this.query_status_response_type=y,this.revokeTokenTypes=d,this.revokeTokensOnSignout=p,this.includeIdTokenInSilentSignout=v,this.accessTokenExpiringNotificationTimeInSeconds=b,E)this.userStore=E;else{const x=typeof window<"u"?window.sessionStorage:new ie;this.userStore=new oe({store:x})}}},se=class extends Se{constructor({silentRequestTimeoutInSeconds:e=ke}){super(),this._logger=new f("IFrameWindow"),this._timeoutInSeconds=e,this._frame=se.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new J("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var s;const r=t.target;(s=r.parentNode)==null||s.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},rt=class{constructor(e){this._settings=e,this._logger=new f("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new se({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),se.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},it=500,ue=class extends Se{constructor({popupWindowTarget:e=be,popupWindowFeatures:t={}}){super(),this._logger=new f("PopupWindow");const s=de.center({...ye,...t});this._window=window.open(void 0,e,de.serialize(s))}async navigate(e){var t;(t=this._window)==null||t.focus();const s=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},it);return this._disposeHandlers.add(()=>clearInterval(s)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},nt=class{constructor(e){this._settings=e,this._logger=new f("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new ue({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),ue.notifyOpener(e,t)}},ot=class{constructor(e){this._settings=e,this._logger=new f("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var s;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(s=window.top)!=null?s:window.self);const i=r.location[e].bind(r.location);let n;return{navigate:async o=>{this._logger.create("navigate");const c=new Promise((l,h)=>{n=h});return i(o.url),await c},close:()=>{this._logger.create("close"),n==null||n(new Error("Redirect aborted")),r.stop()}}}},at=class extends ge{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new f("UserManagerEvents"),this._userLoaded=new q("User loaded"),this._userUnloaded=new q("User unloaded"),this._silentRenewError=new q("Silent renew error"),this._userSignedIn=new q("User signed in"),this._userSignedOut=new q("User signed out"),this._userSessionChanged=new q("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},ct=class{constructor(e){this._userManager=e,this._logger=new f("SilentRenewService"),this._isStarted=!1,this._retryTimer=new I("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(s){if(s instanceof J){t.warn("ErrorTimeout from signinSilent:",s,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",s),this._userManager.events._raiseSilentRenewError(s)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},lt=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},dt=class{constructor(e){this._logger=new f("UserManager"),this.settings=new Ee(e),this._client=new ve(e),this._redirectNavigator=new ot(this.settings),this._popupNavigator=new nt(this.settings),this._iframeNavigator=new rt(this.settings),this._events=new at(this.settings),this._silentRenewService=new ct(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new me(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...s}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...s},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),s=await this._signinEnd(e);return s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject"),s}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:s=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:s,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const n=await this._buildUser(i);return n.profile&&n.profile.sub?r.info("success, signed in subject",n.profile.sub):r.info("no subject"),n}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:s,popupWindowTarget:r,...i}=e,n=this.settings.popup_redirect_uri;n||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:s,popupWindowTarget:r}),c=await this._signin({request_type:"si:p",redirect_uri:n,display:"popup",...i},o);return c&&(c.profile&&c.profile.sub?t.info("success, signed in subject",c.profile.sub):t.info("no subject")),c}async signinPopupCallback(e=window.location.href,t=!1){const s=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),s.info("success")}async signinSilent(e={}){var t;const s=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=e;let n=await this._loadUser();if(n!=null&&n.refresh_token){s.debug("using refresh token");const h=new lt(n);return await this._useRefreshToken(h)}const o=this.settings.silent_redirect_uri;o||s.throw(new Error("No silent_redirect_uri configured"));let c;n&&this.settings.validateSubOnSilentRenew&&(s.debug("subject prior to silent renew:",n.profile.sub),c=n.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return n=await this._signin({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?n==null?void 0:n.id_token:void 0,...i},l,c),n&&((t=n.profile)!=null&&t.sub?s.info("success, signed in subject",n.profile.sub):s.info("no subject")),n}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),s=new L({...e,...t});return await this.storeUser(s),this._events.load(s),s}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:s}=await this._client.readSignoutResponseState(e);if(s)switch(s.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:s,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const n=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s}),c=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?n==null?void 0:n.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},o);try{const l=await this._client.processSigninResponse(c.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof N)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,s){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,s)}async _signinStart(e,t){const s=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return s.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw s.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const s=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return s.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const s=this._logger.create("_buildUser"),r=new L(e);if(t){if(t!==r.profile.sub)throw s.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new N({...e,error:"login_required"});s.debug("current user matches user returned from signin")}return await this.storeUser(r),s.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:s,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:s});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),s=await this._signoutEnd(e);return t.info("success"),s}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:s,popupWindowTarget:r,...i}=e,n=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:s,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:n,state:n==null?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const s=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),s.info("success")}async _signout(e,t){const s=await this._signoutStart(e,t);return await this._signoutEnd(s.url)}async _signoutStart(e={},t){var s;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const n=e.id_token_hint||i&&i.id_token;n&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=n),await this.removeUser(),r.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:o.url,state:(s=o.state)==null?void 0:s.id})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),s=await this._client.processSignoutResponse(e);return t.debug("got signout response"),s}async signoutSilent(e={}){var t;const s=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,n=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:n,...i},c),s.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const s=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(i=>typeof e[i]=="string");if(!r.length){s.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(e[i],i),s.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),s.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),L.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const s=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,s)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},ht="2.2.2",ut=ht;const xe=R.createContext(null),Ce=()=>{const e=R.useContext(xe);if(!e)throw new Error("useImpersonationContext must be used within a ImpersonationContextProvider");return e},gt=({children:e})=>{const[t,s]=Te.useLocalStorageState("impersonationState",{defaultValue:{}}),r=R.useMemo(()=>({accessToken:t==null?void 0:t.accessToken,userInfo:t==null?void 0:t.userInfo,setImpersonation:(i,n)=>{s({accessToken:i,userInfo:n})}}),[]);return re.jsxRuntimeExports.jsx(xe.Provider,{value:r,children:e})},_t=e=>{const s=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(s);return JSON.parse(r)},pt=e=>{const{setImpersonation:t}=Ce();R.useEffect(()=>{const{search:s}=window.location,r=new URLSearchParams(s).get("impersonateAccessToken");if(r&&t){const i=_t(r);t(r,i),e()}},[])},ft=({userManager:e,context:t,children:s})=>{const[r,i]=R.useState({user:null,isLoading:!0,isAuthenticated:!1,isError:!1,error:null}),n=R.useRef(!1);R.useEffect(()=>{n.current||(n.current=!0,(async()=>{try{const h=await e.getUser();i({user:h,isLoading:!1,isAuthenticated:h?!h.expired:!1,isError:!1,error:null})}catch(h){i({user:null,isLoading:!1,isAuthenticated:!1,isError:!0,error:h instanceof Error?h:new Error("Unknown error during auth")})}})())},[e]),R.useEffect(()=>{const h=S=>{i({user:S,isLoading:!1,isAuthenticated:!S.expired,isError:!1,error:null})};e.events.addUserLoaded(h);const g=()=>{i({...r,user:null,isAuthenticated:!1})};e.events.addUserUnloaded(g);const u=S=>{i({...r,isLoading:!1,isError:!0,error:S})};return e.events.addSilentRenewError(u),()=>{e.events.removeUserLoaded(h),e.events.removeUserUnloaded(g),e.events.removeSilentRenewError(u)}},[e]);const o=R.useCallback(async()=>{const h=await e.signinCallback();return i({user:h??null,isLoading:!1,isAuthenticated:h?!h.expired:!1,isError:!1,error:null}),h??void 0},[e]),c=R.useCallback(async h=>{try{await e.signinRedirect(h)}catch(g){console.error(g)}},[e]),l=R.useMemo(()=>({state:r,handleSigninCallback:o,redirectToSignin:c}),[r,o,c]);return re.jsxRuntimeExports.jsx(t.Provider,{value:l,children:s})},ce=e=>{const t=R.useContext(e);if(!t)throw new Error("useAuthContext must be used within an AuthProvider");return t},wt=e=>{const{state:t}=ce(e);return t},vt=(e,t)=>{const{state:s,handleSigninCallback:r}=ce(e),i=R.useRef(!1);return R.useEffect(()=>{i.current||(i.current=!0,r().then(n=>new Promise(o=>setTimeout(()=>o(n),0))).then(n=>t==null?void 0:t(n)))},[r]),s},mt=e=>{const t=R.createContext(null);return{AuthContext:t,AuthProvider:({children:c})=>re.jsxRuntimeExports.jsx(ft,{userManager:e,context:t,children:c}),useAuthContext:()=>ce(t),useAuthState:()=>wt(t),useSigninCallback:c=>vt(t,c),getAccessToken:async()=>{const c=await e.getUser();return c?c.access_token:null}}};exports.AccessTokenEvents=ge;exports.CheckSessionIFrame=_e;exports.ErrorResponse=N;exports.ErrorTimeout=J;exports.ImpersonationContextProvider=gt;exports.InMemoryWebStorage=ie;exports.Logger=f;exports.MetadataService=pe;exports.OidcClient=ve;exports.OidcClientSettingsStore=ae;exports.SessionMonitor=me;exports.SigninResponse=$;exports.SigninState=K;exports.SignoutResponse=we;exports.State=H;exports.User=L;exports.UserManager=dt;exports.UserManagerSettingsStore=Ee;exports.Version=ut;exports.WebStorageStateStore=oe;exports.createAuthContext=mt;exports.useImpersonationCallback=pt;exports.useImpersonationContext=Ce;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("react"),s=new Map;function m(e,t){if(o.useSyncExternalStore===void 0)throw new TypeError('You are using React 17 or below. Install with "npm install use-local-storage-state@17".');const[c]=o.useState(t==null?void 0:t.defaultValue);if(typeof window>"u")return[c,()=>{},{isPersistent:!0,removeItem:()=>{}}];const a=t==null?void 0:t.serializer;return v(e,c,t==null?void 0:t.storageSync,a==null?void 0:a.parse,a==null?void 0:a.stringify)}function v(e,t,c=!0,a=w,i=JSON.stringify){if(!s.has(e)&&t!==void 0&&localStorage.getItem(e)===null)try{localStorage.setItem(e,i(t))}catch{}const l=o.useRef({item:null,parsed:t}),u=o.useSyncExternalStore(o.useCallback(r=>{const n=d=>{e===d&&r()};return g.add(n),()=>{g.delete(n)}},[e]),()=>{const r=localStorage.getItem(e);if(s.has(e))l.current={item:r,parsed:s.get(e)};else if(r!==l.current.item){let n;try{n=r===null?t:a(r)}catch{n=t}l.current={item:r,parsed:n}}return l.current.parsed},()=>t),f=o.useCallback(r=>{const n=r instanceof Function?r(l.current.parsed):r;try{localStorage.setItem(e,i(n)),s.delete(e)}catch{s.set(e,n)}S(e)},[e,i]);return o.useEffect(()=>{if(!c)return;const r=n=>{n.storageArea===localStorage&&n.key===e&&S(e)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},[e,c]),o.useMemo(()=>[u,f,{isPersistent:u===t||!s.has(e),removeItem(){s.delete(e),localStorage.removeItem(e),S(e)}}],[e,f,u,t])}const g=new Set;function S(e){for(const t of[...g])t(e)}function w(e){return e==="undefined"?void 0:JSON.parse(e)}exports.useLocalStorageState=m;
|