@mattilsynet/design 2.3.3 → 2.3.5
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/mtds/app/app.js +25 -16
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/dialog/dialog-observer.js +1 -1
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js +9 -8
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/index.iife.js +2 -2
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/toast/toast.js +5 -4
- package/mtds/toast/toast.js.map +1 -1
- package/package.json +1 -1
package/mtds/app/app.js
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import a from "clsx";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { Button as m } from "../button/button.js";
|
|
5
|
+
import s from "../styles.module.css.js";
|
|
6
6
|
import d from "./app-toggle.js";
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */ o(r || "div", { className: a(
|
|
9
|
-
}),
|
|
10
|
-
return /* @__PURE__ */ o(r || "div", { className: a(
|
|
11
|
-
}), b = Object.assign(
|
|
12
|
-
Header:
|
|
7
|
+
const u = n(function({ as: r, className: t, ...p }, e) {
|
|
8
|
+
return /* @__PURE__ */ o(r || "div", { className: a(s.app, t), ref: e, ...p });
|
|
9
|
+
}), f = n(function({ as: r, className: t, ...p }, e) {
|
|
10
|
+
return /* @__PURE__ */ o(r || "div", { className: a(s.sticky, t), ref: e, ...p });
|
|
11
|
+
}), b = Object.assign(u, {
|
|
12
|
+
Header: n(
|
|
13
13
|
function(r, t) {
|
|
14
14
|
return /* @__PURE__ */ o("header", { ref: t, ...r });
|
|
15
15
|
}
|
|
16
16
|
),
|
|
17
|
-
Sidebar:
|
|
17
|
+
Sidebar: n(
|
|
18
18
|
function(r, t) {
|
|
19
|
-
return /* @__PURE__ */ o(
|
|
19
|
+
return /* @__PURE__ */ o(
|
|
20
|
+
"dialog",
|
|
21
|
+
{
|
|
22
|
+
role: "navigation",
|
|
23
|
+
id: "mtds-sidebar",
|
|
24
|
+
suppressHydrationWarning: !0,
|
|
25
|
+
ref: t,
|
|
26
|
+
...r
|
|
27
|
+
}
|
|
28
|
+
);
|
|
20
29
|
}
|
|
21
30
|
),
|
|
22
|
-
Sticky:
|
|
23
|
-
Toggle:
|
|
31
|
+
Sticky: f,
|
|
32
|
+
Toggle: n(
|
|
24
33
|
function({ children: r, ...t }, p) {
|
|
25
34
|
return /* @__PURE__ */ o(
|
|
26
|
-
|
|
35
|
+
m,
|
|
27
36
|
{
|
|
28
37
|
command: "show-modal",
|
|
29
38
|
commandfor: "mtds-sidebar",
|
|
@@ -35,10 +44,10 @@ const f = i(function({ as: r, className: t, ...p }, e) {
|
|
|
35
44
|
);
|
|
36
45
|
}
|
|
37
46
|
),
|
|
38
|
-
Main:
|
|
47
|
+
Main: n(function(r, t) {
|
|
39
48
|
return /* @__PURE__ */ o("main", { ref: t, ...r });
|
|
40
49
|
}),
|
|
41
|
-
Footer:
|
|
50
|
+
Footer: n(
|
|
42
51
|
function(r, t) {
|
|
43
52
|
return /* @__PURE__ */ o("footer", { ref: t, ...r });
|
|
44
53
|
}
|
package/mtds/app/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn <dialog
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn (\n\t\t\t\t<dialog\n\t\t\t\t\trole=\"navigation\"\n\t\t\t\t\tid=\"mtds-sidebar\"\n\t\t\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t),\n\tSticky: AppSticky,\n\tToggle: forwardRef<HTMLButtonElement, ButtonProps<\"button\">>(\n\t\tfunction AppToggle({ children, ...rest }: ButtonProps<\"button\">, ref) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tcommand=\"show-modal\"\n\t\t\t\t\tcommandfor=\"mtds-sidebar\"\n\t\t\t\t\tdata-tooltip=\"Vis meny\"\n\t\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{children ?? \"Skjul meny\"}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t},\n\t),\n\tMain: forwardRef<HTMLElement, AppMainProps>(function AppMain(rest, ref) {\n\t\treturn <main ref={ref} {...rest} />;\n\t}),\n\tFooter: forwardRef<HTMLElement, AppFooterProps>(\n\t\tfunction AppFooter(rest, ref) {\n\t\t\treturn <footer ref={ref} {...rest} />;\n\t\t},\n\t),\n\t// Needed to avoid flash of unstyled content and still be Next.js hydration compatible\n\tScript: () => <script id=\"mtds-app-script\">{script}</script>,\n});\n"],"names":["AppComp","forwardRef","as","className","rest","ref","jsx","clsx","styles","AppSticky","App","children","Button","script"],"mappings":";;;;;;AAsBA,MAAMA,IAAUC,EAAiB,SAE/B,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,KAAKL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AACzE,CAAC,GAEKK,IAAYR,EAAiB,SAEjC,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,QAAQL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC5E,CAAC,GAEYM,IAAM,OAAO,OAAOV,GAAS;AAAA,EACzC,QAAQC;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA,EAED,SAASH;AAAA,IACR,SAAoBG,GAAMC,GAAK;AAC9B,aACC,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,MAAK;AAAA,UACL,IAAG;AAAA,UACH,0BAAwB;AAAA,UACxB,KAAAD;AAAA,UACC,GAAGD;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAAA,EAAA;AAAA,EAED,QAAQK;AAAA,EACR,QAAQR;AAAA,IACP,SAAmB,EAAE,UAAAU,GAAU,GAAGP,EAAA,GAA+BC,GAAK;AACrE,aACC,gBAAAC;AAAA,QAACM;AAAA,QAAA;AAAA,UACA,SAAQ;AAAA,UACR,YAAW;AAAA,UACX,gBAAa;AAAA,UACb,KAAAP;AAAA,UACC,GAAGD;AAAA,UAEH,UAAAO,KAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhB;AAAA,EAAA;AAAA,EAED,MAAMV,EAAsC,SAAiBG,GAAMC,GAAK;AACvE,WAAO,gBAAAC,EAAC,QAAA,EAAK,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,EAClC,CAAC;AAAA,EACD,QAAQH;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA;AAAA,EAGD,QAAQ,MAAM,gBAAAE,EAAC,UAAA,EAAO,IAAG,mBAAmB,UAAAO,EAAA,CAAO;AACpD,CAAC;"}
|
|
@@ -27,7 +27,7 @@ function g({ target: o }) {
|
|
|
27
27
|
}
|
|
28
28
|
const n = /* @__PURE__ */ new WeakSet();
|
|
29
29
|
function u() {
|
|
30
|
-
document.querySelectorAll("[data-command").forEach((o) => {
|
|
30
|
+
document.querySelectorAll("[data-command]").forEach((o) => {
|
|
31
31
|
if (n.has(o)) return;
|
|
32
32
|
const a = t(o, "data-command");
|
|
33
33
|
n.add(o), a === "row" ? e(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tdeprecate,\n\tisBrowser,\n\ton,\n\tonLoaded,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst CSS_DIALOG = styles.dialog.split(\" \")[0];\nconst DIALOGS = isBrowser()\n\t? (document.getElementsByClassName(\n\t\t\tCSS_DIALOG,\n\t\t) as HTMLCollectionOf<HTMLDialogElement>)\n\t: [];\n\nfunction handleDialogModal() {\n\tfor (const dialog of DIALOGS) {\n\t\tif (dialog.getAttribute(\"data-variant\") === \"drawer\")\n\t\t\tdeprecate(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tdialog,\n\t\t\t);\n\t\tif (dialog.isConnected && dialog.showModal && dialog.close) {\n\t\t\tconst closedby = attr(dialog, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(dialog, \"closedby\", closedby);\n\t\t\t\tdeprecate(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tdialog,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (dialog.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\tdeprecate(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t);\n\t\t\t\tattr(dialog, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tdialog.showModal();\n\t\t\t} else if (dialog.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(dialog, \"open\", \"\"); // Set as open\n\t\t\t\tdialog.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction handleDialogCloseClick({ target: el }: Event) {\n\tfor (const dialog of DIALOGS)\n\t\tif (dialog.open && dialog.contains(el as Node)) {\n\t\t\tif ((el as Element)?.closest?.('[data-command=\"close\"]')) dialog.close();\n\t\t}\n}\n\nconst deprecations = new WeakSet();\nfunction handleCommandDepreactions() {\n\tdocument.querySelectorAll(\"[data-command\").forEach((el) => {\n\t\tif (deprecations.has(el)) return;\n\t\tconst command = attr(el, \"data-command\");\n\t\tdeprecations.add(el);\n\n\t\tif (command === \"row\")\n\t\t\tdeprecate(\n\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\telse\n\t\t\tdeprecate(\n\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\tel,\n\t\t\t);\n\t});\n}\n\nonLoaded(() => [\n\ton(document, \"click\", handleDialogCloseClick, QUICK_EVENT),\n\tonMutation(handleDialogModal, [\"open\", \"data-drawer\"]),\n\tonMutation(handleCommandDepreactions, \"data-command\"),\n]);\n"],"names":["CSS_DIALOG","styles","DIALOGS","isBrowser","handleDialogModal","dialog","deprecate","closedby","attr","handleDialogCloseClick","el","deprecations","handleCommandDepreactions","command","onLoaded","on","QUICK_EVENT","onMutation"],"mappings":";;AAWA,MAAMA,IAAaC,EAAO,OAAO,MAAM,GAAG,EAAE,CAAC,GACvCC,IAAUC,MACZ,SAAS;AAAA,EACVH;AACD,IACC,CAAA;AAEH,SAASI,IAAoB;AAC5B,aAAWC,KAAUH;AAOpB,QANIG,EAAO,aAAa,cAAc,MAAM,YAC3CC;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA,GAEEA,EAAO,eAAeA,EAAO,aAAaA,EAAO,OAAO;AAC3D,YAAME,IAAWC,EAAKH,GAAQ,eAAe;AAC7C,MAAIE,MACHC,EAAKH,GAAQ,YAAYE,CAAQ,GACjCD;AAAA,QACC,0BAA0BC,CAAQ;AAAA,QAClC,qBAAqBA,CAAQ;AAAA,QAC7BF;AAAA,MAAA,IAGEA,EAAO,QAAQ,8CAA8C,KAChEC;AAAA,QACC;AAAA,QACA;AAAA,MAAA,GAEDE,EAAKH,GAAQ,QAAQ,IAAI,GACzBA,EAAO,UAAA,KACGA,EAAO,QAAQ,oBAAoB,MAC7CG,EAAKH,GAAQ,QAAQ,EAAE,GACvBA,EAAO,MAAA;AAAA,IAET;AAEF;AAEA,SAASI,EAAuB,EAAE,QAAQC,KAAa;AACtD,aAAWL,KAAUH;AACpB,IAAIG,EAAO,QAAQA,EAAO,SAASK,CAAU,KACvCA,GAAgB,UAAU,wBAAwB,OAAU,MAAA;AAEpE;AAEA,MAAMC,wBAAmB,QAAA;AACzB,SAASC,IAA4B;AACpC,WAAS,iBAAiB,
|
|
1
|
+
{"version":3,"file":"dialog-observer.js","sources":["../../designsystem/dialog/dialog-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tdeprecate,\n\tisBrowser,\n\ton,\n\tonLoaded,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"../utils\";\n\nconst CSS_DIALOG = styles.dialog.split(\" \")[0];\nconst DIALOGS = isBrowser()\n\t? (document.getElementsByClassName(\n\t\t\tCSS_DIALOG,\n\t\t) as HTMLCollectionOf<HTMLDialogElement>)\n\t: [];\n\nfunction handleDialogModal() {\n\tfor (const dialog of DIALOGS) {\n\t\tif (dialog.getAttribute(\"data-variant\") === \"drawer\")\n\t\t\tdeprecate(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tdialog,\n\t\t\t);\n\t\tif (dialog.isConnected && dialog.showModal && dialog.close) {\n\t\t\tconst closedby = attr(dialog, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(dialog, \"closedby\", closedby);\n\t\t\t\tdeprecate(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tdialog,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (dialog.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\tdeprecate(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t);\n\t\t\t\tattr(dialog, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tdialog.showModal();\n\t\t\t} else if (dialog.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(dialog, \"open\", \"\"); // Set as open\n\t\t\t\tdialog.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction handleDialogCloseClick({ target: el }: Event) {\n\tfor (const dialog of DIALOGS)\n\t\tif (dialog.open && dialog.contains(el as Node)) {\n\t\t\tif ((el as Element)?.closest?.('[data-command=\"close\"]')) dialog.close();\n\t\t}\n}\n\nconst deprecations = new WeakSet();\nfunction handleCommandDepreactions() {\n\tdocument.querySelectorAll(\"[data-command]\").forEach((el) => {\n\t\tif (deprecations.has(el)) return;\n\t\tconst command = attr(el, \"data-command\");\n\t\tdeprecations.add(el);\n\n\t\tif (command === \"row\")\n\t\t\tdeprecate(\n\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\telse\n\t\t\tdeprecate(\n\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\tel,\n\t\t\t);\n\t});\n}\n\nonLoaded(() => [\n\ton(document, \"click\", handleDialogCloseClick, QUICK_EVENT),\n\tonMutation(handleDialogModal, [\"open\", \"data-drawer\"]),\n\tonMutation(handleCommandDepreactions, \"data-command\"),\n]);\n"],"names":["CSS_DIALOG","styles","DIALOGS","isBrowser","handleDialogModal","dialog","deprecate","closedby","attr","handleDialogCloseClick","el","deprecations","handleCommandDepreactions","command","onLoaded","on","QUICK_EVENT","onMutation"],"mappings":";;AAWA,MAAMA,IAAaC,EAAO,OAAO,MAAM,GAAG,EAAE,CAAC,GACvCC,IAAUC,MACZ,SAAS;AAAA,EACVH;AACD,IACC,CAAA;AAEH,SAASI,IAAoB;AAC5B,aAAWC,KAAUH;AAOpB,QANIG,EAAO,aAAa,cAAc,MAAM,YAC3CC;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA,GAEEA,EAAO,eAAeA,EAAO,aAAaA,EAAO,OAAO;AAC3D,YAAME,IAAWC,EAAKH,GAAQ,eAAe;AAC7C,MAAIE,MACHC,EAAKH,GAAQ,YAAYE,CAAQ,GACjCD;AAAA,QACC,0BAA0BC,CAAQ;AAAA,QAClC,qBAAqBA,CAAQ;AAAA,QAC7BF;AAAA,MAAA,IAGEA,EAAO,QAAQ,8CAA8C,KAChEC;AAAA,QACC;AAAA,QACA;AAAA,MAAA,GAEDE,EAAKH,GAAQ,QAAQ,IAAI,GACzBA,EAAO,UAAA,KACGA,EAAO,QAAQ,oBAAoB,MAC7CG,EAAKH,GAAQ,QAAQ,EAAE,GACvBA,EAAO,MAAA;AAAA,IAET;AAEF;AAEA,SAASI,EAAuB,EAAE,QAAQC,KAAa;AACtD,aAAWL,KAAUH;AACpB,IAAIG,EAAO,QAAQA,EAAO,SAASK,CAAU,KACvCA,GAAgB,UAAU,wBAAwB,OAAU,MAAA;AAEpE;AAEA,MAAMC,wBAAmB,QAAA;AACzB,SAASC,IAA4B;AACpC,WAAS,iBAAiB,gBAAgB,EAAE,QAAQ,CAACF,MAAO;AAC3D,QAAIC,EAAa,IAAID,CAAE,EAAG;AAC1B,UAAMG,IAAUL,EAAKE,GAAI,cAAc;AACvC,IAAAC,EAAa,IAAID,CAAE,GAEfG,MAAY,QACfP;AAAA,MACC,IAAII,EAAG,SAAS,YAAA,CAAa,kBAAkBG,CAAO;AAAA,MACtD,8BAA8BH,EAAG,QAAQ;AAAA,MACzCA;AAAA,IAAA,IAGDJ;AAAA,MACC,yBAAyBO,CAAO;AAAA,MAChC,oBAAoBA,GAAS,QAAQ,uBAAuB,YAAY,CAAC;AAAA,MACzEH;AAAA,IAAA;AAAA,EAEH,CAAC;AACF;AAEAI,EAAS,MAAM;AAAA,EACdC,EAAG,UAAU,SAASN,GAAwBO,CAAW;AAAA,EACzDC,EAAWb,GAAmB,CAAC,QAAQ,aAAa,CAAC;AAAA,EACrDa,EAAWL,GAA2B,cAAc;AACrD,CAAC;"}
|
package/mtds/dialog/dialog.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as l } from "react";
|
|
4
|
-
import
|
|
4
|
+
import s from "../styles.module.css.js";
|
|
5
5
|
const g = l(
|
|
6
|
-
function({ className:
|
|
7
|
-
return /* @__PURE__ */
|
|
6
|
+
function({ className: r, modal: a = !0, ...o }, t) {
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
8
8
|
"dialog",
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
"data-modal": o["data-modal"] ??
|
|
12
|
-
|
|
10
|
+
className: m(s.dialog, r),
|
|
11
|
+
"data-modal": o["data-modal"] ?? a,
|
|
12
|
+
suppressHydrationWarning: !0,
|
|
13
|
+
ref: t,
|
|
13
14
|
...o
|
|
14
15
|
}
|
|
15
16
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-placement\"?: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n\t/**\n\t * @deprecated Use 'closedby' instead\n\t */\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\tmodal?: boolean;\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog","forwardRef","className","modal","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBO,MAAMA,IAASC;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,IAAM,GAAGC,EAAA,GAAQC,GAAK;AAC1D,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,QAAQN,CAAS;AAAA,QACxC,cAAYE,EAAK,YAAY,KAAKD;AAAA,QAClC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-placement\"?: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n\t/**\n\t * @deprecated Use 'closedby' instead\n\t */\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\tmodal?: boolean;\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog","forwardRef","className","modal","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBO,MAAMA,IAASC;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,IAAM,GAAGC,EAAA,GAAQC,GAAK;AAC1D,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,QAAQN,CAAS;AAAA,QACxC,cAAYE,EAAK,YAAY,KAAKD;AAAA,QAClC,0BAAwB;AAAA,QACxB,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
|
package/mtds/index.iife.js
CHANGED
|
@@ -155,7 +155,7 @@ var mtds=(function(L){"use strict";var kr=Object.defineProperty,hn=Object.getOwn
|
|
|
155
155
|
white-space: pre-wrap;
|
|
156
156
|
width: calc(var(--mtdsc-print-inner-width) / 3);
|
|
157
157
|
}
|
|
158
|
-
}`,sa="2.3.3",Dn="_alert_1p489_1 _ds-alert_1331q_3",Un="_app_1p489_1",zn="_sticky_1p489_1",Fn="_avatar_1p489_1 _ds-avatar_1331q_1",Bn="_badge_1p489_1",Gn="_breadcrumbs_1p489_1 _ds-breadcrumbs_1331q_5",Jn="_button_1p489_1 _ds-button_1331q_1",Hn="_card_1p489_1",jn="_group_1p489_1",Xn="_chip_1p489_1 _ds-chip_1331q_5",Zn="_details_1p489_1 _ds-details_1331q_3",Kn="_dialog_1p489_1 _ds-dialog_1331q_5",Yn="__drawer_1p489_1",Qn="_divider_1p489_1",_n="_errorsummary_1p489_1 _ds-error-summary_1331q_5",$n="__errorsummary_1p489_1",to="_field_1p489_1 _ds-field_1331q_1",eo="__datalist_1p489_1",no="_affixes_1p489_1 _ds-field-affixes_1331q_3",oo="_fieldset_1p489_1 _ds-fieldset_1331q_3",io="_fileupload_1p489_1",ro="_helptext_1p489_1 _ds-focus_1331q_1",ao="_input_1p489_1 _ds-input_1331q_1",so="_law_1p489_1",lo="_grid_1p489_1",co="_flex_1p489_1",uo="_link_1p489_1",po="_logo_1p489_1",mo="_pagination_1p489_1 _ds-pagination_1331q_5",fo="_popover_1p489_1",ho="_progress_1p489_1",go="__indeterminate_1p489_1",vo="_skeleton_1p489_1 _ds-skeleton_1331q_5",bo="__skeleton_1p489_1",wo="_spinner_1p489_1",yo="_steps_1p489_1",xo="_table_1p489_1 _ds-table_1331q_5",Eo="__scrollShadow_1p489_1",So="_tabs_1p489_1 _ds-tabs_1331q_5",ko="__scrollMask_1p489_1",To="_tag_1p489_1 _ds-tag_1331q_5",Ao="_toast_1p489_1",Lo="__toastClose_1p489_1",Co="__toastOpen_1p489_1",Oo="__toastTimeout_1p489_1",Io="_togglegroup_1p489_1",Mo="__tooltip_1p489_1",No="_heading_1p489_1 _ds-heading_1331q_1",Po="_ingress_1p489_1",Ro="_muted_1p489_1",Wo="_info_1p489_1",qo="_prose_1p489_1",Vo="_validation_1p489_1 _ds-validation-message_1331q_1",Do="_body_1p489_186",Uo="__checked_1p489_1",k={alert:Dn,app:Un,sticky:zn,avatar:Fn,badge:Bn,breadcrumbs:Gn,button:Jn,card:Hn,group:jn,chip:Xn,details:Zn,dialog:Kn,_drawer:Yn,divider:Qn,errorsummary:_n,_errorsummary:$n,field:to,_datalist:eo,affixes:no,fieldset:oo,fileupload:io,helptext:ro,input:ao,law:so,grid:lo,flex:co,link:uo,logo:po,pagination:mo,popover:fo,progress:ho,_indeterminate:go,skeleton:vo,_skeleton:bo,spinner:wo,steps:yo,table:xo,_scrollShadow:Eo,tabs:So,_scrollMask:ko,tag:To,toast:Ao,_toastClose:Lo,_toastOpen:Co,_toastTimeout:Oo,togglegroup:Io,_tooltip:Mo,heading:No,ingress:Po,muted:Ro,info:Wo,prose:qo,validation:Vo,body:Do,_checked:Uo},la=Object.freeze(Object.defineProperty({__proto__:null,_checked:Uo,_datalist:eo,_drawer:Yn,_errorsummary:$n,_indeterminate:go,_scrollMask:ko,_scrollShadow:Eo,_skeleton:bo,_toastClose:Lo,_toastOpen:Co,_toastTimeout:Oo,_tooltip:Mo,affixes:no,alert:Dn,app:Un,avatar:Fn,badge:Bn,body:Do,breadcrumbs:Gn,button:Jn,card:Hn,chip:Xn,default:k,details:Zn,dialog:Kn,divider:Qn,errorsummary:_n,field:to,fieldset:oo,fileupload:io,flex:co,grid:lo,group:jn,heading:No,helptext:ro,info:Wo,ingress:Po,input:ao,law:so,link:uo,logo:po,muted:Ro,pagination:mo,popover:fo,progress:ho,prose:qo,skeleton:vo,spinner:wo,steps:yo,sticky:zn,table:xo,tabs:So,tag:To,toast:Ao,togglegroup:Io,validation:Vo},Symbol.toStringTag,{value:"Module"})),gt=Math.min,q=Math.max,$t=Math.round,te=Math.floor,J=t=>({x:t,y:t}),ca={left:"right",right:"left",bottom:"top",top:"bottom"},da={start:"end",end:"start"};function zo(t,e,n){return q(t,gt(e,n))}function ee(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function ne(t){return t.split("-")[1]}function Fo(t){return t==="x"?"y":"x"}function Bo(t){return t==="y"?"height":"width"}const ua=new Set(["top","bottom"]);function $(t){return ua.has(it(t))?"y":"x"}function Go(t){return Fo($(t))}function pa(t,e,n){n===void 0&&(n=!1);const o=ne(t),i=Go(t),r=Bo(i);let a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=oe(a)),[a,oe(a)]}function ma(t){const e=oe(t);return[We(t),e,We(e)]}function We(t){return t.replace(/start|end/g,e=>da[e])}const Jo=["left","right"],Ho=["right","left"],fa=["top","bottom"],ha=["bottom","top"];function ga(t,e,n){switch(t){case"top":case"bottom":return n?e?Ho:Jo:e?Jo:Ho;case"left":case"right":return e?fa:ha;default:return[]}}function va(t,e,n,o){const i=ne(t);let r=ga(it(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(We)))),r}function oe(t){return t.replace(/left|right|bottom|top/g,e=>ca[e])}function ba(t){return{top:0,right:0,bottom:0,left:0,...t}}function wa(t){return typeof t!="number"?ba(t):{top:t,right:t,bottom:t,left:t}}function ie(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function jo(t,e,n){let{reference:o,floating:i}=t;const r=$(e),a=Go(e),s=Bo(a),l=it(e),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let g;switch(l){case"top":g={x:d,y:o.y-i.height};break;case"bottom":g={x:d,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:u};break;case"left":g={x:o.x-i.width,y:u};break;default:g={x:o.x,y:o.y}}switch(ne(e)){case"start":g[a]-=h*(n&&c?-1:1);break;case"end":g[a]+=h*(n&&c?-1:1);break}return g}const ya=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=jo(c,o,l),h=o,g={},w=0;for(let p=0;p<s.length;p++){const{name:v,fn:f}=s[p],{x:b,y,data:x,reset:E}=await f({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});d=b??d,u=y??u,g={...g,[v]:{...g[v],...x}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:d,y:u}=jo(c,h,l)),p=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:g}};async function qe(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:g=0}=ee(e,t),w=wa(g),v=s[h?u==="floating"?"reference":"floating":u],f=ie(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(v)))==null||n?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),x=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},E=ie(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:l}):b);return{top:(f.top-E.top+w.top)/x.y,bottom:(E.bottom-f.bottom+w.bottom)/x.y,left:(f.left-E.left+w.left)/x.x,right:(E.right-f.right+w.right)/x.x}}const xa=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...v}=ee(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const f=it(i),b=$(s),y=it(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=h||(y||!p?[oe(s)]:ma(s)),C=w!=="none";!h&&C&&E.push(...va(s,p,w,x));const B=[s,...E],dt=await qe(e,v),ut=[];let _=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&ut.push(dt[f]),u){const pt=pa(i,a,x);ut.push(dt[pt[0]],dt[pt[1]])}if(_=[..._,{placement:i,overflows:ut}],!ut.every(pt=>pt<=0)){var Wt,qt;const pt=(((Wt=r.flip)==null?void 0:Wt.index)||0)+1,fn=B[pt];if(fn&&(!(u==="alignment"?b!==$(fn):!1)||_.every(G=>$(G.placement)===b?G.overflows[0]>0:!0)))return{data:{index:pt,overflows:_},reset:{placement:fn}};let Dt=(qt=_.filter(mt=>mt.overflows[0]<=0).sort((mt,G)=>mt.overflows[1]-G.overflows[1])[0])==null?void 0:qt.placement;if(!Dt)switch(g){case"bestFit":{var Vt;const mt=(Vt=_.filter(G=>{if(C){const et=$(G.placement);return et===b||et==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(et=>et>0).reduce((et,Gc)=>et+Gc,0)]).sort((G,et)=>G[1]-et[1])[0])==null?void 0:Vt[0];mt&&(Dt=mt);break}case"initialPlacement":Dt=s;break}if(i!==Dt)return{reset:{placement:Dt}}}return{}}}},Ea=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:f,y:b}=v;return{x:f,y:b}}},...l}=ee(t,e),c={x:n,y:o},d=await qe(e,l),u=$(it(i)),h=Fo(u);let g=c[h],w=c[u];if(r){const v=h==="y"?"top":"left",f=h==="y"?"bottom":"right",b=g+d[v],y=g-d[f];g=zo(b,g,y)}if(a){const v=u==="y"?"top":"left",f=u==="y"?"bottom":"right",b=w+d[v],y=w-d[f];w=zo(b,w,y)}const p=s.fn({...e,[h]:g,[u]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:r,[u]:a}}}}}},Sa=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:s}=e,{apply:l=()=>{},...c}=ee(t,e),d=await qe(e,c),u=it(i),h=ne(i),g=$(i)==="y",{width:w,height:p}=r.floating;let v,f;u==="top"||u==="bottom"?(v=u,f=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(f=u,v=h==="end"?"top":"bottom");const b=p-d.top-d.bottom,y=w-d.left-d.right,x=gt(p-d[v],b),E=gt(w-d[f],y),C=!e.middlewareData.shift;let B=x,dt=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(dt=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(B=b),C&&!h){const _=q(d.left,0),Wt=q(d.right,0),qt=q(d.top,0),Vt=q(d.bottom,0);g?dt=w-2*(_!==0||Wt!==0?_+Wt:q(d.left,d.right)):B=p-2*(qt!==0||Vt!==0?qt+Vt:q(d.top,d.bottom))}await l({...e,availableWidth:dt,availableHeight:B});const ut=await a.getDimensions(s.floating);return w!==ut.width||p!==ut.height?{reset:{rects:!0}}:{}}}};function re(){return typeof window<"u"}function vt(t){return Xo(t)?(t.nodeName||"").toLowerCase():"#document"}function V(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function H(t){var e;return(e=(Xo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xo(t){return re()?t instanceof Node||t instanceof V(t).Node:!1}function D(t){return re()?t instanceof Element||t instanceof V(t).Element:!1}function j(t){return re()?t instanceof HTMLElement||t instanceof V(t).HTMLElement:!1}function Zo(t){return!re()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof V(t).ShadowRoot}const ka=new Set(["inline","contents"]);function Et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!ka.has(i)}const Ta=new Set(["table","td","th"]);function Aa(t){return Ta.has(vt(t))}const La=[":popover-open",":modal"];function ae(t){return La.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ca=["transform","translate","scale","rotate","perspective"],Oa=["transform","translate","scale","rotate","perspective","filter"],Ia=["paint","layout","strict","content"];function Ve(t){const e=De(),n=D(t)?U(t):t;return Ca.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Oa.some(o=>(n.willChange||"").includes(o))||Ia.some(o=>(n.contain||"").includes(o))}function Ma(t){let e=tt(t);for(;j(e)&&!bt(e);){if(Ve(e))return e;if(ae(e))return null;e=tt(e)}return null}function De(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Na=new Set(["html","body","#document"]);function bt(t){return Na.has(vt(t))}function U(t){return V(t).getComputedStyle(t)}function se(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function tt(t){if(vt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Zo(t)&&t.host||H(t);return Zo(e)?e.host:e}function Ko(t){const e=tt(t);return bt(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&Et(e)?e:Ko(e)}function St(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ko(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=V(i);if(r){const s=Ue(a);return e.concat(a,a.visualViewport||[],Et(i)?i:[],s&&n?St(s):[])}return e.concat(i,St(i,[],n))}function Ue(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yo(t){const e=U(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=$t(n)!==r||$t(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function ze(t){return D(t)?t:t.contextElement}function wt(t){const e=ze(t);if(!j(e))return J(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Yo(e);let a=(r?$t(n.width):n.width)/o,s=(r?$t(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Pa=J(0);function Qo(t){const e=V(t);return!De()||!e.visualViewport?Pa:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ra(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==V(t)?!1:e}function rt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ze(t);let a=J(1);e&&(o?D(o)&&(a=wt(o)):a=wt(t));const s=Ra(r,n,o)?Qo(r):J(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(r){const h=V(r),g=o&&D(o)?V(o):o;let w=h,p=Ue(w);for(;p&&o&&g!==w;){const v=wt(p),f=p.getBoundingClientRect(),b=U(p),y=f.left+(p.clientLeft+parseFloat(b.paddingLeft))*v.x,x=f.top+(p.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=y,c+=x,w=V(p),p=Ue(w)}}return ie({width:d,height:u,x:l,y:c})}function le(t,e){const n=se(t).scrollLeft;return e?e.left+n:rt(H(t)).left+n}function _o(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-le(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Wa(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",a=H(o),s=e?ae(e.floating):!1;if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=J(1);const d=J(0),u=j(o);if((u||!u&&!r)&&((vt(o)!=="body"||Et(a))&&(l=se(o)),j(o))){const g=rt(o);c=wt(o),d.x=g.x+o.clientLeft,d.y=g.y+o.clientTop}const h=a&&!u&&!r?_o(a,l):J(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function qa(t){return Array.from(t.getClientRects())}function Va(t){const e=H(t),n=se(t),o=t.ownerDocument.body,i=q(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=q(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+le(t);const s=-n.scrollTop;return U(o).direction==="rtl"&&(a+=q(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}const $o=25;function Da(t,e){const n=V(t),o=H(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const d=De();(!d||d&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=le(o);if(c<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-u.clientWidth-g);w<=$o&&(r-=w)}else c<=$o&&(r+=c);return{width:r,height:a,x:s,y:l}}const Ua=new Set(["absolute","fixed"]);function za(t,e){const n=rt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=j(t)?wt(t):J(1),a=t.clientWidth*r.x,s=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:a,height:s,x:l,y:c}}function ti(t,e,n){let o;if(e==="viewport")o=Da(t,n);else if(e==="document")o=Va(H(t));else if(D(e))o=za(e,n);else{const i=Qo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ie(o)}function ei(t,e){const n=tt(t);return n===e||!D(n)||bt(n)?!1:U(n).position==="fixed"||ei(n,e)}function Fa(t,e){const n=e.get(t);if(n)return n;let o=St(t,[],!1).filter(s=>D(s)&&vt(s)!=="body"),i=null;const r=U(t).position==="fixed";let a=r?tt(t):t;for(;D(a)&&!bt(a);){const s=U(a),l=Ve(a);!l&&s.position==="fixed"&&(i=null),(r?!l&&!i:!l&&s.position==="static"&&!!i&&Ua.has(i.position)||Et(a)&&!l&&ei(t,a))?o=o.filter(d=>d!==a):i=s,a=tt(a)}return e.set(t,o),o}function Ba(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const a=[...n==="clippingAncestors"?ae(e)?[]:Fa(e,this._c):[].concat(n),o],s=a[0],l=a.reduce((c,d)=>{const u=ti(e,d,i);return c.top=q(u.top,c.top),c.right=gt(u.right,c.right),c.bottom=gt(u.bottom,c.bottom),c.left=q(u.left,c.left),c},ti(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ga(t){const{width:e,height:n}=Yo(t);return{width:e,height:n}}function Ja(t,e,n){const o=j(e),i=H(e),r=n==="fixed",a=rt(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=J(0);function c(){l.x=le(i)}if(o||!o&&!r)if((vt(e)!=="body"||Et(i))&&(s=se(e)),o){const g=rt(e,!0,r,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();r&&!o&&i&&c();const d=i&&!o&&!r?_o(i,s):J(0),u=a.left+s.scrollLeft-l.x-d.x,h=a.top+s.scrollTop-l.y-d.y;return{x:u,y:h,width:a.width,height:a.height}}function Fe(t){return U(t).position==="static"}function ni(t,e){if(!j(t)||U(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return H(t)===n&&(n=n.ownerDocument.body),n}function oi(t,e){const n=V(t);if(ae(t))return n;if(!j(t)){let i=tt(t);for(;i&&!bt(i);){if(D(i)&&!Fe(i))return i;i=tt(i)}return n}let o=ni(t,e);for(;o&&Aa(o)&&Fe(o);)o=ni(o,e);return o&&bt(o)&&Fe(o)&&!Ve(o)?n:o||Ma(t)||n}const Ha=async function(t){const e=this.getOffsetParent||oi,n=this.getDimensions,o=await n(t.floating);return{reference:Ja(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ja(t){return U(t).direction==="rtl"}const Xa={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:H,getClippingRect:Ba,getOffsetParent:oi,getElementRects:Ha,getClientRects:qa,getDimensions:Ga,getScale:wt,isElement:D,isRTL:ja};function ii(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Za(t,e){let n=null,o;const i=H(t);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:d,top:u,width:h,height:g}=c;if(s||e(),!h||!g)return;const w=te(u),p=te(i.clientWidth-(d+h)),v=te(i.clientHeight-(u+g)),f=te(d),y={rootMargin:-w+"px "+-p+"px "+-v+"px "+-f+"px",threshold:q(0,gt(1,l))||1};let x=!0;function E(C){const B=C[0].intersectionRatio;if(B!==l){if(!x)return a();B?a(!1,B):o=setTimeout(()=>{a(!1,1e-7)},1e3)}B===1&&!ii(c,t.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(E,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(t)}return a(!0),r}function Ka(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=ze(t),d=i||r?[...c?St(c):[],...St(e)]:[];d.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),r&&f.addEventListener("resize",n)});const u=c&&s?Za(c,n):null;let h=-1,g=null;a&&(g=new ResizeObserver(f=>{let[b]=f;b&&b.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let w,p=l?rt(t):null;l&&v();function v(){const f=rt(t);p&&!ii(p,f)&&n(),p=f,w=requestAnimationFrame(v)}return n(),()=>{var f;d.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(w)}}const ri=Ea,ai=xa,Ya=Sa,Qa=(t,e,n)=>{const o=new Map,i={platform:Xa,...n},r={...i.platform,_c:o};return ya(t,e,{...i,platform:r})};function si(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=si(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function _a(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=si(t))&&(o&&(o+=" "),o+=e);return o}const R={capture:!0,passive:!0},I=()=>typeof window<"u"&&typeof document<"u";function li(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const kt=(t,e,...n)=>console.warn(`\x1B[1m@mattilsynet/design - deprecation warning:\x1B[m \x1B[103m${t}\x1B[m is deprecated, please use \x1B[103m${e}\x1B[m instead`,...n);function m(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let $a=0;const ts=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function ce(t){return t.id||(t.id=`${ts}${++$a}`),t.id}const ci=(t,e,[...n])=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},A=(t,...e)=>(ci("add",t,e),()=>di(t,...e)),di=(t,...e)=>ci("remove",t,e),M=t=>{if(!I()||!window.requestAnimationFrame)return;window._mtdsCleanups||(window._mtdsCleanups=new Map);const e=()=>requestAnimationFrame(()=>{const n=String(t).replace(/(\n|\s)/g,"");window._mtdsCleanups?.get(n)?.map(o=>o()),window._mtdsCleanups?.set(n,t())});document.readyState==="complete"?e():A(window,"load",e)},Be=new WeakMap,es=`.${k.dialog.split(" ")[0]}`;function at(t,e,{contain:n,middleware:o,placement:i,...r}={}){if(Be.get(t)?.(),Be.delete(t),e){const a=t.closest(es)?.querySelector(":scope > footer"),s=Number(m(t,"data-inset"))||20,c={bottom:(a?.clientHeight||0)+s,left:s,right:s,top:s},d=m(t,"data-position")??"bottom";Be.set(t,Ka(e,t,()=>{if(!t.isConnected||!e.isConnected||t.hidden)return at(t,!1);Qa(e,t,{...r,placement:i||d,middleware:[ai({padding:c}),ri(),...n?[Ya({padding:c,apply:n})]:[],...o||[]]}).then(({x:u,y:h})=>{t.style.left=`${u}px`,t.style.top=`${h}px`})}))}}function X(t,e){let n=0;const o=Array.isArray(e)||typeof e=="string"?{attr:e}:e,i=()=>setTimeout(r,o?.delay??200),r=()=>{if(!I())return s();t(a),a.takeRecords(),n=0},a=new MutationObserver(()=>{n||(n=requestAnimationFrame(i))}),s=()=>{try{a.disconnect()}catch{}};return a.observe(o?.root||document.documentElement,{attributeFilter:[].concat(o.attr),attributes:!0,childList:!0,subtree:!0}),t(a),s}function ns(t,e){const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}const Ge=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),O=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))m(o,i,r);return o},os=typeof HTMLElement>"u"?class{}:HTMLElement,is=(t,e)=>!I()||window.customElements.get(t)||window.customElements.define(t,e),rs=`[data-command="toggle-app-expanded"],.${k.app.split(" ")[0]} > [command="show-modal"]`,as=`.${k.breadcrumbs.split(" ")[0]}`,ss=`.${k.card.split(" ")[0]}`,ui=`.${k.chip.split(" ")[0]}`,ls=`.${k.helptext.split(" ")[0]}`,cs=`.${k.pagination.split(" ")[0]}`,ds='summary,u-summary,a,button,[role="tab"],[role="button"]',us="click,toggle,submit,change",Je="mattilsynet.matomo.cloud",ps=["setCustomUrl","setDocumentTitle","setReferrerUrl"],z="mtds-analytics-banner",ms="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function pi(t,e={}){if(I()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Je}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&fs();const a=r?`https://cdn.matomo.cloud/${Je}/container_${r}.js`:`https://cdn.matomo.cloud/${Je}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(O("script",{async:"",src:a}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;ps.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function fs(){if(document.getElementById(z)||window.localStorage.getItem(z))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${z}" data-analytics="ignore"><style>
|
|
158
|
+
}`,sa="2.3.5",Dn="_alert_1p489_1 _ds-alert_1331q_3",Un="_app_1p489_1",zn="_sticky_1p489_1",Fn="_avatar_1p489_1 _ds-avatar_1331q_1",Bn="_badge_1p489_1",Gn="_breadcrumbs_1p489_1 _ds-breadcrumbs_1331q_5",Jn="_button_1p489_1 _ds-button_1331q_1",Hn="_card_1p489_1",jn="_group_1p489_1",Xn="_chip_1p489_1 _ds-chip_1331q_5",Zn="_details_1p489_1 _ds-details_1331q_3",Kn="_dialog_1p489_1 _ds-dialog_1331q_5",Yn="__drawer_1p489_1",Qn="_divider_1p489_1",_n="_errorsummary_1p489_1 _ds-error-summary_1331q_5",$n="__errorsummary_1p489_1",to="_field_1p489_1 _ds-field_1331q_1",eo="__datalist_1p489_1",no="_affixes_1p489_1 _ds-field-affixes_1331q_3",oo="_fieldset_1p489_1 _ds-fieldset_1331q_3",io="_fileupload_1p489_1",ro="_helptext_1p489_1 _ds-focus_1331q_1",ao="_input_1p489_1 _ds-input_1331q_1",so="_law_1p489_1",lo="_grid_1p489_1",co="_flex_1p489_1",uo="_link_1p489_1",po="_logo_1p489_1",mo="_pagination_1p489_1 _ds-pagination_1331q_5",fo="_popover_1p489_1",ho="_progress_1p489_1",go="__indeterminate_1p489_1",vo="_skeleton_1p489_1 _ds-skeleton_1331q_5",bo="__skeleton_1p489_1",wo="_spinner_1p489_1",yo="_steps_1p489_1",xo="_table_1p489_1 _ds-table_1331q_5",Eo="__scrollShadow_1p489_1",So="_tabs_1p489_1 _ds-tabs_1331q_5",ko="__scrollMask_1p489_1",To="_tag_1p489_1 _ds-tag_1331q_5",Ao="_toast_1p489_1",Lo="__toastClose_1p489_1",Co="__toastOpen_1p489_1",Oo="__toastTimeout_1p489_1",Io="_togglegroup_1p489_1",Mo="__tooltip_1p489_1",No="_heading_1p489_1 _ds-heading_1331q_1",Po="_ingress_1p489_1",Ro="_muted_1p489_1",Wo="_info_1p489_1",qo="_prose_1p489_1",Vo="_validation_1p489_1 _ds-validation-message_1331q_1",Do="_body_1p489_186",Uo="__checked_1p489_1",k={alert:Dn,app:Un,sticky:zn,avatar:Fn,badge:Bn,breadcrumbs:Gn,button:Jn,card:Hn,group:jn,chip:Xn,details:Zn,dialog:Kn,_drawer:Yn,divider:Qn,errorsummary:_n,_errorsummary:$n,field:to,_datalist:eo,affixes:no,fieldset:oo,fileupload:io,helptext:ro,input:ao,law:so,grid:lo,flex:co,link:uo,logo:po,pagination:mo,popover:fo,progress:ho,_indeterminate:go,skeleton:vo,_skeleton:bo,spinner:wo,steps:yo,table:xo,_scrollShadow:Eo,tabs:So,_scrollMask:ko,tag:To,toast:Ao,_toastClose:Lo,_toastOpen:Co,_toastTimeout:Oo,togglegroup:Io,_tooltip:Mo,heading:No,ingress:Po,muted:Ro,info:Wo,prose:qo,validation:Vo,body:Do,_checked:Uo},la=Object.freeze(Object.defineProperty({__proto__:null,_checked:Uo,_datalist:eo,_drawer:Yn,_errorsummary:$n,_indeterminate:go,_scrollMask:ko,_scrollShadow:Eo,_skeleton:bo,_toastClose:Lo,_toastOpen:Co,_toastTimeout:Oo,_tooltip:Mo,affixes:no,alert:Dn,app:Un,avatar:Fn,badge:Bn,body:Do,breadcrumbs:Gn,button:Jn,card:Hn,chip:Xn,default:k,details:Zn,dialog:Kn,divider:Qn,errorsummary:_n,field:to,fieldset:oo,fileupload:io,flex:co,grid:lo,group:jn,heading:No,helptext:ro,info:Wo,ingress:Po,input:ao,law:so,link:uo,logo:po,muted:Ro,pagination:mo,popover:fo,progress:ho,prose:qo,skeleton:vo,spinner:wo,steps:yo,sticky:zn,table:xo,tabs:So,tag:To,toast:Ao,togglegroup:Io,validation:Vo},Symbol.toStringTag,{value:"Module"})),gt=Math.min,q=Math.max,$t=Math.round,te=Math.floor,J=t=>({x:t,y:t}),ca={left:"right",right:"left",bottom:"top",top:"bottom"},da={start:"end",end:"start"};function zo(t,e,n){return q(t,gt(e,n))}function ee(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function ne(t){return t.split("-")[1]}function Fo(t){return t==="x"?"y":"x"}function Bo(t){return t==="y"?"height":"width"}const ua=new Set(["top","bottom"]);function $(t){return ua.has(it(t))?"y":"x"}function Go(t){return Fo($(t))}function pa(t,e,n){n===void 0&&(n=!1);const o=ne(t),i=Go(t),r=Bo(i);let a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=oe(a)),[a,oe(a)]}function ma(t){const e=oe(t);return[We(t),e,We(e)]}function We(t){return t.replace(/start|end/g,e=>da[e])}const Jo=["left","right"],Ho=["right","left"],fa=["top","bottom"],ha=["bottom","top"];function ga(t,e,n){switch(t){case"top":case"bottom":return n?e?Ho:Jo:e?Jo:Ho;case"left":case"right":return e?fa:ha;default:return[]}}function va(t,e,n,o){const i=ne(t);let r=ga(it(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(We)))),r}function oe(t){return t.replace(/left|right|bottom|top/g,e=>ca[e])}function ba(t){return{top:0,right:0,bottom:0,left:0,...t}}function wa(t){return typeof t!="number"?ba(t):{top:t,right:t,bottom:t,left:t}}function ie(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function jo(t,e,n){let{reference:o,floating:i}=t;const r=$(e),a=Go(e),s=Bo(a),l=it(e),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let g;switch(l){case"top":g={x:d,y:o.y-i.height};break;case"bottom":g={x:d,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:u};break;case"left":g={x:o.x-i.width,y:u};break;default:g={x:o.x,y:o.y}}switch(ne(e)){case"start":g[a]-=h*(n&&c?-1:1);break;case"end":g[a]+=h*(n&&c?-1:1);break}return g}const ya=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=jo(c,o,l),h=o,g={},w=0;for(let p=0;p<s.length;p++){const{name:v,fn:f}=s[p],{x:b,y,data:x,reset:E}=await f({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});d=b??d,u=y??u,g={...g,[v]:{...g[v],...x}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:d,y:u}=jo(c,h,l)),p=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:g}};async function qe(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:g=0}=ee(e,t),w=wa(g),v=s[h?u==="floating"?"reference":"floating":u],f=ie(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(v)))==null||n?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),x=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},E=ie(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:l}):b);return{top:(f.top-E.top+w.top)/x.y,bottom:(E.bottom-f.bottom+w.bottom)/x.y,left:(f.left-E.left+w.left)/x.x,right:(E.right-f.right+w.right)/x.x}}const xa=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...v}=ee(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const f=it(i),b=$(s),y=it(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=h||(y||!p?[oe(s)]:ma(s)),C=w!=="none";!h&&C&&E.push(...va(s,p,w,x));const B=[s,...E],dt=await qe(e,v),ut=[];let _=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&ut.push(dt[f]),u){const pt=pa(i,a,x);ut.push(dt[pt[0]],dt[pt[1]])}if(_=[..._,{placement:i,overflows:ut}],!ut.every(pt=>pt<=0)){var Wt,qt;const pt=(((Wt=r.flip)==null?void 0:Wt.index)||0)+1,fn=B[pt];if(fn&&(!(u==="alignment"?b!==$(fn):!1)||_.every(G=>$(G.placement)===b?G.overflows[0]>0:!0)))return{data:{index:pt,overflows:_},reset:{placement:fn}};let Dt=(qt=_.filter(mt=>mt.overflows[0]<=0).sort((mt,G)=>mt.overflows[1]-G.overflows[1])[0])==null?void 0:qt.placement;if(!Dt)switch(g){case"bestFit":{var Vt;const mt=(Vt=_.filter(G=>{if(C){const et=$(G.placement);return et===b||et==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(et=>et>0).reduce((et,Gc)=>et+Gc,0)]).sort((G,et)=>G[1]-et[1])[0])==null?void 0:Vt[0];mt&&(Dt=mt);break}case"initialPlacement":Dt=s;break}if(i!==Dt)return{reset:{placement:Dt}}}return{}}}},Ea=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:f,y:b}=v;return{x:f,y:b}}},...l}=ee(t,e),c={x:n,y:o},d=await qe(e,l),u=$(it(i)),h=Fo(u);let g=c[h],w=c[u];if(r){const v=h==="y"?"top":"left",f=h==="y"?"bottom":"right",b=g+d[v],y=g-d[f];g=zo(b,g,y)}if(a){const v=u==="y"?"top":"left",f=u==="y"?"bottom":"right",b=w+d[v],y=w-d[f];w=zo(b,w,y)}const p=s.fn({...e,[h]:g,[u]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:r,[u]:a}}}}}},Sa=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:s}=e,{apply:l=()=>{},...c}=ee(t,e),d=await qe(e,c),u=it(i),h=ne(i),g=$(i)==="y",{width:w,height:p}=r.floating;let v,f;u==="top"||u==="bottom"?(v=u,f=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(f=u,v=h==="end"?"top":"bottom");const b=p-d.top-d.bottom,y=w-d.left-d.right,x=gt(p-d[v],b),E=gt(w-d[f],y),C=!e.middlewareData.shift;let B=x,dt=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(dt=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(B=b),C&&!h){const _=q(d.left,0),Wt=q(d.right,0),qt=q(d.top,0),Vt=q(d.bottom,0);g?dt=w-2*(_!==0||Wt!==0?_+Wt:q(d.left,d.right)):B=p-2*(qt!==0||Vt!==0?qt+Vt:q(d.top,d.bottom))}await l({...e,availableWidth:dt,availableHeight:B});const ut=await a.getDimensions(s.floating);return w!==ut.width||p!==ut.height?{reset:{rects:!0}}:{}}}};function re(){return typeof window<"u"}function vt(t){return Xo(t)?(t.nodeName||"").toLowerCase():"#document"}function V(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function H(t){var e;return(e=(Xo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xo(t){return re()?t instanceof Node||t instanceof V(t).Node:!1}function D(t){return re()?t instanceof Element||t instanceof V(t).Element:!1}function j(t){return re()?t instanceof HTMLElement||t instanceof V(t).HTMLElement:!1}function Zo(t){return!re()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof V(t).ShadowRoot}const ka=new Set(["inline","contents"]);function Et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!ka.has(i)}const Ta=new Set(["table","td","th"]);function Aa(t){return Ta.has(vt(t))}const La=[":popover-open",":modal"];function ae(t){return La.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ca=["transform","translate","scale","rotate","perspective"],Oa=["transform","translate","scale","rotate","perspective","filter"],Ia=["paint","layout","strict","content"];function Ve(t){const e=De(),n=D(t)?U(t):t;return Ca.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Oa.some(o=>(n.willChange||"").includes(o))||Ia.some(o=>(n.contain||"").includes(o))}function Ma(t){let e=tt(t);for(;j(e)&&!bt(e);){if(Ve(e))return e;if(ae(e))return null;e=tt(e)}return null}function De(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Na=new Set(["html","body","#document"]);function bt(t){return Na.has(vt(t))}function U(t){return V(t).getComputedStyle(t)}function se(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function tt(t){if(vt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Zo(t)&&t.host||H(t);return Zo(e)?e.host:e}function Ko(t){const e=tt(t);return bt(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&Et(e)?e:Ko(e)}function St(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ko(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=V(i);if(r){const s=Ue(a);return e.concat(a,a.visualViewport||[],Et(i)?i:[],s&&n?St(s):[])}return e.concat(i,St(i,[],n))}function Ue(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yo(t){const e=U(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=$t(n)!==r||$t(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function ze(t){return D(t)?t:t.contextElement}function wt(t){const e=ze(t);if(!j(e))return J(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Yo(e);let a=(r?$t(n.width):n.width)/o,s=(r?$t(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Pa=J(0);function Qo(t){const e=V(t);return!De()||!e.visualViewport?Pa:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ra(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==V(t)?!1:e}function rt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ze(t);let a=J(1);e&&(o?D(o)&&(a=wt(o)):a=wt(t));const s=Ra(r,n,o)?Qo(r):J(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(r){const h=V(r),g=o&&D(o)?V(o):o;let w=h,p=Ue(w);for(;p&&o&&g!==w;){const v=wt(p),f=p.getBoundingClientRect(),b=U(p),y=f.left+(p.clientLeft+parseFloat(b.paddingLeft))*v.x,x=f.top+(p.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=y,c+=x,w=V(p),p=Ue(w)}}return ie({width:d,height:u,x:l,y:c})}function le(t,e){const n=se(t).scrollLeft;return e?e.left+n:rt(H(t)).left+n}function _o(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-le(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Wa(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",a=H(o),s=e?ae(e.floating):!1;if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=J(1);const d=J(0),u=j(o);if((u||!u&&!r)&&((vt(o)!=="body"||Et(a))&&(l=se(o)),j(o))){const g=rt(o);c=wt(o),d.x=g.x+o.clientLeft,d.y=g.y+o.clientTop}const h=a&&!u&&!r?_o(a,l):J(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function qa(t){return Array.from(t.getClientRects())}function Va(t){const e=H(t),n=se(t),o=t.ownerDocument.body,i=q(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=q(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+le(t);const s=-n.scrollTop;return U(o).direction==="rtl"&&(a+=q(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}const $o=25;function Da(t,e){const n=V(t),o=H(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const d=De();(!d||d&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=le(o);if(c<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-u.clientWidth-g);w<=$o&&(r-=w)}else c<=$o&&(r+=c);return{width:r,height:a,x:s,y:l}}const Ua=new Set(["absolute","fixed"]);function za(t,e){const n=rt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=j(t)?wt(t):J(1),a=t.clientWidth*r.x,s=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:a,height:s,x:l,y:c}}function ti(t,e,n){let o;if(e==="viewport")o=Da(t,n);else if(e==="document")o=Va(H(t));else if(D(e))o=za(e,n);else{const i=Qo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ie(o)}function ei(t,e){const n=tt(t);return n===e||!D(n)||bt(n)?!1:U(n).position==="fixed"||ei(n,e)}function Fa(t,e){const n=e.get(t);if(n)return n;let o=St(t,[],!1).filter(s=>D(s)&&vt(s)!=="body"),i=null;const r=U(t).position==="fixed";let a=r?tt(t):t;for(;D(a)&&!bt(a);){const s=U(a),l=Ve(a);!l&&s.position==="fixed"&&(i=null),(r?!l&&!i:!l&&s.position==="static"&&!!i&&Ua.has(i.position)||Et(a)&&!l&&ei(t,a))?o=o.filter(d=>d!==a):i=s,a=tt(a)}return e.set(t,o),o}function Ba(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const a=[...n==="clippingAncestors"?ae(e)?[]:Fa(e,this._c):[].concat(n),o],s=a[0],l=a.reduce((c,d)=>{const u=ti(e,d,i);return c.top=q(u.top,c.top),c.right=gt(u.right,c.right),c.bottom=gt(u.bottom,c.bottom),c.left=q(u.left,c.left),c},ti(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ga(t){const{width:e,height:n}=Yo(t);return{width:e,height:n}}function Ja(t,e,n){const o=j(e),i=H(e),r=n==="fixed",a=rt(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=J(0);function c(){l.x=le(i)}if(o||!o&&!r)if((vt(e)!=="body"||Et(i))&&(s=se(e)),o){const g=rt(e,!0,r,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();r&&!o&&i&&c();const d=i&&!o&&!r?_o(i,s):J(0),u=a.left+s.scrollLeft-l.x-d.x,h=a.top+s.scrollTop-l.y-d.y;return{x:u,y:h,width:a.width,height:a.height}}function Fe(t){return U(t).position==="static"}function ni(t,e){if(!j(t)||U(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return H(t)===n&&(n=n.ownerDocument.body),n}function oi(t,e){const n=V(t);if(ae(t))return n;if(!j(t)){let i=tt(t);for(;i&&!bt(i);){if(D(i)&&!Fe(i))return i;i=tt(i)}return n}let o=ni(t,e);for(;o&&Aa(o)&&Fe(o);)o=ni(o,e);return o&&bt(o)&&Fe(o)&&!Ve(o)?n:o||Ma(t)||n}const Ha=async function(t){const e=this.getOffsetParent||oi,n=this.getDimensions,o=await n(t.floating);return{reference:Ja(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ja(t){return U(t).direction==="rtl"}const Xa={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:H,getClippingRect:Ba,getOffsetParent:oi,getElementRects:Ha,getClientRects:qa,getDimensions:Ga,getScale:wt,isElement:D,isRTL:ja};function ii(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Za(t,e){let n=null,o;const i=H(t);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:d,top:u,width:h,height:g}=c;if(s||e(),!h||!g)return;const w=te(u),p=te(i.clientWidth-(d+h)),v=te(i.clientHeight-(u+g)),f=te(d),y={rootMargin:-w+"px "+-p+"px "+-v+"px "+-f+"px",threshold:q(0,gt(1,l))||1};let x=!0;function E(C){const B=C[0].intersectionRatio;if(B!==l){if(!x)return a();B?a(!1,B):o=setTimeout(()=>{a(!1,1e-7)},1e3)}B===1&&!ii(c,t.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(E,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(t)}return a(!0),r}function Ka(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=ze(t),d=i||r?[...c?St(c):[],...St(e)]:[];d.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),r&&f.addEventListener("resize",n)});const u=c&&s?Za(c,n):null;let h=-1,g=null;a&&(g=new ResizeObserver(f=>{let[b]=f;b&&b.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let w,p=l?rt(t):null;l&&v();function v(){const f=rt(t);p&&!ii(p,f)&&n(),p=f,w=requestAnimationFrame(v)}return n(),()=>{var f;d.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(w)}}const ri=Ea,ai=xa,Ya=Sa,Qa=(t,e,n)=>{const o=new Map,i={platform:Xa,...n},r={...i.platform,_c:o};return ya(t,e,{...i,platform:r})};function si(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=si(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function _a(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=si(t))&&(o&&(o+=" "),o+=e);return o}const R={capture:!0,passive:!0},I=()=>typeof window<"u"&&typeof document<"u";function li(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const kt=(t,e,...n)=>console.warn(`\x1B[1m@mattilsynet/design - deprecation warning:\x1B[m \x1B[103m${t}\x1B[m is deprecated, please use \x1B[103m${e}\x1B[m instead`,...n);function m(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let $a=0;const ts=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function ce(t){return t.id||(t.id=`${ts}${++$a}`),t.id}const ci=(t,e,[...n])=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},A=(t,...e)=>(ci("add",t,e),()=>di(t,...e)),di=(t,...e)=>ci("remove",t,e),M=t=>{if(!I()||!window.requestAnimationFrame)return;window._mtdsCleanups||(window._mtdsCleanups=new Map);const e=()=>requestAnimationFrame(()=>{const n=String(t).replace(/(\n|\s)/g,"");window._mtdsCleanups?.get(n)?.map(o=>o()),window._mtdsCleanups?.set(n,t())});document.readyState==="complete"?e():A(window,"load",e)},Be=new WeakMap,es=`.${k.dialog.split(" ")[0]}`;function at(t,e,{contain:n,middleware:o,placement:i,...r}={}){if(Be.get(t)?.(),Be.delete(t),e){const a=t.closest(es)?.querySelector(":scope > footer"),s=Number(m(t,"data-inset"))||20,c={bottom:(a?.clientHeight||0)+s,left:s,right:s,top:s},d=m(t,"data-position")??"bottom";Be.set(t,Ka(e,t,()=>{if(!t.isConnected||!e.isConnected||t.hidden)return at(t,!1);Qa(e,t,{...r,placement:i||d,middleware:[ai({padding:c}),ri(),...n?[Ya({padding:c,apply:n})]:[],...o||[]]}).then(({x:u,y:h})=>{t.style.left=`${u}px`,t.style.top=`${h}px`})}))}}function X(t,e){let n=0;const o=Array.isArray(e)||typeof e=="string"?{attr:e}:e,i=()=>setTimeout(r,o?.delay??200),r=()=>{if(!I())return s();t(a),a.takeRecords(),n=0},a=new MutationObserver(()=>{n||(n=requestAnimationFrame(i))}),s=()=>{try{a.disconnect()}catch{}};return a.observe(o?.root||document.documentElement,{attributeFilter:[].concat(o.attr),attributes:!0,childList:!0,subtree:!0}),t(a),s}function ns(t,e){const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}const Ge=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),O=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))m(o,i,r);return o},os=typeof HTMLElement>"u"?class{}:HTMLElement,is=(t,e)=>!I()||window.customElements.get(t)||window.customElements.define(t,e),rs=`[data-command="toggle-app-expanded"],.${k.app.split(" ")[0]} > [command="show-modal"]`,as=`.${k.breadcrumbs.split(" ")[0]}`,ss=`.${k.card.split(" ")[0]}`,ui=`.${k.chip.split(" ")[0]}`,ls=`.${k.helptext.split(" ")[0]}`,cs=`.${k.pagination.split(" ")[0]}`,ds='summary,u-summary,a,button,[role="tab"],[role="button"]',us="click,toggle,submit,change",Je="mattilsynet.matomo.cloud",ps=["setCustomUrl","setDocumentTitle","setReferrerUrl"],z="mtds-analytics-banner",ms="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function pi(t,e={}){if(I()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Je}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&fs();const a=r?`https://cdn.matomo.cloud/${Je}/container_${r}.js`:`https://cdn.matomo.cloud/${Je}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(O("script",{async:"",src:a}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;ps.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function fs(){if(document.getElementById(z)||window.localStorage.getItem(z))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${z}" data-analytics="ignore"><style>
|
|
159
159
|
#${z}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
|
|
160
160
|
#${z} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
|
|
161
161
|
#${z} button:focus-visible { outline: 2px solid }
|
|
@@ -332,7 +332,7 @@ var mtds=(function(L){"use strict";var kr=Object.defineProperty,hn=Object.getOwn
|
|
|
332
332
|
vertical-align: middle;
|
|
333
333
|
width: var(--mtds-5);
|
|
334
334
|
}
|
|
335
|
-
`,Qs=[.1,.2,.25,.5,1];function _s(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((w,p,v)=>{const f=t.map(y=>y[v].number),b=f.reduce((y,x)=>y+x,0);return Math.max(w,...i?[b]:f)},0),a=r/10,s=10**`${Math.round(a)}`.length,l=a/s,c=(Qs.find(w=>w>l)||1)*s,d=Math.ceil(r/c)*c,u=O("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure",style:`${e?`--mtdsc-chart-aspect: ${e};`:""} --bars: ${t[0]?.length-1}; --groups: ${t.length-1}; --total: ${d}`}),h=u.appendChild(O("div",{class:"axisSteps"})),g=u.appendChild(O("div",{class:"axisGroups"}));return Array.from({length:d/c+1},(w,p)=>$s(c*p)).reverse().map(w=>h.append(O("div",{class:"axisStep","data-label":w}))),{total:d,groups:g,axis:u}}const $s=new Intl.NumberFormat().format;function tl(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=O("div",{class:"axisGroup","data-label":e}),r=i.appendChild(O("div",{class:"axisGroupContent"}));return t.slice(1).map(a=>a[o+1]).map(({tooltip:a,style:s,number:l})=>r.appendChild(O("div",{"aria-label":a,"data-event":n,class:"bar",role:"img",style:`${s}; --value: ${l}`,tabindex:"0"}))),i})}function el(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=O("div",{class:"axisGroup"});return t.slice(1).forEach(([,...a])=>{const s=O("div",{class:"lineContainer",role:"list",style:a[0].style}),l=nl(a.map(({number:u},h,{length:g})=>[100/(g-1)*h,100-u/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");m(c,"aria-hidden","true"),m(c,"preserveAspectRatio","none"),m(c,"viewBox","0 0 100 100");const d=document.createElementNS("http://www.w3.org/2000/svg","path");if(m(d,"class","line"),m(d,"d",l),m(d,"fill","none"),m(d,"stroke","currentColor"),o==="area"){const u=d.cloneNode(!0);m(u,"d",`M-100,100 L${l.slice(1)}L200,100`),m(u,"class","lineShade"),c.append(u)}a.forEach(({number:u,tooltip:h,event:g})=>{const w=O("div",{role:"listitem"});w.appendChild(O("div",{"aria-label":h,"data-event":g,tabindex:"0",class:"linePoint",role:"img",style:`--value: ${u}`})),s.append(w)}),s.appendChild(c).append(d),r.append(s)}),r}const nl=(t,e)=>t.map(([n,o],i,r)=>i?ol(i,r,e):`M${n},${o}`).join(" "),Si=([t,e],[n,o])=>[t+n,e+o],ki=([t,e],[n,o])=>[t-n,e-o],Ti=(t,[e,n])=>[t*e,t*n],ol=(t,e,n)=>{const o=e[t-1],i=e[t],[r,a]=Si(o,Ti(n,ki(i,e[t-2]||o))),[s,l]=Si(i,Ti(n,ki(o,e[t+1]||i)));return`C ${r},${a} ${s},${l} ${i[0]},${i[1]}`};function il(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),m(o,"class","pie"),m(o,"viewBox","0 0 100 100");let i=0;const r=50,a=n==="doughnut"?25:0,s=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:d,style:u}])=>{if(!c)return;const h=document.createElementNS("http://www.w3.org/2000/svg","path"),g=i/s;i+=c;const w=Math.min(i/s,.99999),p=w-g>.5?1:0,v=2*Math.PI*(g-.25),f=2*Math.PI*(w-.25),b=Math.cos(v),y=Math.sin(v),x=Math.cos(f),E=Math.sin(f),C=`M ${r+a*b} ${r+a*y} L ${r+r*b} ${r+r*y} A ${r} ${r} 0 ${p} 1 ${r+r*x} ${r+r*E} L ${r+a*x} ${r+a*E} A ${a} ${a} 0 ${p} 0 ${r+a*b} ${r+a*y}`;m(h,"aria-label",l),m(h,"data-event",d),m(h,"style",u),m(h,"d",C),m(h,"role","img"),m(h,"tabindex","0"),o.appendChild(h)}),o}const Ai="click,keydown,mousemove,mouseout",Li="mtds-chart-tooltip",K=I()?document.getElementById(Li)||O("div",{"aria-hidden":"true",class:k._tooltip,hidden:"",id:Li}):null;class rl extends os{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.#e=ns(()=>this.handleResize(),this),this.#t=X(()=>this.attributeChangedCallback(),{attr:"data-tooltip",root:this}),this.attributeChangedCallback(),A(this,Ai,this)}disconnectedCallback(){K&&(K.hidden=!0),di(this,Ai,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=ll(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(d=>d.remove());const[n,o]=(m(this,"data-variant")||"column").split("-"),i=m(this,"data-aspect")||void 0,r=O("style",{},Ys),a=O("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:d,style:u}])=>{a.appendChild(O("div",{class:"legend",style:u},d))});const{axis:s,groups:l,total:c}=_s(e,{aspect:i,type:o});(n==="column"||n==="bar")&&l.append(...tl(e)),(n==="line"||n==="area")&&l.append(el(e,{total:c,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(il(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,a,r)}handleEvent(e){e.type==="click"||e.type==="keydown"?al(e,this):sl(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function al(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&m(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let Ci="";function sl(t){if(!K)return;K?.isConnected||document.body.append(K);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(K.style.transform=`translate(${Math.min(t.clientX,window.innerWidth-K.clientWidth-10)}px, ${t.clientY}px)`),n!==Ci&&(n&&(K.textContent=n),Ci=n,K.hidden=!n)}const At=t=>t?.textContent?.trim()||"",ll=t=>Array.from(t?.rows||[],(e,n)=>Array.from(e.cells,(o,i)=>{const r=At(e.cells[0]),a=At(t?.rows[0].cells[i]),s=`${r}: ${At(o)}${a?` (${a})`:""}`;return{number:i&&n&&Number.parseFloat(At(o))||0,event:o.querySelector("a,button")&&`${n}-${i}`,style:`--color: var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base))`,value:At(o),tooltip:m(o,"data-tooltip")||s}}));is("mtds-chart",rl);const cl=k.dialog.split(" ")[0],Oi=I()?document.getElementsByClassName(cl):[];function dl(){for(const t of Oi)if(t.getAttribute("data-variant")==="drawer"&&kt('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t),t.isConnected&&t.showModal&&t.close){const e=m(t,"data-closedby");e&&(m(t,"closedby",e),kt(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.matches('[open]:not([data-modal="false"]):not(:modal)')?(kt('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>'),m(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(m(t,"open",""),t.close())}}function ul({target:t}){for(const e of Oi)e.open&&e.contains(t)&&t?.closest?.('[data-command="close"]')&&e.close()}const Ii=new WeakSet;function pl(){document.querySelectorAll("[data-command").forEach(t=>{if(Ii.has(t))return;const e=m(t,"data-command");Ii.add(t),e==="row"?kt(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):kt(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)})}M(()=>[A(document,"click",ul,R),X(dl,["open","data-drawer"]),X(pl,"data-command")]);function ml(t){if(t.animationName!==k._errorsummary)return;const e=t.target?.firstElementChild;e instanceof HTMLHeadingElement&&(m(e,"tabindex","-1"),e.focus())}M(()=>[A(document,"animationend",ml,R)]);var fl=Object.defineProperty,Mi=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,gl=Object.prototype.propertyIsEnumerable,Ni=(t,e,n)=>e in t?fl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vl=(t,e)=>{for(var n in e||(e={}))hl.call(e,n)&&Ni(t,n,e[n]);if(Mi)for(var n of Mi(e))gl.call(e,n)&&Ni(t,n,e[n]);return t},Lt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",pe=Lt&&/android/i.test(navigator.userAgent),_e=Lt&&/iPad|iPhone|iPod/.test(navigator.userAgent),Pi;Lt&&/^Mac/i.test(((Pi=navigator.userAgentData)==null?void 0:Pi.platform)||navigator.platform);var bl=`${pe?"data":"aria"}-labelledby`,wl=":host(:not([hidden])) { display: block }",yl="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ri=typeof HTMLElement>"u"?class{}:HTMLElement;function T(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Wi=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Ct=(t,...e)=>Wi("add",t,e),me=(t,...e)=>Wi("remove",t,e),xl=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(en("slot"),en("style",e)),fe=new WeakMap,$e=(t,e)=>{if(e===void 0)return fe.get(t);try{fe.get(t).disconnect(),fe.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),fe.set(t,n)}},qi=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},El=0,tn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++El).toString(32)}`),t.id):"",en=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},Vi={define:(t,e)=>!Lt||window.customElements.get(t)||window.customElements.define(t,e)},ct,Sl=0,Di=t=>{ct||(ct=en("div"),ct.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",T(ct,"aria-live","assertive")),ct.isConnected||document.body.append(ct),t&&(ct.textContent=`${t}${Sl++%2?" ":""}`)},kl=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},nn=!1,on=t=>(t?.type==="mouseup"&&(nn=!1),t?.type==="mousedown"&&(nn=!0,Ct(document,"mouseup",on,{once:!0})),nn),rn="disabled",Ot="selected",Tl=class extends Ri{static get observedAttributes(){return[rn,Ot]}connectedCallback(){_e||(this.tabIndex=-1),this.hasAttribute("role")||T(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){T(this,"aria-disabled",`${this.disabled}`),T(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[Ot]}set defaultSelected(t){this[Ot]=t}get disabled(){return T(this,rn)!==null}set disabled(t){T(this,rn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=T(this,"label"))!=null?t:this.text}set label(t){T(this,"label",t)}get selected(){return T(this,Ot)!==null}set selected(t){T(this,Ot,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=T(this,"value"))!=null?t:this.text}set value(t){T(this,"value",t)}};Vi.define("u-option",Tl);var Al=`${wl}
|
|
335
|
+
`,Qs=[.1,.2,.25,.5,1];function _s(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((w,p,v)=>{const f=t.map(y=>y[v].number),b=f.reduce((y,x)=>y+x,0);return Math.max(w,...i?[b]:f)},0),a=r/10,s=10**`${Math.round(a)}`.length,l=a/s,c=(Qs.find(w=>w>l)||1)*s,d=Math.ceil(r/c)*c,u=O("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure",style:`${e?`--mtdsc-chart-aspect: ${e};`:""} --bars: ${t[0]?.length-1}; --groups: ${t.length-1}; --total: ${d}`}),h=u.appendChild(O("div",{class:"axisSteps"})),g=u.appendChild(O("div",{class:"axisGroups"}));return Array.from({length:d/c+1},(w,p)=>$s(c*p)).reverse().map(w=>h.append(O("div",{class:"axisStep","data-label":w}))),{total:d,groups:g,axis:u}}const $s=new Intl.NumberFormat().format;function tl(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=O("div",{class:"axisGroup","data-label":e}),r=i.appendChild(O("div",{class:"axisGroupContent"}));return t.slice(1).map(a=>a[o+1]).map(({tooltip:a,style:s,number:l})=>r.appendChild(O("div",{"aria-label":a,"data-event":n,class:"bar",role:"img",style:`${s}; --value: ${l}`,tabindex:"0"}))),i})}function el(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=O("div",{class:"axisGroup"});return t.slice(1).forEach(([,...a])=>{const s=O("div",{class:"lineContainer",role:"list",style:a[0].style}),l=nl(a.map(({number:u},h,{length:g})=>[100/(g-1)*h,100-u/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");m(c,"aria-hidden","true"),m(c,"preserveAspectRatio","none"),m(c,"viewBox","0 0 100 100");const d=document.createElementNS("http://www.w3.org/2000/svg","path");if(m(d,"class","line"),m(d,"d",l),m(d,"fill","none"),m(d,"stroke","currentColor"),o==="area"){const u=d.cloneNode(!0);m(u,"d",`M-100,100 L${l.slice(1)}L200,100`),m(u,"class","lineShade"),c.append(u)}a.forEach(({number:u,tooltip:h,event:g})=>{const w=O("div",{role:"listitem"});w.appendChild(O("div",{"aria-label":h,"data-event":g,tabindex:"0",class:"linePoint",role:"img",style:`--value: ${u}`})),s.append(w)}),s.appendChild(c).append(d),r.append(s)}),r}const nl=(t,e)=>t.map(([n,o],i,r)=>i?ol(i,r,e):`M${n},${o}`).join(" "),Si=([t,e],[n,o])=>[t+n,e+o],ki=([t,e],[n,o])=>[t-n,e-o],Ti=(t,[e,n])=>[t*e,t*n],ol=(t,e,n)=>{const o=e[t-1],i=e[t],[r,a]=Si(o,Ti(n,ki(i,e[t-2]||o))),[s,l]=Si(i,Ti(n,ki(o,e[t+1]||i)));return`C ${r},${a} ${s},${l} ${i[0]},${i[1]}`};function il(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),m(o,"class","pie"),m(o,"viewBox","0 0 100 100");let i=0;const r=50,a=n==="doughnut"?25:0,s=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:d,style:u}])=>{if(!c)return;const h=document.createElementNS("http://www.w3.org/2000/svg","path"),g=i/s;i+=c;const w=Math.min(i/s,.99999),p=w-g>.5?1:0,v=2*Math.PI*(g-.25),f=2*Math.PI*(w-.25),b=Math.cos(v),y=Math.sin(v),x=Math.cos(f),E=Math.sin(f),C=`M ${r+a*b} ${r+a*y} L ${r+r*b} ${r+r*y} A ${r} ${r} 0 ${p} 1 ${r+r*x} ${r+r*E} L ${r+a*x} ${r+a*E} A ${a} ${a} 0 ${p} 0 ${r+a*b} ${r+a*y}`;m(h,"aria-label",l),m(h,"data-event",d),m(h,"style",u),m(h,"d",C),m(h,"role","img"),m(h,"tabindex","0"),o.appendChild(h)}),o}const Ai="click,keydown,mousemove,mouseout",Li="mtds-chart-tooltip",K=I()?document.getElementById(Li)||O("div",{"aria-hidden":"true",class:k._tooltip,hidden:"",id:Li}):null;class rl extends os{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.#e=ns(()=>this.handleResize(),this),this.#t=X(()=>this.attributeChangedCallback(),{attr:"data-tooltip",root:this}),this.attributeChangedCallback(),A(this,Ai,this)}disconnectedCallback(){K&&(K.hidden=!0),di(this,Ai,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=ll(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(d=>d.remove());const[n,o]=(m(this,"data-variant")||"column").split("-"),i=m(this,"data-aspect")||void 0,r=O("style",{},Ys),a=O("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:d,style:u}])=>{a.appendChild(O("div",{class:"legend",style:u},d))});const{axis:s,groups:l,total:c}=_s(e,{aspect:i,type:o});(n==="column"||n==="bar")&&l.append(...tl(e)),(n==="line"||n==="area")&&l.append(el(e,{total:c,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(il(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,a,r)}handleEvent(e){e.type==="click"||e.type==="keydown"?al(e,this):sl(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function al(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&m(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let Ci="";function sl(t){if(!K)return;K?.isConnected||document.body.append(K);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(K.style.transform=`translate(${Math.min(t.clientX,window.innerWidth-K.clientWidth-10)}px, ${t.clientY}px)`),n!==Ci&&(n&&(K.textContent=n),Ci=n,K.hidden=!n)}const At=t=>t?.textContent?.trim()||"",ll=t=>Array.from(t?.rows||[],(e,n)=>Array.from(e.cells,(o,i)=>{const r=At(e.cells[0]),a=At(t?.rows[0].cells[i]),s=`${r}: ${At(o)}${a?` (${a})`:""}`;return{number:i&&n&&Number.parseFloat(At(o))||0,event:o.querySelector("a,button")&&`${n}-${i}`,style:`--color: var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base))`,value:At(o),tooltip:m(o,"data-tooltip")||s}}));is("mtds-chart",rl);const cl=k.dialog.split(" ")[0],Oi=I()?document.getElementsByClassName(cl):[];function dl(){for(const t of Oi)if(t.getAttribute("data-variant")==="drawer"&&kt('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t),t.isConnected&&t.showModal&&t.close){const e=m(t,"data-closedby");e&&(m(t,"closedby",e),kt(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.matches('[open]:not([data-modal="false"]):not(:modal)')?(kt('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>'),m(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(m(t,"open",""),t.close())}}function ul({target:t}){for(const e of Oi)e.open&&e.contains(t)&&t?.closest?.('[data-command="close"]')&&e.close()}const Ii=new WeakSet;function pl(){document.querySelectorAll("[data-command]").forEach(t=>{if(Ii.has(t))return;const e=m(t,"data-command");Ii.add(t),e==="row"?kt(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):kt(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)})}M(()=>[A(document,"click",ul,R),X(dl,["open","data-drawer"]),X(pl,"data-command")]);function ml(t){if(t.animationName!==k._errorsummary)return;const e=t.target?.firstElementChild;e instanceof HTMLHeadingElement&&(m(e,"tabindex","-1"),e.focus())}M(()=>[A(document,"animationend",ml,R)]);var fl=Object.defineProperty,Mi=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,gl=Object.prototype.propertyIsEnumerable,Ni=(t,e,n)=>e in t?fl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vl=(t,e)=>{for(var n in e||(e={}))hl.call(e,n)&&Ni(t,n,e[n]);if(Mi)for(var n of Mi(e))gl.call(e,n)&&Ni(t,n,e[n]);return t},Lt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",pe=Lt&&/android/i.test(navigator.userAgent),_e=Lt&&/iPad|iPhone|iPod/.test(navigator.userAgent),Pi;Lt&&/^Mac/i.test(((Pi=navigator.userAgentData)==null?void 0:Pi.platform)||navigator.platform);var bl=`${pe?"data":"aria"}-labelledby`,wl=":host(:not([hidden])) { display: block }",yl="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ri=typeof HTMLElement>"u"?class{}:HTMLElement;function T(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Wi=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Ct=(t,...e)=>Wi("add",t,e),me=(t,...e)=>Wi("remove",t,e),xl=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(en("slot"),en("style",e)),fe=new WeakMap,$e=(t,e)=>{if(e===void 0)return fe.get(t);try{fe.get(t).disconnect(),fe.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),fe.set(t,n)}},qi=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},El=0,tn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++El).toString(32)}`),t.id):"",en=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},Vi={define:(t,e)=>!Lt||window.customElements.get(t)||window.customElements.define(t,e)},ct,Sl=0,Di=t=>{ct||(ct=en("div"),ct.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",T(ct,"aria-live","assertive")),ct.isConnected||document.body.append(ct),t&&(ct.textContent=`${t}${Sl++%2?" ":""}`)},kl=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},nn=!1,on=t=>(t?.type==="mouseup"&&(nn=!1),t?.type==="mousedown"&&(nn=!0,Ct(document,"mouseup",on,{once:!0})),nn),rn="disabled",Ot="selected",Tl=class extends Ri{static get observedAttributes(){return[rn,Ot]}connectedCallback(){_e||(this.tabIndex=-1),this.hasAttribute("role")||T(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){T(this,"aria-disabled",`${this.disabled}`),T(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[Ot]}set defaultSelected(t){this[Ot]=t}get disabled(){return T(this,rn)!==null}set disabled(t){T(this,rn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=T(this,"label"))!=null?t:this.text}set label(t){T(this,"label",t)}get selected(){return T(this,Ot)!==null}set selected(t){T(this,Ot,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=T(this,"value"))!=null?t:this.text}set value(t){T(this,"value",t)}};Vi.define("u-option",Tl);var Al=`${wl}
|
|
336
336
|
::slotted(u-option) { display: block; cursor: pointer }
|
|
337
337
|
::slotted(u-option:focus) { ${yl} }
|
|
338
338
|
::slotted(u-option[aria-hidden="true"]),
|
package/mtds/package.json.js
CHANGED