@warp-ds/elements 2.6.0-next.4 → 2.6.0

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.
Files changed (65) hide show
  1. package/dist/custom-elements.json +145 -143
  2. package/dist/index.d.ts +52 -52
  3. package/dist/packages/affix/affix.d.ts +1 -2
  4. package/dist/packages/affix/affix.js +35 -19
  5. package/dist/packages/affix/affix.js.map +4 -4
  6. package/dist/packages/alert/alert.d.ts +2 -5
  7. package/dist/packages/alert/alert.js +32 -16
  8. package/dist/packages/alert/alert.js.map +4 -4
  9. package/dist/packages/alert/alert.test.js +1 -3
  10. package/dist/packages/attention/attention.d.ts +2 -2
  11. package/dist/packages/attention/attention.js +53 -26
  12. package/dist/packages/attention/attention.js.map +4 -4
  13. package/dist/packages/button/button.react.stories.d.ts +1 -1
  14. package/dist/packages/button/button.stories.d.ts +1 -4
  15. package/dist/packages/button/button.stories.js +11 -16
  16. package/dist/packages/card/card.d.ts +1 -1
  17. package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
  18. package/dist/packages/datepicker/datepicker.d.ts +1 -3
  19. package/dist/packages/datepicker/datepicker.js +66 -41
  20. package/dist/packages/datepicker/datepicker.js.map +4 -4
  21. package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
  22. package/dist/packages/expandable/expandable.d.ts +1 -2
  23. package/dist/packages/expandable/expandable.js +39 -23
  24. package/dist/packages/expandable/expandable.js.map +4 -4
  25. package/dist/packages/icon/icon.js +2 -2
  26. package/dist/packages/icon/icon.js.map +4 -4
  27. package/dist/packages/icon/icon.react.stories.js +274 -2
  28. package/dist/packages/icon/icon.stories.js +273 -1
  29. package/dist/packages/link/link.react.stories.d.ts +1 -1
  30. package/dist/packages/modal-header/modal-header.d.ts +1 -2
  31. package/dist/packages/modal-header/modal-header.js +39 -14
  32. package/dist/packages/modal-header/modal-header.js.map +4 -4
  33. package/dist/packages/page-indicator/page-indicator.test.js +40 -20
  34. package/dist/packages/pagination/pagination.a11y.test.d.ts +1 -0
  35. package/dist/packages/pagination/pagination.a11y.test.js +36 -0
  36. package/dist/packages/pagination/pagination.d.ts +1 -3
  37. package/dist/packages/pagination/pagination.js +57 -34
  38. package/dist/packages/pagination/pagination.js.map +4 -4
  39. package/dist/packages/pill/pill.d.ts +1 -1
  40. package/dist/packages/pill/pill.js +38 -13
  41. package/dist/packages/pill/pill.js.map +4 -4
  42. package/dist/packages/pill/pill.test.js +1 -3
  43. package/dist/packages/select/select.d.ts +1 -1
  44. package/dist/packages/select/select.js +44 -19
  45. package/dist/packages/select/select.js.map +4 -4
  46. package/dist/packages/select/select.react.stories.d.ts +1 -1
  47. package/dist/packages/step/step.d.ts +1 -1
  48. package/dist/packages/step/step.js +38 -13
  49. package/dist/packages/step/step.js.map +4 -4
  50. package/dist/packages/step-indicator/step-indicator.a11y.test.d.ts +2 -0
  51. package/dist/packages/step-indicator/step-indicator.a11y.test.js +66 -0
  52. package/dist/packages/textarea/textarea.a11y.test.d.ts +1 -0
  53. package/dist/packages/textarea/textarea.a11y.test.js +115 -0
  54. package/dist/packages/textarea/textarea.js +6 -6
  55. package/dist/packages/textarea/textarea.js.map +4 -4
  56. package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
  57. package/dist/packages/textarea/textarea.test.js +3 -1
  58. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  59. package/dist/packages/toast/toast.d.ts +1 -4
  60. package/dist/packages/toast/toast.js +38 -13
  61. package/dist/packages/toast/toast.js.map +4 -4
  62. package/dist/setup-tests.d.ts +10 -0
  63. package/dist/setup-tests.js +61 -0
  64. package/dist/web-types.json +47 -47
  65. package/package.json +2 -2
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { Textarea } from './react';
4
4
  declare const _default: {
5
5
  title: string;
6
- render(args: Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "disabled" | "name" | "value" | "updated" | "firstUpdated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "placeholder" | "helpText" | "required" | "optional" | "readOnly" | "readonly" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "maxRows" | "minRows" | "minHeight" | "maxHeight" | "reportValidity" | "setCustomValidity" | "_textareaStyles"> & {
6
+ render(args: Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "name" | "form" | "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "disabled" | "value" | "updated" | "firstUpdated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "placeholder" | "helpText" | "required" | "optional" | "readOnly" | "readonly" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "maxRows" | "minRows" | "minHeight" | "maxHeight" | "reportValidity" | "setCustomValidity" | "_textareaStyles"> & {
7
7
  onBlur?: (e: Event) => void;
8
8
  onblur?: (e: Event) => void;
9
9
  onChange?: (e: Event) => void;
@@ -166,7 +166,9 @@ test('restores original help text when validation passes', async () => {
166
166
  await expect.poll(() => wTextArea.helpText).not.toBe('Enter your message');
167
167
  // Fill in a value
168
168
  await textarea.fill('Hello');
169
- // Should restore original help text
169
+ // Wait for value + validity to update, then restore original help text
170
+ await expect.poll(() => wTextArea.value).toBe('Hello');
171
+ await expect.poll(() => wTextArea.checkValidity()).toBe(true);
170
172
  await expect.poll(() => wTextArea.invalid).toBe(false);
171
173
  await expect.poll(() => wTextArea.helpText).toBe('Enter your message');
172
174
  });
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { TextField } from './react';
4
4
  declare const _default: {
5
5
  title: string;
6
- render(args: Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "mask" | "pattern" | "disabled" | "type" | "name" | "value" | "updated" | "firstUpdated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "step" | "placeholder" | "helpText" | "required" | "autocomplete" | "size" | "max" | "min" | "minLength" | "maxLength" | "readOnly" | "readonly" | "formatter" | "_hasPrefix" | "_hasSuffix" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange"> & {
6
+ render(args: Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "name" | "size" | "form" | "label" | "mask" | "pattern" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "disabled" | "type" | "value" | "updated" | "firstUpdated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "step" | "placeholder" | "helpText" | "required" | "autocomplete" | "max" | "min" | "minLength" | "maxLength" | "readOnly" | "readonly" | "formatter" | "_hasPrefix" | "_hasSuffix" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange"> & {
7
7
  onBlur?: (e: Event) => void;
8
8
  onblur?: (e: Event) => void;
9
9
  onChange?: (e: Event) => void;
@@ -1,8 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import '@warp-ds/icons/elements/warning-16';
3
- import '@warp-ds/icons/elements/error-16';
4
- import '@warp-ds/icons/elements/success-16';
5
- import '@warp-ds/icons/elements/close-16';
2
+ import '../icon/icon.js';
6
3
  import type { ToastType } from './types';
7
4
  export { removeToast, toast, updateToast } from './api.js';
8
5
  /**
@@ -1,13 +1,38 @@
1
- var Be=Object.create;var D=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var K=r=>{throw TypeError(r)};var G=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Re=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of $e(e))!Xe.call(r,a)&&a!==o&&D(r,a,{get:()=>e[a],enumerable:!(t=V(e,a))||t.enumerable});return r};var Ze=(r,e,o)=>(o=r!=null?Be(Je(r)):{},Re(e||!r||!r.__esModule?D(o,"default",{value:r,enumerable:!0}):o,r));var x=(r,e,o,t)=>{for(var a=t>1?void 0:t?V(e,o):e,n=r.length-1,i;n>=0;n--)(i=r[n])&&(a=(t?i(e,o,a):i(a))||a);return t&&a&&D(e,o,a),a};var He=(r,e,o)=>e.has(r)||K("Cannot "+o);var A=(r,e,o)=>(He(r,e,"read from private field"),o?o.call(r):e.get(r)),W=(r,e,o)=>e.has(r)?K("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,o);var Q=G(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.errorMessages=f.ErrorType=void 0;var k;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(k=f.ErrorType||(f.ErrorType={}));f.errorMessages=new Map([[k.MalformedUnicode,"malformed Unicode character escape sequence"],[k.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[k.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[k.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[k.EndOfString,"malformed escape sequence at end of string"]])});var oe=G(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.unraw=g.errorMessages=g.ErrorType=void 0;var d=Q();Object.defineProperty(g,"ErrorType",{enumerable:!0,get:function(){return d.ErrorType}});Object.defineProperty(g,"errorMessages",{enumerable:!0,get:function(){return d.errorMessages}});function Ue(r){return!r.match(/[^a-f0-9]/i)?parseInt(r,16):NaN}function L(r,e,o){let t=Ue(r);if(Number.isNaN(t)||o!==void 0&&o!==r.length)throw new SyntaxError(d.errorMessages.get(e));return t}function qe(r){let e=L(r,d.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function ee(r,e){let o=L(r,d.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=L(e,d.ErrorType.MalformedUnicode,4);return String.fromCharCode(o,t)}return String.fromCharCode(o)}function Ve(r){return r.charAt(0)==="{"&&r.charAt(r.length-1)==="}"}function Ke(r){if(!Ve(r))throw new SyntaxError(d.errorMessages.get(d.ErrorType.MalformedUnicode));let e=r.slice(1,-1),o=L(e,d.ErrorType.MalformedUnicode);try{return String.fromCodePoint(o)}catch(t){throw t instanceof RangeError?new SyntaxError(d.errorMessages.get(d.ErrorType.CodePointLimit)):t}}function Ge(r,e=!1){if(e)throw new SyntaxError(d.errorMessages.get(d.ErrorType.OctalDeprecation));let o=parseInt(r,8);return String.fromCharCode(o)}var We=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Qe(r){return We.get(r)||r}var er=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function re(r,e=!1){return r.replace(er,function(o,t,a,n,i,s,l,u,v){if(t!==void 0)return"\\";if(a!==void 0)return qe(a);if(n!==void 0)return Ke(n);if(i!==void 0)return ee(i,s);if(l!==void 0)return ee(l);if(u==="0")return"\0";if(u!==void 0)return Ge(u,!e);if(v!==void 0)return Qe(v);throw new SyntaxError(d.errorMessages.get(d.ErrorType.EndOfString))})}g.unraw=re;g.default=re});var C=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return r.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?C.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ne=Ze(oe(),1);var m=r=>typeof r=="string",rr=r=>typeof r=="function",te=new Map,ie="en";function P(r){return[...Array.isArray(r)?r:[r],ie]}function B(r,e,o){let t=P(r);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return M(()=>O("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format(m(e)?new Date(e):e)}function or(r,e,o){let t;if(o||(o="default"),typeof o=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=o;return B(r,e,t)}function I(r,e,o){let t=P(r);return M(()=>O("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function ae(r,e,o,{offset:t=0,...a}){var s,l;let n=P(r),i=e?M(()=>O("plural-ordinal",n),()=>new Intl.PluralRules(n,{type:"ordinal"})):M(()=>O("plural-cardinal",n),()=>new Intl.PluralRules(n,{type:"cardinal"}));return(l=(s=a[o])!=null?s:a[i.select(o-t)])!=null?l:a.other}function M(r,e){let o=r(),t=te.get(o);return t||(t=e(),te.set(o,t)),t}function O(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var se=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ce="%__lingui_octothorpe__%",tr=(r,e,o={})=>{let t=e||r,a=i=>typeof i=="object"?i:o[i],n=(i,s)=>{let l=Object.keys(o).length?a("number"):void 0,u=I(t,i,l);return s.replace(new RegExp(ce,"g"),u)};return{plural:(i,s)=>{let{offset:l=0}=s,u=ae(t,!1,i,s);return n(i-l,u)},selectordinal:(i,s)=>{let{offset:l=0}=s,u=ae(t,!0,i,s);return n(i-l,u)},select:ar,number:(i,s)=>I(t,i,a(s)||{style:s}),date:(i,s)=>B(t,i,a(s)||s),time:(i,s)=>or(t,i,a(s)||s)}},ar=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function nr(r,e,o){return(t={},a)=>{let n=tr(e,o,a),i=(l,u=!1)=>Array.isArray(l)?l.reduce((v,z)=>{if(z==="#"&&u)return v+ce;if(m(z))return v+z;let[U,h,q]=z,T={};h==="plural"||h==="selectordinal"||h==="select"?Object.entries(q).forEach(([j,Pe])=>{T[j]=i(Pe,h==="plural"||h==="selectordinal")}):T=q;let E;if(h){let j=n[h];E=j(t[U],T)}else E=t[U];return E==null?v:v+E},""):l,s=i(r);return m(s)&&se.test(s)?(0,ne.unraw)(s):m(s)?s:s?String(s):""}}var ir=Object.defineProperty,sr=(r,e,o)=>e in r?ir(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,cr=(r,e,o)=>(sr(r,typeof e!="symbol"?e+"":e,o),o),Y=class{constructor(){cr(this,"_events",{})}on(e,o){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(o),()=>this.removeListener(e,o)}removeListener(e,o){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(o);~a&&t.splice(a,1)}emit(e,...o){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,o))}_getListeners(e){let o=this._events[e];return Array.isArray(o)?o:!1}},lr=Object.defineProperty,dr=(r,e,o)=>e in r?lr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,w=(r,e,o)=>(dr(r,typeof e!="symbol"?e+"":e,o),o),F=class extends Y{constructor(e){var o;super(),w(this,"_locale",""),w(this,"_locales"),w(this,"_localeData",{}),w(this,"_messages",{}),w(this,"_missing"),w(this,"_messageCompiler"),w(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((o=e.locale)!=null?o:ie,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,o){let t=this._localeData[e];t?Object.assign(t,o):this._localeData[e]=o}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,o){typeof e=="string"?this._loadLocaleData(e,o):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,o){let t=this._messages[e];t?Object.assign(t,o):this._messages[e]=o}load(e,o){typeof e=="string"&&typeof o=="object"?this._load(e,o):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:o,messages:t}){this._locale=e,this._locales=o||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,o){this._locale=e,this._locales=o,this.emit("change")}_(e,o,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;e||(e=""),m(e)||(o=e.values||o,a=e.message,e=e.id);let n=this.messages[e],i=n===void 0,s=this._missing;if(s&&i)return rr(s)?s(this._locale,e):s;i&&this.emit("missing",{id:e,locale:this._locale});let l=n||a||e;return m(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
1
+ var Te=Object.create;var D=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var B=r=>{throw TypeError(r)};var K=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Fe=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Oe(e))!Pe.call(r,a)&&a!==o&&D(r,a,{get:()=>e[a],enumerable:!(t=J(e,a))||t.enumerable});return r};var je=(r,e,o)=>(o=r!=null?Te(Le(r)):{},Fe(e||!r||!r.__esModule?D(o,"default",{value:r,enumerable:!0}):o,r));var p=(r,e,o,t)=>{for(var a=t>1?void 0:t?J(e,o):e,s=r.length-1,n;s>=0;s--)(n=r[s])&&(a=(t?n(e,o,a):n(a))||a);return t&&a&&D(e,o,a),a};var Ye=(r,e,o)=>e.has(r)||B("Cannot "+o);var N=(r,e,o)=>(Ye(r,e,"read from private field"),o?o.call(r):e.get(r)),Q=(r,e,o)=>e.has(r)?B("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,o);var W=K(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.errorMessages=x.ErrorType=void 0;var k;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(k=x.ErrorType||(x.ErrorType={}));x.errorMessages=new Map([[k.MalformedUnicode,"malformed Unicode character escape sequence"],[k.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[k.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[k.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[k.EndOfString,"malformed escape sequence at end of string"]])});var oe=K(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});u.unraw=u.errorMessages=u.ErrorType=void 0;var l=W();Object.defineProperty(u,"ErrorType",{enumerable:!0,get:function(){return l.ErrorType}});Object.defineProperty(u,"errorMessages",{enumerable:!0,get:function(){return l.errorMessages}});function De(r){return!r.match(/[^a-f0-9]/i)?parseInt(r,16):NaN}function S(r,e,o){let t=De(r);if(Number.isNaN(t)||o!==void 0&&o!==r.length)throw new SyntaxError(l.errorMessages.get(e));return t}function Ne(r){let e=S(r,l.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function ee(r,e){let o=S(r,l.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=S(e,l.ErrorType.MalformedUnicode,4);return String.fromCharCode(o,t)}return String.fromCharCode(o)}function $e(r){return r.charAt(0)==="{"&&r.charAt(r.length-1)==="}"}function Ae(r){if(!$e(r))throw new SyntaxError(l.errorMessages.get(l.ErrorType.MalformedUnicode));let e=r.slice(1,-1),o=S(e,l.ErrorType.MalformedUnicode);try{return String.fromCodePoint(o)}catch(t){throw t instanceof RangeError?new SyntaxError(l.errorMessages.get(l.ErrorType.CodePointLimit)):t}}function Xe(r,e=!1){if(e)throw new SyntaxError(l.errorMessages.get(l.ErrorType.OctalDeprecation));let o=parseInt(r,8);return String.fromCharCode(o)}var Ie=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Re(r){return Ie.get(r)||r}var Ze=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function re(r,e=!1){return r.replace(Ze,function(o,t,a,s,n,i,c,d,w){if(t!==void 0)return"\\";if(a!==void 0)return Ne(a);if(s!==void 0)return Ae(s);if(n!==void 0)return ee(n,i);if(c!==void 0)return ee(c);if(d==="0")return"\0";if(d!==void 0)return Xe(d,!e);if(w!==void 0)return Re(w);throw new SyntaxError(l.errorMessages.get(l.ErrorType.EndOfString))})}u.unraw=re;u.default=re});var C=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return r.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?C.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ie=je(oe(),1);var h=r=>typeof r=="string",Ue=r=>typeof r=="function",te=new Map,ne="en";function I(r){return[...Array.isArray(r)?r:[r],ne]}function R(r,e,o){let t=I(r);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return T(()=>O("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format(h(e)?new Date(e):e)}function qe(r,e,o){let t;if(o||(o="default"),typeof o=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=o;return R(r,e,t)}function $(r,e,o){let t=I(r);return T(()=>O("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function ae(r,e,o,{offset:t=0,...a}){var i,c;let s=I(r),n=e?T(()=>O("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):T(()=>O("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(c=(i=a[o])!=null?i:a[n.select(o-t)])!=null?c:a.other}function T(r,e){let o=r(),t=te.get(o);return t||(t=e(),te.set(o,t)),t}function O(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var se=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ce="%__lingui_octothorpe__%",He=(r,e,o={})=>{let t=e||r,a=n=>typeof n=="object"?n:o[n],s=(n,i)=>{let c=Object.keys(o).length?a("number"):void 0,d=$(t,n,c);return i.replace(new RegExp(ce,"g"),d)};return{plural:(n,i)=>{let{offset:c=0}=i,d=ae(t,!1,n,i);return s(n-c,d)},selectordinal:(n,i)=>{let{offset:c=0}=i,d=ae(t,!0,n,i);return s(n-c,d)},select:Ve,number:(n,i)=>$(t,n,a(i)||{style:i}),date:(n,i)=>R(t,n,a(i)||i),time:(n,i)=>qe(t,n,a(i)||i)}},Ve=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function Ge(r,e,o){return(t={},a)=>{let s=He(e,o,a),n=(c,d=!1)=>Array.isArray(c)?c.reduce((w,M)=>{if(M==="#"&&d)return w+ce;if(h(M))return w+M;let[V,f,G]=M,j={};f==="plural"||f==="selectordinal"||f==="select"?Object.entries(G).forEach(([Y,Se])=>{j[Y]=n(Se,f==="plural"||f==="selectordinal")}):j=G;let E;if(f){let Y=s[f];E=Y(t[V],j)}else E=t[V];return E==null?w:w+E},""):c,i=n(r);return h(i)&&se.test(i)?(0,ie.unraw)(i):h(i)?i:i?String(i):""}}var Je=Object.defineProperty,Be=(r,e,o)=>e in r?Je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,Ke=(r,e,o)=>(Be(r,typeof e!="symbol"?e+"":e,o),o),A=class{constructor(){Ke(this,"_events",{})}on(e,o){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(o),()=>this.removeListener(e,o)}removeListener(e,o){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(o);~a&&t.splice(a,1)}emit(e,...o){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,o))}_getListeners(e){let o=this._events[e];return Array.isArray(o)?o:!1}},Qe=Object.defineProperty,We=(r,e,o)=>e in r?Qe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,y=(r,e,o)=>(We(r,typeof e!="symbol"?e+"":e,o),o),X=class extends A{constructor(e){var o;super(),y(this,"_locale",""),y(this,"_locales"),y(this,"_localeData",{}),y(this,"_messages",{}),y(this,"_missing"),y(this,"_messageCompiler"),y(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((o=e.locale)!=null?o:ne,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,o){let t=this._localeData[e];t?Object.assign(t,o):this._localeData[e]=o}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,o){typeof e=="string"?this._loadLocaleData(e,o):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,o){let t=this._messages[e];t?Object.assign(t,o):this._messages[e]=o}load(e,o){typeof e=="string"&&typeof o=="object"?this._load(e,o):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:o,messages:t}){this._locale=e,this._locales=o||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,o){this._locale=e,this._locales=o,this.emit("change")}_(e,o,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;e||(e=""),h(e)||(o=e.values||o,a=e.message,e=e.id);let s=this.messages[e],n=s===void 0,i=this._missing;if(i&&n)return Ue(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let c=s||a||e;return h(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
3
3
 
4
- > ${l}
4
+ > ${c}
5
5
 
6
6
  That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
7
7
  ICU features such as interpolation and plurals will not work properly for that message.
8
8
 
9
9
  Please compile your catalog first.
10
- `)),m(l)&&se.test(l)?JSON.parse(`"${l}"`):m(l)?l:nr(l,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return B(this._locales||this._locale,e,o)}number(e,o){return I(this._locales||this._locale,e,o)}};function ur(r={}){return new F(r)}var c=ur();var $=typeof window!="undefined",le=!0;if($){let r=window.matchMedia("(prefers-reduced-motion: reduce)"),e=({matches:o})=>le=!o;r.addEventListener&&r.addEventListener("change",e),e(r)}var de=r=>{r.style.transition=null,r.style.backfaceVisibility=null,r.style.overflow=null},ue=r=>{let e=le?"var(--f-expansion-duration, 0.3s)":"0.01s";r.style.transition=`height ${e}`,r.style.backfaceVisibility="hidden",r.style.overflow="hidden"},pr=(r,e)=>()=>{r.style.height="auto",r.style.overflow=null,e&&e()},gr=r=>()=>{r&&r()},pe=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=pr(r,e);de(r),r.style.height="auto";let a=r.scrollHeight;if($&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height="0px",r.style.transitionTimingFunction="ease-out",ue(r),requestAnimationFrame(()=>r.style.height=a+"px")}),o)return o},ge=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=gr(e);de(r);let a=r.scrollHeight;if($&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height=a+"px",r.style.transitionTimingFunction="ease-in",ue(r),requestAnimationFrame(()=>r.style.height="0px")}),o)return o};import{css as wo,html as y,LitElement as xo}from"lit";import{property as N,state as ko}from"lit/decorators.js";import{when as yo}from"lit/directives/when.js";import{LitElement as br}from"lit";import{unsafeStatic as mr,html as vr}from"lit/static-html.js";var hr=JSON.parse('{"icon.title.warning":["Varseltrekant med utropstegn"]}'),fr=JSON.parse('{"icon.title.warning":["Warning triangle with exclamation point"]}'),wr=JSON.parse('{"icon.title.warning":["Varoituskolmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),xr=JSON.parse('{"icon.title.warning":["Advarselstrekant med et udr\xE5bstegn"]}'),kr=JSON.parse('{"icon.title.warning":["Varningstriangel med utropstecken"]}'),be=["en","nb","fi","da","sv"],me="en",yr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},ve=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":me},J=r=>be.find(e=>r===e||r.toLowerCase().includes(e))||ve();function _r(){var r;if(typeof window=="undefined"){let e=yr();return J(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=ve();return be.includes(e)?J(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),J(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),me}}var zr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Er=(r,e,o,t,a)=>{let n=_r(),i=zr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Er(fr,hr,wr,xr,kr);var Cr=class extends br{render(){let r=c.t({message:"Warning triangle with exclamation point",id:"icon.title.warning",comment:"Title for warning icon"});return vr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-warning-16-part">${mr(`<title>${r}</title>`)}<path stroke="currentColor" d="m.712 14.07 6.25-12.994a1 1 0 0 1 1.792-.022l6.635 12.995a1 1 0 0 1-.89 1.455H1.613a1 1 0 0 1-.902-1.434Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 6v4.992M8 13v.333"></path></svg>`}};customElements.get("w-icon-warning-16")||customElements.define("w-icon-warning-16",Cr);import{LitElement as Lr}from"lit";import{unsafeStatic as Mr,html as Or}from"lit/static-html.js";var Sr=JSON.parse('{"icon.title.error":["\xC5ttekant med utropstegn"]}'),Nr=JSON.parse('{"icon.title.error":["Octagon with exclamation point"]}'),Tr=JSON.parse('{"icon.title.error":["Kahdeksankulmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),jr=JSON.parse('{"icon.title.error":["Ottekant med et udr\xE5bstegn"]}'),Dr=JSON.parse('{"icon.title.error":["Oktagon med utropstecken"]}'),he=["en","nb","fi","da","sv"],fe="en",Ar=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},we=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":fe},X=r=>he.find(e=>r===e||r.toLowerCase().includes(e))||we();function Ir(){var r;if(typeof window=="undefined"){let e=Ar();return X(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=we();return he.includes(e)?X(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),X(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),fe}}var Yr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Fr=(r,e,o,t,a)=>{let n=Ir(),i=Yr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Fr(Nr,Sr,Tr,jr,Dr);var Pr=class extends Lr{render(){let r=c.t({message:"Octagon with exclamation point",id:"icon.title.error",comment:"Title for error icon"});return Or`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-error-16-part">${Mr(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 11.107 4.748 15.5h6.503l4.248-4.393V4.893L11.252.5H4.748L.5 4.893z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 11.398a.25.25 0 1 1 0-.5m0 .5a.25.25 0 1 0 0-.5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M8 8.5V3"></path></svg>`}};customElements.get("w-icon-error-16")||customElements.define("w-icon-error-16",Pr);import{LitElement as Br}from"lit";import{unsafeStatic as $r,html as Jr}from"lit/static-html.js";var Xr=JSON.parse('{"icon.title.success":["Sirkel med sjekkmerke"]}'),Rr=JSON.parse('{"icon.title.success":["Circle with checkmark"]}'),Zr=JSON.parse('{"icon.title.success":["Ympyr\xE4, jonka sis\xE4ll\xE4 on valintamerkki"]}'),Hr=JSON.parse('{"icon.title.success":["Cirkel med et flueben"]}'),Ur=JSON.parse('{"icon.title.success":["Cirkel med bock"]}'),xe=["en","nb","fi","da","sv"],ke="en",qr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},ye=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ke},R=r=>xe.find(e=>r===e||r.toLowerCase().includes(e))||ye();function Vr(){var r;if(typeof window=="undefined"){let e=qr();return R(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=ye();return xe.includes(e)?R(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),R(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ke}}var Kr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Gr=(r,e,o,t,a)=>{let n=Vr(),i=Kr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Gr(Rr,Xr,Zr,Hr,Ur);var Wr=class extends Br{render(){let r=c.t({message:"Circle with checkmark",id:"icon.title.success",comment:"Title for success icon"});return Jr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-success-16-part">${$r(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m4 8.815 1.633 2.318a.7.7 0 0 0 1.138.034l5.228-6.615"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 7.999a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0"></path></svg>`}};customElements.get("w-icon-success-16")||customElements.define("w-icon-success-16",Wr);import{LitElement as Qr}from"lit";import{unsafeStatic as eo,html as ro}from"lit/static-html.js";var oo=JSON.parse('{"icon.title.close":["Kryss"]}'),to=JSON.parse('{"icon.title.close":["Cross"]}'),ao=JSON.parse('{"icon.title.close":["Rasti"]}'),no=JSON.parse('{"icon.title.close":["Kryds"]}'),io=JSON.parse('{"icon.title.close":["Kryss"]}'),_e=["en","nb","fi","da","sv"],ze="en",so=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},Ee=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ze},Z=r=>_e.find(e=>r===e||r.toLowerCase().includes(e))||Ee();function co(){var r;if(typeof window=="undefined"){let e=so();return Z(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=Ee();return _e.includes(e)?Z(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),Z(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ze}}var lo=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,uo=(r,e,o,t,a)=>{let n=co(),i=lo(n,r,e,o,t,a);c.load(n,i),c.activate(n)};uo(to,oo,ao,no,io);var po=class extends Qr{render(){let r=c.t({message:"Cross",id:"icon.title.close",comment:"Title for close icon"});return ro`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${eo(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9m0-9 9 9"></path></svg>`}};customElements.get("w-icon-close-16")||customElements.define("w-icon-close-16",po);var go=["en","nb","fi","da","sv"],Le="en",Ce=r=>go.find(e=>r===e||r.toLowerCase().includes(e))||Le;function bo(){if(typeof window=="undefined"){let r=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Ce(r)}try{let r=document.documentElement.lang;return Ce(r)}catch(r){return console.warn("could not detect locale, falling back to source locale",r),Le}}var Me=(r,e,o,t,a)=>{c.load("en",r),c.load("nb",e),c.load("fi",o),c.load("da",t),c.load("sv",a);let n=bo();c.activate(n)};import{css as Oe}from"lit";var Se=Oe`
10
+ `)),h(c)&&se.test(c)?JSON.parse(`"${c}"`):h(c)?c:Ge(c,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return R(this._locales||this._locale,e,o)}number(e,o){return $(this._locales||this._locale,e,o)}};function er(r={}){return new X(r)}var g=er();var Z=typeof window!="undefined",le=!0;if(Z){let r=window.matchMedia("(prefers-reduced-motion: reduce)"),e=({matches:o})=>le=!o;r.addEventListener&&r.addEventListener("change",e),e(r)}var de=r=>{r.style.transition=null,r.style.backfaceVisibility=null,r.style.overflow=null},pe=r=>{let e=le?"var(--f-expansion-duration, 0.3s)":"0.01s";r.style.transition=`height ${e}`,r.style.backfaceVisibility="hidden",r.style.overflow="hidden"},rr=(r,e)=>()=>{r.style.height="auto",r.style.overflow=null,e&&e()},or=r=>()=>{r&&r()},ge=(r,e)=>{let o=(()=>{if(!e)return new Promise(s=>{e=s})})(),t=rr(r,e);de(r),r.style.height="auto";let a=r.scrollHeight;if(Z&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height="0px",r.style.transitionTimingFunction="ease-out",pe(r),requestAnimationFrame(()=>r.style.height=a+"px")}),o)return o},be=(r,e)=>{let o=(()=>{if(!e)return new Promise(s=>{e=s})})(),t=or(e);de(r);let a=r.scrollHeight;if(Z&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height=a+"px",r.style.transitionTimingFunction="ease-in",pe(r),requestAnimationFrame(()=>r.style.height="0px")}),o)return o};import{css as mr,html as _,LitElement as hr}from"lit";import{property as F,state as vr}from"lit/decorators.js";import{when as wr}from"lit/directives/when.js";import{html as ar,LitElement as ir}from"lit";import{property as U,state as nr}from"lit/decorators.js";import{classMap as sr}from"lit/directives/class-map.js";import{css as tr}from"lit";var ue=tr`
11
+ :host {
12
+ display: inline-block;
13
+ }
14
+ .w-icon {
15
+ --_w-icon-size: var(--w-icon-size, 24px);
16
+ height: var(--_w-icon-size);
17
+ width: var(--_w-icon-size);
18
+ display: flex;
19
+ }
20
+ .w-icon svg {
21
+ pointer-events: none;
22
+ height: var(--_w-icon-size);
23
+ width: var(--_w-icon-size);
24
+ }
25
+ .w-icon--s {
26
+ --w-icon-size: 16px;
27
+ }
28
+ .w-icon--m {
29
+ --w-icon-size: 24px;
30
+ }
31
+ .w-icon--l {
32
+ --w-icon-size: 32px;
33
+ }
34
+
35
+ `;var q=new Map,cr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function lr(r,e={}){var t;let o=(t=e.responseParser)!=null?t:(a=>a.text());return q.has(r)||q.set(r,fetch(r).then(o)),q.get(r)}var v=class extends ir{constructor(){super(...arguments);this.name="";this.size="medium";this.locale="en";this.svg=null}async fetchIcon(o){let t=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${o}.svg`;try{let a=await lr(t);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch(a){return null}}firstUpdated(){this.loadIcon()}updated(o){(o.has("name")||o.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let o=await this.fetchIcon(this.name);o||(o=new DOMParser().parseFromString(cr,"text/html").body.firstElementChild),this.svg=o}render(){let o={"w-icon":!0,"w-icon--s":this.size==="small","w-icon--m":this.size==="medium","w-icon--l":this.size==="large"},t=typeof this.size=="string"&&this.size.endsWith("px")?`--w-icon-size: ${this.size};`:"";return ar`<div class="${sr(o)}" style="${t}" part="w-${this.name.toLowerCase()}">${this.svg}</div>`}};v.styles=[ue],p([U({type:String,reflect:!0})],v.prototype,"name",2),p([U({type:String,reflect:!0})],v.prototype,"size",2),p([U({type:String,reflect:!0})],v.prototype,"locale",2),p([nr()],v.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",v);var dr=["en","nb","fi","da","sv"],he="en",me=r=>dr.find(e=>r===e||r.toLowerCase().includes(e))||he;function L(){if(typeof window=="undefined"){let r=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return me(r)}try{let r=document.documentElement.lang;return me(r)}catch(r){return console.warn("could not detect locale, falling back to source locale",r),he}}var ve=(r,e,o,t,a)=>{g.load("en",r),g.load("nb",e),g.load("fi",o),g.load("da",t),g.load("sv",a);let s=L();g.activate(s)};import{css as we}from"lit";var fe=we`
11
36
  *,
12
37
  :before,
13
38
  :after {
@@ -280,7 +305,7 @@ Please compile your catalog first.
280
305
  svg {
281
306
  pointer-events: none;
282
307
  }
283
- `,tt=Oe`*, :before, :after {
308
+ `,$r=we`*, :before, :after {
284
309
  --w-rotate: 0;
285
310
  --w-rotate-x: 0;
286
311
  --w-rotate-y: 0;
@@ -2446,21 +2471,21 @@ Please compile your catalog first.
2446
2471
  display: none
2447
2472
  }
2448
2473
  }
2449
- `;var Ne=JSON.parse('{"toast.aria.error":["Fejl"],"toast.aria.successful":["Fuldf\xF8rt"],"toast.aria.warning":["Advarsel"]}');var Te=JSON.parse('{"toast.aria.error":["Error"],"toast.aria.successful":["Successful"],"toast.aria.warning":["Warning"]}');var je=JSON.parse('{"toast.aria.error":["Virhe"],"toast.aria.successful":["Onnistui"],"toast.aria.warning":["Varoitus"]}');var De=JSON.parse('{"toast.aria.error":["Feil"],"toast.aria.successful":["Vellykket"],"toast.aria.warning":["Advarsel"]}');var Ae=JSON.parse('{"toast.aria.error":["Fel"],"toast.aria.successful":["Genomf\xF6rt"],"toast.aria.warning":["Varning"]}');import{css as mo}from"lit";var Ie=mo`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.bg-transparent{background-color:#0000}.border-2{border-width:2px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.block{display:block}.flex{display:flex}.grid{display:grid}.shrink-0{flex-shrink:0}.auto-rows-auto{grid-auto-rows:auto}.overflow-hidden{overflow:hidden}.self-center{align-self:center}.bottom-16{bottom:1.6rem}.left-0{left:0}.right-0{right:0}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.fixed{position:fixed}.relative{position:relative}.static{position:static}.z-50{z-index:50}.s-bg-negative-subtle{background-color:var(--w-s-color-background-negative-subtle)}.s-bg-positive-subtle{background-color:var(--w-s-color-background-positive-subtle)}.s-bg-warning-subtle{background-color:var(--w-s-color-background-warning-subtle)}.s-text{color:var(--w-s-color-text)}.s-icon{color:var(--w-s-color-icon)}.s-icon-negative{color:var(--w-s-color-icon-negative)}.s-icon-positive{color:var(--w-s-color-icon-positive)}.s-icon-warning{color:var(--w-s-color-icon-warning)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border-negative-subtle{border-color:var(--w-s-color-border-negative-subtle)}.s-border-positive-subtle{border-color:var(--w-s-color-border-positive-subtle)}.s-border-warning-subtle{border-color:var(--w-s-color-border-warning-subtle)}.w-full{width:100%}.h-\\[16px\\]{height:16px}.w-\\[16px\\]{width:16px}.mx-8{margin-left:.8rem;margin-right:.8rem}.mx-auto{margin-left:auto;margin-right:auto}.last-child\\:mb-0>:last-child{margin-bottom:0}.ml-auto{margin-left:auto}.mr-8{margin-right:.8rem}.mt-16{margin-top:1.6rem}.m-\\[8px\\]{margin:8px}.p-8{padding:.8rem}.py-4{padding-top:.4rem;padding-bottom:.4rem}.p-\\[8px\\]{padding:8px}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.translate-z-0{--w-translate-z:0rem;transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transform{transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:480px){.sm\\:mx-16{margin-left:1.6rem;margin-right:1.6rem}}`;var S=typeof window!="undefined";function H(){return customElements.get("w-toast-container")}function vo(r,e){if(!S)return;let o=H().init(),t={id:Date.now().toString(36)+Math.random().toString(36).slice(2,5),text:r,duration:5e3,type:"success",...e};return o.set(t),t}function ho(r){return S?H().init().del(r):void 0}function fo(r,e){if(!S)return;let o=H().init();return o.set({...o.get(r),...e}),o.get(r)}var p={wrapper:"relative overflow-hidden w-full",base:"flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",positive:"s-bg-positive-subtle s-border-positive-subtle s-text",warning:"s-bg-warning-subtle s-border-warning-subtle s-text",negative:"s-bg-negative-subtle s-border-negative-subtle s-text",iconBase:"shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",iconPositive:"s-icon-positive",iconWarning:"s-icon-warning",iconNegative:"s-icon-negative",iconLoading:"animate-bounce",content:"self-center mr-8 py-4 last-child:mb-0",close:"bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"},_,Ye,Fe,b=class extends xo{constructor(){super();W(this,_);this.id=Date.now().toString(36)+Math.random().toString(36).slice(2,5);this.type="success";this.text="";this.canclose=!1;this._expanded=!1;Me(Te,De,je,Ne,Ae)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(){!this._expanded&&this._wrapper&&pe(this._wrapper,()=>this._expanded=!0)}get _wrapper(){var o,t;return(t=(o=this.renderRoot)==null?void 0:o.querySelector("section"))!=null?t:null}get _warning(){return this.type==="warning"}get _error(){return this.type==="error"}get _role(){return this._error||this._warning?"alert":"status"}get _typeLabel(){return this._warning?c._({id:"toast.aria.warning",message:"Warning",comment:"Default screenreader message for warning in toast component"}):this._error?c._({id:"toast.aria.error",message:"Error",comment:"Default screenreader message for error in toast component"}):c._({id:"toast.aria.successful",message:"Successful",comment:"Default screenreader message for successful in toast component"})}get _iconMarkup(){return this._warning?y`<w-icon-warning-16></w-icon-warning-16>`:this._error?y`<w-icon-error-16></w-icon-error-16>`:y`<w-icon-success-16></w-icon-success-16>`}async collapse(){return new Promise(o=>{this._expanded&&this._wrapper?ge(this._wrapper,o):o()})}close(){let o=new CustomEvent("close",{detail:{id:this.id},bubbles:!0,composed:!0});this.updateComplete.then(()=>this.dispatchEvent(o))}render(){return this.text?y` <section class="${p.wrapper}" aria-label="${this._typeLabel}">
2450
- <div class="${A(this,_,Ye)}">
2451
- <div class="${A(this,_,Fe)}">${this._iconMarkup}</div>
2452
- <div role="${this._role}" class="${p.content}">
2474
+ `;var xe=JSON.parse('{"toast.aria.error":["Fejl"],"toast.aria.successful":["Fuldf\xF8rt"],"toast.aria.warning":["Advarsel"]}');var ye=JSON.parse('{"toast.aria.error":["Error"],"toast.aria.successful":["Successful"],"toast.aria.warning":["Warning"]}');var ke=JSON.parse('{"toast.aria.error":["Virhe"],"toast.aria.successful":["Onnistui"],"toast.aria.warning":["Varoitus"]}');var _e=JSON.parse('{"toast.aria.error":["Feil"],"toast.aria.successful":["Vellykket"],"toast.aria.warning":["Advarsel"]}');var ze=JSON.parse('{"toast.aria.error":["Fel"],"toast.aria.successful":["Genomf\xF6rt"],"toast.aria.warning":["Varning"]}');import{css as pr}from"lit";var Me=pr`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.bg-transparent{background-color:#0000}.border-2{border-width:2px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.block{display:block}.flex{display:flex}.grid{display:grid}.shrink-0{flex-shrink:0}.auto-rows-auto{grid-auto-rows:auto}.overflow-hidden{overflow:hidden}.self-center{align-self:center}.bottom-16{bottom:1.6rem}.left-0{left:0}.right-0{right:0}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.fixed{position:fixed}.relative{position:relative}.static{position:static}.z-50{z-index:50}.s-bg-negative-subtle{background-color:var(--w-s-color-background-negative-subtle)}.s-bg-positive-subtle{background-color:var(--w-s-color-background-positive-subtle)}.s-bg-warning-subtle{background-color:var(--w-s-color-background-warning-subtle)}.s-text{color:var(--w-s-color-text)}.s-icon{color:var(--w-s-color-icon)}.s-icon-negative{color:var(--w-s-color-icon-negative)}.s-icon-positive{color:var(--w-s-color-icon-positive)}.s-icon-warning{color:var(--w-s-color-icon-warning)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border-negative-subtle{border-color:var(--w-s-color-border-negative-subtle)}.s-border-positive-subtle{border-color:var(--w-s-color-border-positive-subtle)}.s-border-warning-subtle{border-color:var(--w-s-color-border-warning-subtle)}.w-full{width:100%}.h-\\[16px\\]{height:16px}.w-\\[16px\\]{width:16px}.mx-8{margin-left:.8rem;margin-right:.8rem}.mx-auto{margin-left:auto;margin-right:auto}.last-child\\:mb-0>:last-child{margin-bottom:0}.ml-auto{margin-left:auto}.mr-8{margin-right:.8rem}.mt-16{margin-top:1.6rem}.m-\\[8px\\]{margin:8px}.p-8{padding:.8rem}.py-4{padding-top:.4rem;padding-bottom:.4rem}.p-\\[8px\\]{padding:8px}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.translate-z-0{--w-translate-z:0rem;transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transform{transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:480px){.sm\\:mx-16{margin-left:1.6rem;margin-right:1.6rem}}`;var P=typeof window!="undefined";function H(){return customElements.get("w-toast-container")}function gr(r,e){if(!P)return;let o=H().init(),t={id:Date.now().toString(36)+Math.random().toString(36).slice(2,5),text:r,duration:5e3,type:"success",...e};return o.set(t),t}function br(r){return P?H().init().del(r):void 0}function ur(r,e){if(!P)return;let o=H().init();return o.set({...o.get(r),...e}),o.get(r)}var b={wrapper:"relative overflow-hidden w-full",base:"flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",positive:"s-bg-positive-subtle s-border-positive-subtle s-text",warning:"s-bg-warning-subtle s-border-warning-subtle s-text",negative:"s-bg-negative-subtle s-border-negative-subtle s-text",iconBase:"shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",iconPositive:"s-icon-positive",iconWarning:"s-icon-warning",iconNegative:"s-icon-negative",iconLoading:"animate-bounce",content:"self-center mr-8 py-4 last-child:mb-0",close:"bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"},z,Ee,Ce,m=class extends hr{constructor(){super();Q(this,z);this.id=Date.now().toString(36)+Math.random().toString(36).slice(2,5);this.type="success";this.text="";this.canclose=!1;this._expanded=!1;ve(ye,_e,ke,xe,ze)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(){!this._expanded&&this._wrapper&&ge(this._wrapper,()=>this._expanded=!0)}get _wrapper(){var o,t;return(t=(o=this.renderRoot)==null?void 0:o.querySelector("section"))!=null?t:null}get _warning(){return this.type==="warning"}get _error(){return this.type==="error"}get _role(){return this._error||this._warning?"alert":"status"}get _typeLabel(){return this._warning?g._({id:"toast.aria.warning",message:"Warning",comment:"Default screenreader message for warning in toast component"}):this._error?g._({id:"toast.aria.error",message:"Error",comment:"Default screenreader message for error in toast component"}):g._({id:"toast.aria.successful",message:"Successful",comment:"Default screenreader message for successful in toast component"})}get _iconMarkup(){let o=L();return this._warning?_`<w-icon name="Warning" size="small" locale="${o}" class="flex"></w-icon>`:this._error?_`<w-icon name="Error" size="small" locale="${o}" class="flex"></w-icon>`:_`<w-icon name="Success" size="small" locale="${o}" class="flex"></w-icon>`}async collapse(){return new Promise(o=>{this._expanded&&this._wrapper?be(this._wrapper,o):o()})}close(){let o=new CustomEvent("close",{detail:{id:this.id},bubbles:!0,composed:!0});this.updateComplete.then(()=>this.dispatchEvent(o))}render(){return this.text?_` <section class="${b.wrapper}" aria-label="${this._typeLabel}">
2475
+ <div class="${N(this,z,Ee)}">
2476
+ <div class="${N(this,z,Ce)}">${this._iconMarkup}</div>
2477
+ <div role="${this._role}" class="${b.content}">
2453
2478
  <p>${this.text}</p>
2454
2479
  </div>
2455
- ${yo(this.canclose===!0,()=>y`
2480
+ ${wr(this.canclose===!0,()=>_`
2456
2481
  <w-button variant="pill" small="" @click="${this.close}">
2457
- <w-icon-close-16 style="display: flex"></w-icon-close-16>
2482
+ <w-icon name="Close" size="small" locale="${L()}" style="display: flex" class="flex"></w-icon>
2458
2483
  </w-button>
2459
2484
  `)}
2460
2485
  </div>
2461
- </section>`:y``}};_=new WeakSet,Ye=function(){return C([p.base,this.type==="success"&&p.positive,this.type==="warning"&&p.warning,this.type==="error"&&p.negative])},Fe=function(){return C([p.iconBase,this.type==="success"&&p.iconPositive,this.type==="warning"&&p.iconWarning,this.type==="error"&&p.iconNegative])},b.styles=[Se,Ie,wo`
2486
+ </section>`:_``}};z=new WeakSet,Ee=function(){return C([b.base,this.type==="success"&&b.positive,this.type==="warning"&&b.warning,this.type==="error"&&b.negative])},Ce=function(){return C([b.iconBase,this.type==="success"&&b.iconPositive,this.type==="warning"&&b.iconWarning,this.type==="error"&&b.iconNegative])},m.styles=[fe,Me,mr`
2462
2487
  :host {
2463
2488
  display: block;
2464
2489
  }
2465
- `],x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"id",2),x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"type",2),x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"text",2),x([N({type:Boolean,attribute:!0,reflect:!0})],b.prototype,"canclose",2),x([ko()],b.prototype,"_expanded",2);customElements.get("w-toast")||customElements.define("w-toast",b);export{b as WarpToast,ho as removeToast,vo as toast,fo as updateToast};
2490
+ `],p([F({type:String,attribute:!0,reflect:!0})],m.prototype,"id",2),p([F({type:String,attribute:!0,reflect:!0})],m.prototype,"type",2),p([F({type:String,attribute:!0,reflect:!0})],m.prototype,"text",2),p([F({type:Boolean,attribute:!0,reflect:!0})],m.prototype,"canclose",2),p([vr()],m.prototype,"_expanded",2);customElements.get("w-toast")||customElements.define("w-toast",m);export{m as WarpToast,br as removeToast,gr as toast,ur as updateToast};
2466
2491
  //# sourceMappingURL=toast.js.map