@warp-ds/elements 2.6.0-next.5 → 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.
@@ -4691,7 +4691,8 @@
4691
4691
  "type": {
4692
4692
  "text": "string"
4693
4693
  },
4694
- "attribute": "name"
4694
+ "attribute": "name",
4695
+ "reflects": true
4695
4696
  },
4696
4697
  {
4697
4698
  "kind": "field",
@@ -4699,7 +4700,8 @@
4699
4700
  "type": {
4700
4701
  "text": "string"
4701
4702
  },
4702
- "attribute": "placeholder"
4703
+ "attribute": "placeholder",
4704
+ "reflects": true
4703
4705
  },
4704
4706
  {
4705
4707
  "kind": "field",
@@ -0,0 +1 @@
1
+ import './pagination.js';
@@ -0,0 +1,36 @@
1
+ import { html } from 'lit';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { render } from 'vitest-browser-lit';
4
+ import './pagination.js';
5
+ describe('w-pagination accessibility (WCAG 2.2)', () => {
6
+ describe('axe-core automated checks', () => {
7
+ test('default state has no violations', async () => {
8
+ const page = render(html `<w-pagination current-page="5" pages="10" base-url="/page/"></w-pagination>`);
9
+ await expect(page).toHaveNoAxeViolations();
10
+ });
11
+ test('first page (no first or previous links) has no violations', async () => {
12
+ const page = render(html `<w-pagination current-page="1" pages="10" base-url="/page/"></w-pagination>`);
13
+ await expect(page).toHaveNoAxeViolations();
14
+ });
15
+ });
16
+ describe('WCAG 1.3.1 - Info and Relationships', () => {
17
+ test('page links expose accessible names', async () => {
18
+ const page = render(html `<w-pagination current-page="3" pages="5" base-url="/page/"></w-pagination>`);
19
+ await expect.element(page.getByRole('link', { name: 'Page 3' })).toBeVisible();
20
+ await expect.element(page.getByRole('link', { name: 'Page 2' })).toBeVisible();
21
+ });
22
+ });
23
+ describe('WCAG 4.1.2 - Name, Role, Value', () => {
24
+ test('current page is exposed via aria-current', async () => {
25
+ const page = render(html `<w-pagination current-page="4" pages="8" base-url="/page/"></w-pagination>`);
26
+ await expect.element(page.getByRole('link', { name: 'Page 4' })).toHaveAttribute('aria-current', 'page');
27
+ await expect.element(page.getByRole('link', { name: 'Page 3' })).not.toHaveAttribute('aria-current', 'page');
28
+ });
29
+ test('navigation controls have accessible names', async () => {
30
+ const page = render(html `<w-pagination current-page="4" pages="8" base-url="/page/"></w-pagination>`);
31
+ await expect.element(page.getByRole('link', { name: 'First page' })).toBeVisible();
32
+ await expect.element(page.getByRole('link', { name: 'Previous page' })).toBeVisible();
33
+ await expect.element(page.getByRole('link', { name: 'Next page' })).toBeVisible();
34
+ });
35
+ });
36
+ });
@@ -0,0 +1,2 @@
1
+ import '../step/step.js';
2
+ import './step-indicator.js';
@@ -0,0 +1,66 @@
1
+ import { html } from 'lit';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { render } from 'vitest-browser-lit';
4
+ import '../step/step.js';
5
+ import './step-indicator.js';
6
+ describe('w-step-indicator accessibility (WCAG 2.2)', () => {
7
+ test('default state has no violations', async () => {
8
+ const page = render(html `
9
+ <w-step-indicator>
10
+ <w-step>Step one</w-step>
11
+ <w-step active>Step two</w-step>
12
+ <w-step>Step three</w-step>
13
+ </w-step-indicator>
14
+ `);
15
+ await expect(page).toHaveNoAxeViolations();
16
+ });
17
+ test('horizontal state has no violations', async () => {
18
+ const page = render(html `
19
+ <w-step-indicator horizontal>
20
+ <w-step completed>Step one</w-step>
21
+ <w-step active>Step two</w-step>
22
+ <w-step>Step three</w-step>
23
+ </w-step-indicator>
24
+ `);
25
+ await expect(page).toHaveNoAxeViolations();
26
+ });
27
+ });
28
+ describe('WCAG 1.3.1 - Info and Relationships', () => {
29
+ test('steps are exposed as a list of listitems', async () => {
30
+ const page = render(html `
31
+ <w-step-indicator>
32
+ <w-step>Step one</w-step>
33
+ <w-step>Step two</w-step>
34
+ </w-step-indicator>
35
+ `);
36
+ await expect.element(page.getByRole('list')).toBeVisible();
37
+ await expect.poll(() => page.getByRole('listitem').all().length).toBeGreaterThan(0);
38
+ });
39
+ });
40
+ describe('WCAG 4.1.2 - Name, Role, Value', () => {
41
+ test('active step is exposed via aria-current', async () => {
42
+ render(html `
43
+ <w-step-indicator>
44
+ <w-step>Step one</w-step>
45
+ <w-step active>Step two</w-step>
46
+ </w-step-indicator>
47
+ `);
48
+ const activeStep = document.querySelector('w-step[active]');
49
+ expect(activeStep).toBeTruthy();
50
+ await expect.poll(() => activeStep?.shadowRoot?.querySelector('[aria-current="step"]')).toBeTruthy();
51
+ });
52
+ test('step status icon has an accessible name', async () => {
53
+ render(html `
54
+ <w-step-indicator>
55
+ <w-step completed>Step one</w-step>
56
+ <w-step>Step two</w-step>
57
+ </w-step-indicator>
58
+ `);
59
+ const completedStep = document.querySelector('w-step[completed]');
60
+ expect(completedStep).toBeTruthy();
61
+ await expect.poll(() => completedStep?.shadowRoot?.querySelector('[aria-label="Step indicator completed circle"]')).toBeTruthy();
62
+ const incompleteStep = document.querySelector('w-step:not([completed])');
63
+ expect(incompleteStep).toBeTruthy();
64
+ await expect.poll(() => incompleteStep?.shadowRoot?.querySelector('[aria-label="Step indicator completed circle"]')).toBeFalsy();
65
+ });
66
+ });
@@ -0,0 +1 @@
1
+ import './textarea.js';
@@ -0,0 +1,115 @@
1
+ import { html } from 'lit';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { render } from 'vitest-browser-lit';
4
+ import { i18n } from '@lingui/core';
5
+ import { messages } from './locales/en/messages.mjs';
6
+ import './textarea.js';
7
+ // Initialize i18n with English locale for tests
8
+ i18n.load('en', messages);
9
+ i18n.activate('en');
10
+ describe('w-textarea accessibility (WCAG 2.2)', () => {
11
+ describe('axe-core automated checks', () => {
12
+ // go through setting the various attributes and running automated AXE tests on each
13
+ test('default state has no violations', async () => {
14
+ const page = render(html `<w-textarea label="Message"></w-textarea>`);
15
+ await expect(page).toHaveNoAxeViolations();
16
+ });
17
+ test('with help text has no violations', async () => {
18
+ const page = render(html `<w-textarea label="Message" help-text="Enter your message"></w-textarea>`);
19
+ await expect(page).toHaveNoAxeViolations();
20
+ });
21
+ test('invalid state has no violations', async () => {
22
+ const page = render(html `<w-textarea label="Message" invalid help-text="This field is required"></w-textarea>`);
23
+ await expect(page).toHaveNoAxeViolations();
24
+ });
25
+ test('disabled state has no violations', async () => {
26
+ const page = render(html `<w-textarea label="Message" disabled></w-textarea>`);
27
+ await expect(page).toHaveNoAxeViolations();
28
+ });
29
+ test('readonly state has no violations', async () => {
30
+ const page = render(html `<w-textarea label="Message" readonly value="Read only text"></w-textarea>`);
31
+ await expect(page).toHaveNoAxeViolations();
32
+ });
33
+ test('required state has no violations', async () => {
34
+ const page = render(html `<w-textarea label="Message" required></w-textarea>`);
35
+ await expect(page).toHaveNoAxeViolations();
36
+ });
37
+ test('optional state has no violations', async () => {
38
+ const page = render(html `<w-textarea label="Message" optional></w-textarea>`);
39
+ await expect(page).toHaveNoAxeViolations();
40
+ });
41
+ });
42
+ describe('WCAG 1.3.1 - Info and Relationships', () => {
43
+ test('textarea has accessible name from label', async () => {
44
+ const page = render(html `<w-textarea label="Description"></w-textarea>`);
45
+ // this checks that after we set the label to "Description", the textbox's accessible name is also "Description".
46
+ // accessible name is derived from the label (or aria-label / aria-labelledby) if present (which they are not in this case)
47
+ await expect.element(page.getByRole('textbox', { name: 'Description' })).toBeVisible();
48
+ });
49
+ });
50
+ describe('WCAG 3.3.1 - Error Identification', () => {
51
+ test('error state is indicated via aria-invalid', async () => {
52
+ const page = render(html `<w-textarea label="Message" invalid></w-textarea>`);
53
+ await expect.element(page.getByLabelText('Message')).toHaveAttribute('aria-invalid', 'true');
54
+ });
55
+ test('error message is associated via aria-errormessage', async () => {
56
+ const page = render(html `<w-textarea label="Message" invalid help-text="Field is required"></w-textarea>`);
57
+ await expect.element(page.getByLabelText('Message')).toHaveAccessibleErrorMessage('Field is required');
58
+ });
59
+ });
60
+ describe('WCAG 3.3.2 - Labels or Instructions', () => {
61
+ test('help text is programmatically associated', async () => {
62
+ const page = render(html `<w-textarea label="Bio" help-text="Tell us about yourself"></w-textarea>`);
63
+ await expect.element(page.getByLabelText('Bio')).toHaveAccessibleDescription('Tell us about yourself');
64
+ });
65
+ });
66
+ // these tests essentially verify that the attributes we set on the host are mirrored to the internal textarea
67
+ describe('WCAG 4.1.2 - Name, Role, Value', () => {
68
+ test('required state is exposed', async () => {
69
+ const page = render(html `<w-textarea label="Name" required></w-textarea>`);
70
+ // getByLabelText resolves to the internal <textarea>, not the host element
71
+ await expect.element(page.getByLabelText('Name')).toHaveAttribute('required');
72
+ });
73
+ test('disabled state is exposed', async () => {
74
+ const page = render(html `<w-textarea label="Name" disabled></w-textarea>`);
75
+ await expect.element(page.getByLabelText('Name')).toBeDisabled();
76
+ });
77
+ test('readonly state is exposed', async () => {
78
+ const page = render(html `<w-textarea label="Name" readonly></w-textarea>`);
79
+ await expect.element(page.getByLabelText('Name')).toHaveAttribute('readonly');
80
+ });
81
+ test('value is exposed', async () => {
82
+ const page = render(html `<w-textarea label="Name" value="Hello"></w-textarea>`);
83
+ await expect.element(page.getByLabelText('Name')).toHaveValue('Hello');
84
+ });
85
+ });
86
+ describe('WCAG 2.1.1 - Keyboard', () => {
87
+ test('textarea is focusable', async () => {
88
+ const page = render(html `<w-textarea label="Message"></w-textarea>`);
89
+ const textarea = page.getByLabelText('Message');
90
+ await textarea.click();
91
+ // Check focus via activeElement - delegatesFocus means the shadow root's textarea gets focus
92
+ const wTextarea = document.querySelector('w-textarea');
93
+ await expect.poll(() => wTextarea?.shadowRoot?.activeElement?.tagName).toBe('TEXTAREA');
94
+ });
95
+ test('disabled textarea is not focusable', async () => {
96
+ const page = render(html `
97
+ <button>Before</button>
98
+ <w-textarea label="Message" disabled></w-textarea>
99
+ <button>After</button>
100
+ `);
101
+ const buttons = Array.from(document.querySelectorAll('button'));
102
+ const beforeBtn = buttons[0];
103
+ const afterBtn = buttons[1];
104
+ expect(beforeBtn).toBeDefined();
105
+ expect(afterBtn).toBeDefined();
106
+ beforeBtn?.focus();
107
+ // Attempt to move focus to the disabled textarea; focus should remain on "Before".
108
+ const wTextarea = document.querySelector('w-textarea');
109
+ wTextarea?.click();
110
+ await expect.element(beforeBtn).toHaveFocus();
111
+ // Verify disabled textarea doesn't receive focus
112
+ expect(wTextarea?.shadowRoot?.activeElement).toBeNull();
113
+ });
114
+ });
115
+ });
@@ -1,5 +1,5 @@
1
- var Be=Object.create;var he=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var _e=o=>{throw TypeError(o)};var Ce=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Qe=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ge(e))!Ke.call(o,a)&&a!==r&&he(o,a,{get:()=>e[a],enumerable:!(t=ke(e,a))||t.enumerable});return o};var We=(o,e,r)=>(r=o!=null?Be(Je(o)):{},Qe(e||!o||!o.__esModule?he(r,"default",{value:o,enumerable:!0}):r,o));var w=(o,e,r,t)=>{for(var a=t>1?void 0:t?ke(e,r):e,l=o.length-1,n;l>=0;l--)(n=o[l])&&(a=(t?n(e,r,a):n(a))||a);return t&&a&&he(e,r,a),a};var be=(o,e,r)=>e.has(o)||_e("Cannot "+r);var V=(o,e,r)=>(be(o,e,"read from private field"),r?r.call(o):e.get(o)),I=(o,e,r)=>e.has(o)?_e("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),E=(o,e,r,t)=>(be(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r),m=(o,e,r)=>(be(o,e,"access private method"),r);var ze=Ce(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.errorMessages=j.ErrorType=void 0;var U;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(U=j.ErrorType||(j.ErrorType={}));j.errorMessages=new Map([[U.MalformedUnicode,"malformed Unicode character escape sequence"],[U.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[U.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[U.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[U.EndOfString,"malformed escape sequence at end of string"]])});var Fe=Ce(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.unraw=S.errorMessages=S.ErrorType=void 0;var x=ze();Object.defineProperty(S,"ErrorType",{enumerable:!0,get:function(){return x.ErrorType}});Object.defineProperty(S,"errorMessages",{enumerable:!0,get:function(){return x.errorMessages}});function er(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function re(o,e,r){let t=er(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(x.errorMessages.get(e));return t}function rr(o){let e=re(o,x.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function Me(o,e){let r=re(o,x.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=re(e,x.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function or(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function tr(o){if(!or(o))throw new SyntaxError(x.errorMessages.get(x.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=re(e,x.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(x.errorMessages.get(x.ErrorType.CodePointLimit)):t}}function ar(o,e=!1){if(e)throw new SyntaxError(x.errorMessages.get(x.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var ir=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function nr(o){return ir.get(o)||o}var sr=/\\(?:(\\)|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 Ee(o,e=!1){return o.replace(sr,function(r,t,a,l,n,i,d,p,y){if(t!==void 0)return"\\";if(a!==void 0)return rr(a);if(l!==void 0)return tr(l);if(n!==void 0)return Me(n,i);if(d!==void 0)return Me(d);if(p==="0")return"\0";if(p!==void 0)return ar(p,!e);if(y!==void 0)return nr(y);throw new SyntaxError(x.errorMessages.get(x.ErrorType.EndOfString))})}S.unraw=Ee;S.default=Ee});var ee=function(){for(var o=[],e=arguments.length;e--;)o[e]=arguments[e];return o.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?ee.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var Oe=We(Fe(),1);var N=o=>typeof o=="string",lr=o=>typeof o=="function",Ve=new Map,Ae="en";function ve(o){return[...Array.isArray(o)?o:[o],Ae]}function me(o,e,r){let t=ve(o);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return oe(()=>te("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(N(e)?new Date(e):e)}function dr(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return me(o,e,t)}function ue(o,e,r){let t=ve(o);return oe(()=>te("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function Se(o,e,r,{offset:t=0,...a}){var i,d;let l=ve(o),n=e?oe(()=>te("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):oe(()=>te("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[n.select(r-t)])!=null?d:a.other}function oe(o,e){let r=o(),t=Ve.get(r);return t||(t=e(),Ve.set(r,t)),t}function te(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var Pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ie="%__lingui_octothorpe__%",cr=(o,e,r={})=>{let t=e||o,a=n=>typeof n=="object"?n:r[n],l=(n,i)=>{let d=Object.keys(r).length?a("number"):void 0,p=ue(t,n,d);return i.replace(new RegExp(Ie,"g"),p)};return{plural:(n,i)=>{let{offset:d=0}=i,p=Se(t,!1,n,i);return l(n-d,p)},selectordinal:(n,i)=>{let{offset:d=0}=i,p=Se(t,!0,n,i);return l(n-d,p)},select:hr,number:(n,i)=>ue(t,n,a(i)||{style:i}),date:(n,i)=>me(t,n,a(i)||i),time:(n,i)=>dr(t,n,a(i)||i)}},hr=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function br(o,e,r){return(t={},a)=>{let l=cr(e,r,a),n=(d,p=!1)=>Array.isArray(d)?d.reduce((y,M)=>{if(M==="#"&&p)return y+Ie;if(N(M))return y+M;let[R,C,A]=M,P={};C==="plural"||C==="selectordinal"||C==="select"?Object.entries(A).forEach(([L,X])=>{P[L]=n(X,C==="plural"||C==="selectordinal")}):P=A;let k;if(C){let L=l[C];k=L(t[R],P)}else k=t[R];return k==null?y:y+k},""):d,i=n(o);return N(i)&&Pe.test(i)?(0,Oe.unraw)(i):N(i)?i:i?String(i):""}}var ur=Object.defineProperty,pr=(o,e,r)=>e in o?ur(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,gr=(o,e,r)=>(pr(o,typeof e!="symbol"?e+"":e,r),r),pe=class{constructor(){gr(this,"_events",{})}on(e,r){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},vr=Object.defineProperty,mr=(o,e,r)=>e in o?vr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Y=(o,e,r)=>(mr(o,typeof e!="symbol"?e+"":e,r),r),ge=class extends pe{constructor(e){var r;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((r=e.locale)!=null?r:Ae,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,r){let t=this._localeData[e];t?Object.assign(t,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,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=""),N(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],n=l===void 0,i=this._missing;if(i&&n)return lr(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let d=l||a||e;return N(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
1
+ var Be=Object.create;var he=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var _e=t=>{throw TypeError(t)};var Ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Qe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ge(e))!Ke.call(t,a)&&a!==r&&he(t,a,{get:()=>e[a],enumerable:!(o=ke(e,a))||o.enumerable});return t};var We=(t,e,r)=>(r=t!=null?Be(Je(t)):{},Qe(e||!t||!t.__esModule?he(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ke(e,r):e,l=t.length-1,n;l>=0;l--)(n=t[l])&&(a=(o?n(e,r,a):n(a))||a);return o&&a&&he(e,r,a),a};var be=(t,e,r)=>e.has(t)||_e("Cannot "+r);var V=(t,e,r)=>(be(t,e,"read from private field"),r?r.call(t):e.get(t)),I=(t,e,r)=>e.has(t)?_e("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),E=(t,e,r,o)=>(be(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),m=(t,e,r)=>(be(t,e,"access private method"),r);var ze=Ce(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.errorMessages=j.ErrorType=void 0;var U;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(U=j.ErrorType||(j.ErrorType={}));j.errorMessages=new Map([[U.MalformedUnicode,"malformed Unicode character escape sequence"],[U.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[U.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[U.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[U.EndOfString,"malformed escape sequence at end of string"]])});var Fe=Ce(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.unraw=S.errorMessages=S.ErrorType=void 0;var x=ze();Object.defineProperty(S,"ErrorType",{enumerable:!0,get:function(){return x.ErrorType}});Object.defineProperty(S,"errorMessages",{enumerable:!0,get:function(){return x.errorMessages}});function er(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function re(t,e,r){let o=er(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(x.errorMessages.get(e));return o}function rr(t){let e=re(t,x.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function Me(t,e){let r=re(t,x.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=re(e,x.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function tr(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function or(t){if(!tr(t))throw new SyntaxError(x.errorMessages.get(x.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=re(e,x.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(x.errorMessages.get(x.ErrorType.CodePointLimit)):o}}function ar(t,e=!1){if(e)throw new SyntaxError(x.errorMessages.get(x.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var ir=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function nr(t){return ir.get(t)||t}var sr=/\\(?:(\\)|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 Ee(t,e=!1){return t.replace(sr,function(r,o,a,l,n,i,d,p,y){if(o!==void 0)return"\\";if(a!==void 0)return rr(a);if(l!==void 0)return or(l);if(n!==void 0)return Me(n,i);if(d!==void 0)return Me(d);if(p==="0")return"\0";if(p!==void 0)return ar(p,!e);if(y!==void 0)return nr(y);throw new SyntaxError(x.errorMessages.get(x.ErrorType.EndOfString))})}S.unraw=Ee;S.default=Ee});var ee=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?ee.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var Oe=We(Fe(),1);var N=t=>typeof t=="string",lr=t=>typeof t=="function",Ve=new Map,Ae="en";function ve(t){return[...Array.isArray(t)?t:[t],Ae]}function me(t,e,r){let o=ve(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return te(()=>oe("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(N(e)?new Date(e):e)}function dr(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return me(t,e,o)}function ue(t,e,r){let o=ve(t);return te(()=>oe("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function Se(t,e,r,{offset:o=0,...a}){var i,d;let l=ve(t),n=e?te(()=>oe("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):te(()=>oe("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[n.select(r-o)])!=null?d:a.other}function te(t,e){let r=t(),o=Ve.get(r);return o||(o=e(),Ve.set(r,o)),o}function oe(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ie="%__lingui_octothorpe__%",cr=(t,e,r={})=>{let o=e||t,a=n=>typeof n=="object"?n:r[n],l=(n,i)=>{let d=Object.keys(r).length?a("number"):void 0,p=ue(o,n,d);return i.replace(new RegExp(Ie,"g"),p)};return{plural:(n,i)=>{let{offset:d=0}=i,p=Se(o,!1,n,i);return l(n-d,p)},selectordinal:(n,i)=>{let{offset:d=0}=i,p=Se(o,!0,n,i);return l(n-d,p)},select:hr,number:(n,i)=>ue(o,n,a(i)||{style:i}),date:(n,i)=>me(o,n,a(i)||i),time:(n,i)=>dr(o,n,a(i)||i)}},hr=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function br(t,e,r){return(o={},a)=>{let l=cr(e,r,a),n=(d,p=!1)=>Array.isArray(d)?d.reduce((y,M)=>{if(M==="#"&&p)return y+Ie;if(N(M))return y+M;let[R,C,A]=M,P={};C==="plural"||C==="selectordinal"||C==="select"?Object.entries(A).forEach(([L,X])=>{P[L]=n(X,C==="plural"||C==="selectordinal")}):P=A;let k;if(C){let L=l[C];k=L(o[R],P)}else k=o[R];return k==null?y:y+k},""):d,i=n(t);return N(i)&&Pe.test(i)?(0,Oe.unraw)(i):N(i)?i:i?String(i):""}}var ur=Object.defineProperty,pr=(t,e,r)=>e in t?ur(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gr=(t,e,r)=>(pr(t,typeof e!="symbol"?e+"":e,r),r),pe=class{constructor(){gr(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},vr=Object.defineProperty,mr=(t,e,r)=>e in t?vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y=(t,e,r)=>(mr(t,typeof e!="symbol"?e+"":e,r),r),ge=class extends pe{constructor(e){var r;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((r=e.locale)!=null?r:Ae,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,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){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=o==null?void 0:o.message;e||(e=""),N(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],n=l===void 0,i=this._missing;if(i&&n)return lr(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let d=l||a||e;return N(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
3
3
 
4
4
  > ${d}
5
5
 
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
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
- `)),N(d)&&Pe.test(d)?JSON.parse(`"${d}"`):N(d)?d:br(d,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return me(this._locales||this._locale,e,r)}number(e,r){return ue(this._locales||this._locale,e,r)}};function fr(o={}){return new ge(o)}var Ne=fr();var h=function(o,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!t:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(o):t?t.value:e.get(o)},v=function(o,e,r,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!a:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,r):a?a.value=r:e.set(o,r),r};function Te(o){var e,r,t,a,l,n,i,d,p,y,M,R,C,A,P,k,L,X,le;class Ze extends o{constructor(...s){var c,g,f;super(...s),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),t.set(this,!1),a.set(this,!1),l.set(this,void 0),n.set(this,void 0),i.set(this,!0),p.set(this,""),y.set(this,()=>{v(this,a,!0,"f"),v(this,r,!0,"f"),h(this,e,"m",k).call(this)}),M.set(this,()=>{v(this,r,!1,"f"),h(this,e,"m",L).call(this,this.shouldFormValueUpdate()?h(this,p,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,t,!0,"f");let F=h(this,e,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),R.set(this,()=>{var F;h(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,i,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),h(this,e,"m",k).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),C.set(this,void 0),A.set(this,!1),P.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,y,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,M,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,R,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let s=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...s])]}static getValidator(s){return this.validators.find(c=>c.attribute===s)||null}static getValidators(s){return this.validators.filter(c=>{var g;if(c.attribute===s||!((g=c.attribute)===null||g===void 0)&&g.includes(s))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(s,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,s,c,g);let B=this.constructor.getValidators(s);B!=null&&B.length&&this.validationTarget&&this.setValue(h(this,p,"f"))}setValue(s){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,p,s,"f");let f=this.shouldFormValueUpdate()?s:null;this.internals.setFormValue(f),h(this,e,"m",L).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,e,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(s=>s(h(this,P,"f")))}formResetCallback(){var s,c;v(this,a,!1,"f"),v(this,t,!1,"f"),h(this,e,"m",k).call(this),(s=this.resetFormControl)===null||s===void 0||s.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",k).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,l=new WeakMap,n=new WeakMap,i=new WeakMap,p=new WeakMap,y=new WeakMap,M=new WeakMap,R=new WeakMap,C=new WeakMap,A=new WeakMap,P=new WeakMap,e=new WeakSet,d=function(){let s=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return s.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let s=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return s&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),s},L=function(s){let c=this.constructor,g={},f=c.validators,F=[],B=f.some(z=>z.isValid instanceof Promise);h(this,A,"f")||(v(this,P,new Promise(z=>{v(this,C,z,"f")}),"f"),v(this,A,!0,"f")),h(this,l,"f")&&(h(this,l,"f").abort(),v(this,n,h(this,l,"f"),"f"));let G=new AbortController;v(this,l,G,"f");let J,ye=!1;f.length&&(f.forEach(z=>{let de=z.key||"customError",H=z.isValid(this,s,G.signal);H instanceof Promise?(F.push(H),H.then(ce=>{ce!=null&&(g[de]=!ce,J=h(this,e,"m",le).call(this,z,s),h(this,e,"m",X).call(this,g,J))})):(g[de]=!H,this.validity[de]!==!H&&(ye=!0),!H&&!J&&(J=h(this,e,"m",le).call(this,z,s)))}),Promise.allSettled(F).then(()=>{var z;G!=null&&G.signal.aborted||(v(this,A,!1,"f"),(z=h(this,C,"f"))===null||z===void 0||z.call(this))}),(ye||!B)&&h(this,e,"m",X).call(this,g,J))},X=function(s,c){if(this.validationTarget)this.internals.setValidity(s,c,this.validationTarget),v(this,i,!1,"f");else{if(this.internals.setValidity(s,c),this.internals.validity.valid)return;v(this,i,!0,"f")}},le=function(s,c){if(this.validityCallback){let g=this.validityCallback(s.key||"customError");if(g)return g}return s.message instanceof Function?s.message(this,c):s.message},Ze}import{html as ae,LitElement as He,nothing as ie}from"lit";import{property as _,query as xr,state as Ue}from"lit/decorators.js";import{ifDefined as ne}from"lit/directives/if-defined.js";import{css as $e}from"lit";var Le=$e`
10
+ `)),N(d)&&Pe.test(d)?JSON.parse(`"${d}"`):N(d)?d:br(d,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return me(this._locales||this._locale,e,r)}number(e,r){return ue(this._locales||this._locale,e,r)}};function fr(t={}){return new ge(t)}var Ne=fr();var h=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},v=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function Te(t){var e,r,o,a,l,n,i,d,p,y,M,R,C,A,P,k,L,X,le;class Ze extends t{constructor(...s){var c,g,f;super(...s),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),l.set(this,void 0),n.set(this,void 0),i.set(this,!0),p.set(this,""),y.set(this,()=>{v(this,a,!0,"f"),v(this,r,!0,"f"),h(this,e,"m",k).call(this)}),M.set(this,()=>{v(this,r,!1,"f"),h(this,e,"m",L).call(this,this.shouldFormValueUpdate()?h(this,p,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,o,!0,"f");let F=h(this,e,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),R.set(this,()=>{var F;h(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,i,!1,"f")),v(this,a,!0,"f"),v(this,o,!0,"f"),h(this,e,"m",k).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),C.set(this,void 0),A.set(this,!1),P.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,y,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,M,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,R,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let s=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...s])]}static getValidator(s){return this.validators.find(c=>c.attribute===s)||null}static getValidators(s){return this.validators.filter(c=>{var g;if(c.attribute===s||!((g=c.attribute)===null||g===void 0)&&g.includes(s))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(s,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,s,c,g);let B=this.constructor.getValidators(s);B!=null&&B.length&&this.validationTarget&&this.setValue(h(this,p,"f"))}setValue(s){var c;v(this,o,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,p,s,"f");let f=this.shouldFormValueUpdate()?s:null;this.internals.setFormValue(f),h(this,e,"m",L).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,e,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(s=>s(h(this,P,"f")))}formResetCallback(){var s,c;v(this,a,!1,"f"),v(this,o,!1,"f"),h(this,e,"m",k).call(this),(s=this.resetFormControl)===null||s===void 0||s.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",k).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,n=new WeakMap,i=new WeakMap,p=new WeakMap,y=new WeakMap,M=new WeakMap,R=new WeakMap,C=new WeakMap,A=new WeakMap,P=new WeakMap,e=new WeakSet,d=function(){let s=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return s.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let s=h(this,o,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return s&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),s},L=function(s){let c=this.constructor,g={},f=c.validators,F=[],B=f.some(z=>z.isValid instanceof Promise);h(this,A,"f")||(v(this,P,new Promise(z=>{v(this,C,z,"f")}),"f"),v(this,A,!0,"f")),h(this,l,"f")&&(h(this,l,"f").abort(),v(this,n,h(this,l,"f"),"f"));let G=new AbortController;v(this,l,G,"f");let J,ye=!1;f.length&&(f.forEach(z=>{let de=z.key||"customError",H=z.isValid(this,s,G.signal);H instanceof Promise?(F.push(H),H.then(ce=>{ce!=null&&(g[de]=!ce,J=h(this,e,"m",le).call(this,z,s),h(this,e,"m",X).call(this,g,J))})):(g[de]=!H,this.validity[de]!==!H&&(ye=!0),!H&&!J&&(J=h(this,e,"m",le).call(this,z,s)))}),Promise.allSettled(F).then(()=>{var z;G!=null&&G.signal.aborted||(v(this,A,!1,"f"),(z=h(this,C,"f"))===null||z===void 0||z.call(this))}),(ye||!B)&&h(this,e,"m",X).call(this,g,J))},X=function(s,c){if(this.validationTarget)this.internals.setValidity(s,c,this.validationTarget),v(this,i,!1,"f");else{if(this.internals.setValidity(s,c),this.internals.validity.valid)return;v(this,i,!0,"f")}},le=function(s,c){if(this.validityCallback){let g=this.validityCallback(s.key||"customError");if(g)return g}return s.message instanceof Function?s.message(this,c):s.message},Ze}import{html as ae,LitElement as He,nothing as ie}from"lit";import{property as _,query as xr,state as Ue}from"lit/decorators.js";import{ifDefined as ne}from"lit/directives/if-defined.js";import{css as $e}from"lit";var Le=$e`
11
11
  *,
12
12
  :before,
13
13
  :after {
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
2446
2446
  display: none
2447
2447
  }
2448
2448
  }
2449
- `;var je="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ye=(o=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=je[r[o]&63];return e};function De(o=""){return`${o}${Ye()}`}import{css as wr}from"lit";var Re=wr`*,: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}.focus\\:\\[--w-outline-offset\\:-2px\\]:focus{--w-outline-offset:-2px}.bg-transparent{background-color:#0000}.border-1{border-width:1px}.rounded-4{border-radius:4px}.caret-current{caret-color:currentColor}.block{display:block}.flex{display:flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.outline-\\[--w-s-color-border-negative\\]\\!{outline-color:var(--w-s-color-border-negative)!important}.fixed{position:fixed}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled-subtle{background-color:var(--w-s-color-background-disabled-subtle)}.s-text{color:var(--w-s-color-text)}.s-text-disabled{color:var(--w-s-color-text-disabled)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.placeholder\\:s-text-placeholder::placeholder{color:var(--w-s-color-text-placeholder)}.s-border-disabled{border-color:var(--w-s-color-border-disabled)}.s-border-negative{border-color:var(--w-s-color-border-negative)}.s-border-strong{border-color:var(--w-s-color-border-strong)}.hover\\:s-border-negative-hover:hover{border-color:var(--w-s-color-border-negative-hover)}.hover\\:s-border-strong-hover:hover{border-color:var(--w-s-color-border-strong-hover)}.active\\:s-border-selected:active{border-color:var(--w-s-color-border-selected)}.w-full{width:100%}.min-h-\\[42\\]{min-height:4.2rem}.mb-0{margin-bottom:0}.mt-4{margin-top:.4rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.pb-4{padding-bottom:.4rem}.pl-0{padding-left:0}.pl-8{padding-left:.8rem}.pr-40{padding-right:4rem}.pl-\\[var\\(--w-prefix-width\\,_40px\\)\\]{padding-left:var(--w-prefix-width,40px)}.cursor-pointer{cursor:pointer}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.font-normal{font-weight:400}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-s{font-size:var(--w-font-size-s);line-height:var(--w-line-height-s)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-m{line-height:var(--w-line-height-m)}@media (min-width:480px){.sm\\:min-h-\\[45\\]{min-height:4.5rem}}`;var T={base:"block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current",default:"border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected",disabled:"border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none",invalid:"border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!",readOnly:"pl-0 bg-transparent pointer-events-none",placeholder:"placeholder:s-text-placeholder",suffix:"pr-40",prefix:"pl-[var(--w-prefix-width,_40px)]",textArea:"min-h-[42] sm:min-h-[45]",fixed:"resize-none"},qe={base:"antialiased block relative text-s font-bold pb-4 cursor-pointer s-text flex",optional:"pl-8 font-normal text-s s-text-subtle"},fe={base:"text-xs mt-4 block",color:"s-text-subtle",colorInvalid:"s-text-negative"},Q,se,D,q,$,b,we,K,O,Xe,W,xe,u=class extends Te(He){constructor(){super(...arguments);I(this,b);this.minHeight=Number.NEGATIVE_INFINITY;this.maxHeight=Number.POSITIVE_INFINITY;I(this,Q,null);I(this,se,De("textarea-"));I(this,D,!1);I(this,q);I(this,$,!1);I(this,W,r=>{r.preventDefault(),E(this,$,!0),m(this,b,O).call(this)})}updated(r){r.has("value")&&this.setValue(this.value),(r.has("value")||r.has("required")||r.has("disabled"))&&m(this,b,O).call(this)}resetFormControl(){this.value=V(this,Q),E(this,$,!1),m(this,b,K).call(this),m(this,b,O).call(this)}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return m(this,b,O).call(this),this.internals.checkValidity()}reportValidity(){return E(this,$,!0),m(this,b,O).call(this),this.internals.checkValidity()}setCustomValidity(r){r?(this.internals.setValidity({customError:!0},r,this._textarea),m(this,b,we).call(this,r)):(m(this,b,K).call(this),m(this,b,O).call(this))}get _textareaStyles(){return ee([T.base,T.textArea,!!this.placeholder&&T.placeholder,!this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.default,this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.invalid,!this.invalid&&this.disabled&&!(this.readonly||this.readOnly)&&T.disabled,!this.invalid&&!this.disabled&&(this.readonly||this.readOnly)&&T.readOnly,this.maxRows&&T.fixed])}get _helptextstyles(){return ee([fe.base,this.invalid?fe.colorInvalid:fe.color])}get _helpId(){if(this.helpText)return`${this._id}__hint`}get _id(){return V(this,se)}get _error(){if(this.invalid&&this._helpId)return this._helpId}async connectedCallback(){var r;if(super.connectedCallback(),E(this,Q,this.value),this.setValue(this.value),this.addEventListener("invalid",V(this,W)),await this.updateComplete,this.value||this.minRows){let t=(r=this.shadowRoot)==null?void 0:r.querySelector("textarea");t&&m(this,b,xe).call(this,t)}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",V(this,W))}firstUpdated(r){super.firstUpdated(r),m(this,b,O).call(this)}handler(r){let t=r.currentTarget;this.value=t.value,m(this,b,xe).call(this,t)}render(){return ae`
2449
+ `;var je="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ye=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=je[r[t]&63];return e};function De(t=""){return`${t}${Ye()}`}import{css as wr}from"lit";var Re=wr`*,: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}.focus\\:\\[--w-outline-offset\\:-2px\\]:focus{--w-outline-offset:-2px}.bg-transparent{background-color:#0000}.border-1{border-width:1px}.rounded-4{border-radius:4px}.caret-current{caret-color:currentColor}.block{display:block}.flex{display:flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.outline-\\[--w-s-color-border-negative\\]\\!{outline-color:var(--w-s-color-border-negative)!important}.fixed{position:fixed}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled-subtle{background-color:var(--w-s-color-background-disabled-subtle)}.s-text{color:var(--w-s-color-text)}.s-text-disabled{color:var(--w-s-color-text-disabled)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.placeholder\\:s-text-placeholder::placeholder{color:var(--w-s-color-text-placeholder)}.s-border-disabled{border-color:var(--w-s-color-border-disabled)}.s-border-negative{border-color:var(--w-s-color-border-negative)}.s-border-strong{border-color:var(--w-s-color-border-strong)}.hover\\:s-border-negative-hover:hover{border-color:var(--w-s-color-border-negative-hover)}.hover\\:s-border-strong-hover:hover{border-color:var(--w-s-color-border-strong-hover)}.active\\:s-border-selected:active{border-color:var(--w-s-color-border-selected)}.w-full{width:100%}.min-h-\\[42\\]{min-height:4.2rem}.mb-0{margin-bottom:0}.mt-4{margin-top:.4rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.pb-4{padding-bottom:.4rem}.pl-0{padding-left:0}.pl-8{padding-left:.8rem}.pr-40{padding-right:4rem}.pl-\\[var\\(--w-prefix-width\\,_40px\\)\\]{padding-left:var(--w-prefix-width,40px)}.cursor-pointer{cursor:pointer}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.font-normal{font-weight:400}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-s{font-size:var(--w-font-size-s);line-height:var(--w-line-height-s)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-m{line-height:var(--w-line-height-m)}@media (min-width:480px){.sm\\:min-h-\\[45\\]{min-height:4.5rem}}`;var T={base:"block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current",default:"border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected",disabled:"border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none",invalid:"border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!",readOnly:"pl-0 bg-transparent pointer-events-none",placeholder:"placeholder:s-text-placeholder",suffix:"pr-40",prefix:"pl-[var(--w-prefix-width,_40px)]",textArea:"min-h-[42] sm:min-h-[45]",fixed:"resize-none"},qe={base:"antialiased block relative text-s font-bold pb-4 cursor-pointer s-text flex",optional:"pl-8 font-normal text-s s-text-subtle"},fe={base:"text-xs mt-4 block",color:"s-text-subtle",colorInvalid:"s-text-negative"},Q,se,D,q,$,b,we,K,O,Xe,W,xe,u=class extends Te(He){constructor(){super(...arguments);I(this,b);this.minHeight=Number.NEGATIVE_INFINITY;this.maxHeight=Number.POSITIVE_INFINITY;I(this,Q,null);I(this,se,De("textarea-"));I(this,D,!1);I(this,q);I(this,$,!1);I(this,W,r=>{r.preventDefault(),E(this,$,!0),m(this,b,O).call(this)})}updated(r){r.has("value")&&this.setValue(this.value),(r.has("value")||r.has("required")||r.has("disabled"))&&m(this,b,O).call(this)}resetFormControl(){this.value=V(this,Q),E(this,$,!1),m(this,b,K).call(this),m(this,b,O).call(this)}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return m(this,b,O).call(this),this.internals.checkValidity()}reportValidity(){return E(this,$,!0),m(this,b,O).call(this),this.internals.checkValidity()}setCustomValidity(r){r?(this.internals.setValidity({customError:!0},r,this._textarea),m(this,b,we).call(this,r)):(m(this,b,K).call(this),m(this,b,O).call(this))}get _textareaStyles(){return ee([T.base,T.textArea,!!this.placeholder&&T.placeholder,!this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.default,this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.invalid,!this.invalid&&this.disabled&&!(this.readonly||this.readOnly)&&T.disabled,!this.invalid&&!this.disabled&&(this.readonly||this.readOnly)&&T.readOnly,this.maxRows&&T.fixed])}get _helptextstyles(){return ee([fe.base,this.invalid?fe.colorInvalid:fe.color])}get _helpId(){if(this.helpText)return`${this._id}__hint`}get _id(){return V(this,se)}get _error(){if(this.invalid&&this._helpId)return this._helpId}async connectedCallback(){var r;if(super.connectedCallback(),E(this,Q,this.value),this.setValue(this.value),this.addEventListener("invalid",V(this,W)),await this.updateComplete,this.value||this.minRows){let o=(r=this.shadowRoot)==null?void 0:r.querySelector("textarea");o&&m(this,b,xe).call(this,o)}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",V(this,W))}firstUpdated(r){super.firstUpdated(r),m(this,b,O).call(this)}handler(r){let o=r.currentTarget;this.value=o.value,m(this,b,xe).call(this,o)}render(){return ae`
2450
2450
  ${this.label?ae`
2451
2451
  <label for="${this._id}" class=${qe.base}>
2452
2452
  ${this.label}
@@ -2472,5 +2472,5 @@ Please compile your catalog first.
2472
2472
  @blur="${m(this,b,Xe)}">
2473
2473
  </textarea>
2474
2474
  ${this.helpText?ae`<div class="${this._helptextstyles}" id="${this._helpId}">${this.helpText}</div>`:ie}
2475
- `}};Q=new WeakMap,se=new WeakMap,D=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakSet,we=function(r){V(this,D)||E(this,q,this.helpText),E(this,D,!0),this.invalid=!0,this.helpText=r},K=function(){V(this,D)&&(this.invalid=!1,this.helpText=V(this,q),E(this,q,void 0),E(this,D,!1))},O=function(){var r;if(this.disabled){this.internals.setValidity({}),m(this,b,K).call(this);return}if(this.required&&!this.value){let t=((r=this._textarea)==null?void 0:r.validationMessage)||"";this.internals.setValidity({valueMissing:!0},t,this._textarea),V(this,$)&&m(this,b,we).call(this,t);return}this.internals.setValidity({}),m(this,b,K).call(this)},Xe=function(){E(this,$,!0),m(this,b,O).call(this)},W=new WeakMap,xe=function(r){let t=getComputedStyle(r),a=Number.parseFloat(t.getPropertyValue("border-top-width")),l=Number.parseFloat(t.getPropertyValue("border-bottom-width")),n=Number.parseFloat(t.getPropertyValue("line-height")),i=Number.parseFloat(t.getPropertyValue("padding-top")),d=Number.parseFloat(t.getPropertyValue("padding-bottom")),p=i+d+l+a;this.minRows&&(this.minHeight=n*this.minRows+p),this.maxRows&&(this.maxHeight=n*this.maxRows+p);let y=r.scrollHeight+a+l,M=Math.min(this.maxHeight,Math.max(this.minHeight,y));r.style.setProperty("height",M+"px")},u.shadowRootOptions={...He.shadowRootOptions,delegatesFocus:!0},u.styles=[Le,Re],w([_({type:Boolean,reflect:!0})],u.prototype,"disabled",2),w([_({type:Boolean,reflect:!0})],u.prototype,"invalid",2),w([_({type:String,reflect:!0})],u.prototype,"label",2),w([_({type:String,reflect:!0,attribute:"help-text"})],u.prototype,"helpText",2),w([_({type:Number,reflect:!0,attribute:"maximum-rows"})],u.prototype,"maxRows",2),w([_({type:Number,reflect:!0,attribute:"minimum-rows"})],u.prototype,"minRows",2),w([_()],u.prototype,"name",2),w([_()],u.prototype,"placeholder",2),w([_({type:Boolean,reflect:!0,attribute:"read-only"})],u.prototype,"readOnly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"readonly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"required",2),w([_({type:String,reflect:!0})],u.prototype,"value",2),w([_({type:Boolean,reflect:!0})],u.prototype,"optional",2),w([Ue()],u.prototype,"minHeight",2),w([Ue()],u.prototype,"maxHeight",2),w([xr("textarea")],u.prototype,"_textarea",2);customElements.get("w-textarea")||customElements.define("w-textarea",u);export{u as WarpTextarea};
2475
+ `}};Q=new WeakMap,se=new WeakMap,D=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakSet,we=function(r){V(this,D)||E(this,q,this.helpText),E(this,D,!0),this.invalid=!0,this.helpText=r},K=function(){V(this,D)&&(this.invalid=!1,this.helpText=V(this,q),E(this,q,void 0),E(this,D,!1))},O=function(){var r;if(this.disabled){this.internals.setValidity({}),m(this,b,K).call(this);return}if(this.required&&!this.value){let o=((r=this._textarea)==null?void 0:r.validationMessage)||"";this.internals.setValidity({valueMissing:!0},o,this._textarea),V(this,$)&&m(this,b,we).call(this,o);return}this.internals.setValidity({}),m(this,b,K).call(this)},Xe=function(){E(this,$,!0),m(this,b,O).call(this)},W=new WeakMap,xe=function(r){let o=getComputedStyle(r),a=Number.parseFloat(o.getPropertyValue("border-top-width")),l=Number.parseFloat(o.getPropertyValue("border-bottom-width")),n=Number.parseFloat(o.getPropertyValue("line-height")),i=Number.parseFloat(o.getPropertyValue("padding-top")),d=Number.parseFloat(o.getPropertyValue("padding-bottom")),p=i+d+l+a;this.minRows&&(this.minHeight=n*this.minRows+p),this.maxRows&&(this.maxHeight=n*this.maxRows+p);let y=r.scrollHeight+a+l,M=Math.min(this.maxHeight,Math.max(this.minHeight,y));r.style.setProperty("height",M+"px")},u.shadowRootOptions={...He.shadowRootOptions,delegatesFocus:!0},u.styles=[Le,Re],w([_({type:Boolean,reflect:!0})],u.prototype,"disabled",2),w([_({type:Boolean,reflect:!0})],u.prototype,"invalid",2),w([_({type:String,reflect:!0})],u.prototype,"label",2),w([_({type:String,reflect:!0,attribute:"help-text"})],u.prototype,"helpText",2),w([_({type:Number,reflect:!0,attribute:"maximum-rows"})],u.prototype,"maxRows",2),w([_({type:Number,reflect:!0,attribute:"minimum-rows"})],u.prototype,"minRows",2),w([_({type:String,reflect:!0})],u.prototype,"name",2),w([_({type:String,reflect:!0})],u.prototype,"placeholder",2),w([_({type:Boolean,reflect:!0,attribute:"read-only"})],u.prototype,"readOnly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"readonly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"required",2),w([_({type:String,reflect:!0})],u.prototype,"value",2),w([_({type:Boolean,reflect:!0})],u.prototype,"optional",2),w([Ue()],u.prototype,"minHeight",2),w([Ue()],u.prototype,"maxHeight",2),w([xr("textarea")],u.prototype,"_textarea",2);customElements.get("w-textarea")||customElements.define("w-textarea",u);export{u as WarpTextarea};
2476
2476
  //# sourceMappingURL=textarea.js.map