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

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.
@@ -2,60 +2,89 @@ import { css } from 'lit';
2
2
  export const styles = css `
3
3
  :host {
4
4
  display: block;
5
+
6
+ --_label-font-size: var(--w-c-radio-group-label-font-size, var(--w-font-size-s));
7
+ --_label-line-height: var(--w-c-radio-group-label-line-height, var(--w-line-height-s));
8
+ --_label-font-weight: var(--w-c-radio-group-label-font-weight, 700);
9
+ --_label-color: var(--w-c-radio-group-label-color, var(--w-s-color-text));
10
+ --_label-color-disabled: var(--w-c-radio-group-label-color-disabled, var(--w-s-color-text-disabled));
11
+ --_label-padding-bottom: var(--w-c-radio-group-label-padding-bottom, 16px);
12
+
13
+ --_optional-font-weight: var(--w-c-radio-group-optional-font-weight, 400);
14
+ --_optional-color: var(--w-c-radio-group-optional-color, var(--w-s-color-text-subtle));
15
+ --_optional-margin-inline-start: var(--w-c-radio-group-optional-margin-inline-start, 0.5rem);
16
+
17
+ --_radios-gap: var(--w-c-radio-group-gap, 16px);
18
+
19
+ --_help-text-margin-block-start: var(--w-c-radio-group-help-text-margin-block-start, 16px);
20
+ --_help-text-font-size: var(--w-c-radio-group-help-text-font-size, var(--w-font-size-xs));
21
+ --_help-text-line-height: var(--w-c-radio-group-help-text-line-height, var(--w-line-height-xs));
22
+ --_help-text-color: var(--w-c-radio-group-help-text-color, var(--w-s-color-text-subtle));
23
+ --_help-text-color-disabled: var(--w-c-radio-group-help-text-color-disabled, var(--w-s-color-text-disabled));
24
+ --_help-text-color-error: var(--w-c-radio-group-help-text-color-error, var(--w-s-color-text-negative));
5
25
  }
6
26
 
7
- .form-control {
27
+ [part='form-control'] {
8
28
  position: relative;
9
- border: none;
29
+
30
+ border: 0;
10
31
  padding: 0;
11
32
  margin: 0;
33
+
34
+ min-inline-size: 0;
12
35
  }
13
36
 
14
- .label {
15
- font-size: var(--w-font-size-s);
16
- line-height: var(--w-line-height-s);
17
- font-weight: 700;
37
+ [part='form-control-label'] {
38
+ display: block;
39
+ cursor: pointer;
40
+
41
+ font-size: var(--_label-font-size);
42
+ line-height: var(--_label-line-height);
43
+ font-weight: var(--_label-font-weight);
44
+ color: var(--_label-color);
45
+
46
+ padding-bottom: var(--_label-padding-bottom);
47
+
18
48
  -webkit-font-smoothing: antialiased;
19
49
  -moz-osx-font-smoothing: grayscale;
20
50
  font-smoothing: grayscale;
21
- cursor: pointer;
22
- padding-bottom: 16px;
23
- color: var(--w-s-color-text);
24
- display: block;
25
51
  }
26
52
 
27
- .optional {
28
- font-weight: 400;
29
- color: var(--w-s-color-text-subtle);
30
- margin-inline-start: 0.5rem;
53
+ :host([disabled]) [part='form-control-label'] {
54
+ cursor: default;
55
+ color: var(--_label-color-disabled);
31
56
  }
32
57
 
33
- .radio-group-required .label::after {
58
+ :host([required]) [part='form-control-label']::after {
34
59
  content: var(--wa-form-control-required-content);
35
60
  margin-inline-start: var(--wa-form-control-required-content-offset);
36
61
  }
37
62
 
63
+ .optional {
64
+ font-weight: var(--_optional-font-weight);
65
+ color: var(--_optional-color);
66
+ margin-inline-start: var(--_optional-margin-inline-start);
67
+ }
68
+
38
69
  [part~='form-control-input'] {
39
70
  display: flex;
40
71
  flex-direction: column;
41
72
  flex-wrap: wrap;
42
- gap: 16px;
73
+ gap: var(--_radios-gap);
43
74
  }
44
75
 
45
- /* Help text */
46
76
  [part~='help-text'] {
47
- margin-block-start: 16px;
48
- font-size: var(--w-font-size-xs);
49
- line-height: var(--w-line-height-xs);
50
- color: var(--w-s-color-text-subtle);
77
+ margin-block-start: var(--_help-text-margin-block-start);
78
+ font-size: var(--_help-text-font-size);
79
+ line-height: var(--_help-text-line-height);
80
+ color: var(--_help-text-color);
51
81
  }
52
82
 
53
83
  :host([disabled]) [part~='help-text'] {
54
- color: var(--w-s-color-text-disabled);
84
+ color: var(--_help-text-color-disabled);
55
85
  }
56
86
 
57
- [part~='help-text'].error {
58
- color: var(--w-s-color-text-negative);
87
+ :host([data-show-error]) [part~='help-text'] {
88
+ color: var(--_help-text-color-error);
59
89
  }
60
-
61
90
  `;
@@ -12,22 +12,12 @@ export declare class WRadioGroup extends WRadioGroup_base {
12
12
  hasInteracted: boolean;
13
13
  private hasWarnedMissingName;
14
14
  private autoTabIndex;
15
- /**
16
- * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot
17
- * instead.
18
- */
19
15
  label: string;
20
- /** The radio group's help text. If you need to display HTML, use the `help-text` slot instead. */
21
16
  helpText: string;
22
- /** Optional indicator for the label. */
23
17
  optional: boolean;
24
- /** Marks the radio group as invalid. */
25
18
  invalid: boolean;
26
- /** The name of the radio group */
27
19
  name: string | null;
28
- /** Disables the radio group and all child radios. */
29
20
  disabled: boolean;
30
- /** Ensures a child radio is checked before allowing the containing form to submit. */
31
21
  required: boolean;
32
22
  private defaultCheckedValue;
33
23
  private slottedHelpText;
@@ -41,14 +31,10 @@ export declare class WRadioGroup extends WRadioGroup_base {
41
31
  slotAssignment?: SlotAssignmentMode;
42
32
  };
43
33
  constructor();
44
- /**
45
- * We use the first available radio as the validationTarget similar to native HTML that shows the validation popup on
46
- * the first radio element.
47
- */
48
34
  get validationTarget(): WRadio;
49
- updated(changedProperties: PropertyValues<this>): void;
50
35
  connectedCallback(): void;
51
36
  disconnectedCallback(): void;
37
+ updated(changedProperties: PropertyValues<this>): Promise<void>;
52
38
  resetFormControl(): void;
53
39
  private handleRadioClick;
54
40
  private getAllRadios;
@@ -64,7 +50,6 @@ export declare class WRadioGroup extends WRadioGroup_base {
64
50
  private syncTabOrder;
65
51
  private emitSelectionChange;
66
52
  private handleKeyDown;
67
- /** Sets focus on the radio group. */
68
53
  focus(options?: FocusOptions): void;
69
54
  checkValidity(): any;
70
55
  reportValidity(): any;
@@ -1,5 +1,5 @@
1
- var Be=Object.create;var se=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var ve=o=>{throw TypeError(o)};var fe=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var Je=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ze(r))!Ke.call(o,a)&&a!==e&&se(o,a,{get:()=>r[a],enumerable:!(t=ge(r,a))||t.enumerable});return o};var Qe=(o,r,e)=>(e=o!=null?Be(Ge(o)):{},Je(r||!o||!o.__esModule?se(e,"default",{value:o,enumerable:!0}):e,o));var m=(o,r,e,t)=>{for(var a=t>1?void 0:t?ge(r,e):r,i=o.length-1,n;i>=0;i--)(n=o[i])&&(a=(t?n(r,e,a):n(a))||a);return t&&a&&se(r,e,a),a};var me=(o,r,e)=>r.has(o)||ve("Cannot "+e);var S=(o,r,e)=>(me(o,r,"read from private field"),e?e.call(o):r.get(o)),G=(o,r,e)=>r.has(o)?ve("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),M=(o,r,e,t)=>(me(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e);var we=fe(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.errorMessages=N.ErrorType=void 0;var j;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(j=N.ErrorType||(N.ErrorType={}));N.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var ye=fe(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.unraw=T.errorMessages=T.ErrorType=void 0;var w=we();Object.defineProperty(T,"ErrorType",{enumerable:!0,get:function(){return w.ErrorType}});Object.defineProperty(T,"errorMessages",{enumerable:!0,get:function(){return w.errorMessages}});function er(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function K(o,r,e){let t=er(o);if(Number.isNaN(t)||e!==void 0&&e!==o.length)throw new SyntaxError(w.errorMessages.get(r));return t}function rr(o){let r=K(o,w.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(r)}function xe(o,r){let e=K(o,w.ErrorType.MalformedUnicode,4);if(r!==void 0){let t=K(r,w.ErrorType.MalformedUnicode,4);return String.fromCharCode(e,t)}return String.fromCharCode(e)}function tr(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function or(o){if(!tr(o))throw new SyntaxError(w.errorMessages.get(w.ErrorType.MalformedUnicode));let r=o.slice(1,-1),e=K(r,w.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(t){throw t instanceof RangeError?new SyntaxError(w.errorMessages.get(w.ErrorType.CodePointLimit)):t}}function ar(o,r=!1){if(r)throw new SyntaxError(w.errorMessages.get(w.ErrorType.OctalDeprecation));let e=parseInt(o,8);return String.fromCharCode(e)}var ir=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function sr(o){return ir.get(o)||o}var nr=/\\(?:(\\)|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 ke(o,r=!1){return o.replace(nr,function(e,t,a,i,n,s,l,u,b){if(t!==void 0)return"\\";if(a!==void 0)return rr(a);if(i!==void 0)return or(i);if(n!==void 0)return xe(n,s);if(l!==void 0)return xe(l);if(u==="0")return"\0";if(u!==void 0)return ar(u,!r);if(b!==void 0)return sr(b);throw new SyntaxError(w.errorMessages.get(w.ErrorType.EndOfString))})}T.unraw=ke;T.default=ke});import{html as be,LitElement as Ue}from"lit";var Ee=Qe(ye(),1);var F=o=>typeof o=="string",lr=o=>typeof o=="function",_e=new Map,Me="en";function ce(o){return[...Array.isArray(o)?o:[o],Me]}function he(o,r,e){let t=ce(o);e||(e="default");let a;if(typeof e=="string")switch(a={day:"numeric",month:"short",year:"numeric"},e){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=e;return J(()=>Q("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(F(r)?new Date(r):r)}function dr(o,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return he(o,r,t)}function ne(o,r,e){let t=ce(o);return J(()=>Q("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function Ce(o,r,e,{offset:t=0,...a}){var s,l;let i=ce(o),n=r?J(()=>Q("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):J(()=>Q("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(l=(s=a[e])!=null?s:a[n.select(e-t)])!=null?l:a.other}function J(o,r){let e=o(),t=_e.get(e);return t||(t=r(),_e.set(e,t)),t}function Q(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var Ve=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ze="%__lingui_octothorpe__%",cr=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let l=Object.keys(e).length?a("number"):void 0,u=ne(t,n,l);return s.replace(new RegExp(ze,"g"),u)};return{plural:(n,s)=>{let{offset:l=0}=s,u=Ce(t,!1,n,s);return i(n-l,u)},selectordinal:(n,s)=>{let{offset:l=0}=s,u=Ce(t,!0,n,s);return i(n-l,u)},select:hr,number:(n,s)=>ne(t,n,a(s)||{style:s}),date:(n,s)=>he(t,n,a(s)||s),time:(n,s)=>dr(t,n,a(s)||s)}},hr=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function ur(o,r,e){return(t={},a)=>{let i=cr(r,e,a),n=(l,u=!1)=>Array.isArray(l)?l.reduce((b,p)=>{if(p==="#"&&u)return b+ze;if(F(p))return b+p;let[I,x,E]=p,A={};x==="plural"||x==="selectordinal"||x==="select"?Object.entries(E).forEach(([O,Y])=>{A[O]=n(Y,x==="plural"||x==="selectordinal")}):A=E;let k;if(x){let O=i[x];k=O(t[I],A)}else k=t[I];return k==null?b:b+k},""):l,s=n(o);return F(s)&&Ve.test(s)?(0,Ee.unraw)(s):F(s)?s:s?String(s):""}}var br=Object.defineProperty,pr=(o,r,e)=>r in o?br(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,gr=(o,r,e)=>(pr(o,typeof r!="symbol"?r+"":r,e),e),le=class{constructor(){gr(this,"_events",{})}on(r,e){var a;var t;return(a=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let a=t.indexOf(e);~a&&t.splice(a,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(a=>a.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},vr=Object.defineProperty,fr=(o,r,e)=>r in o?vr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,D=(o,r,e)=>(fr(o,typeof r!="symbol"?r+"":r,e),e),de=class extends le{constructor(r){var e;super(),D(this,"_locale",""),D(this,"_locales"),D(this,"_localeData",{}),D(this,"_messages",{}),D(this,"_missing"),D(this,"_messageCompiler"),D(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:Me,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,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;r||(r=""),F(r)||(e=r.values||e,a=r.message,r=r.id);let i=this.messages[r],n=i===void 0,s=this._missing;if(s&&n)return lr(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let l=i||a||r;return F(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
1
+ var Xe=Object.create;var ne=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var fe=o=>{throw TypeError(o)};var me=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var Ke=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Be(r))!Ge.call(o,a)&&a!==e&&ne(o,a,{get:()=>r[a],enumerable:!(t=ve(r,a))||t.enumerable});return o};var Je=(o,r,e)=>(e=o!=null?Xe(Ze(o)):{},Ke(r||!o||!o.__esModule?ne(e,"default",{value:o,enumerable:!0}):e,o));var m=(o,r,e,t)=>{for(var a=t>1?void 0:t?ve(r,e):r,i=o.length-1,n;i>=0;i--)(n=o[i])&&(a=(t?n(r,e,a):n(a))||a);return t&&a&&ne(r,e,a),a};var we=(o,r,e)=>r.has(o)||fe("Cannot "+e);var S=(o,r,e)=>(we(o,r,"read from private field"),e?e.call(o):r.get(o)),G=(o,r,e)=>r.has(o)?fe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),M=(o,r,e,t)=>(we(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e);var xe=me(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.errorMessages=N.ErrorType=void 0;var j;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(j=N.ErrorType||(N.ErrorType={}));N.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var _e=me(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.unraw=A.errorMessages=A.ErrorType=void 0;var w=xe();Object.defineProperty(A,"ErrorType",{enumerable:!0,get:function(){return w.ErrorType}});Object.defineProperty(A,"errorMessages",{enumerable:!0,get:function(){return w.errorMessages}});function Qe(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function K(o,r,e){let t=Qe(o);if(Number.isNaN(t)||e!==void 0&&e!==o.length)throw new SyntaxError(w.errorMessages.get(r));return t}function er(o){let r=K(o,w.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(r)}function ke(o,r){let e=K(o,w.ErrorType.MalformedUnicode,4);if(r!==void 0){let t=K(r,w.ErrorType.MalformedUnicode,4);return String.fromCharCode(e,t)}return String.fromCharCode(e)}function rr(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function tr(o){if(!rr(o))throw new SyntaxError(w.errorMessages.get(w.ErrorType.MalformedUnicode));let r=o.slice(1,-1),e=K(r,w.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(t){throw t instanceof RangeError?new SyntaxError(w.errorMessages.get(w.ErrorType.CodePointLimit)):t}}function or(o,r=!1){if(r)throw new SyntaxError(w.errorMessages.get(w.ErrorType.OctalDeprecation));let e=parseInt(o,8);return String.fromCharCode(e)}var ar=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ir(o){return ar.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 ye(o,r=!1){return o.replace(sr,function(e,t,a,i,n,s,l,u,b){if(t!==void 0)return"\\";if(a!==void 0)return er(a);if(i!==void 0)return tr(i);if(n!==void 0)return ke(n,s);if(l!==void 0)return ke(l);if(u==="0")return"\0";if(u!==void 0)return or(u,!r);if(b!==void 0)return ir(b);throw new SyntaxError(w.errorMessages.get(w.ErrorType.EndOfString))})}A.unraw=ye;A.default=ye});import{html as oe,LitElement as Ye}from"lit";var Me=Je(_e(),1);var F=o=>typeof o=="string",nr=o=>typeof o=="function",Ce=new Map,ze="en";function he(o){return[...Array.isArray(o)?o:[o],ze]}function ue(o,r,e){let t=he(o);e||(e="default");let a;if(typeof e=="string")switch(a={day:"numeric",month:"short",year:"numeric"},e){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=e;return J(()=>Q("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(F(r)?new Date(r):r)}function lr(o,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return ue(o,r,t)}function le(o,r,e){let t=he(o);return J(()=>Q("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function Ee(o,r,e,{offset:t=0,...a}){var s,l;let i=he(o),n=r?J(()=>Q("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):J(()=>Q("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(l=(s=a[e])!=null?s:a[n.select(e-t)])!=null?l:a.other}function J(o,r){let e=o(),t=Ce.get(e);return t||(t=r(),Ce.set(e,t)),t}function Q(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var Ve=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Se="%__lingui_octothorpe__%",dr=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let l=Object.keys(e).length?a("number"):void 0,u=le(t,n,l);return s.replace(new RegExp(Se,"g"),u)};return{plural:(n,s)=>{let{offset:l=0}=s,u=Ee(t,!1,n,s);return i(n-l,u)},selectordinal:(n,s)=>{let{offset:l=0}=s,u=Ee(t,!0,n,s);return i(n-l,u)},select:cr,number:(n,s)=>le(t,n,a(s)||{style:s}),date:(n,s)=>ue(t,n,a(s)||s),time:(n,s)=>lr(t,n,a(s)||s)}},cr=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function hr(o,r,e){return(t={},a)=>{let i=dr(r,e,a),n=(l,u=!1)=>Array.isArray(l)?l.reduce((b,p)=>{if(p==="#"&&u)return b+Se;if(F(p))return b+p;let[I,x,E]=p,T={};x==="plural"||x==="selectordinal"||x==="select"?Object.entries(E).forEach(([O,Y])=>{T[O]=n(Y,x==="plural"||x==="selectordinal")}):T=E;let k;if(x){let O=i[x];k=O(t[I],T)}else k=t[I];return k==null?b:b+k},""):l,s=n(o);return F(s)&&Ve.test(s)?(0,Me.unraw)(s):F(s)?s:s?String(s):""}}var ur=Object.defineProperty,br=(o,r,e)=>r in o?ur(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,pr=(o,r,e)=>(br(o,typeof r!="symbol"?r+"":r,e),e),de=class{constructor(){pr(this,"_events",{})}on(r,e){var a;var t;return(a=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let a=t.indexOf(e);~a&&t.splice(a,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(a=>a.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},gr=Object.defineProperty,vr=(o,r,e)=>r in o?gr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,D=(o,r,e)=>(vr(o,typeof r!="symbol"?r+"":r,e),e),ce=class extends de{constructor(r){var e;super(),D(this,"_locale",""),D(this,"_locales"),D(this,"_localeData",{}),D(this,"_messages",{}),D(this,"_missing"),D(this,"_messageCompiler"),D(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:ze,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,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;r||(r=""),F(r)||(e=r.values||e,a=r.message,r=r.id);let i=this.messages[r],n=i===void 0,s=this._missing;if(s&&n)return nr(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let l=i||a||r;return F(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
3
3
 
4
4
  > ${l}
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
- `)),F(l)&&Ve.test(l)?JSON.parse(`"${l}"`):F(l)?l:ur(l,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return he(this._locales||this._locale,r,e)}number(r,e){return ne(this._locales||this._locale,r,e)}};function mr(o={}){return new de(o)}var y=mr();var h=function(o,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?o!==r||!t:!r.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(o):t?t.value:r.get(o)},v=function(o,r,e,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 r=="function"?o!==r||!a:!r.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,e):a?a.value=e:r.set(o,e),e};function ee(o){var r,e,t,a,i,n,s,l,u,b,p,I,x,E,A,k,O,Y,oe;class Xe extends o{constructor(...d){var c,g,f;super(...d),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),a.set(this,!1),i.set(this,void 0),n.set(this,void 0),s.set(this,!0),u.set(this,""),b.set(this,()=>{v(this,a,!0,"f"),v(this,e,!0,"f"),h(this,r,"m",k).call(this)}),p.set(this,()=>{v(this,e,!1,"f"),h(this,r,"m",O).call(this,this.shouldFormValueUpdate()?h(this,u,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,t,!0,"f");let z=h(this,r,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),I.set(this,()=>{var z;h(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,s,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),h(this,r,"m",k).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),x.set(this,void 0),E.set(this,!1),A.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,b,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,p,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,I,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let d=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...d])]}static getValidator(d){return this.validators.find(c=>c.attribute===d)||null}static getValidators(d){return this.validators.filter(c=>{var g;if(c.attribute===d||!((g=c.attribute)===null||g===void 0)&&g.includes(d))return!0})}get form(){return this.internals.form}get showError(){return h(this,r,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(d,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,d,c,g);let X=this.constructor.getValidators(d);X!=null&&X.length&&this.validationTarget&&this.setValue(h(this,u,"f"))}setValue(d){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,u,d,"f");let f=this.shouldFormValueUpdate()?d:null;this.internals.setFormValue(f),h(this,r,"m",O).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,r,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(d=>d(h(this,A,"f")))}formResetCallback(){var d,c;v(this,a,!1,"f"),v(this,t,!1,"f"),h(this,r,"m",k).call(this),(d=this.resetFormControl)===null||d===void 0||d.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,r,"m",k).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,u=new WeakMap,b=new WeakMap,p=new WeakMap,I=new WeakMap,x=new WeakMap,E=new WeakMap,A=new WeakMap,r=new WeakSet,l=function(){let d=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return d.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let d=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,e,"f");return d&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),d},O=function(d){let c=this.constructor,g={},f=c.validators,z=[],X=f.some(C=>C.isValid instanceof Promise);h(this,E,"f")||(v(this,A,new Promise(C=>{v(this,x,C,"f")}),"f"),v(this,E,!0,"f")),h(this,i,"f")&&(h(this,i,"f").abort(),v(this,n,h(this,i,"f"),"f"));let B=new AbortController;v(this,i,B,"f");let Z,pe=!1;f.length&&(f.forEach(C=>{let ae=C.key||"customError",P=C.isValid(this,d,B.signal);P instanceof Promise?(z.push(P),P.then(ie=>{ie!=null&&(g[ae]=!ie,Z=h(this,r,"m",oe).call(this,C,d),h(this,r,"m",Y).call(this,g,Z))})):(g[ae]=!P,this.validity[ae]!==!P&&(pe=!0),!P&&!Z&&(Z=h(this,r,"m",oe).call(this,C,d)))}),Promise.allSettled(z).then(()=>{var C;B!=null&&B.signal.aborted||(v(this,E,!1,"f"),(C=h(this,x,"f"))===null||C===void 0||C.call(this))}),(pe||!X)&&h(this,r,"m",Y).call(this,g,Z))},Y=function(d,c){if(this.validationTarget)this.internals.setValidity(d,c,this.validationTarget),v(this,s,!1,"f");else{if(this.internals.setValidity(d,c),this.internals.validity.valid)return;v(this,s,!0,"f")}},oe=function(d,c){if(this.validityCallback){let g=this.validityCallback(d.key||"customError");if(g)return g}return d.message instanceof Function?d.message(this,c):d.message},Xe}import{property as H,state as Sr}from"lit/decorators.js";import{classMap as Ye}from"lit/directives/class-map.js";import{ifDefined as We}from"lit/directives/if-defined.js";import{html as kr,LitElement as yr}from"lit";import{property as $}from"lit/decorators.js";import{css as Se}from"lit";var Te=Se`
10
+ `)),F(l)&&Ve.test(l)?JSON.parse(`"${l}"`):F(l)?l:hr(l,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return ue(this._locales||this._locale,r,e)}number(r,e){return le(this._locales||this._locale,r,e)}};function fr(o={}){return new ce(o)}var y=fr();var h=function(o,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?o!==r||!t:!r.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(o):t?t.value:r.get(o)},v=function(o,r,e,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 r=="function"?o!==r||!a:!r.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,e):a?a.value=e:r.set(o,e),e};function ee(o){var r,e,t,a,i,n,s,l,u,b,p,I,x,E,T,k,O,Y,ae;class We extends o{constructor(...d){var c,g,f;super(...d),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),a.set(this,!1),i.set(this,void 0),n.set(this,void 0),s.set(this,!0),u.set(this,""),b.set(this,()=>{v(this,a,!0,"f"),v(this,e,!0,"f"),h(this,r,"m",k).call(this)}),p.set(this,()=>{v(this,e,!1,"f"),h(this,r,"m",O).call(this,this.shouldFormValueUpdate()?h(this,u,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,t,!0,"f");let V=h(this,r,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(V?this.internals.validationMessage:"")}),I.set(this,()=>{var V;h(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,s,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),h(this,r,"m",k).call(this),(V=this===null||this===void 0?void 0:this.validationMessageCallback)===null||V===void 0||V.call(this,this.showError?this.internals.validationMessage:"")}),x.set(this,void 0),E.set(this,!1),T.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,b,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,p,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,I,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let d=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...d])]}static getValidator(d){return this.validators.find(c=>c.attribute===d)||null}static getValidators(d){return this.validators.filter(c=>{var g;if(c.attribute===d||!((g=c.attribute)===null||g===void 0)&&g.includes(d))return!0})}get form(){return this.internals.form}get showError(){return h(this,r,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(d,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,d,c,g);let X=this.constructor.getValidators(d);X!=null&&X.length&&this.validationTarget&&this.setValue(h(this,u,"f"))}setValue(d){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,u,d,"f");let f=this.shouldFormValueUpdate()?d:null;this.internals.setFormValue(f),h(this,r,"m",O).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,r,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(d=>d(h(this,T,"f")))}formResetCallback(){var d,c;v(this,a,!1,"f"),v(this,t,!1,"f"),h(this,r,"m",k).call(this),(d=this.resetFormControl)===null||d===void 0||d.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,r,"m",k).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,u=new WeakMap,b=new WeakMap,p=new WeakMap,I=new WeakMap,x=new WeakMap,E=new WeakMap,T=new WeakMap,r=new WeakSet,l=function(){let d=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return d.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let d=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,e,"f");return d&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),d},O=function(d){let c=this.constructor,g={},f=c.validators,V=[],X=f.some(C=>C.isValid instanceof Promise);h(this,E,"f")||(v(this,T,new Promise(C=>{v(this,x,C,"f")}),"f"),v(this,E,!0,"f")),h(this,i,"f")&&(h(this,i,"f").abort(),v(this,n,h(this,i,"f"),"f"));let B=new AbortController;v(this,i,B,"f");let Z,ge=!1;f.length&&(f.forEach(C=>{let ie=C.key||"customError",H=C.isValid(this,d,B.signal);H instanceof Promise?(V.push(H),H.then(se=>{se!=null&&(g[ie]=!se,Z=h(this,r,"m",ae).call(this,C,d),h(this,r,"m",Y).call(this,g,Z))})):(g[ie]=!H,this.validity[ie]!==!H&&(ge=!0),!H&&!Z&&(Z=h(this,r,"m",ae).call(this,C,d)))}),Promise.allSettled(V).then(()=>{var C;B!=null&&B.signal.aborted||(v(this,E,!1,"f"),(C=h(this,x,"f"))===null||C===void 0||C.call(this))}),(ge||!X)&&h(this,r,"m",Y).call(this,g,Z))},Y=function(d,c){if(this.validationTarget)this.internals.setValidity(d,c,this.validationTarget),v(this,s,!1,"f");else{if(this.internals.setValidity(d,c),this.internals.validity.valid)return;v(this,s,!0,"f")}},ae=function(d,c){if(this.validityCallback){let g=this.validityCallback(d.key||"customError");if(g)return g}return d.message instanceof Function?d.message(this,c):d.message},We}import{property as P,state as Vr}from"lit/decorators.js";import{ifDefined as pe}from"lit/directives/if-defined.js";import{html as xr,LitElement as kr}from"lit";import{property as U}from"lit/decorators.js";import{css as Ae}from"lit";var Ie=Ae`
11
11
  *,
12
12
  :before,
13
13
  :after {
@@ -280,7 +280,7 @@ Please compile your catalog first.
280
280
  svg {
281
281
  pointer-events: none;
282
282
  }
283
- `,Dr=Se`*, :before, :after {
283
+ `,Nr=Ae`*, :before, :after {
284
284
  --w-rotate: 0;
285
285
  --w-rotate-x: 0;
286
286
  --w-rotate-y: 0;
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
2446
2446
  display: none
2447
2447
  }
2448
2448
  }
2449
- `;import{css as wr}from"lit";var re=wr`
2449
+ `;import{css as mr}from"lit";var re=mr`
2450
2450
  :host {
2451
2451
  box-sizing: border-box !important;
2452
2452
  }
@@ -2456,7 +2456,7 @@ Please compile your catalog first.
2456
2456
  :host *::after {
2457
2457
  box-sizing: inherit !important;
2458
2458
  }
2459
- `;import{css as xr}from"lit";var Ie=xr`
2459
+ `;import{css as wr}from"lit";var Te=wr`
2460
2460
  :host {
2461
2461
  display: inline-flex;
2462
2462
  align-items: center;
@@ -2497,6 +2497,7 @@ Please compile your catalog first.
2497
2497
  );
2498
2498
  }
2499
2499
 
2500
+ :host([disabled]),
2500
2501
  :host([disabled-ui]) {
2501
2502
  --w-c-radio-border-color: var(--w-c-radio-border-color-disabled, var(--w-s-color-border-disabled));
2502
2503
  --w-c-radio-bg: var(--w-c-radio-bg-disabled, var(--w-s-color-background-disabled-subtle));
@@ -2529,6 +2530,7 @@ Please compile your catalog first.
2529
2530
  transition: var(--_transition);
2530
2531
  }
2531
2532
 
2533
+ :host([checked]) [part='control'],
2532
2534
  :host([checked-ui]) [part='control'],
2533
2535
  :host([role='radio'][checked-ui]) [part='control'],
2534
2536
  :host([role='radio']:state(checked)) [part='control'] {
@@ -2549,6 +2551,7 @@ Please compile your catalog first.
2549
2551
  outline-offset: var(--_outline-offset);
2550
2552
  }
2551
2553
 
2554
+ :host([disabled]) [part='control'],
2552
2555
  :host([disabled-ui]) [part='control'],
2553
2556
  :host([role='radio']:state(disabled)) [part='control'] {
2554
2557
  border-color: var(--_border-color-disabled);
@@ -2556,6 +2559,14 @@ Please compile your catalog first.
2556
2559
  cursor: var(--_cursor-disabled);
2557
2560
  }
2558
2561
 
2562
+ :host([disabled]) [part='label'],
2563
+ :host([disabled-ui]) [part='label'] {
2564
+ color: var(--_label-color-disabled);
2565
+ cursor: var(--_cursor-disabled);
2566
+ }
2567
+
2568
+ :host([disabled][checked]),
2569
+ :host([disabled][checked-ui]),
2559
2570
  :host([disabled-ui][checked-ui]) [part='control'] {
2560
2571
  border-color: var(--_border-color-disabled);
2561
2572
  }
@@ -2590,115 +2601,138 @@ Please compile your catalog first.
2590
2601
  forced-color-adjust: none;
2591
2602
  }
2592
2603
 
2604
+ :host([checked]) [part='control'],
2593
2605
  :host([checked-ui]) [part='control'],
2594
2606
  :host([role='radio']:state(checked)) [part='control'] {
2595
2607
  background-color: var(--_border-color-checked);
2596
2608
  border-color: var(--_border-color-checked);
2597
2609
  }
2598
2610
 
2611
+ :host([disabled][checked]),
2612
+ :host([disabled][checked-ui]),
2599
2613
  :host([disabled-ui][checked-ui]) [part='control'],
2600
2614
  :host([role='radio']:state(disabled):state(checked)) [part='control'] {
2601
2615
  background-color: var(--_border-color-disabled);
2602
2616
  border-color: var(--_border-color-disabled);
2603
2617
  }
2604
2618
  }
2605
- `;var U,q,R,L,V=class extends ee(yr){constructor(){super();this.name="";this.value=null;this.checked=!1;this.disabled=!1;this.required=!1;this.invalid=!1;G(this,U,!1);G(this,q,!1);G(this,R,!1);G(this,L,!1);this.handleClick=()=>{this.isInGroup()||this.disabled||(M(this,R,!0),!this.checked&&(this.checked=!0,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})))};this.handleInvalid=()=>{M(this,R,!0),this.updateValidity()};this.handleKeyDown=e=>{var t,a;if(!this.isInGroup()&&!this.disabled&&!e.defaultPrevented){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){let i=this.getStandaloneNamedRadios().filter(p=>!p.disabled);if(i.length<=1)return;e.preventDefault();let n=(a=(t=i.find(p=>p.checked))!=null?t:i.find(p=>p===this))!=null?a:i[0],s=e.key==="ArrowUp"||e.key==="ArrowLeft"?-1:1,u=(i.indexOf(n)+s+i.length)%i.length,b=i[u];M(b,R,!0),b.checked||(b.checked=!0,b.updateComplete.then(()=>{b.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})),b.focus();return}e.key!==" "&&e.key!=="Spacebar"&&e.key!=="Enter"||(e.preventDefault(),this.click())}};this.addEventListener("click",this.handleClick),this.addEventListener("invalid",this.handleInvalid),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){var e;super.connectedCallback(),this.setAttribute("type","radio"),this.value=(e=this.getAttribute("value"))!=null?e:"on",M(this,U,this.hasAttribute("checked")),this.checked=S(this,U),this.setAttribute("role","radio"),this.syncAriaDisabled(),this.syncTabIndex(),this.syncFormValue(),this.updateValidity()}syncAriaDisabled(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}syncAriaChecked(){this.setAttribute("aria-checked",this.checked?"true":"false")}willUpdate(e){this.shouldSyncFormState(e)&&(this.syncFormValue(),this.updateValidity())}updated(e){super.updated(e),e.has("checked")&&(this[this.checked?"setAttribute":"removeAttribute"]("checked-ui",""),this.syncAriaChecked(),this.checked&&!this.isInGroup()&&this.uncheckOtherRadios(),this.syncTabIndex()),e.has("disabled")&&(this[this.disabled?"setAttribute":"removeAttribute"]("disabled-ui",""),this.syncAriaDisabled(),this.syncTabIndex()),e.has("invalid")&&this.toggleAttribute("aria-invalid",this.invalid),e.has("name")&&this.checked&&!this.isInGroup()&&this.uncheckOtherRadios()}resetFormControl(){this.checked=S(this,U),this.syncFormValue(),this.updateValidity()}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return M(this,R,!0),this.updateValidity(),this.internals.checkValidity()}isInGroup(){return!!this.closest("w-radio-group")}getRadioScope(){var e,t;return(t=(e=this.internals.form)!=null?e:this.closest("form"))!=null?t:document}getStandaloneNamedRadios(){if(!this.name)return[this];let e=this.getRadioScope();return Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).filter(t=>!t.closest("w-radio-group"))}syncStandaloneTabOrder(){var n;let e=this.getStandaloneNamedRadios(),t=e.filter(s=>!s.disabled),a=t.find(s=>s.checked),i=(n=a!=null?a:t[0])!=null?n:null;e.forEach(s=>{if(s.disabled){s.tabIndex=-1;return}s.hasAttribute("tabindex")&&!S(s,L)||(s.tabIndex=s===i?0:-1,M(s,L,!0))})}uncheckOtherRadios(){if(!this.name)return;let e=this.getRadioScope();Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).forEach(a=>{a!==this&&(a.closest("w-radio-group")||a.checked&&(a.checked=!1))})}updateValidity(){if(this.disabled||this.isInGroup()){this.internals.setValidity({});return}let e=this.required&&!this.checked,t=this.invalid&&!S(this,q);if(e){M(this,q,!0),this.invalid=S(this,R),this.internals.setValidity({valueMissing:!0},this.internals.validationMessage||" ");return}if(S(this,q)&&(this.invalid=!1,M(this,q,!1)),t){this.internals.setValidity({customError:!0},this.internals.validationMessage||" ");return}this.internals.setValidity({})}syncFormValue(){if(this.disabled){this.setValue(null);return}this.setValue(this.checked?this.value:null)}syncTabIndex(){if(!this.hasAttribute("tabindex")&&!S(this,L)&&(M(this,L,!0),this.tabIndex=0),this.isInGroup()){this.disabled&&(this.tabIndex=-1);return}this.hasAttribute("tabindex")&&!S(this,L)||this.syncStandaloneTabOrder()}shouldSyncFormState(e){return e.has("checked")||e.has("value")||e.has("disabled")||e.has("required")||e.has("invalid")}render(){return kr`
2619
+ `;var $,q,R,L,z=class extends ee(kr){constructor(){super();this.name="";this.value=null;this.checked=!1;this.disabled=!1;this.required=!1;this.invalid=!1;G(this,$,!1);G(this,q,!1);G(this,R,!1);G(this,L,!1);this.handleClick=()=>{this.isInGroup()||this.disabled||(M(this,R,!0),!this.checked&&(this.checked=!0,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})))};this.handleInvalid=()=>{M(this,R,!0),this.updateValidity()};this.handleKeyDown=e=>{var t,a;if(!this.isInGroup()&&!this.disabled&&!e.defaultPrevented){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){let i=this.getStandaloneNamedRadios().filter(p=>!p.disabled);if(i.length<=1)return;e.preventDefault();let n=(a=(t=i.find(p=>p.checked))!=null?t:i.find(p=>p===this))!=null?a:i[0],s=e.key==="ArrowUp"||e.key==="ArrowLeft"?-1:1,u=(i.indexOf(n)+s+i.length)%i.length,b=i[u];M(b,R,!0),b.checked||(b.checked=!0,b.updateComplete.then(()=>{b.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})),b.focus();return}e.key!==" "&&e.key!=="Spacebar"&&e.key!=="Enter"||(e.preventDefault(),this.click())}};this.addEventListener("click",this.handleClick),this.addEventListener("invalid",this.handleInvalid),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){var e;super.connectedCallback(),this.setAttribute("type","radio"),this.value=(e=this.getAttribute("value"))!=null?e:"on",M(this,$,this.hasAttribute("checked")),this.checked=S(this,$),this.setAttribute("role","radio"),this.syncAriaDisabled(),this.syncTabIndex(),this.syncFormValue(),this.updateValidity()}syncAriaDisabled(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}syncAriaChecked(){this.setAttribute("aria-checked",this.checked?"true":"false")}willUpdate(e){this.shouldSyncFormState(e)&&(this.syncFormValue(),this.updateValidity())}updated(e){super.updated(e),e.has("checked")&&(this[this.checked?"setAttribute":"removeAttribute"]("checked-ui",""),this.syncAriaChecked(),this.checked&&!this.isInGroup()&&this.uncheckOtherRadios(),this.syncTabIndex()),e.has("disabled")&&(this[this.disabled?"setAttribute":"removeAttribute"]("disabled-ui",""),this.syncAriaDisabled(),this.syncTabIndex()),e.has("invalid")&&this.toggleAttribute("aria-invalid",this.invalid),e.has("name")&&this.checked&&!this.isInGroup()&&this.uncheckOtherRadios()}resetFormControl(){this.checked=S(this,$),this.syncFormValue(),this.updateValidity()}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return M(this,R,!0),this.updateValidity(),this.internals.checkValidity()}isInGroup(){return!!this.closest("w-radio-group")}getRadioScope(){var e,t;return(t=(e=this.internals.form)!=null?e:this.closest("form"))!=null?t:document}getStandaloneNamedRadios(){if(!this.name)return[this];let e=this.getRadioScope();return Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).filter(t=>!t.closest("w-radio-group"))}syncStandaloneTabOrder(){var n;let e=this.getStandaloneNamedRadios(),t=e.filter(s=>!s.disabled),a=t.find(s=>s.checked),i=(n=a!=null?a:t[0])!=null?n:null;e.forEach(s=>{if(s.disabled){s.tabIndex=-1;return}s.hasAttribute("tabindex")&&!S(s,L)||(s.tabIndex=s===i?0:-1,M(s,L,!0))})}uncheckOtherRadios(){if(!this.name)return;let e=this.getRadioScope();Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).forEach(a=>{a!==this&&(a.closest("w-radio-group")||a.checked&&(a.checked=!1))})}updateValidity(){if(this.disabled||this.isInGroup()){this.internals.setValidity({});return}let e=this.required&&!this.checked,t=this.invalid&&!S(this,q);if(e){M(this,q,!0),this.invalid=S(this,R),this.internals.setValidity({valueMissing:!0},this.internals.validationMessage||" ");return}if(S(this,q)&&(this.invalid=!1,M(this,q,!1)),t){this.internals.setValidity({customError:!0},this.internals.validationMessage||" ");return}this.internals.setValidity({})}syncFormValue(){if(this.disabled){this.setValue(null);return}this.setValue(this.checked?this.value:null)}syncTabIndex(){if(!this.hasAttribute("tabindex")&&!S(this,L)&&(M(this,L,!0),this.tabIndex=0),this.isInGroup()){this.disabled&&(this.tabIndex=-1);return}this.hasAttribute("tabindex")&&!S(this,L)||this.syncStandaloneTabOrder()}shouldSyncFormState(e){return e.has("checked")||e.has("value")||e.has("disabled")||e.has("required")||e.has("invalid")}render(){return xr`
2606
2620
  <div class="wrapper">
2607
2621
  <div part="control" class="control"></div>
2608
2622
  <slot part="label" class="label"></slot>
2609
2623
  </div>
2610
- `}};U=new WeakMap,q=new WeakMap,R=new WeakMap,L=new WeakMap,V.styles=[re,Te,Ie],m([$({reflect:!0})],V.prototype,"name",2),m([$({reflect:!0})],V.prototype,"value",2),m([$({type:Boolean,reflect:!0})],V.prototype,"checked",2),m([$({type:Boolean})],V.prototype,"disabled",2),m([$({type:Boolean,reflect:!0})],V.prototype,"required",2),m([$({type:Boolean,reflect:!0})],V.prototype,"invalid",2);customElements.get("w-radio")||customElements.define("w-radio",V);var _r=["en","nb","fi","da","sv"],ue="en",te=o=>_r.find(r=>o===r||o.toLowerCase().includes(r))||ue;function Re(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return te(o)}try{let o=Fe(document);if(o)return te(o);let r=Vr();if(r)return te(r);let e=Fe(Ne());return e?te(e):ue}catch(o){return console.warn("could not detect locale, falling back to source locale",o),ue}}var Le=(o,r,e,t,a)=>{y.load("en",o),y.load("nb",r),y.load("fi",e),y.load("da",t),y.load("sv",a);let i=Re();y.activate(i),Oe(),Er()},Cr="warp-i18n-change";function Oe(){typeof window!="undefined"&&window.dispatchEvent(new Event(Cr))}var Ae=!1;function Er(){if(Ae||typeof window=="undefined"||!(document!=null&&document.documentElement))return;Ae=!0;let o=()=>{let a=Re();y.locale!==a&&(y.activate(a),Oe())},r=new MutationObserver(a=>{for(let i of a)if(i.type==="attributes"&&i.attributeName==="lang"){o();break}});r.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let e=Ne();e&&e.documentElement&&e!==document&&r.observe(e.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=Mr();t&&r.observe(t,{attributes:!0,attributeFilter:["lang"]})}function Ne(){var o,r;try{return(r=(o=window.parent)==null?void 0:o.document)!=null?r:null}catch(e){return null}}function Fe(o){var r,e;try{return(e=(r=o==null?void 0:o.documentElement)==null?void 0:r.lang)!=null?e:""}catch(t){return""}}function Mr(){var o;try{return(o=window.frameElement)!=null?o:null}catch(r){return null}}function Vr(){var o,r,e;try{return(e=(r=(o=window.frameElement)==null?void 0:o.getAttribute)==null?void 0:r.call(o,"lang"))!=null?e:""}catch(t){return""}}var De=JSON.parse('{"radio-group.validation.required":["V\xE6lg en mulighed."],"radio-group.label.optional":["Valgfri"]}');var qe=JSON.parse('{"radio-group.validation.required":["Please select an option."],"radio-group.label.optional":["Optional"]}');var He=JSON.parse('{"radio-group.validation.required":["Valitse vaihtoehto."],"radio-group.label.optional":["Valinnainen"]}');var Pe=JSON.parse('{"radio-group.validation.required":["Velg et alternativ."],"radio-group.label.optional":["Valgfri"]}');var je=JSON.parse('{"radio-group.validation.required":["V\xE4lj ett alternativ."],"radio-group.label.optional":["Valfritt"]}');import{css as zr}from"lit";var $e=zr`
2624
+ `}};$=new WeakMap,q=new WeakMap,R=new WeakMap,L=new WeakMap,z.styles=[re,Ie,Te],m([U({reflect:!0})],z.prototype,"name",2),m([U({reflect:!0})],z.prototype,"value",2),m([U({type:Boolean,reflect:!0})],z.prototype,"checked",2),m([U({type:Boolean,reflect:!0})],z.prototype,"disabled",2),m([U({type:Boolean,reflect:!0})],z.prototype,"required",2),m([U({type:Boolean,reflect:!0})],z.prototype,"invalid",2);customElements.get("w-radio")||customElements.define("w-radio",z);var yr=["en","nb","fi","da","sv"],be="en",te=o=>yr.find(r=>o===r||o.toLowerCase().includes(r))||be;function Le(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return te(o)}try{let o=Re(document);if(o)return te(o);let r=Mr();if(r)return te(r);let e=Re(De());return e?te(e):be}catch(o){return console.warn("could not detect locale, falling back to source locale",o),be}}var Oe=(o,r,e,t,a)=>{y.load("en",o),y.load("nb",r),y.load("fi",e),y.load("da",t),y.load("sv",a);let i=Le();y.activate(i),Ne(),Cr()},_r="warp-i18n-change";function Ne(){typeof window!="undefined"&&window.dispatchEvent(new Event(_r))}var Fe=!1;function Cr(){if(Fe||typeof window=="undefined"||!(document!=null&&document.documentElement))return;Fe=!0;let o=()=>{let a=Le();y.locale!==a&&(y.activate(a),Ne())},r=new MutationObserver(a=>{for(let i of a)if(i.type==="attributes"&&i.attributeName==="lang"){o();break}});r.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let e=De();e&&e.documentElement&&e!==document&&r.observe(e.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=Er();t&&r.observe(t,{attributes:!0,attributeFilter:["lang"]})}function De(){var o,r;try{return(r=(o=window.parent)==null?void 0:o.document)!=null?r:null}catch(e){return null}}function Re(o){var r,e;try{return(e=(r=o==null?void 0:o.documentElement)==null?void 0:r.lang)!=null?e:""}catch(t){return""}}function Er(){var o;try{return(o=window.frameElement)!=null?o:null}catch(r){return null}}function Mr(){var o,r,e;try{return(e=(r=(o=window.frameElement)==null?void 0:o.getAttribute)==null?void 0:r.call(o,"lang"))!=null?e:""}catch(t){return""}}var qe=JSON.parse('{"radio-group.validation.required":["V\xE6lg en mulighed."],"radio-group.label.optional":["Valgfri"]}');var Pe=JSON.parse('{"radio-group.validation.required":["Please select an option."],"radio-group.label.optional":["Optional"]}');var He=JSON.parse('{"radio-group.validation.required":["Valitse vaihtoehto."],"radio-group.label.optional":["Valinnainen"]}');var je=JSON.parse('{"radio-group.validation.required":["Velg et alternativ."],"radio-group.label.optional":["Valgfri"]}');var Ue=JSON.parse('{"radio-group.validation.required":["V\xE4lj ett alternativ."],"radio-group.label.optional":["Valfritt"]}');import{css as zr}from"lit";var $e=zr`
2611
2625
  :host {
2612
2626
  display: block;
2627
+
2628
+ --_label-font-size: var(--w-c-radio-group-label-font-size, var(--w-font-size-s));
2629
+ --_label-line-height: var(--w-c-radio-group-label-line-height, var(--w-line-height-s));
2630
+ --_label-font-weight: var(--w-c-radio-group-label-font-weight, 700);
2631
+ --_label-color: var(--w-c-radio-group-label-color, var(--w-s-color-text));
2632
+ --_label-color-disabled: var(--w-c-radio-group-label-color-disabled, var(--w-s-color-text-disabled));
2633
+ --_label-padding-bottom: var(--w-c-radio-group-label-padding-bottom, 16px);
2634
+
2635
+ --_optional-font-weight: var(--w-c-radio-group-optional-font-weight, 400);
2636
+ --_optional-color: var(--w-c-radio-group-optional-color, var(--w-s-color-text-subtle));
2637
+ --_optional-margin-inline-start: var(--w-c-radio-group-optional-margin-inline-start, 0.5rem);
2638
+
2639
+ --_radios-gap: var(--w-c-radio-group-gap, 16px);
2640
+
2641
+ --_help-text-margin-block-start: var(--w-c-radio-group-help-text-margin-block-start, 16px);
2642
+ --_help-text-font-size: var(--w-c-radio-group-help-text-font-size, var(--w-font-size-xs));
2643
+ --_help-text-line-height: var(--w-c-radio-group-help-text-line-height, var(--w-line-height-xs));
2644
+ --_help-text-color: var(--w-c-radio-group-help-text-color, var(--w-s-color-text-subtle));
2645
+ --_help-text-color-disabled: var(--w-c-radio-group-help-text-color-disabled, var(--w-s-color-text-disabled));
2646
+ --_help-text-color-error: var(--w-c-radio-group-help-text-color-error, var(--w-s-color-text-negative));
2613
2647
  }
2614
2648
 
2615
- .form-control {
2649
+ [part='form-control'] {
2616
2650
  position: relative;
2617
- border: none;
2651
+
2652
+ border: 0;
2618
2653
  padding: 0;
2619
2654
  margin: 0;
2655
+
2656
+ min-inline-size: 0;
2620
2657
  }
2621
2658
 
2622
- .label {
2623
- font-size: var(--w-font-size-s);
2624
- line-height: var(--w-line-height-s);
2625
- font-weight: 700;
2659
+ [part='form-control-label'] {
2660
+ display: block;
2661
+ cursor: pointer;
2662
+
2663
+ font-size: var(--_label-font-size);
2664
+ line-height: var(--_label-line-height);
2665
+ font-weight: var(--_label-font-weight);
2666
+ color: var(--_label-color);
2667
+
2668
+ padding-bottom: var(--_label-padding-bottom);
2669
+
2626
2670
  -webkit-font-smoothing: antialiased;
2627
2671
  -moz-osx-font-smoothing: grayscale;
2628
2672
  font-smoothing: grayscale;
2629
- cursor: pointer;
2630
- padding-bottom: 16px;
2631
- color: var(--w-s-color-text);
2632
- display: block;
2633
2673
  }
2634
2674
 
2635
- .optional {
2636
- font-weight: 400;
2637
- color: var(--w-s-color-text-subtle);
2638
- margin-inline-start: 0.5rem;
2675
+ :host([disabled]) [part='form-control-label'] {
2676
+ cursor: default;
2677
+ color: var(--_label-color-disabled);
2639
2678
  }
2640
2679
 
2641
- .radio-group-required .label::after {
2680
+ :host([required]) [part='form-control-label']::after {
2642
2681
  content: var(--wa-form-control-required-content);
2643
2682
  margin-inline-start: var(--wa-form-control-required-content-offset);
2644
2683
  }
2645
2684
 
2685
+ .optional {
2686
+ font-weight: var(--_optional-font-weight);
2687
+ color: var(--_optional-color);
2688
+ margin-inline-start: var(--_optional-margin-inline-start);
2689
+ }
2690
+
2646
2691
  [part~='form-control-input'] {
2647
2692
  display: flex;
2648
2693
  flex-direction: column;
2649
2694
  flex-wrap: wrap;
2650
- gap: 16px;
2695
+ gap: var(--_radios-gap);
2651
2696
  }
2652
2697
 
2653
- /* Help text */
2654
2698
  [part~='help-text'] {
2655
- margin-block-start: 16px;
2656
- font-size: var(--w-font-size-xs);
2657
- line-height: var(--w-line-height-xs);
2658
- color: var(--w-s-color-text-subtle);
2699
+ margin-block-start: var(--_help-text-margin-block-start);
2700
+ font-size: var(--_help-text-font-size);
2701
+ line-height: var(--_help-text-line-height);
2702
+ color: var(--_help-text-color);
2659
2703
  }
2660
2704
 
2661
2705
  :host([disabled]) [part~='help-text'] {
2662
- color: var(--w-s-color-text-disabled);
2706
+ color: var(--_help-text-color-disabled);
2663
2707
  }
2664
2708
 
2665
- [part~='help-text'].error {
2666
- color: var(--w-s-color-text-negative);
2709
+ :host([data-show-error]) [part~='help-text'] {
2710
+ color: var(--_help-text-color-error);
2667
2711
  }
2668
-
2669
- `;Le(qe,Pe,He,De,je);var Tr=()=>y._({id:"radio-group.validation.required",message:"Please select an option.",comment:"Shown when required radio group has no selections"}),_=class extends ee(Ue){constructor(){super();this.hasInteracted=!1;this.hasWarnedMissingName=!1;this.autoTabIndex=!1;this.label="";this.helpText="";this.optional=!1;this.invalid=!1;this.name=null;this.disabled=!1;this.required=!1;this.defaultCheckedValue=void 0;this.slottedHelpText=null;this.nameManagedRadios=new WeakSet;this.disabledManagedRadios=new WeakSet;this.handleRadioClick=e=>{let t=e.target.closest("w-radio");if(!t||t.disabled||this.disabled)return;let a=this.getCheckedValue(),i=this.getAllRadios();this.selectSingleRadio(t,i),this.getCheckedValue()!==a&&this.updateComplete.then(this.emitSelectionChange)};this.handleInvalid=e=>{e.preventDefault(),this.hasInteracted=!0,this.updateValidity()};this.handleHelpTextSlotChange=()=>{this.syncSlottedHelpText(),this.requestUpdate()};this.handleI18nChange=()=>{this.requestUpdate()};this.emitSelectionChange=()=>{this.hasInteracted=!0,this.syncFormValue(),this.updateValidity(),this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};this.captureDefaultSelection=()=>{this.defaultCheckedValue===void 0&&(this.defaultCheckedValue=this.getCheckedValue())};this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleRadioClick),this.addEventListener("invalid",this.handleInvalid)}get validationTarget(){let e=this.querySelector(":is(w-radio):not([disabled])");if(e)return e}updated(e){(e.has("disabled")||e.has("name")||e.has("required")||e.has("invalid")||e.has("helpText"))&&(this.syncRadioElements(),this.syncFormValue(),this.updateValidity())}connectedCallback(){super.connectedCallback(),this.syncSlottedHelpText(),this.syncFormValue(),this.updateValidity(),this.unsubscribeI18n=y.on("change",this.handleI18nChange),this.warnIfMissingName(),this.updateComplete.then(this.captureDefaultSelection)}disconnectedCallback(){var e;(e=this.unsubscribeI18n)==null||e.call(this),this.unsubscribeI18n=void 0,super.disconnectedCallback()}resetFormControl(){var t;let e=(t=this.defaultCheckedValue)!=null?t:null;this.getAllRadios().forEach(a=>{a.checked=e?a.value===e:!1}),this.syncRadioElements(),this.syncFormValue(),this.updateValidity()}getAllRadios(){return[...this.querySelectorAll("w-radio")]}getCheckedValue(){var t;let e=this.getAllRadios().find(a=>a.checked);return(t=e==null?void 0:e.value)!=null?t:null}getEnabledRadios(e=this.getAllRadios()){return e.filter(t=>!t.disabled)}selectSingleRadio(e,t=this.getAllRadios()){t.forEach(a=>{let i=a===e;a.checked=i,a.setAttribute("tabindex",i?"0":"-1")})}handleLabelClick(){this.focus()}async syncRadioElements(){let e=this.getAllRadios();e.forEach((t,a)=>{t.toggleAttribute("data-w-radio-first",a===0),t.toggleAttribute("data-w-radio-inner",a!==0&&a!==e.length-1),t.toggleAttribute("data-w-radio-last",a===e.length-1),this.syncRadioDisabledState(t),this.name?(!t.getAttribute("name")||this.nameManagedRadios.has(t))&&(t.setAttribute("name",this.name),this.nameManagedRadios.add(t)):this.nameManagedRadios.has(t)&&(t.removeAttribute("name"),this.nameManagedRadios.delete(t))}),await Promise.all(e.map(async t=>t.updateComplete)),this.normalizeCheckedRadios(e),this.syncTabOrder(e)}syncRadioDisabledState(e){if(this.disabled){e.disabled||(e.disabled=!0,this.disabledManagedRadios.add(e));return}this.disabledManagedRadios.has(e)&&(e.disabled=!1,this.disabledManagedRadios.delete(e))}syncTabOrder(e){if(this.disabled){e.forEach(i=>{i.tabIndex=-1});return}let t=this.getEnabledRadios(e),a=t.find(i=>i.checked);t.length>0&&(a?t.forEach(i=>{i.tabIndex=i.checked?0:-1}):t.forEach((i,n)=>{i.tabIndex=n===0?0:-1})),e.filter(i=>i.disabled).forEach(i=>{i.tabIndex=-1})}handleKeyDown(e){var b;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key)||this.disabled)return;let t=this.getAllRadios(),a=this.getEnabledRadios(t);if(a.length<=0)return;e.preventDefault();let i=this.getCheckedValue(),n=(b=a.find(p=>p.checked))!=null?b:a[0],s=e.key===" "?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1,l=a.indexOf(n)+s;l<0&&(l=a.length-1),l>=a.length&&(l=0),this.selectSingleRadio(a[l],t),a[l].focus(),this.getCheckedValue()!==i&&this.updateComplete.then(this.emitSelectionChange)}focus(e){if(this.disabled)return;let t=this.getAllRadios(),a=t.find(s=>s.checked),i=t.find(s=>!s.disabled),n=a||i;n&&n.focus(e)}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.updateValidity(),this.internals.checkValidity()}hasSlottedContent(e){var a;if(this.querySelector(`[slot="${e}"]`))return!0;let t=(a=this.shadowRoot)==null?void 0:a.querySelector(`slot[name="${e}"]`);return t?t.assignedNodes({flatten:!0}).some(i=>{var n;return i.nodeType===Node.ELEMENT_NODE?!0:i.nodeType===Node.TEXT_NODE?!!((n=i.textContent)!=null&&n.trim()):!1}):!1}syncFormValue(){this.setValue(null)}syncSlottedHelpText(){var t;let e=this.querySelector('[slot="help-text"]');if(!e){this.slottedHelpText=null;return}this.slottedHelpText=((t=e.textContent)==null?void 0:t.trim())||null}updateValidity(){if(this.warnIfMissingName(),this.disabled){this.internals.setValidity({}),this.syncChildInvalid(!1),this.syncHostTabIndex(!1);return}let e=this.required&&!this.getCheckedValue(),t=this.invalid,a=e&&this.hasInteracted,i=t||a;if(this.syncHostTabIndex(i),e){this.setValidityState({valueMissing:!0}),this.syncChildInvalid(i);return}if(t){this.setValidityState({customError:!0}),this.syncChildInvalid(!0);return}this.internals.setValidity({}),this.syncChildInvalid(!1)}normalizeCheckedRadios(e){let t=e.find(a=>a.checked);t&&e.forEach(a=>{a!==t&&(a.checked=!1)})}syncChildInvalid(e){this.getAllRadios().forEach(t=>{t.invalid=e})}setValidityState(e){let t=this.validationTarget;this.internals.setValidity(e," ",t!=null?t:void 0)}syncHostTabIndex(e){if(!(this.hasAttribute("tabindex")&&!this.autoTabIndex)){if(e){this.tabIndex=0,this.autoTabIndex=!0;return}this.autoTabIndex&&(this.removeAttribute("tabindex"),this.autoTabIndex=!1)}}warnIfMissingName(){this.hasWarnedMissingName||this.internals.form&&(this.name&&this.name.trim().length>0||(console.warn('w-radio-group: "name" is required for form submission.'),this.hasWarnedMissingName=!0))}render(){let e=this.hasSlottedContent("label"),t=this.hasSlottedContent("help-text"),a=this.label?!0:!!e,i=this.helpText?!0:!!t,s=this.required&&!this.getCheckedValue()&&this.hasInteracted,l=this.invalid||s,u=l,b=l?Tr():this.helpText,p=l||i,I=a?"label":void 0,x=p?"help-text":void 0,E=this.slottedHelpText||void 0;return be`
2712
+ `;Oe(Pe,je,He,qe,Ue);var Sr=()=>y._({id:"radio-group.validation.required",message:"Please select an option.",comment:"Shown when required radio group has no selections"}),_=class extends ee(Ye){constructor(){super();this.hasInteracted=!1;this.hasWarnedMissingName=!1;this.autoTabIndex=!1;this.label="";this.helpText="";this.optional=!1;this.invalid=!1;this.name=null;this.disabled=!1;this.required=!1;this.defaultCheckedValue=void 0;this.slottedHelpText=null;this.nameManagedRadios=new WeakSet;this.disabledManagedRadios=new WeakSet;this.handleRadioClick=e=>{let t=e.target.closest("w-radio");if(!t||t.disabled||this.disabled)return;let a=this.getCheckedValue(),i=this.getAllRadios();this.selectSingleRadio(t,i),this.getCheckedValue()!==a&&this.updateComplete.then(this.emitSelectionChange)};this.handleInvalid=e=>{e.preventDefault(),this.hasInteracted=!0,this.updateValidity()};this.handleHelpTextSlotChange=()=>{this.syncSlottedHelpText(),this.requestUpdate()};this.handleI18nChange=()=>{this.requestUpdate()};this.emitSelectionChange=()=>{this.hasInteracted=!0,this.syncFormValue(),this.updateValidity(),this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};this.captureDefaultSelection=()=>{this.defaultCheckedValue===void 0&&(this.defaultCheckedValue=this.getCheckedValue())};this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleRadioClick),this.addEventListener("invalid",this.handleInvalid)}get validationTarget(){let e=this.querySelector(":is(w-radio):not([disabled])");return e!=null?e:void 0}connectedCallback(){super.connectedCallback(),this.syncSlottedHelpText(),this.syncFormValue(),this.updateValidity(),this.unsubscribeI18n=y.on("change",this.handleI18nChange),this.warnIfMissingName(),this.updateComplete.then(this.captureDefaultSelection)}disconnectedCallback(){var e;(e=this.unsubscribeI18n)==null||e.call(this),this.unsubscribeI18n=void 0,super.disconnectedCallback()}async updated(e){(e.has("disabled")||e.has("name")||e.has("required")||e.has("invalid")||e.has("helpText"))&&(this.syncFormValue(),this.updateValidity(),this.syncRadioElements(),this.syncFormValue(),this.updateValidity())}resetFormControl(){var t;let e=(t=this.defaultCheckedValue)!=null?t:null;this.getAllRadios().forEach(a=>{a.checked=e?a.value===e:!1}),this.syncRadioElements(),this.syncFormValue(),this.updateValidity()}getAllRadios(){return[...this.querySelectorAll("w-radio")]}getCheckedValue(){var t;let e=this.getAllRadios().find(a=>a.checked);return(t=e==null?void 0:e.value)!=null?t:null}getEnabledRadios(e=this.getAllRadios()){return e.filter(t=>!t.disabled)}selectSingleRadio(e,t=this.getAllRadios()){t.forEach(a=>{let i=a===e;a.checked=i,a.setAttribute("tabindex",i?"0":"-1")})}handleLabelClick(){this.focus()}async syncRadioElements(){let e=this.getAllRadios();e.forEach((t,a)=>{t.toggleAttribute("data-w-radio-first",a===0),t.toggleAttribute("data-w-radio-inner",a!==0&&a!==e.length-1),t.toggleAttribute("data-w-radio-last",a===e.length-1),this.syncRadioDisabledState(t),this.name?(!t.getAttribute("name")||this.nameManagedRadios.has(t))&&(t.setAttribute("name",this.name),this.nameManagedRadios.add(t)):this.nameManagedRadios.has(t)&&(t.removeAttribute("name"),this.nameManagedRadios.delete(t))}),await Promise.all(e.map(async t=>t.updateComplete)),this.normalizeCheckedRadios(e),this.syncTabOrder(e)}syncRadioDisabledState(e){if(this.disabled){e.disabled||(e.disabled=!0,this.disabledManagedRadios.add(e));return}this.disabledManagedRadios.has(e)&&(e.disabled=!1,this.disabledManagedRadios.delete(e))}syncTabOrder(e){if(this.disabled){e.forEach(i=>i.tabIndex=-1);return}let t=this.getEnabledRadios(e),a=t.find(i=>i.checked);t.length>0&&(a?t.forEach(i=>i.tabIndex=i.checked?0:-1):t.forEach((i,n)=>i.tabIndex=n===0?0:-1)),e.filter(i=>i.disabled).forEach(i=>i.tabIndex=-1)}handleKeyDown(e){var b;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key)||this.disabled)return;let t=this.getAllRadios(),a=this.getEnabledRadios(t);if(a.length<=0)return;e.preventDefault();let i=this.getCheckedValue(),n=(b=a.find(p=>p.checked))!=null?b:a[0],s=e.key===" "?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1,l=a.indexOf(n)+s;l<0&&(l=a.length-1),l>=a.length&&(l=0),this.selectSingleRadio(a[l],t),a[l].focus(),this.getCheckedValue()!==i&&this.updateComplete.then(this.emitSelectionChange)}focus(e){if(this.disabled)return;let t=this.getAllRadios(),a=t.find(s=>s.checked),i=t.find(s=>!s.disabled),n=a||i;n&&n.focus(e)}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.updateValidity(),this.internals.checkValidity()}hasSlottedContent(e){var a;if(this.querySelector(`[slot="${e}"]`))return!0;let t=(a=this.shadowRoot)==null?void 0:a.querySelector(`slot[name="${e}"]`);return t?t.assignedNodes({flatten:!0}).some(i=>{var n;return i.nodeType===Node.ELEMENT_NODE?!0:i.nodeType===Node.TEXT_NODE?!!((n=i.textContent)!=null&&n.trim()):!1}):!1}syncFormValue(){this.setValue(null)}syncSlottedHelpText(){var t;let e=this.querySelector('[slot="help-text"]');this.slottedHelpText=((t=e==null?void 0:e.textContent)==null?void 0:t.trim())||null}updateValidity(){this.warnIfMissingName();let e=this.required&&!this.getCheckedValue(),t=e&&this.hasInteracted,a=this.invalid||this.hasAttribute("invalid"),i=a||t;if(this.toggleAttribute("data-show-error",i),this.disabled){this.internals.setValidity({}),this.syncChildInvalid(!1),this.syncHostTabIndex(!1);return}if(this.syncHostTabIndex(i),e){this.setValidityState({valueMissing:!0}),this.syncChildInvalid(i);return}if(a){this.setValidityState({customError:!0}),this.syncChildInvalid(!0);return}this.internals.setValidity({}),this.syncChildInvalid(!1)}normalizeCheckedRadios(e){let t=e.find(a=>a.checked);t&&e.forEach(a=>{a!==t&&(a.checked=!1)})}syncChildInvalid(e){this.getAllRadios().forEach(t=>{t.invalid=e})}setValidityState(e){let t=this.validationTarget;this.internals.setValidity(e," ",t!=null?t:void 0)}syncHostTabIndex(e){if(!(this.hasAttribute("tabindex")&&!this.autoTabIndex)){if(e){this.setAttribute("tabindex","0"),this.autoTabIndex=!0;return}this.autoTabIndex&&(this.removeAttribute("tabindex"),this.autoTabIndex=!1)}}warnIfMissingName(){this.hasWarnedMissingName||this.internals.form&&(this.name&&this.name.trim().length>0||(console.warn('w-radio-group: "name" is required for form submission.'),this.hasWarnedMissingName=!0))}render(){let e=this.hasSlottedContent("label"),t=this.hasSlottedContent("help-text"),a=this.label?!0:!!e,i=this.helpText?!0:!!t,s=this.required&&!this.getCheckedValue()&&this.hasInteracted,u=this.invalid||this.hasAttribute("invalid")||s,b=u?Sr():this.helpText,p=u||i,I=a?"label":void 0,x=p?"help-text":void 0,E=this.slottedHelpText||void 0;return oe`
2670
2713
  <fieldset
2671
2714
  part="form-control"
2672
- class=${Ye({"form-control":!0,"form-control-radio-group":!0,"form-control-has-label":a,"radio-group-required":this.required})}
2673
2715
  role="radiogroup"
2674
- aria-labelledby=${We(I)}
2675
- aria-describedby=${We(x)}
2716
+ aria-labelledby=${pe(I)}
2717
+ aria-describedby=${pe(x)}
2676
2718
  aria-errormessage="error-message"
2677
2719
  aria-invalid=${u?"true":void 0}>
2678
- <label
2679
- part="form-control-label"
2680
- id="label"
2681
- class="label"
2682
- aria-hidden=${a?"false":"true"}
2683
- @click=${this.handleLabelClick}>
2684
- <slot name="label">${this.label}</slot>
2685
- ${this.optional?be` <span class="optional">
2686
- ${y._({id:"radio-group.label.optional",message:"Optional",comment:"Shown behind label when marked as optional"})}
2687
- </span>`:null}
2688
- </label>
2720
+ ${a?oe`
2721
+ <label part="form-control-label" id="label" @click=${this.handleLabelClick}>
2722
+ <slot name="label">${this.label}</slot>
2723
+ ${this.optional?oe`<span class="optional">
2724
+ ${y._({id:"radio-group.label.optional",message:"Optional",comment:"Shown behind label when marked as optional"})}
2725
+ </span>`:null}
2726
+ </label>
2727
+ `:null}
2689
2728
 
2690
2729
  <slot part="form-control-input" @slotchange=${this.syncRadioElements}></slot>
2691
2730
 
2692
- ${p?be`
2693
- <div
2694
- id="help-text"
2695
- part="help-text"
2696
- class=${Ye({"has-slotted":i,error:u})}
2697
- aria-hidden=${p?"false":"true"}
2698
- aria-label=${E}>
2731
+ ${p?oe`
2732
+ <div id="help-text" part="help-text" aria-label=${pe(E)}>
2699
2733
  <slot name="help-text" @slotchange=${this.handleHelpTextSlotChange}>${b}</slot>
2700
2734
  </div>
2701
2735
  `:null}
2702
2736
  </fieldset>
2703
- `}};_.styles=[re,$e],_.shadowRootOptions={...Ue.shadowRootOptions,delegatesFocus:!0},m([Sr()],_.prototype,"hasInteracted",2),m([H()],_.prototype,"label",2),m([H({attribute:"help-text"})],_.prototype,"helpText",2),m([H({type:Boolean,reflect:!0})],_.prototype,"optional",2),m([H({type:Boolean,reflect:!0})],_.prototype,"invalid",2),m([H({reflect:!0})],_.prototype,"name",2),m([H({type:Boolean,reflect:!0})],_.prototype,"disabled",2),m([H({type:Boolean,reflect:!0})],_.prototype,"required",2);customElements.get("w-radio-group")||customElements.define("w-radio-group",_);export{_ as WRadioGroup};
2737
+ `}};_.styles=[re,$e],_.shadowRootOptions={...Ye.shadowRootOptions,delegatesFocus:!0},m([Vr()],_.prototype,"hasInteracted",2),m([P()],_.prototype,"label",2),m([P({attribute:"help-text"})],_.prototype,"helpText",2),m([P({type:Boolean,reflect:!0})],_.prototype,"optional",2),m([P({type:Boolean,reflect:!0})],_.prototype,"invalid",2),m([P({reflect:!0})],_.prototype,"name",2),m([P({type:Boolean,reflect:!0})],_.prototype,"disabled",2),m([P({type:Boolean,reflect:!0})],_.prototype,"required",2);customElements.get("w-radio-group")||customElements.define("w-radio-group",_);export{_ as WRadioGroup};
2704
2738
  //# sourceMappingURL=radio-group.js.map