@commmerce/ui 1.23.0 → 1.24.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.
package/dist/cdn.js CHANGED
@@ -1,6 +1,6 @@
1
- var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(o,n,e)=>(hu(o,n,"read from private field"),e?e.call(o):n.get(o)),m=(o,n,e)=>n.has(o)?wb("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(hu(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(hu(o,n,"access private method"),e);var rh=globalThis,sh=rh.ShadowRoot&&(rh.ShadyCSS===void 0||rh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pu=Symbol(),$b=new WeakMap,ml=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==pu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(sh&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=$b.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&$b.set(e,n))}return n}toString(){return this.cssText}},ah=o=>new ml(typeof o=="string"?o:o+"",void 0,pu),w=(o,...n)=>{let e=o.length===1?o[0]:n.reduce((t,i,s)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new ml(e,o,pu)},kb=(o,n)=>{if(sh)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=rh.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},mu=sh?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return ah(e)})(o):o;var{is:Uw,defineProperty:Kw,getOwnPropertyDescriptor:Ww,getOwnPropertyNames:Gw,getOwnPropertySymbols:Yw,getPrototypeOf:Xw}=Object,nh=globalThis,Eb=nh.trustedTypes,Jw=Eb?Eb.emptyScript:"",Qw=nh.reactiveElementPolyfillSupport,ul=(o,n)=>o,uu={toAttribute(o,n){switch(n){case Boolean:o=o?Jw:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,n){let e=o;switch(n){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},_b=(o,n)=>!Uw(o,n),Mb={attribute:!0,type:String,converter:uu,reflect:!1,useDefault:!1,hasChanged:_b};Symbol.metadata??=Symbol("metadata"),nh.litPropertyMetadata??=new WeakMap;var ei=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=Mb){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(n,t,e);i!==void 0&&Kw(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:s}=Ww(this.prototype,n)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);s?.call(this,l),this.requestUpdate(n,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Mb}static _$Ei(){if(this.hasOwnProperty(ul("elementProperties")))return;let n=Xw(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(ul("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ul("properties"))){let e=this.properties,t=[...Gw(e),...Yw(e)];for(let i of t)this.createProperty(i,e[i])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){let e=[];if(Array.isArray(n)){let t=new Set(n.flat(1/0).reverse());for(let i of t)e.unshift(mu(i))}else n!==void 0&&e.push(mu(n));return e}static _$Eu(n,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(n=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(n.set(t,this[t]),delete this[t]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return kb(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(n=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach(n=>n.hostDisconnected?.())}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$ET(n,e){let t=this.constructor.elementProperties.get(n),i=this.constructor._$Eu(n,t);if(i!==void 0&&t.reflect===!0){let s=(t.converter?.toAttribute!==void 0?t.converter:uu).toAttribute(e,t.type);this._$Em=n,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(n,e){let t=this.constructor,i=t._$Eh.get(n);if(i!==void 0&&this._$Em!==i){let s=t.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:uu;this._$Em=i;let d=l.fromAttribute(e,s.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(n,e,t,i=!1,s){if(n!==void 0){let l=this.constructor;if(i===!1&&(s=this[n]),t??=l.getPropertyOptions(n),!((t.hasChanged??_b)(s,e)||t.useDefault&&t.reflect&&s===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,t))))return;this.C(n,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:t,reflect:i,wrapped:s},l){t&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,l??e??this[n]),s!==!0||l!==void 0)||(this._$AL.has(n)||(this.hasUpdated||t||(e=void 0),this._$AL.set(n,e)),i===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,s]of t){let{wrapped:l}=s,d=this[i];l!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,s,d)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}};ei.elementStyles=[],ei.shadowRootOptions={mode:"open"},ei[ul("elementProperties")]=new Map,ei[ul("finalized")]=new Map,Qw?.({ReactiveElement:ei}),(nh.reactiveElementVersions??=[]).push("2.1.2");var fu=globalThis,Tb=o=>o,oh=fu.trustedTypes,Cb=oh?oh.createPolicy("lit-html",{createHTML:o=>o}):void 0,bu="$lit$",ti=`lit$${Math.random().toFixed(9).slice(2)}$`,vu="?"+ti,Zw=`<${vu}>`,Tr=document,fl=()=>Tr.createComment(""),bl=o=>o===null||typeof o!="object"&&typeof o!="function",yu=Array.isArray,Rb=o=>yu(o)||typeof o?.[Symbol.iterator]=="function",gu=`[
2
- \f\r]`,gl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zb=/-->/g,Sb=/>/g,Mr=RegExp(`>|${gu}(?:([^\\s"'>=/]+)(${gu}*=${gu}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Lb=/'/g,Ab=/"/g,Hb=/^(?:script|style|textarea|title)$/i,xu=o=>(n,...e)=>({_$litType$:o,strings:n,values:e}),c=xu(1),ii=xu(2),d$=xu(3),Pe=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Db=new WeakMap,_r=Tr.createTreeWalker(Tr,129);function Nb(o,n){if(!yu(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cb!==void 0?Cb.createHTML(n):n}var Pb=(o,n)=>{let e=o.length-1,t=[],i,s=n===2?"<svg>":n===3?"<math>":"",l=gl;for(let d=0;d<e;d++){let p=o[d],u,b,f=-1,x=0;for(;x<p.length&&(l.lastIndex=x,b=l.exec(p),b!==null);)x=l.lastIndex,l===gl?b[1]==="!--"?l=zb:b[1]!==void 0?l=Sb:b[2]!==void 0?(Hb.test(b[2])&&(i=RegExp("</"+b[2],"g")),l=Mr):b[3]!==void 0&&(l=Mr):l===Mr?b[0]===">"?(l=i??gl,f=-1):b[1]===void 0?f=-2:(f=l.lastIndex-b[2].length,u=b[1],l=b[3]===void 0?Mr:b[3]==='"'?Ab:Lb):l===Ab||l===Lb?l=Mr:l===zb||l===Sb?l=gl:(l=Mr,i=void 0);let v=l===Mr&&o[d+1].startsWith("/>")?" ":"";s+=l===gl?p+Zw:f>=0?(t.push(u),p.slice(0,f)+bu+p.slice(f)+ti+v):p+ti+(f===-2?d:v)}return[Nb(o,s+(o[e]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),t]},vl=class o{constructor({strings:n,_$litType$:e},t){let i;this.parts=[];let s=0,l=0,d=n.length-1,p=this.parts,[u,b]=Pb(n,e);if(this.el=o.createElement(u,t),_r.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=_r.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(bu)){let x=b[l++],v=i.getAttribute(f).split(ti),k=/([.?@])?(.*)/.exec(x);p.push({type:1,index:s,name:k[2],strings:v,ctor:k[1]==="."?ch:k[1]==="?"?dh:k[1]==="@"?hh:zr}),i.removeAttribute(f)}else f.startsWith(ti)&&(p.push({type:6,index:s}),i.removeAttribute(f));if(Hb.test(i.tagName)){let f=i.textContent.split(ti),x=f.length-1;if(x>0){i.textContent=oh?oh.emptyScript:"";for(let v=0;v<x;v++)i.append(f[v],fl()),_r.nextNode(),p.push({type:2,index:++s});i.append(f[x],fl())}}}else if(i.nodeType===8)if(i.data===vu)p.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(ti,f+1))!==-1;)p.push({type:7,index:s}),f+=ti.length-1}s++}}static createElement(n,e){let t=Tr.createElement("template");return t.innerHTML=n,t}};function Cr(o,n,e=o,t){if(n===Pe)return n;let i=t!==void 0?e._$Co?.[t]:e._$Cl,s=bl(n)?void 0:n._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(n=Cr(o,i._$AS(o,n.values),i,t)),n}var lh=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:e},parts:t}=this._$AD,i=(n?.creationScope??Tr).importNode(e,!0);_r.currentNode=i;let s=_r.nextNode(),l=0,d=0,p=t[0];for(;p!==void 0;){if(l===p.index){let u;p.type===2?u=new Qs(s,s.nextSibling,this,n):p.type===1?u=new p.ctor(s,p.name,p.strings,this,n):p.type===6&&(u=new ph(s,this,n)),this._$AV.push(u),p=t[++d]}l!==p?.index&&(s=_r.nextNode(),l++)}return _r.currentNode=Tr,i}p(n){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},Qs=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=n,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,e=this._$AM;return e!==void 0&&n?.nodeType===11&&(n=e.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,e=this){n=Cr(this,n,e),bl(n)?n===h||n==null||n===""?(this._$AH!==h&&this._$AR(),this._$AH=h):n!==this._$AH&&n!==Pe&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):Rb(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==h&&bl(this._$AH)?this._$AA.nextSibling.data=n:this.T(Tr.createTextNode(n)),this._$AH=n}$(n){let{values:e,_$litType$:t}=n,i=typeof t=="number"?this._$AC(n):(t.el===void 0&&(t.el=vl.createElement(Nb(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let s=new lh(i,this),l=s.u(this.options);s.p(e),this.T(l),this._$AH=s}}_$AC(n){let e=Db.get(n.strings);return e===void 0&&Db.set(n.strings,e=new vl(n)),e}k(n){yu(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let s of n)i===e.length?e.push(t=new o(this.O(fl()),this.O(fl()),this,this.options)):t=e[i],t._$AI(s),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(n=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);n!==this._$AB;){let t=Tb(n).nextSibling;Tb(n).remove(),n=t}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}},zr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,i,s){this.type=1,this._$AH=h,this._$AN=void 0,this.element=n,this.name=e,this._$AM=i,this.options=s,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(n,e=this,t,i){let s=this.strings,l=!1;if(s===void 0)n=Cr(this,n,e,0),l=!bl(n)||n!==this._$AH&&n!==Pe,l&&(this._$AH=n);else{let d=n,p,u;for(n=s[0],p=0;p<s.length-1;p++)u=Cr(this,d[t+p],e,p),u===Pe&&(u=this._$AH[p]),l||=!bl(u)||u!==this._$AH[p],u===h?n=h:n!==h&&(n+=(u??"")+s[p+1]),this._$AH[p]=u}l&&!i&&this.j(n)}j(n){n===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},ch=class extends zr{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===h?void 0:n}},dh=class extends zr{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==h)}},hh=class extends zr{constructor(n,e,t,i,s){super(n,e,t,i,s),this.type=5}_$AI(n,e=this){if((n=Cr(this,n,e,0)??h)===Pe)return;let t=this._$AH,i=n===h&&t!==h||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,s=n!==h&&(t===h||i);i&&this.element.removeEventListener(this.name,this,t),s&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}},ph=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){Cr(this,n)}},Ib={M:bu,P:ti,A:vu,C:1,L:Pb,R:lh,D:Rb,V:Cr,I:Qs,H:zr,N:dh,U:hh,B:ch,F:ph},e0=fu.litHtmlPolyfillSupport;e0?.(vl,Qs),(fu.litHtmlVersions??=[]).push("3.3.3");var qb=(o,n,e)=>{let t=e?.renderBefore??n,i=t._$litPart$;if(i===void 0){let s=e?.renderBefore??null;t._$litPart$=i=new Qs(n.insertBefore(fl(),s),s,void 0,e??{})}return i._$AI(o),i};var wu=globalThis,A=class extends ei{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=qb(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Pe}};A._$litElement$=!0,A.finalized=!0,wu.litElementHydrateSupport?.({LitElement:A});var t0=wu.litElementPolyfillSupport;t0?.({LitElement:A});(wu.litElementVersions??=[]).push("4.2.2");var E=w`
1
+ var $b=o=>{throw TypeError(o)};var pu=(o,n,e)=>n.has(o)||$b("Cannot "+e);var r=(o,n,e)=>(pu(o,n,"read from private field"),e?e.call(o):n.get(o)),m=(o,n,e)=>n.has(o)?$b("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(pu(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(pu(o,n,"access private method"),e);var sh=globalThis,ah=sh.ShadowRoot&&(sh.ShadyCSS===void 0||sh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mu=Symbol(),kb=new WeakMap,ul=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==mu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(ah&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=kb.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&kb.set(e,n))}return n}toString(){return this.cssText}},nh=o=>new ul(typeof o=="string"?o:o+"",void 0,mu),w=(o,...n)=>{let e=o.length===1?o[0]:n.reduce((t,i,s)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new ul(e,o,mu)},Eb=(o,n)=>{if(ah)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=sh.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},uu=ah?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return nh(e)})(o):o;var{is:Kw,defineProperty:Ww,getOwnPropertyDescriptor:Gw,getOwnPropertyNames:Yw,getOwnPropertySymbols:Xw,getPrototypeOf:Jw}=Object,oh=globalThis,Mb=oh.trustedTypes,Qw=Mb?Mb.emptyScript:"",Zw=oh.reactiveElementPolyfillSupport,gl=(o,n)=>o,gu={toAttribute(o,n){switch(n){case Boolean:o=o?Qw:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,n){let e=o;switch(n){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},Tb=(o,n)=>!Kw(o,n),_b={attribute:!0,type:String,converter:gu,reflect:!1,useDefault:!1,hasChanged:Tb};Symbol.metadata??=Symbol("metadata"),oh.litPropertyMetadata??=new WeakMap;var ti=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=_b){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(n,t,e);i!==void 0&&Ww(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:s}=Gw(this.prototype,n)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);s?.call(this,l),this.requestUpdate(n,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??_b}static _$Ei(){if(this.hasOwnProperty(gl("elementProperties")))return;let n=Jw(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(gl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(gl("properties"))){let e=this.properties,t=[...Yw(e),...Xw(e)];for(let i of t)this.createProperty(i,e[i])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){let e=[];if(Array.isArray(n)){let t=new Set(n.flat(1/0).reverse());for(let i of t)e.unshift(uu(i))}else n!==void 0&&e.push(uu(n));return e}static _$Eu(n,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(n=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(n.set(t,this[t]),delete this[t]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Eb(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(n=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach(n=>n.hostDisconnected?.())}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$ET(n,e){let t=this.constructor.elementProperties.get(n),i=this.constructor._$Eu(n,t);if(i!==void 0&&t.reflect===!0){let s=(t.converter?.toAttribute!==void 0?t.converter:gu).toAttribute(e,t.type);this._$Em=n,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(n,e){let t=this.constructor,i=t._$Eh.get(n);if(i!==void 0&&this._$Em!==i){let s=t.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:gu;this._$Em=i;let d=l.fromAttribute(e,s.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(n,e,t,i=!1,s){if(n!==void 0){let l=this.constructor;if(i===!1&&(s=this[n]),t??=l.getPropertyOptions(n),!((t.hasChanged??Tb)(s,e)||t.useDefault&&t.reflect&&s===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,t))))return;this.C(n,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:t,reflect:i,wrapped:s},l){t&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,l??e??this[n]),s!==!0||l!==void 0)||(this._$AL.has(n)||(this.hasUpdated||t||(e=void 0),this._$AL.set(n,e)),i===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,s]of t){let{wrapped:l}=s,d=this[i];l!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,s,d)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}};ti.elementStyles=[],ti.shadowRootOptions={mode:"open"},ti[gl("elementProperties")]=new Map,ti[gl("finalized")]=new Map,Zw?.({ReactiveElement:ti}),(oh.reactiveElementVersions??=[]).push("2.1.2");var bu=globalThis,Cb=o=>o,lh=bu.trustedTypes,zb=lh?lh.createPolicy("lit-html",{createHTML:o=>o}):void 0,vu="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,yu="?"+ii,e0=`<${yu}>`,Cr=document,bl=()=>Cr.createComment(""),vl=o=>o===null||typeof o!="object"&&typeof o!="function",xu=Array.isArray,Hb=o=>xu(o)||typeof o?.[Symbol.iterator]=="function",fu=`[
2
+ \f\r]`,fl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Sb=/-->/g,Lb=/>/g,_r=RegExp(`>|${fu}(?:([^\\s"'>=/]+)(${fu}*=${fu}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ab=/'/g,Db=/"/g,Nb=/^(?:script|style|textarea|title)$/i,wu=o=>(n,...e)=>({_$litType$:o,strings:n,values:e}),c=wu(1),ri=wu(2),h1=wu(3),Pe=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Rb=new WeakMap,Tr=Cr.createTreeWalker(Cr,129);function Pb(o,n){if(!xu(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return zb!==void 0?zb.createHTML(n):n}var Ib=(o,n)=>{let e=o.length-1,t=[],i,s=n===2?"<svg>":n===3?"<math>":"",l=fl;for(let d=0;d<e;d++){let p=o[d],u,b,f=-1,x=0;for(;x<p.length&&(l.lastIndex=x,b=l.exec(p),b!==null);)x=l.lastIndex,l===fl?b[1]==="!--"?l=Sb:b[1]!==void 0?l=Lb:b[2]!==void 0?(Nb.test(b[2])&&(i=RegExp("</"+b[2],"g")),l=_r):b[3]!==void 0&&(l=_r):l===_r?b[0]===">"?(l=i??fl,f=-1):b[1]===void 0?f=-2:(f=l.lastIndex-b[2].length,u=b[1],l=b[3]===void 0?_r:b[3]==='"'?Db:Ab):l===Db||l===Ab?l=_r:l===Sb||l===Lb?l=fl:(l=_r,i=void 0);let v=l===_r&&o[d+1].startsWith("/>")?" ":"";s+=l===fl?p+e0:f>=0?(t.push(u),p.slice(0,f)+vu+p.slice(f)+ii+v):p+ii+(f===-2?d:v)}return[Pb(o,s+(o[e]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),t]},yl=class o{constructor({strings:n,_$litType$:e},t){let i;this.parts=[];let s=0,l=0,d=n.length-1,p=this.parts,[u,b]=Ib(n,e);if(this.el=o.createElement(u,t),Tr.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Tr.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(vu)){let x=b[l++],v=i.getAttribute(f).split(ii),k=/([.?@])?(.*)/.exec(x);p.push({type:1,index:s,name:k[2],strings:v,ctor:k[1]==="."?dh:k[1]==="?"?hh:k[1]==="@"?ph:Sr}),i.removeAttribute(f)}else f.startsWith(ii)&&(p.push({type:6,index:s}),i.removeAttribute(f));if(Nb.test(i.tagName)){let f=i.textContent.split(ii),x=f.length-1;if(x>0){i.textContent=lh?lh.emptyScript:"";for(let v=0;v<x;v++)i.append(f[v],bl()),Tr.nextNode(),p.push({type:2,index:++s});i.append(f[x],bl())}}}else if(i.nodeType===8)if(i.data===yu)p.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(ii,f+1))!==-1;)p.push({type:7,index:s}),f+=ii.length-1}s++}}static createElement(n,e){let t=Cr.createElement("template");return t.innerHTML=n,t}};function zr(o,n,e=o,t){if(n===Pe)return n;let i=t!==void 0?e._$Co?.[t]:e._$Cl,s=vl(n)?void 0:n._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(n=zr(o,i._$AS(o,n.values),i,t)),n}var ch=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:e},parts:t}=this._$AD,i=(n?.creationScope??Cr).importNode(e,!0);Tr.currentNode=i;let s=Tr.nextNode(),l=0,d=0,p=t[0];for(;p!==void 0;){if(l===p.index){let u;p.type===2?u=new Zs(s,s.nextSibling,this,n):p.type===1?u=new p.ctor(s,p.name,p.strings,this,n):p.type===6&&(u=new mh(s,this,n)),this._$AV.push(u),p=t[++d]}l!==p?.index&&(s=Tr.nextNode(),l++)}return Tr.currentNode=Cr,i}p(n){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},Zs=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=n,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,e=this._$AM;return e!==void 0&&n?.nodeType===11&&(n=e.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,e=this){n=zr(this,n,e),vl(n)?n===h||n==null||n===""?(this._$AH!==h&&this._$AR(),this._$AH=h):n!==this._$AH&&n!==Pe&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):Hb(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==h&&vl(this._$AH)?this._$AA.nextSibling.data=n:this.T(Cr.createTextNode(n)),this._$AH=n}$(n){let{values:e,_$litType$:t}=n,i=typeof t=="number"?this._$AC(n):(t.el===void 0&&(t.el=yl.createElement(Pb(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let s=new ch(i,this),l=s.u(this.options);s.p(e),this.T(l),this._$AH=s}}_$AC(n){let e=Rb.get(n.strings);return e===void 0&&Rb.set(n.strings,e=new yl(n)),e}k(n){xu(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let s of n)i===e.length?e.push(t=new o(this.O(bl()),this.O(bl()),this,this.options)):t=e[i],t._$AI(s),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(n=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);n!==this._$AB;){let t=Cb(n).nextSibling;Cb(n).remove(),n=t}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}},Sr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,i,s){this.type=1,this._$AH=h,this._$AN=void 0,this.element=n,this.name=e,this._$AM=i,this.options=s,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(n,e=this,t,i){let s=this.strings,l=!1;if(s===void 0)n=zr(this,n,e,0),l=!vl(n)||n!==this._$AH&&n!==Pe,l&&(this._$AH=n);else{let d=n,p,u;for(n=s[0],p=0;p<s.length-1;p++)u=zr(this,d[t+p],e,p),u===Pe&&(u=this._$AH[p]),l||=!vl(u)||u!==this._$AH[p],u===h?n=h:n!==h&&(n+=(u??"")+s[p+1]),this._$AH[p]=u}l&&!i&&this.j(n)}j(n){n===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},dh=class extends Sr{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===h?void 0:n}},hh=class extends Sr{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==h)}},ph=class extends Sr{constructor(n,e,t,i,s){super(n,e,t,i,s),this.type=5}_$AI(n,e=this){if((n=zr(this,n,e,0)??h)===Pe)return;let t=this._$AH,i=n===h&&t!==h||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,s=n!==h&&(t===h||i);i&&this.element.removeEventListener(this.name,this,t),s&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}},mh=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){zr(this,n)}},qb={M:vu,P:ii,A:yu,C:1,L:Ib,R:ch,D:Hb,V:zr,I:Zs,H:Sr,N:hh,U:ph,B:dh,F:mh},t0=bu.litHtmlPolyfillSupport;t0?.(yl,Zs),(bu.litHtmlVersions??=[]).push("3.3.3");var Ob=(o,n,e)=>{let t=e?.renderBefore??n,i=t._$litPart$;if(i===void 0){let s=e?.renderBefore??null;t._$litPart$=i=new Zs(n.insertBefore(bl(),s),s,void 0,e??{})}return i._$AI(o),i};var $u=globalThis,A=class extends ti{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=Ob(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Pe}};A._$litElement$=!0,A.finalized=!0,$u.litElementHydrateSupport?.({LitElement:A});var i0=$u.litElementPolyfillSupport;i0?.({LitElement:A});($u.litElementVersions??=[]).push("4.2.2");var E=w`
4
4
  :host {
5
5
  font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif);
6
6
  color: var(--cm-text-default, #000);
@@ -12,20 +12,20 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
12
12
  shifts the layout. Overflow is shown instead by the component (fades, "more" hints, sticky edges). */
13
13
  :host, * { scrollbar-width: none; }
14
14
  ::-webkit-scrollbar { display: none; }
15
- `,E$=w`
15
+ `,M1=w`
16
16
  outline: 2px solid var(--cm-border-strong);
17
17
  outline-offset: 2px;
18
- `,i0=0,N=o=>`${o}-${++i0}`,$u=new Set,mh;function Zs(o){$u.has(o)||typeof document>"u"||typeof CSSStyleSheet>"u"||($u.add(o),mh||(mh=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,mh]),mh.replaceSync(`:where(${[...$u].map(n=>`${n}[align]`).join(", ")}) { text-align: inherit; }`))}function $(o,n){customElements.get(o)||customElements.define(o,n)}function se(o,n){let e=o.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(n).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var r0={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},uh={common:{...r0}},yl={},xl={},gh;function z(o,n){return uh[o]={...uh[o],...n},n}function s0(){return Object.fromEntries(Object.entries(uh).map(([o,n])=>[o,{...n}]))}function fh(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function a0(o,n){fh(n?xl[n.toLowerCase()]??={}:yl,o),yh()}function n0(o={}){"locale"in o&&(gh=o.locale||void 0),o.strings&&fh(yl,o.strings);for(let[n,e]of Object.entries(o.translations??{}))fh(xl[n.toLowerCase()]??={},e);yh()}function o0(){gh=void 0;for(let o of Object.keys(yl))delete yl[o];for(let o of Object.keys(xl))delete xl[o];yh()}function wl(o){if(gh)return gh;let n=o;for(;n;){if(n instanceof Element&&n.hasAttribute("lang")&&n.getAttribute("lang"))return n.getAttribute("lang");n=n.parentNode??(n instanceof ShadowRoot?n.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var Ob=new Map;function Mu(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,s=Ob.get(i);if(!s){try{s=t(n)}catch{s=t(void 0)}Ob.set(i,s)}return s}function _u(o,n={},e){return Mu("n",e,n,t=>new Intl.NumberFormat(t,n)).format(o)}function ue(o,n={},e){return Mu("d",e,n,t=>new Intl.DateTimeFormat(t,n)).format(o)}function bh(o,n){return Mu("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function Bb(o,n={},e){if(o==null)return"";if(typeof o=="function")return String(o(n));let t;if(typeof o=="object"){let i=Number(n.count??0);t=o[bh(i,e)]??o.other??""}else t=String(o);return t.replace(/\{(\w+)\}/g,(i,s)=>{let l=n[s];return l===void 0?i:typeof l=="number"?_u(l,{},e):String(l)})}function l0(o,n,e,t){if(t&&t[n]!==void 0)return t[n];let i=[];if(e){let s=e.toLowerCase().split("-");for(let l=s.length;l>0;l--)i.push(s.slice(0,l).join("-"))}for(let s of o==="common"?["common"]:[o,"common"]){for(let d of i){let p=xl[d]?.[s]?.[n];if(p!==void 0)return p}let l=yl[s]?.[n]??uh[s]?.[n];if(l!==void 0)return l}}function vh(o,n,e,t,i){let s=wl(t);return Bb(l0(o,n,s,i),e,s)}var Eu=new Set,ku;function yh(){for(let o of Eu)o.requestUpdate()}function c0(){ku||typeof MutationObserver>"u"||typeof document>"u"||(ku=new MutationObserver(yh),ku.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var d0=o=>o.replace(/^cm-/,"").replace(/-([a-z])/g,(n,e)=>e.toUpperCase()),C=class extends A{static finalize(){let n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!n(this,"finalized")&&n(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||n(this.prototype,e))continue;let s=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[s]??this.t(i)},set(l){this[s]=l},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return d0(this.localName)}t(n,e){return vh(this.stringsNamespace,n,e,this,this.strings)}get locale(){return wl(this)}formatNumber(n,e){return _u(n,e,this.locale)}connectedCallback(){super.connectedCallback(),Eu.add(this),c0()}disconnectedCallback(){super.disconnectedCallback(),Eu.delete(this)}};C.properties={strings:{type:Object}};var xh={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",eyedropper:"M14 6l4 4M12.5 7.5l4 4M15.5 3.5a2.1 2.1 0 013 0l2 2a2.1 2.1 0 010 3L18 11l-5-5 2.5-2.5zM14 9.5L5.5 18v2h2L16 11.5",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z",camera:"M3 8.5A1.5 1.5 0 0 1 4.5 7h3L9 4.5h6L16.5 7h3A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5zM12 16.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",image:"M4 5h16v14H4zM4 16l4.5-4.5 4 4 2.5-2.5 5 5M15.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","id-card":"M3 6h18v12H3zM8.5 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM5.5 16a3 3 0 0 1 6 0M14 9.5h4M14 12.5h4M14 15.5h2.5",navigation:"M20 4l-6.5 16-2.5-7-7-2.5z","wifi-off":"M8.9 16.9a4 4 0 0 1 3.3-1.4M5.9 14.4a8 8 0 0 1 3-2.3M15.6 12.4a8 8 0 0 1 2.5 2M2.8 11.8a12 12 0 0 1 3-2.6M10.8 7.6a12 12 0 0 1 10.4 4.2M12 19.5h.01M3 3l18 18"},Fb=["more","drag"],C$=Object.keys(xh);var Vb=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],ea=class extends A{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=xh[this.name]??xh.more,t=Fb.includes(this.name)?3:1.6;return ii`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
18
+ `,r0=0,N=o=>`${o}-${++r0}`,ku=new Set,uh;function ea(o){ku.has(o)||typeof document>"u"||typeof CSSStyleSheet>"u"||(ku.add(o),uh||(uh=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,uh]),uh.replaceSync(`:where(${[...ku].map(n=>`${n}[align]`).join(", ")}) { text-align: inherit; }`))}function $(o,n){customElements.get(o)||customElements.define(o,n)}function se(o,n){let e=o.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(n).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var s0={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},gh={common:{...s0}},xl={},wl={},fh;function z(o,n){return gh[o]={...gh[o],...n},n}function a0(){return Object.fromEntries(Object.entries(gh).map(([o,n])=>[o,{...n}]))}function bh(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function n0(o,n){bh(n?wl[n.toLowerCase()]??={}:xl,o),xh()}function o0(o={}){"locale"in o&&(fh=o.locale||void 0),o.strings&&bh(xl,o.strings);for(let[n,e]of Object.entries(o.translations??{}))bh(wl[n.toLowerCase()]??={},e);xh()}function l0(){fh=void 0;for(let o of Object.keys(xl))delete xl[o];for(let o of Object.keys(wl))delete wl[o];xh()}function $l(o){if(fh)return fh;let n=o;for(;n;){if(n instanceof Element&&n.hasAttribute("lang")&&n.getAttribute("lang"))return n.getAttribute("lang");n=n.parentNode??(n instanceof ShadowRoot?n.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var Bb=new Map;function _u(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,s=Bb.get(i);if(!s){try{s=t(n)}catch{s=t(void 0)}Bb.set(i,s)}return s}function Tu(o,n={},e){return _u("n",e,n,t=>new Intl.NumberFormat(t,n)).format(o)}function ue(o,n={},e){return _u("d",e,n,t=>new Intl.DateTimeFormat(t,n)).format(o)}function vh(o,n){return _u("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function Fb(o,n={},e){if(o==null)return"";if(typeof o=="function")return String(o(n));let t;if(typeof o=="object"){let i=Number(n.count??0);t=o[vh(i,e)]??o.other??""}else t=String(o);return t.replace(/\{(\w+)\}/g,(i,s)=>{let l=n[s];return l===void 0?i:typeof l=="number"?Tu(l,{},e):String(l)})}function c0(o,n,e,t){if(t&&t[n]!==void 0)return t[n];let i=[];if(e){let s=e.toLowerCase().split("-");for(let l=s.length;l>0;l--)i.push(s.slice(0,l).join("-"))}for(let s of o==="common"?["common"]:[o,"common"]){for(let d of i){let p=wl[d]?.[s]?.[n];if(p!==void 0)return p}let l=xl[s]?.[n]??gh[s]?.[n];if(l!==void 0)return l}}function yh(o,n,e,t,i){let s=$l(t);return Fb(c0(o,n,s,i),e,s)}var Mu=new Set,Eu;function xh(){for(let o of Mu)o.requestUpdate()}function d0(){Eu||typeof MutationObserver>"u"||typeof document>"u"||(Eu=new MutationObserver(xh),Eu.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var h0=o=>o.replace(/^cm-/,"").replace(/-([a-z])/g,(n,e)=>e.toUpperCase()),C=class extends A{static finalize(){let n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!n(this,"finalized")&&n(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||n(this.prototype,e))continue;let s=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[s]??this.t(i)},set(l){this[s]=l},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return h0(this.localName)}t(n,e){return yh(this.stringsNamespace,n,e,this,this.strings)}get locale(){return $l(this)}formatNumber(n,e){return Tu(n,e,this.locale)}connectedCallback(){super.connectedCallback(),Mu.add(this),d0()}disconnectedCallback(){super.disconnectedCallback(),Mu.delete(this)}};C.properties={strings:{type:Object}};var wh={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",eyedropper:"M14 6l4 4M12.5 7.5l4 4M15.5 3.5a2.1 2.1 0 013 0l2 2a2.1 2.1 0 010 3L18 11l-5-5 2.5-2.5zM14 9.5L5.5 18v2h2L16 11.5",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM10.4 5.2L10.6 3.1H13.4L13.6 5.2A7 7 0 0 1 15.7 6L17.3 4.7L19.3 6.7L18 8.3A7 7 0 0 1 18.8 10.4L20.9 10.6V13.4L18.8 13.6A7 7 0 0 1 18 15.7L19.3 17.3L17.3 19.3L15.7 18A7 7 0 0 1 13.6 18.8L13.4 20.9H10.6L10.4 18.8A7 7 0 0 1 8.3 18L6.7 19.3L4.7 17.3L6 15.7A7 7 0 0 1 5.2 13.6L3.1 13.4V10.6L5.2 10.4A7 7 0 0 1 6 8.3L4.7 6.7L6.7 4.7L8.3 6A7 7 0 0 1 10.4 5.2z",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-8-8 2-2 4 1 4-4zM8 16l-4 4",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z",camera:"M3 8.5A1.5 1.5 0 0 1 4.5 7h3L9 4.5h6L16.5 7h3A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5zM12 16.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",image:"M4 5h16v14H4zM4 16l4.5-4.5 4 4 2.5-2.5 5 5M15.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","id-card":"M3 6h18v12H3zM8.5 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM5.5 16a3 3 0 0 1 6 0M14 9.5h4M14 12.5h4M14 15.5h2.5",navigation:"M20 4l-6.5 16-2.5-7-7-2.5z","wifi-off":"M8.9 16.9a4 4 0 0 1 3.3-1.4M5.9 14.4a8 8 0 0 1 3-2.3M15.6 12.4a8 8 0 0 1 2.5 2M2.8 11.8a12 12 0 0 1 3-2.6M10.8 7.6a12 12 0 0 1 10.4 4.2M12 19.5h.01M3 3l18 18"},Vb=["more","drag"],z1=Object.keys(wh);var jb=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],ta=class extends A{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=wh[this.name]??wh.more,t=Vb.includes(this.name)?3:1.6;return ri`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
19
19
  stroke-width=${t} stroke-linecap="round" stroke-linejoin="round"
20
20
  role=${this.label?"img":h} aria-label=${this.label||h} aria-hidden=${this.label?h:"true"}
21
- part="svg" class=${(this.mirror==="auto"?Vb.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};ea.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},ea.styles=w`
21
+ part="svg" class=${(this.mirror==="auto"?jb.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};ta.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},ta.styles=w`
22
22
  :host { display: inline-flex; flex: none; color: inherit; line-height: 0; }
23
23
  svg { display: block; }
24
24
  :host(:dir(rtl)) svg.flip { transform: scaleX(-1); }
25
- `;$("cm-icon",ea);var jb=99,P$=z("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),wh,$h,$l,Sr=class extends C{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;m(this,wh,this.attachInternals());m(this,$h,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,wh).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});m(this,$l,!1);this.addEventListener("click",r(this,$h),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,$l)&&(g(this,$l,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.loading?c`<span class="spinner" aria-hidden="true"></span>`:c`<slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:h}</slot>`,i=this.iconOnly?c`<span class="vh"><slot></slot></span>`:c`<span class="text"><slot></slot></span>`,s=e?c`<span class="count" part="count" aria-hidden="true">${e>jb?this.t("countOverflow",{max:jb}):this.formatNumber(e)}</span>${this.iconOnly?h:c`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:h,l=this.iconOnly&&(this.label||this.textContent?.trim())||"",d=!this.iconOnly||!l?h:e?this.t("labelWithCount",{label:l,count:e}):this.label||h,p=c`${t}${i}${s}`;return this.href&&!this.disabled?c`<a class="btn" part="control" href=${this.href} target=${this.target??h}
25
+ `;$("cm-icon",ta);var Ub=99,I1=z("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),$h,kh,kl,Lr=class extends C{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;m(this,$h,this.attachInternals());m(this,kh,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,$h).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});m(this,kl,!1);this.addEventListener("click",r(this,kh),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,kl)&&(g(this,kl,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.loading?c`<span class="spinner" aria-hidden="true"></span>`:c`<slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:h}</slot>`,i=this.iconOnly?c`<span class="vh"><slot></slot></span>`:c`<span class="text"><slot></slot></span>`,s=e?c`<span class="count" part="count" aria-hidden="true">${e>Ub?this.t("countOverflow",{max:Ub}):this.formatNumber(e)}</span>${this.iconOnly?h:c`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:h,l=this.iconOnly&&(this.label||this.textContent?.trim())||"",d=!this.iconOnly||!l?h:e?this.t("labelWithCount",{label:l,count:e}):this.label||h,p=c`${t}${i}${s}`;return this.href&&!this.disabled?c`<a class="btn" part="control" href=${this.href} target=${this.target??h}
26
26
  rel=${this.target==="_blank"?"noopener noreferrer":h} aria-label=${d}>${p}</a>`:c`<button class="btn" part="control" type="button"
27
27
  ?disabled=${this.disabled} aria-disabled=${this.loading?"true":h}
28
- aria-busy=${this.loading?"true":h} aria-label=${d}>${p}</button>`}};wh=new WeakMap,$h=new WeakMap,$l=new WeakMap,Sr.formAssociated=!0,Sr.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},Sr.styles=[E,w`
28
+ aria-busy=${this.loading?"true":h} aria-label=${d}>${p}</button>`}};$h=new WeakMap,kh=new WeakMap,kl=new WeakMap,Lr.formAssociated=!0,Lr.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},Lr.styles=[E,w`
29
29
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
30
30
  /* A label longer than the room (a button in a narrow card) ends with an ellipsis instead of spilling out (1.8.1). */
31
31
  .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: var(--cm-line-height-14, 20px); } /* a full line box, so overflow: hidden doesn't cut g, p and y (1.9.3) */
@@ -114,16 +114,58 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
114
114
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px;
115
115
  box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
116
116
  }
117
- `];$("cm-button",Sr);var ta=class extends A{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1;this.heading=!1;this.shortcut=""}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0,heading:this.heading||void 0,shortcut:this.shortcut||void 0}}};ta.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0},heading:{type:Boolean,reflect:!0},shortcut:{reflect:!0}},ta.styles=w`:host { display: none; }`;$("cm-menu-item",ta);function kl(o){let n=[];for(let e of Array.from(o.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=s=>e.getAttribute(s)||void 0;n.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0,heading:e.hasAttribute("heading")||void 0,shortcut:i("shortcut")})}else e.localName==="hr"&&n.push({divider:!0});return n}function kh(o,n){let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Ie=w`
117
+ `];$("cm-button",Lr);var ia=class extends A{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1;this.heading=!1;this.shortcut=""}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0,heading:this.heading||void 0,shortcut:this.shortcut||void 0}}};ia.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0},heading:{type:Boolean,reflect:!0},shortcut:{reflect:!0}},ia.styles=w`:host { display: none; }`;$("cm-menu-item",ia);function El(o){let n=[];for(let e of Array.from(o.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=s=>e.getAttribute(s)||void 0;n.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0,heading:e.hasAttribute("heading")||void 0,shortcut:i("shortcut")})}else e.localName==="hr"&&n.push({divider:!0});return n}function Eh(o,n){let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Ie=w`
118
118
  :where([popover]) { margin: 0; padding: 0; border: 0; color: inherit; background: none; overflow: visible; }
119
- `,El=8,Lt,ia,ra,sa,Lr,we=class{constructor(){m(this,Lt,null);m(this,ia,null);m(this,ra,{});m(this,sa,"");m(this,Lr,()=>this.place())}get active(){return!!r(this,Lt)}open(n,e,t={}){if(!n||!e||typeof n.showPopover!="function")return!1;r(this,Lt)&&r(this,Lt)!==n&&this.close(),n.hasAttribute("popover")||n.setAttribute("popover","manual");let i=n.matches(":popover-open");if(!i){if(getComputedStyle(n).position==="static")return n.removeAttribute("popover"),!1;try{n.showPopover()}catch{return!1}}return n.matches(":popover-open")?(r(this,Lt)||g(this,sa,n.style.maxHeight),g(this,Lt,n),g(this,ia,e),g(this,ra,t),Object.assign(n.style,{position:"fixed",inset:"auto",margin:"0"}),this.place(),i||(window.addEventListener("scroll",r(this,Lr),!0),window.addEventListener("resize",r(this,Lr))),!0):!1}place(){let n=r(this,Lt),e=r(this,ia);if(!n||!e)return;let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=r(this,ra).gap??4,d=r(this,ra).align??"start";n.style.maxHeight=r(this,sa),d==="stretch"&&(n.style.minWidth=`${Math.round(t.width)}px`);let p=n.getBoundingClientRect(),u=p.width,b=p.height,f=getComputedStyle(e).direction==="rtl",x=f?t.right-u:t.left,v=f?t.left:t.right-u,k=d==="end"?v:x;k+u>i-El&&(k=f?x:v);let L=Math.max(0,Math.min(El,t.left)),P=Math.min(i,Math.max(i-El,t.right))-u;k=Math.max(L,Math.min(k,P));let U=s-t.bottom-l-El,q=t.top-l-El,O;if(b<=U||U>=q)O=t.bottom+l,b>U&&(n.style.maxHeight=`${Math.max(80,Math.floor(U))}px`);else{let ve=Math.min(b,Math.floor(q));b>q&&(n.style.maxHeight=`${Math.max(80,ve)}px`),O=t.top-l-ve}n.style.left=`${k}px`,n.style.top=`${O}px`}close(){let n=r(this,Lt);if(window.removeEventListener("scroll",r(this,Lr),!0),window.removeEventListener("resize",r(this,Lr)),g(this,Lt,null),g(this,ia,null),!!n){try{n.matches(":popover-open")&&n.hidePopover()}catch{}for(let e of["position","inset","margin","left","top","minWidth"])n.style[e]="";n.style.maxHeight=r(this,sa)}}};Lt=new WeakMap,ia=new WeakMap,ra=new WeakMap,sa=new WeakMap,Lr=new WeakMap;var aa=class extends C{constructor(){super(...arguments);this.size="large";this.custom=!1}onSlotChange(e){let t=e.target.assignedElements().length>0;t!==this.custom&&(this.custom=t,this.requestUpdate())}render(){let e=this.size==="small"?2.5:3;return c`<span class="spinner" part="spinner" role="status">
119
+ `,Ml=8,Lt,ra,sa,aa,Ar,we=class{constructor(){m(this,Lt,null);m(this,ra,null);m(this,sa,{});m(this,aa,"");m(this,Ar,()=>this.place())}get active(){return!!r(this,Lt)}open(n,e,t={}){if(!n||!e||typeof n.showPopover!="function")return!1;r(this,Lt)&&r(this,Lt)!==n&&this.close(),n.hasAttribute("popover")||n.setAttribute("popover","manual");let i=n.matches(":popover-open");if(!i){if(getComputedStyle(n).position==="static")return n.removeAttribute("popover"),!1;try{n.showPopover()}catch{return!1}}return n.matches(":popover-open")?(r(this,Lt)||g(this,aa,n.style.maxHeight),g(this,Lt,n),g(this,ra,e),g(this,sa,t),Object.assign(n.style,{position:"fixed",inset:"auto",margin:"0"}),this.place(),i||(window.addEventListener("scroll",r(this,Ar),!0),window.addEventListener("resize",r(this,Ar))),!0):!1}place(){let n=r(this,Lt),e=r(this,ra);if(!n||!e)return;let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=r(this,sa).gap??4,d=r(this,sa).align??"start";n.style.maxHeight=r(this,aa),d==="stretch"&&(n.style.minWidth=`${Math.round(t.width)}px`);let p=n.getBoundingClientRect(),u=p.width,b=p.height,f=getComputedStyle(e).direction==="rtl",x=f?t.right-u:t.left,v=f?t.left:t.right-u,k=d==="end"?v:x;k+u>i-Ml&&(k=f?x:v);let L=Math.max(0,Math.min(Ml,t.left)),P=Math.min(i,Math.max(i-Ml,t.right))-u;k=Math.max(L,Math.min(k,P));let U=s-t.bottom-l-Ml,q=t.top-l-Ml,O;if(b<=U||U>=q)O=t.bottom+l,b>U&&(n.style.maxHeight=`${Math.max(80,Math.floor(U))}px`);else{let ve=Math.min(b,Math.floor(q));b>q&&(n.style.maxHeight=`${Math.max(80,ve)}px`),O=t.top-l-ve}n.style.left=`${k}px`,n.style.top=`${O}px`}close(){let n=r(this,Lt);if(window.removeEventListener("scroll",r(this,Ar),!0),window.removeEventListener("resize",r(this,Ar)),g(this,Lt,null),g(this,ra,null),!!n){try{n.matches(":popover-open")&&n.hidePopover()}catch{}for(let e of["position","inset","margin","left","top","minWidth"])n.style[e]="";n.style.maxHeight=r(this,aa)}}};Lt=new WeakMap,ra=new WeakMap,sa=new WeakMap,aa=new WeakMap,Ar=new WeakMap;var na=w`
120
+ .pop {
121
+ position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-4)); inset-inline: 0;
122
+ background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
123
+ border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-md); overflow: hidden;
124
+ }
125
+ .pop[hidden] { display: none; }
126
+ .message { display: flex; align-items: center; gap: var(--cm-space-8); margin: 0; padding: var(--cm-space-12) var(--cm-space-20); font-size: 14px; color: var(--cm-text-tertiary); }
127
+ .vh {
128
+ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
129
+ clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
130
+ }
131
+ `;function Mh(o,n,e){let t=i=>{n()&&!i.composedPath().includes(o)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Hi=w`
132
+ [role='group'] + [role='group'] { margin-block-start: var(--cm-space-4); padding-block-start: var(--cm-space-4); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
133
+ [role='option'] + [role='group'], [role='group'] + [role='option'] { margin-block-start: var(--cm-space-4); padding-block-start: var(--cm-space-4); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
134
+ .gh {
135
+ display: flex; align-items: baseline; gap: var(--cm-space-8); padding: var(--cm-space-8) var(--cm-space-12) var(--cm-space-4);
136
+ font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500; color: var(--cm-text-tertiary);
137
+ }
138
+ .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
139
+ .gopts { list-style: none; margin: 0; padding: 0; }
140
+ `;function oa(o){if(!o.some(t=>t.group))return o;let n=[],e=new Map;for(let t of o)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let s=[t];e.set(t.group,s),n.push({key:t.group,items:s})}}else{let i=n[n.length-1];i&&!i.key?i.items.push(t):n.push({key:"",items:[t]})}return n.flatMap(t=>t.items)}function _h(o){let n=[];return o.forEach((e,t)=>{let i=e.group||"",s=n[n.length-1];s&&s.group===i?s.rows.push({row:e,index:t}):n.push({group:i,rows:[{row:e,index:t}]})}),n}var Th=w`
141
+ [role='listbox'] { padding-block: var(--cm-space-4); }
142
+ [role='listbox'][hidden] { display: none; }
143
+ [role='option'] {
144
+ display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md); padding: var(--cm-space-8) var(--cm-space-12);
145
+ font-size: 14px; line-height: 20px; color: var(--cm-text-default); text-decoration: none; cursor: pointer;
146
+ }
147
+ [role='option'].active { background: var(--cm-bg-hover); box-shadow: inset 2px 0 0 var(--cm-border-strong); }
148
+ [role='option'].active:dir(rtl) { box-shadow: inset -2px 0 0 var(--cm-border-strong); }
149
+ [role='option'] cm-icon { flex: none; color: var(--cm-icon-selected); }
150
+ .text { flex: 1; min-width: 0; }
151
+ .title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
152
+ .desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
153
+ .all { font-size: var(--cm-font-size-13); text-decoration: underline; }
154
+ .gh { padding-inline: var(--cm-space-12); }
155
+ kbd {
156
+ flex: none; min-width: 20px; padding: 0 var(--cm-space-4); font: inherit; font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); text-align: center;
157
+ color: var(--cm-text-tertiary); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-xs);
158
+ }
159
+ `;function Ch(o,n,e,t){return c`<div role="presentation" class="gh" id=${o}><span>${n}</span>${e!==void 0?c`<span class="count" aria-hidden="true">${e}</span><span class="vh">, ${t}</span>`:h}</div>`}function zh(o,n=h){return c`${o.icon?c`<cm-icon name=${o.icon} size="16"></cm-icon>`:h}<span class="text"><span class="title">${o.title}</span>${o.description?c`<span class="vh">, </span><span class="desc">${o.description}</span>`:h}</span>${n}`}function At(o){return n=>{(n.movementX||n.movementY)&&o()}}function Sh(o,n){let e=`${o.cls??""}${o.active?" active":""}`;return o.href?c`<a role="option" id=${o.id} class=${e} href=${o.href} tabindex="-1" aria-selected=${o.active?"true":"false"}
160
+ aria-keyshortcuts=${o.keyshortcuts||h} @pointermove=${At(o.onHover)} @click=${o.onChoose}>${n}</a>`:c`<div role="option" id=${o.id} class=${e} tabindex="-1" aria-selected=${o.active?"true":"false"}
161
+ aria-keyshortcuts=${o.keyshortcuts||h} @pointermove=${At(o.onHover)} @click=${o.onChoose}>${n}</div>`}function Lh(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var la=class extends C{constructor(){super(...arguments);this.size="large";this.custom=!1}onSlotChange(e){let t=e.target.assignedElements().length>0;t!==this.custom&&(this.custom=t,this.requestUpdate())}render(){let e=this.size==="small"?2.5:3;return c`<span class="spinner" part="spinner" role="status">
120
162
  ${this.custom?h:c`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
121
163
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
122
164
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
123
165
  </svg>`}
124
166
  <slot @slotchange=${this.onSlotChange}></slot>
125
167
  <span class="vh">${this.accessibleLabel||this.t("loading")}</span>
126
- </span>`}};aa.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},aa.styles=[E,w`
168
+ </span>`}};la.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},la.styles=[E,w`
127
169
  :host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
128
170
  .spinner { display: inline-flex; align-items: center; --cm-spinner-duration: 0.8s; --cm-spinner-play-state: running; }
129
171
  ::slotted(*) { display: block; block-size: 20px; inline-size: auto; }
@@ -141,18 +183,18 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
141
183
  svg { animation-duration: 2.4s; }
142
184
  .spinner { --cm-spinner-play-state: paused; }
143
185
  }
144
- `];$("cm-spinner",aa);var t1=z("actionMenu",{label:"Actions"}),Ml,Ar,Dr,_l,J,Eh,Tl,Mh,_h,Th,Ch,Ub,oa,la,ca,na,zh,Kb,Tu,Wb,Ft=class extends C{constructor(){super(...arguments);m(this,J);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this.loading=!1;this.disabled=!1;this._slotted=[];this._active=-1;this._custom=!1;m(this,Ml);m(this,Ar,N("cm-menu"));m(this,Dr,"");m(this,_l,0);m(this,Tl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,J,Th).call(this,!1)});m(this,oa,new we);m(this,la,e=>{this.disabled||(e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0)))});m(this,ca,()=>{this.disabled||(this.open?this.hide():this.show())});m(this,zh,e=>{let t=a(this,J,_h).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,J,na).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,J,na).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,J,na).call(this,t[0]);break;case"End":e.preventDefault(),a(this,J,na).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let s=Date.now();g(this,Dr,(s-r(this,_l)<600?r(this,Dr):"")+e.key.toLowerCase()),g(this,_l,s);let l=this.menuItems,d=r(this,Dr).length>1?i:i+1,u=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(b=>(l[b].label??"").toLowerCase().startsWith(r(this,Dr)));u!==void 0&&a(this,J,na).call(this,u)}}})}connectedCallback(){super.connectedCallback(),a(this,J,Eh).call(this),g(this,Ml,kh(this,()=>a(this,J,Eh).call(this))),document.addEventListener("pointerdown",r(this,Tl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Ml)?.disconnect(),document.removeEventListener("pointerdown",r(this,Tl),!0),r(this,oa).close()}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,J,_h).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,J,Th).call(this,!0),this.updateComplete.then(()=>a(this,J,Ch).call(this))}hide(e=!1){a(this,J,Th).call(this,!1),e&&a(this,J,Mh).call(this)?.focus()}updated(e){if(e.has("open")&&this.open&&a(this,J,Ub).call(this),e.has("open")&&!this.open&&r(this,oa).close(),this._custom){let t=a(this,J,Mh).call(this);if(t){let i=(s,l)=>{t.getAttribute(s)!==l&&t.setAttribute(s,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${r(this,Ar)}-m`)}}if((e.has("open")||e.has("loading"))&&this.open&&this._active<0){let t=a(this,J,_h).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,J,Ch).call(this))}}triggerTemplate(e,t){}headTemplate(){}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${r(this,ca)} @keydown=${r(this,la)} @slotchange=${()=>a(this,J,Eh).call(this)}></slot>`:this.triggerTemplate(r(this,ca),r(this,la))??c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
145
- aria-expanded=${String(this.open)} aria-controls="${r(this,Ar)}-m" aria-label=${this.iconOnly?t:h}
146
- ?disabled=${this.disabled} @click=${r(this,ca)} @keydown=${r(this,la)}>${this.iconOnly?c`<cm-icon name=${this.icon} size="18"></cm-icon>`:c`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return c`${i}
186
+ `];$("cm-spinner",la);var a$=z("actionMenu",{label:"Actions"}),_l,Dr,Rr,Tl,J,Ah,Cl,Dh,Rh,Hh,Nh,Kb,da,ha,pa,ca,Ph,Wb,Cu,Gb,Vt=class extends C{constructor(){super(...arguments);m(this,J);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this.loading=!1;this.disabled=!1;this._slotted=[];this._active=-1;this._custom=!1;m(this,_l);m(this,Dr,N("cm-menu"));m(this,Rr,"");m(this,Tl,0);m(this,Cl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,J,Hh).call(this,!1)});m(this,da,new we);m(this,ha,e=>{this.disabled||(e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0)))});m(this,pa,()=>{this.disabled||(this.open?this.hide():this.show())});m(this,Ph,e=>{let t=a(this,J,Rh).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,J,ca).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,J,ca).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,J,ca).call(this,t[0]);break;case"End":e.preventDefault(),a(this,J,ca).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let s=Date.now();g(this,Rr,(s-r(this,Tl)<600?r(this,Rr):"")+e.key.toLowerCase()),g(this,Tl,s);let l=this.menuItems,d=r(this,Rr).length>1?i:i+1,u=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(b=>(l[b].label??"").toLowerCase().startsWith(r(this,Rr)));u!==void 0&&a(this,J,ca).call(this,u)}}})}connectedCallback(){super.connectedCallback(),a(this,J,Ah).call(this),g(this,_l,Eh(this,()=>a(this,J,Ah).call(this))),document.addEventListener("pointerdown",r(this,Cl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,_l)?.disconnect(),document.removeEventListener("pointerdown",r(this,Cl),!0),r(this,da).close()}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,J,Rh).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,J,Hh).call(this,!0),this.updateComplete.then(()=>a(this,J,Nh).call(this))}hide(e=!1){a(this,J,Hh).call(this,!1),e&&a(this,J,Dh).call(this)?.focus()}updated(e){if(e.has("open")&&this.open&&a(this,J,Kb).call(this),e.has("open")&&!this.open&&r(this,da).close(),this._custom){let t=a(this,J,Dh).call(this);if(t){let i=(s,l)=>{t.getAttribute(s)!==l&&t.setAttribute(s,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${r(this,Dr)}-m`)}}if((e.has("open")||e.has("loading"))&&this.open&&this._active<0){let t=a(this,J,Rh).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,J,Nh).call(this))}}triggerTemplate(e,t){}headTemplate(){}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${r(this,pa)} @keydown=${r(this,ha)} @slotchange=${()=>a(this,J,Ah).call(this)}></slot>`:this.triggerTemplate(r(this,pa),r(this,ha))??c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
187
+ aria-expanded=${String(this.open)} aria-controls="${r(this,Dr)}-m" aria-label=${this.iconOnly?t:h}
188
+ ?disabled=${this.disabled} @click=${r(this,pa)} @keydown=${r(this,ha)}>${this.iconOnly?c`<cm-icon name=${this.icon} size="18"></cm-icon>`:c`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return c`${i}
147
189
  <div class="pop" part="menu" popover="manual" ?hidden=${!this.open}>
148
190
  ${this.headTemplate()??(this.heading?c`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?c`<span>${this.subheading}</span>`:h}</div>`:h)}
149
- <div role="menu" id="${r(this,Ar)}-m" aria-label=${this.heading||this.label} aria-busy=${this.loading?"true":h} @keydown=${r(this,zh)}>
150
- ${this.loading?c`<div class="loading" role="presentation"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span>${this.t("loading")}</span></div>`:a(this,J,Wb).call(this,e)}
191
+ <div role="menu" id="${r(this,Dr)}-m" aria-label=${this.heading||this.label} aria-busy=${this.loading?"true":h} @keydown=${r(this,Ph)}>
192
+ ${this.loading?c`<div class="loading" role="presentation"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span>${this.t("loading")}</span></div>`:a(this,J,Gb).call(this,e)}
151
193
  </div>
152
194
  </div>
153
- <slot hidden></slot>`}};Ml=new WeakMap,Ar=new WeakMap,Dr=new WeakMap,_l=new WeakMap,J=new WeakSet,Eh=function(){this._slotted=kl(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Tl=new WeakMap,Mh=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},_h=function(){return this.loading?[]:this.menuItems.map((e,t)=>!e.divider&&!e.heading&&!e.disabled?t:-1).filter(e=>e>=0)},Th=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},Ch=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Ub=function(){let e=this.renderRoot.querySelector(".pop");if(!e||r(this,oa).open(e,a(this,J,Mh).call(this)??this,{align:this.align==="end"?"end":"start"}))return;e.classList.remove("to-end","to-start");let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=8,l=getComputedStyle(this).direction==="rtl",d=l?t.left<s:t.right>i-s,p=l?t.right>i-s:t.left<s;this.align!=="end"&&d?e.classList.add("to-end"):this.align==="end"&&p&&e.classList.add("to-start")},oa=new WeakMap,la=new WeakMap,ca=new WeakMap,na=function(e){this._active=e,this.updateComplete.then(()=>a(this,J,Ch).call(this))},zh=new WeakMap,Kb=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},Tu=function(e,t){if(e.divider)return c`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,s=c`${e.icon?c`<cm-icon name=${e.icon} size="16"></cm-icon>`:h}<span class="label">${e.label}</span>${e.shortcut?c`<span class="shortcut" part="shortcut" aria-hidden="true">${e.shortcut}</span>`:h}`,l={over:()=>{e.disabled||(this._active=t)},click:d=>a(this,J,Kb).call(this,d,e)};return e.href&&!e.disabled?c`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
154
- aria-keyshortcuts=${e.shortcut||h} @pointerenter=${l.over} @click=${l.click}>${s}</a>`:c`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
155
- aria-disabled=${e.disabled?"true":h} aria-keyshortcuts=${e.shortcut||h} @pointerenter=${l.over} @click=${l.click}>${s}</button>`},Wb=function(e){let t=[];for(let i=0;i<e.length;i++){let s=e[i];if(!s.heading){t.push(a(this,J,Tu).call(this,s,i));continue}let l=`${r(this,Ar)}-h${i}`,d=[],p=i+1;for(;p<e.length&&!e[p].heading&&!e[p].divider;p++)d.push(a(this,J,Tu).call(this,e[p],p));t.push(c`<div role="group" aria-labelledby=${l}><div class="section" part="section" id=${l} role="presentation">${s.label}</div>${d}</div>`),i=p-1}return t},Ft.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},density:{reflect:!0},loading:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},Ft.styles=[E,w`
195
+ <slot hidden></slot>`}};_l=new WeakMap,Dr=new WeakMap,Rr=new WeakMap,Tl=new WeakMap,J=new WeakSet,Ah=function(){this._slotted=El(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Cl=new WeakMap,Dh=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},Rh=function(){return this.loading?[]:this.menuItems.map((e,t)=>!e.divider&&!e.heading&&!e.disabled?t:-1).filter(e=>e>=0)},Hh=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},Nh=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Kb=function(){let e=this.renderRoot.querySelector(".pop");if(!e||r(this,da).open(e,a(this,J,Dh).call(this)??this,{align:this.align==="end"?"end":"start"}))return;e.classList.remove("to-end","to-start");let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=8,l=getComputedStyle(this).direction==="rtl",d=l?t.left<s:t.right>i-s,p=l?t.right>i-s:t.left<s;this.align!=="end"&&d?e.classList.add("to-end"):this.align==="end"&&p&&e.classList.add("to-start")},da=new WeakMap,ha=new WeakMap,pa=new WeakMap,ca=function(e){this._active=e,this.updateComplete.then(()=>a(this,J,Nh).call(this))},Ph=new WeakMap,Wb=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},Cu=function(e,t){if(e.divider)return c`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,s=c`${e.icon?c`<cm-icon name=${e.icon} size="16"></cm-icon>`:h}<span class="label">${e.label}</span>${e.shortcut?c`<span class="shortcut" part="shortcut" aria-hidden="true">${e.shortcut}</span>`:h}`,l={over:()=>{e.disabled||(this._active=t)},click:d=>a(this,J,Wb).call(this,d,e)};return e.href&&!e.disabled?c`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
196
+ aria-keyshortcuts=${e.shortcut||h} @pointermove=${At(l.over)} @click=${l.click}>${s}</a>`:c`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
197
+ aria-disabled=${e.disabled?"true":h} aria-keyshortcuts=${e.shortcut||h} @pointermove=${At(l.over)} @click=${l.click}>${s}</button>`},Gb=function(e){let t=[];for(let i=0;i<e.length;i++){let s=e[i];if(!s.heading){t.push(a(this,J,Cu).call(this,s,i));continue}let l=`${r(this,Dr)}-h${i}`,d=[],p=i+1;for(;p<e.length&&!e[p].heading&&!e[p].divider;p++)d.push(a(this,J,Cu).call(this,e[p],p));t.push(c`<div role="group" aria-labelledby=${l}><div class="section" part="section" id=${l} role="presentation">${s.label}</div>${d}</div>`),i=p-1}return t},Vt.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},density:{reflect:!0},loading:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},Vt.styles=[E,w`
156
198
  :host { display: inline-block; position: relative; vertical-align: middle; }
157
199
  .trigger {
158
200
  display: inline-flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md, 36px); padding: 0 var(--cm-space-12); font: inherit; font-size: var(--cm-font-size-14); font-weight: 500;
@@ -215,12 +257,12 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
215
257
  }
216
258
  .loading { display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md, 36px); padding: var(--cm-space-4) var(--cm-space-12); font-size: var(--cm-font-size-14); color: var(--cm-text-tertiary); }
217
259
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
218
- `];$("cm-action-menu",Ft);Zs("cm-action-menu");var o1=z("buttonGroup",{more:"More"}),Ri="data-cm-overflow",h0=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],Hi,Rr,ri,Vt,Ni,Hr,Q,da,Gb,Cl,Cu,Sh,Lh,Yb,Ah,zu,Su,Lu,ha=class extends C{constructor(){super(...arguments);m(this,Q);this.overflow="wrap";this.align="start";this.label="";this._items=[];this._size="medium";m(this,Hi,[]);m(this,Rr);m(this,ri);m(this,Vt,0);m(this,Ni,new Set);m(this,Hr,!1);m(this,Ah,e=>{e.stopPropagation();let t=r(this,Hi)[Number(e.detail.value)];if(!t)return;g(this,Hr,!0),(t.shadowRoot?.querySelector('[part="control"]')??t).click(),requestAnimationFrame(()=>requestAnimationFrame(()=>a(this,Q,zu).call(this)))})}get overflowing(){return[...r(this,Hi)]}connectedCallback(){super.connectedCallback(),g(this,Rr,new MutationObserver(e=>a(this,Q,Gb).call(this,e))),r(this,Rr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:h0}),typeof ResizeObserver<"u"&&(g(this,ri,new ResizeObserver(()=>a(this,Q,da).call(this))),r(this,ri).observe(this),g(this,Ni,new Set([this]))),document.fonts?.ready.then(()=>a(this,Q,da).call(this)),a(this,Q,da).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Rr)?.disconnect(),r(this,ri)?.disconnect(),r(this,Ni).clear(),cancelAnimationFrame(r(this,Vt)),g(this,Vt,0),a(this,Q,Cu).call(this,a(this,Q,Cl).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&a(this,Q,da).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,Vt)),g(this,Vt,0),a(this,Q,Lh).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
260
+ `];$("cm-action-menu",Vt);ea("cm-action-menu");var h$=z("buttonGroup",{more:"More"}),Ni="data-cm-overflow",p0=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],Pi,Hr,si,jt,Ii,Nr,Q,ma,Yb,zl,zu,Ih,qh,Xb,Oh,Su,Lu,Au,ua=class extends C{constructor(){super(...arguments);m(this,Q);this.overflow="wrap";this.align="start";this.label="";this._items=[];this._size="medium";m(this,Pi,[]);m(this,Hr);m(this,si);m(this,jt,0);m(this,Ii,new Set);m(this,Nr,!1);m(this,Oh,e=>{e.stopPropagation();let t=r(this,Pi)[Number(e.detail.value)];if(!t)return;g(this,Nr,!0),(t.shadowRoot?.querySelector('[part="control"]')??t).click(),requestAnimationFrame(()=>requestAnimationFrame(()=>a(this,Q,Su).call(this)))})}get overflowing(){return[...r(this,Pi)]}connectedCallback(){super.connectedCallback(),g(this,Hr,new MutationObserver(e=>a(this,Q,Yb).call(this,e))),r(this,Hr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:p0}),typeof ResizeObserver<"u"&&(g(this,si,new ResizeObserver(()=>a(this,Q,ma).call(this))),r(this,si).observe(this),g(this,Ii,new Set([this]))),document.fonts?.ready.then(()=>a(this,Q,ma).call(this)),a(this,Q,ma).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Hr)?.disconnect(),r(this,si)?.disconnect(),r(this,Ii).clear(),cancelAnimationFrame(r(this,jt)),g(this,jt,0),a(this,Q,zu).call(this,a(this,Q,zl).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&a(this,Q,ma).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,jt)),g(this,jt,0),a(this,Q,qh).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
219
261
  <slot></slot>
220
262
  <cm-action-menu class="more ${this._size}${e?" icon":""}" part="more" hidden align="end"
221
263
  .items=${this._items} label=${this.moreLabel} ?icon-only=${e} icon=${this.moreIcon||"more"}
222
- @cm-select=${r(this,Ah)}></cm-action-menu>
223
- </div>`}};Hi=new WeakMap,Rr=new WeakMap,ri=new WeakMap,Vt=new WeakMap,Ni=new WeakMap,Hr=new WeakMap,Q=new WeakSet,da=function(){r(this,Vt)||!this.isConnected||g(this,Vt,requestAnimationFrame(()=>{g(this,Vt,0);let e=a(this,Q,Cl).call(this).map(t=>t.updateComplete).filter(Boolean);e.length?Promise.all(e).then(()=>a(this,Q,Lh).call(this)):a(this,Q,Lh).call(this)}))},Gb=function(e){for(let t of e)for(let i of Array.from(t.removedNodes))i instanceof HTMLElement&&i.hasAttribute(Ri)&&i.parentElement!==this&&(i.removeAttribute(Ri),i.hidden=!1);a(this,Q,da).call(this)},Cl=function(){return Array.from(this.children).filter(e=>e.localName==="cm-button"&&(!e.hidden||e.hasAttribute(Ri)))},Cu=function(e){for(let t of e)t.hasAttribute(Ri)&&(t.removeAttribute(Ri),t.hidden=!1)},Sh=function(){return this.renderRoot.querySelector(".more")},Lh=function(){let e=this.renderRoot.querySelector(".row"),t=a(this,Q,Sh).call(this);if(!e||!t||!this.isConnected)return;let i=a(this,Q,Cl).call(this),s=this.shadowRoot.activeElement===t?t:i.find(b=>b.matches(":focus-within"))??null,l=i[0]?.getAttribute("size");this._size=this.size||(l==="slim"||l==="large"?l:"medium");let d=new Set;if(r(this,ri)){let b=new Set([this,t,...i]);for(let f of r(this,Ni))b.has(f)||r(this,ri).unobserve(f);for(let f of b)r(this,Ni).has(f)||r(this,ri).observe(f);g(this,Ni,b)}if(this.overflow==="menu"){a(this,Q,Cu).call(this,i),t.hidden=!1;let b=e.clientWidth,f=parseFloat(getComputedStyle(e).columnGap)||0,x=Array.from(this.children).filter(L=>!L.hidden),v=new Map(x.map(L=>[L,L.getBoundingClientRect().width])),k=x.reduce((L,P)=>L+v.get(P),0)+f*Math.max(x.length-1,0);if(k>b+.5){let L=q=>{let O=q.dataset.priority;return O==="low"?0:O==="high"?2:q.getAttribute("variant")==="primary"?3:1},P=i.map((q,O)=>({b:q,i:O,r:L(q)})).sort((q,O)=>q.r-O.r||O.i-q.i),U=k+f+t.getBoundingClientRect().width;for(let{b:q}of P){if(U<=b+.5)break;d.add(q),U-=v.get(q)+f}}}for(let b of i)d.has(b)?(b.setAttribute(Ri,""),b.hidden=!0):b.hasAttribute(Ri)&&(b.removeAttribute(Ri),b.hidden=!1);t.hidden=d.size===0,s===t&&t.hidden?a(this,Q,Lu).call(this):s&&s!==t&&d.has(s)&&a(this,Q,Su).call(this),d.size===0&&t.open&&t.hide(),r(this,Rr)?.takeRecords();let p=i.filter(b=>d.has(b));this._items=p.map((b,f)=>a(this,Q,Yb).call(this,b,f));let u=p.length!==r(this,Hi).length||p.some((b,f)=>b!==r(this,Hi)[f]);g(this,Hi,p),u&&this.dispatchEvent(new CustomEvent("cm-overflow-change",{detail:{hidden:[...p]},bubbles:!0,composed:!0})),r(this,Hr)&&this.updateComplete.then(()=>a(this,Q,zu).call(this))},Yb=function(e,t){let i=Array.from(e.childNodes).filter(d=>!(d instanceof Element&&d.hasAttribute("slot"))).map(d=>d.textContent??"").join("").replace(/\s+/g," ").trim(),s=e.hasAttribute("icon-only")?e.getAttribute("label")||i:i||e.getAttribute("label")||"",l=e.getAttribute("icon")||e.querySelector(':scope > [slot="icon"]')?.getAttribute("name")||void 0;return{label:s,value:String(t),icon:l,disabled:e.hasAttribute("disabled")||e.hasAttribute("loading")||void 0,critical:e.getAttribute("tone")==="critical"||void 0}},Ah=new WeakMap,zu=function(){if(!r(this,Hr))return;g(this,Hr,!1);let e=document.activeElement,t=a(this,Q,Sh).call(this);(!e||e===document.body||e===document.documentElement||e===this&&(!t||t.hidden||this.shadowRoot.activeElement!==t))&&(t&&!t.hidden?a(this,Q,Su).call(this):a(this,Q,Lu).call(this))},Su=function(){a(this,Q,Sh).call(this)?.shadowRoot?.querySelector('[part="trigger"]')?.focus()},Lu=function(){let e=a(this,Q,Cl).call(this).filter(i=>!i.hidden&&!i.hasAttribute("disabled")),t=e[e.length-1];(t?.shadowRoot?.querySelector('[part="control"]')??t)?.focus()},ha.properties={overflow:{reflect:!0},moreLabel:{attribute:"more-label",string:"more"},moreIcon:{attribute:"more-icon"},size:{reflect:!0},align:{reflect:!0},label:{},_items:{state:!0},_size:{state:!0}},ha.styles=[E,w`
264
+ @cm-select=${r(this,Oh)}></cm-action-menu>
265
+ </div>`}};Pi=new WeakMap,Hr=new WeakMap,si=new WeakMap,jt=new WeakMap,Ii=new WeakMap,Nr=new WeakMap,Q=new WeakSet,ma=function(){r(this,jt)||!this.isConnected||g(this,jt,requestAnimationFrame(()=>{g(this,jt,0);let e=a(this,Q,zl).call(this).map(t=>t.updateComplete).filter(Boolean);e.length?Promise.all(e).then(()=>a(this,Q,qh).call(this)):a(this,Q,qh).call(this)}))},Yb=function(e){for(let t of e)for(let i of Array.from(t.removedNodes))i instanceof HTMLElement&&i.hasAttribute(Ni)&&i.parentElement!==this&&(i.removeAttribute(Ni),i.hidden=!1);a(this,Q,ma).call(this)},zl=function(){return Array.from(this.children).filter(e=>e.localName==="cm-button"&&(!e.hidden||e.hasAttribute(Ni)))},zu=function(e){for(let t of e)t.hasAttribute(Ni)&&(t.removeAttribute(Ni),t.hidden=!1)},Ih=function(){return this.renderRoot.querySelector(".more")},qh=function(){let e=this.renderRoot.querySelector(".row"),t=a(this,Q,Ih).call(this);if(!e||!t||!this.isConnected)return;let i=a(this,Q,zl).call(this),s=this.shadowRoot.activeElement===t?t:i.find(b=>b.matches(":focus-within"))??null,l=i[0]?.getAttribute("size");this._size=this.size||(l==="slim"||l==="large"?l:"medium");let d=new Set;if(r(this,si)){let b=new Set([this,t,...i]);for(let f of r(this,Ii))b.has(f)||r(this,si).unobserve(f);for(let f of b)r(this,Ii).has(f)||r(this,si).observe(f);g(this,Ii,b)}if(this.overflow==="menu"){a(this,Q,zu).call(this,i),t.hidden=!1;let b=e.clientWidth,f=parseFloat(getComputedStyle(e).columnGap)||0,x=Array.from(this.children).filter(L=>!L.hidden),v=new Map(x.map(L=>[L,L.getBoundingClientRect().width])),k=x.reduce((L,P)=>L+v.get(P),0)+f*Math.max(x.length-1,0);if(k>b+.5){let L=q=>{let O=q.dataset.priority;return O==="low"?0:O==="high"?2:q.getAttribute("variant")==="primary"?3:1},P=i.map((q,O)=>({b:q,i:O,r:L(q)})).sort((q,O)=>q.r-O.r||O.i-q.i),U=k+f+t.getBoundingClientRect().width;for(let{b:q}of P){if(U<=b+.5)break;d.add(q),U-=v.get(q)+f}}}for(let b of i)d.has(b)?(b.setAttribute(Ni,""),b.hidden=!0):b.hasAttribute(Ni)&&(b.removeAttribute(Ni),b.hidden=!1);t.hidden=d.size===0,s===t&&t.hidden?a(this,Q,Au).call(this):s&&s!==t&&d.has(s)&&a(this,Q,Lu).call(this),d.size===0&&t.open&&t.hide(),r(this,Hr)?.takeRecords();let p=i.filter(b=>d.has(b));this._items=p.map((b,f)=>a(this,Q,Xb).call(this,b,f));let u=p.length!==r(this,Pi).length||p.some((b,f)=>b!==r(this,Pi)[f]);g(this,Pi,p),u&&this.dispatchEvent(new CustomEvent("cm-overflow-change",{detail:{hidden:[...p]},bubbles:!0,composed:!0})),r(this,Nr)&&this.updateComplete.then(()=>a(this,Q,Su).call(this))},Xb=function(e,t){let i=Array.from(e.childNodes).filter(d=>!(d instanceof Element&&d.hasAttribute("slot"))).map(d=>d.textContent??"").join("").replace(/\s+/g," ").trim(),s=e.hasAttribute("icon-only")?e.getAttribute("label")||i:i||e.getAttribute("label")||"",l=e.getAttribute("icon")||e.querySelector(':scope > [slot="icon"]')?.getAttribute("name")||void 0;return{label:s,value:String(t),icon:l,disabled:e.hasAttribute("disabled")||e.hasAttribute("loading")||void 0,critical:e.getAttribute("tone")==="critical"||void 0}},Oh=new WeakMap,Su=function(){if(!r(this,Nr))return;g(this,Nr,!1);let e=document.activeElement,t=a(this,Q,Ih).call(this);(!e||e===document.body||e===document.documentElement||e===this&&(!t||t.hidden||this.shadowRoot.activeElement!==t))&&(t&&!t.hidden?a(this,Q,Lu).call(this):a(this,Q,Au).call(this))},Lu=function(){a(this,Q,Ih).call(this)?.shadowRoot?.querySelector('[part="trigger"]')?.focus()},Au=function(){let e=a(this,Q,zl).call(this).filter(i=>!i.hidden&&!i.hasAttribute("disabled")),t=e[e.length-1];(t?.shadowRoot?.querySelector('[part="control"]')??t)?.focus()},ua.properties={overflow:{reflect:!0},moreLabel:{attribute:"more-label",string:"more"},moreIcon:{attribute:"more-icon"},size:{reflect:!0},align:{reflect:!0},label:{},_items:{state:!0},_size:{state:!0}},ua.styles=[E,w`
224
266
  :host { display: block; min-inline-size: 0; }
225
267
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-8); min-inline-size: 0; }
226
268
  :host([align='end']) .row { justify-content: flex-end; }
@@ -244,7 +286,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
244
286
  .more::part(trigger), .more.slim::part(trigger) { min-height: var(--cm-control-height-lg, 40px); }
245
287
  .more.icon::part(trigger), .more.icon.slim::part(trigger) { width: var(--cm-control-height-lg, 40px); }
246
288
  }
247
- `];$("cm-button-group",ha);Zs("cm-button-group");var At={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},pa=o=>(...n)=>({_$litDirective$:o,values:n}),Pi=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};var{I:p0}=Ib,Xb=o=>o;var Qb=o=>o.strings===void 0,Jb=()=>document.createComment(""),ma=(o,n,e)=>{let t=o._$AA.parentNode,i=n===void 0?o._$AB:n._$AA;if(e===void 0){let s=t.insertBefore(Jb(),i),l=t.insertBefore(Jb(),i);e=new p0(s,l,o,o.options)}else{let s=e._$AB.nextSibling,l=e._$AM,d=l!==o;if(d){let p;e._$AQ?.(o),e._$AM=o,e._$AP!==void 0&&(p=o._$AU)!==l._$AU&&e._$AP(p)}if(s!==i||d){let p=e._$AA;for(;p!==s;){let u=Xb(p).nextSibling;Xb(t).insertBefore(p,i),p=u}}}return e},Ii=(o,n,e=o)=>(o._$AI(n,e),o),m0={},Dh=(o,n=m0)=>o._$AH=n,Zb=o=>o._$AH,Rh=o=>{o._$AR(),o._$AA.remove()};var ee=pa(class extends Pi{constructor(o){if(super(o),o.type!==At.PROPERTY&&o.type!==At.ATTRIBUTE&&o.type!==At.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Qb(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[n]){if(n===Pe||n===h)return n;let e=o.element,t=o.name;if(o.type===At.PROPERTY){if(n===e[t])return Pe}else if(o.type===At.BOOLEAN_ATTRIBUTE){if(!!n===e.hasAttribute(t))return Pe}else if(o.type===At.ATTRIBUTE&&e.getAttribute(t)===n+"")return Pe;return Dh(o),n}});var bt=w`
289
+ `];$("cm-button-group",ua);ea("cm-button-group");var Dt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ga=o=>(...n)=>({_$litDirective$:o,values:n}),qi=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};var{I:m0}=qb,Jb=o=>o;var Zb=o=>o.strings===void 0,Qb=()=>document.createComment(""),fa=(o,n,e)=>{let t=o._$AA.parentNode,i=n===void 0?o._$AB:n._$AA;if(e===void 0){let s=t.insertBefore(Qb(),i),l=t.insertBefore(Qb(),i);e=new m0(s,l,o,o.options)}else{let s=e._$AB.nextSibling,l=e._$AM,d=l!==o;if(d){let p;e._$AQ?.(o),e._$AM=o,e._$AP!==void 0&&(p=o._$AU)!==l._$AU&&e._$AP(p)}if(s!==i||d){let p=e._$AA;for(;p!==s;){let u=Jb(p).nextSibling;Jb(t).insertBefore(p,i),p=u}}}return e},Oi=(o,n,e=o)=>(o._$AI(n,e),o),u0={},Bh=(o,n=u0)=>o._$AH=n,ev=o=>o._$AH,Fh=o=>{o._$AR(),o._$AA.remove()};var ee=ga(class extends qi{constructor(o){if(super(o),o.type!==Dt.PROPERTY&&o.type!==Dt.ATTRIBUTE&&o.type!==Dt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Zb(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[n]){if(n===Pe||n===h)return n;let e=o.element,t=o.name;if(o.type===Dt.PROPERTY){if(n===e[t])return Pe}else if(o.type===Dt.BOOLEAN_ATTRIBUTE){if(!!n===e.hasAttribute(t))return Pe}else if(o.type===Dt.ATTRIBUTE&&e.getAttribute(t)===n+"")return Pe;return Bh(o),n}});var bt=w`
248
290
  :host {
249
291
  --_cm-field-h: var(--cm-control-height-lg, 40px);
250
292
  --_cm-field-font: var(--cm-font-size-14, 14px);
@@ -268,7 +310,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
268
310
  .error { color: var(--cm-text-critical); }
269
311
  :host([size='small']) .field { gap: var(--cm-space-4); }
270
312
  :host([size='small']) .label { font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); }
271
- `,ua=w`
313
+ `,ba=w`
272
314
  [role='listbox'] {
273
315
  max-height: 264px; overflow-y: auto; margin: 0; padding: var(--cm-space-4); list-style: none;
274
316
  }
@@ -280,25 +322,25 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
280
322
  [role='option']:not([aria-disabled='true']):not([aria-selected='true']):active { background: color-mix(in srgb, var(--cm-bg-hover), var(--cm-text-default) 8%); }
281
323
  :host([size='small']) [role='option'] { min-height: var(--cm-control-height-sm, 32px); }
282
324
  @media (pointer: coarse) { [role='option'], :host([size='small']) [role='option'] { min-height: var(--cm-control-height-touch, 44px); } }
283
- `;var Hh=!1,Au=!1,ev=!1,tv=()=>{Hh||(Hh=!0,setTimeout(()=>{Hh=!1,Au=!1}))};function u0(){ev||typeof document>"u"||(ev=!0,document.addEventListener("click",tv,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&tv()},!0))}var et,Nr,ga,fa,qi,zl,Pr,Sl,Du,Ll,Nh,Ph,re=class{constructor(n,e,t){m(this,Sl);m(this,et);m(this,Nr);m(this,ga);m(this,fa,!1);m(this,qi,!1);m(this,zl,"");m(this,Pr,!1);m(this,Ll,()=>{g(this,fa,!0)});m(this,Nh,n=>{let e=n.relatedTarget;e&&(r(this,et).contains(e)||r(this,et).shadowRoot?.contains(e))||r(this,et).updateComplete.then(()=>{if(!r(this,fa)||r(this,qi))return;let t=r(this,Nr).validity;t.valid||t.valueMissing||(g(this,qi,!0),r(this,et).requestUpdate())})});m(this,Ph,n=>{if(!(!Hh&&!r(this,Pr))){if(n.preventDefault(),g(this,qi,!0),r(this,et).requestUpdate(),r(this,Pr)){r(this,ga).call(this);return}Au||(Au=!0,r(this,ga).call(this))}});g(this,et,n),g(this,Nr,e),g(this,ga,t??(()=>n.focus())),u0(),n.addEventListener("invalid",r(this,Ph)),n.addEventListener("input",r(this,Ll),!0),n.addEventListener("change",r(this,Ll),!0),n.addEventListener("focusout",r(this,Nh))}get message(){return a(this,Sl,Du).call(this)}sync(){let n=a(this,Sl,Du).call(this);r(this,et).toggleAttribute("data-cm-invalid",!!n),n!==r(this,zl)&&(g(this,zl,n),queueMicrotask(()=>r(this,et).requestUpdate()))}reset(){g(this,fa,g(this,qi,!1)),r(this,et).requestUpdate()}report(n){g(this,Pr,!0);try{return n()}finally{g(this,Pr,!1)}}};et=new WeakMap,Nr=new WeakMap,ga=new WeakMap,fa=new WeakMap,qi=new WeakMap,zl=new WeakMap,Pr=new WeakMap,Sl=new WeakSet,Du=function(){return r(this,et).error?r(this,et).error:r(this,qi)?r(this,Nr).validity.valid?"":r(this,Nr).validationMessage:""},Ll=new WeakMap,Nh=new WeakMap,Ph=new WeakMap;var S1=z("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),ge,Ir,si,Dl,oe,iv,Al,Ih,rv,Ru,Hu,Nu,Oi=class extends C{constructor(){super(...arguments);m(this,oe);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.inputMode="";this.size="default";this.patternMessage="";m(this,ge,this.attachInternals());m(this,Ir,new re(this,r(this,ge)));m(this,si,N("cm-tf"));m(this,Dl,"")}connectedCallback(){super.connectedCallback(),g(this,Dl,this.value)}get form(){return r(this,ge).form}get validity(){return r(this,ge).validity}get validationMessage(){return r(this,ge).validationMessage}checkValidity(){return a(this,oe,Al).call(this),r(this,ge).checkValidity()}reportValidity(){return a(this,oe,Al).call(this),r(this,Ir).report(()=>r(this,ge).reportValidity())}formResetCallback(){this.value=r(this,Dl),this.error="",r(this,Ir).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,ge).setFormValue(this.value),a(this,oe,Al).call(this)}render(){let e=r(this,Ir).message,t=[e&&`${r(this,si)}-err`,this.helpText&&`${r(this,si)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,si),invalid:e?"true":h},s=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
325
+ `;var Vh=!1,Du=!1,tv=!1,iv=()=>{Vh||(Vh=!0,setTimeout(()=>{Vh=!1,Du=!1}))};function g0(){tv||typeof document>"u"||(tv=!0,document.addEventListener("click",iv,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&iv()},!0))}var et,Pr,va,ya,Bi,Sl,Ir,Ll,Ru,Al,jh,Uh,re=class{constructor(n,e,t){m(this,Ll);m(this,et);m(this,Pr);m(this,va);m(this,ya,!1);m(this,Bi,!1);m(this,Sl,"");m(this,Ir,!1);m(this,Al,()=>{g(this,ya,!0)});m(this,jh,n=>{let e=n.relatedTarget;e&&(r(this,et).contains(e)||r(this,et).shadowRoot?.contains(e))||r(this,et).updateComplete.then(()=>{if(!r(this,ya)||r(this,Bi))return;let t=r(this,Pr).validity;t.valid||t.valueMissing||(g(this,Bi,!0),r(this,et).requestUpdate())})});m(this,Uh,n=>{if(!(!Vh&&!r(this,Ir))){if(n.preventDefault(),g(this,Bi,!0),r(this,et).requestUpdate(),r(this,Ir)){r(this,va).call(this);return}Du||(Du=!0,r(this,va).call(this))}});g(this,et,n),g(this,Pr,e),g(this,va,t??(()=>n.focus())),g0(),n.addEventListener("invalid",r(this,Uh)),n.addEventListener("input",r(this,Al),!0),n.addEventListener("change",r(this,Al),!0),n.addEventListener("focusout",r(this,jh))}get message(){return a(this,Ll,Ru).call(this)}sync(){let n=a(this,Ll,Ru).call(this);r(this,et).toggleAttribute("data-cm-invalid",!!n),n!==r(this,Sl)&&(g(this,Sl,n),queueMicrotask(()=>r(this,et).requestUpdate()))}reset(){g(this,ya,g(this,Bi,!1)),r(this,et).requestUpdate()}report(n){g(this,Ir,!0);try{return n()}finally{g(this,Ir,!1)}}};et=new WeakMap,Pr=new WeakMap,va=new WeakMap,ya=new WeakMap,Bi=new WeakMap,Sl=new WeakMap,Ir=new WeakMap,Ll=new WeakSet,Ru=function(){return r(this,et).error?r(this,et).error:r(this,Bi)?r(this,Pr).validity.valid?"":r(this,Pr).validationMessage:""},Al=new WeakMap,jh=new WeakMap,Uh=new WeakMap;var R$=z("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),ge,qr,ai,Rl,oe,rv,Dl,Kh,sv,Hu,Nu,Pu,Fi=class extends C{constructor(){super(...arguments);m(this,oe);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.inputMode="";this.size="default";this.patternMessage="";m(this,ge,this.attachInternals());m(this,qr,new re(this,r(this,ge)));m(this,ai,N("cm-tf"));m(this,Rl,"")}connectedCallback(){super.connectedCallback(),g(this,Rl,this.value)}get form(){return r(this,ge).form}get validity(){return r(this,ge).validity}get validationMessage(){return r(this,ge).validationMessage}checkValidity(){return a(this,oe,Dl).call(this),r(this,ge).checkValidity()}reportValidity(){return a(this,oe,Dl).call(this),r(this,qr).report(()=>r(this,ge).reportValidity())}formResetCallback(){this.value=r(this,Rl),this.error="",r(this,qr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,ge).setFormValue(this.value),a(this,oe,Dl).call(this)}render(){let e=r(this,qr).message,t=[e&&`${r(this,ai)}-err`,this.helpText&&`${r(this,ai)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,ai),invalid:e?"true":h},s=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
284
326
  .value=${ee(this.value)} placeholder=${this.placeholder||h}
285
327
  inputmode=${this.inputMode||h}
286
328
  minlength=${s} maxlength=${l}
287
329
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
288
330
  aria-invalid=${i.invalid} aria-describedby=${t}
289
- @input=${a(this,oe,Ru)} @change=${a(this,oe,Nu)} @blur=${a(this,oe,Hu)}></textarea>`:c`<input class="input" part="input" id=${i.id} type=${this.type}
331
+ @input=${a(this,oe,Hu)} @change=${a(this,oe,Pu)} @blur=${a(this,oe,Nu)}></textarea>`:c`<input class="input" part="input" id=${i.id} type=${this.type}
290
332
  .value=${ee(this.value)} placeholder=${this.placeholder||h}
291
333
  autocomplete=${this.autocomplete??h} inputmode=${this.inputMode||h}
292
334
  min=${this.min||h} max=${this.max||h} step=${this.step||h}
293
335
  pattern=${this.pattern||h} minlength=${s} maxlength=${l}
294
336
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
295
337
  aria-invalid=${i.invalid} aria-describedby=${t}
296
- @input=${a(this,oe,Ru)} @change=${a(this,oe,Nu)} @blur=${a(this,oe,Hu)} />`;return c`<div class="field">
297
- ${this.label?c`<label class="label" for=${r(this,si)} part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</label>`:h}
338
+ @input=${a(this,oe,Hu)} @change=${a(this,oe,Pu)} @blur=${a(this,oe,Nu)} />`;return c`<div class="field">
339
+ ${this.label?c`<label class="label" for=${r(this,ai)} part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</label>`:h}
298
340
  ${d}
299
- ${e?c`<p class="error" id="${r(this,si)}-err" role="alert">${e}</p>`:h}
300
- ${this.helpText?c`<p class="help" id="${r(this,si)}-help">${this.helpText}</p>`:h}
301
- </div>`}};ge=new WeakMap,Ir=new WeakMap,si=new WeakMap,Dl=new WeakMap,oe=new WeakSet,iv=function(e){if(!this.pattern)return!0;for(let t of["v","u"])try{return new RegExp(`^(?:${this.pattern})$`,t).test(e)}catch{}return!0},Al=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?r(this,ge).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?r(this,ge).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.type==="number"&&t?.badInput?r(this,ge).setValidity({badInput:!0},this.t("badNumber"),e??void 0):this.required&&!this.value?r(this,ge).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.typeMismatch?r(this,ge).setValidity({typeMismatch:!0},this.t(this.type==="url"?"badUrl":"badEmail"),e??void 0):this.value&&this.minLength!=null&&this.minLength>0&&this.value.length<this.minLength?r(this,ge).setValidity({tooShort:!0},this.t("tooShort",{min:this.minLength}),e??void 0):this.value&&this.maxLength!=null&&this.maxLength>=0&&this.value.length>this.maxLength?r(this,ge).setValidity({tooLong:!0},this.t("tooLong",{max:this.maxLength}),e??void 0):this.value&&!a(this,oe,iv).call(this,this.value)?r(this,ge).setValidity({patternMismatch:!0},this.patternMessage||this.t("pattern"),e??void 0):!this.multiline&&t?.rangeUnderflow?r(this,ge).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:a(this,oe,Ih).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?r(this,ge).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:a(this,oe,Ih).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?r(this,ge).setValidity({stepMismatch:!0},this.t("stepMismatch",a(this,oe,rv).call(this,e)),e??void 0):r(this,ge).setValidity({}),r(this,Ir).sync()},Ih=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let l=/^(\d{2}):(\d{2})/.exec(e);return l?ue(new Date(2e3,0,1,+l[1],+l[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let s=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?ue(s,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):ue(s,{day:"numeric",month:"short",year:"numeric"},t)},rv=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),s=e.valueAsNumber,l=document.createElement("input");l.type=this.type,l.value=this.min??"";let d=Number.isFinite(l.valueAsNumber)?l.valueAsNumber:0,p=d+Math.floor((s-d)/i)*i,u=b=>{if(this.type==="number")return this.formatNumber(Number(b.toPrecision(12)));let x=new Date(b).toISOString();return a(this,oe,Ih).call(this,this.type==="time"?x.slice(11,16):this.type==="date"?x.slice(0,10):x.slice(0,16))};return{lower:u(p),upper:u(p+i)}},Ru=function(e){this.value=e.target.value},Hu=function(){a(this,oe,Al).call(this)},Nu=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Oi.formAssociated=!0,Oi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Oi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},inputMode:{attribute:"inputmode"},size:{reflect:!0},min:{},max:{},step:{},pattern:{},patternMessage:{attribute:"pattern-message"},minLength:{type:Number,attribute:"minlength"},maxLength:{type:Number,attribute:"maxlength"}},Oi.styles=[E,bt,w`
341
+ ${e?c`<p class="error" id="${r(this,ai)}-err" role="alert">${e}</p>`:h}
342
+ ${this.helpText?c`<p class="help" id="${r(this,ai)}-help">${this.helpText}</p>`:h}
343
+ </div>`}};ge=new WeakMap,qr=new WeakMap,ai=new WeakMap,Rl=new WeakMap,oe=new WeakSet,rv=function(e){if(!this.pattern)return!0;for(let t of["v","u"])try{return new RegExp(`^(?:${this.pattern})$`,t).test(e)}catch{}return!0},Dl=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?r(this,ge).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?r(this,ge).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.type==="number"&&t?.badInput?r(this,ge).setValidity({badInput:!0},this.t("badNumber"),e??void 0):this.required&&!this.value?r(this,ge).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.typeMismatch?r(this,ge).setValidity({typeMismatch:!0},this.t(this.type==="url"?"badUrl":"badEmail"),e??void 0):this.value&&this.minLength!=null&&this.minLength>0&&this.value.length<this.minLength?r(this,ge).setValidity({tooShort:!0},this.t("tooShort",{min:this.minLength}),e??void 0):this.value&&this.maxLength!=null&&this.maxLength>=0&&this.value.length>this.maxLength?r(this,ge).setValidity({tooLong:!0},this.t("tooLong",{max:this.maxLength}),e??void 0):this.value&&!a(this,oe,rv).call(this,this.value)?r(this,ge).setValidity({patternMismatch:!0},this.patternMessage||this.t("pattern"),e??void 0):!this.multiline&&t?.rangeUnderflow?r(this,ge).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:a(this,oe,Kh).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?r(this,ge).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:a(this,oe,Kh).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?r(this,ge).setValidity({stepMismatch:!0},this.t("stepMismatch",a(this,oe,sv).call(this,e)),e??void 0):r(this,ge).setValidity({}),r(this,qr).sync()},Kh=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let l=/^(\d{2}):(\d{2})/.exec(e);return l?ue(new Date(2e3,0,1,+l[1],+l[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let s=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?ue(s,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):ue(s,{day:"numeric",month:"short",year:"numeric"},t)},sv=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),s=e.valueAsNumber,l=document.createElement("input");l.type=this.type,l.value=this.min??"";let d=Number.isFinite(l.valueAsNumber)?l.valueAsNumber:0,p=d+Math.floor((s-d)/i)*i,u=b=>{if(this.type==="number")return this.formatNumber(Number(b.toPrecision(12)));let x=new Date(b).toISOString();return a(this,oe,Kh).call(this,this.type==="time"?x.slice(11,16):this.type==="date"?x.slice(0,10):x.slice(0,16))};return{lower:u(p),upper:u(p+i)}},Hu=function(e){this.value=e.target.value},Nu=function(){a(this,oe,Dl).call(this)},Pu=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Fi.formAssociated=!0,Fi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Fi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},inputMode:{attribute:"inputmode"},size:{reflect:!0},min:{},max:{},step:{},pattern:{},patternMessage:{attribute:"pattern-message"},minLength:{type:Number,attribute:"minlength"},maxLength:{type:Number,attribute:"maxlength"}},Fi.styles=[E,bt,w`
302
344
  :host { display: block; }
303
345
  .input {
304
346
  width: 100%; height: var(--_cm-field-h); padding: 0 var(--_cm-field-pad);
@@ -314,13 +356,13 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
314
356
  .input:read-only, .input:disabled { background: var(--cm-bg-input-filled); }
315
357
  .input:disabled { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
316
358
  :host([error]:not([error=''])) .input, :host([data-cm-invalid]) .input { border-color: var(--cm-border-critical); }
317
- `];$("cm-text-field",Oi);var P1=z("checkbox",{required:"Please tick this box."}),vt,qr,ai,Rl,qh,sv,Bi=class extends C{constructor(){super(...arguments);m(this,qh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;m(this,vt,this.attachInternals());m(this,qr,new re(this,r(this,vt)));m(this,ai,N("cm-cb"));m(this,Rl,!1)}connectedCallback(){super.connectedCallback(),g(this,Rl,this.checked)}get form(){return r(this,vt).form}get validity(){return r(this,vt).validity}get validationMessage(){return r(this,vt).validationMessage}checkValidity(){return r(this,vt).checkValidity()}reportValidity(){return r(this,qr).report(()=>r(this,vt).reportValidity())}formResetCallback(){this.checked=r(this,Rl),r(this,qr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,vt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,vt).setValidity({valueMissing:!0},this.t("required")):r(this,vt).setValidity({}),r(this,qr).sync()}render(){let e=this.indeterminate?c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`,t=r(this,qr).message,i=[this.description&&`${r(this,ai)}-d`,t&&`${r(this,ai)}-err`].filter(Boolean).join(" ");return c`<label for=${r(this,ai)}>
318
- <input type="checkbox" id=${r(this,ai)} .checked=${this.checked} .indeterminate=${this.indeterminate}
359
+ `];$("cm-text-field",Fi);var B$=z("checkbox",{required:"Please tick this box."}),vt,Or,ni,Hl,Wh,av,Vi=class extends C{constructor(){super(...arguments);m(this,Wh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;m(this,vt,this.attachInternals());m(this,Or,new re(this,r(this,vt)));m(this,ni,N("cm-cb"));m(this,Hl,!1)}connectedCallback(){super.connectedCallback(),g(this,Hl,this.checked)}get form(){return r(this,vt).form}get validity(){return r(this,vt).validity}get validationMessage(){return r(this,vt).validationMessage}checkValidity(){return r(this,vt).checkValidity()}reportValidity(){return r(this,Or).report(()=>r(this,vt).reportValidity())}formResetCallback(){this.checked=r(this,Hl),r(this,Or).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,vt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,vt).setValidity({valueMissing:!0},this.t("required")):r(this,vt).setValidity({}),r(this,Or).sync()}render(){let e=this.indeterminate?c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:c`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`,t=r(this,Or).message,i=[this.description&&`${r(this,ni)}-d`,t&&`${r(this,ni)}-err`].filter(Boolean).join(" ");return c`<label for=${r(this,ni)}>
360
+ <input type="checkbox" id=${r(this,ni)} .checked=${this.checked} .indeterminate=${this.indeterminate}
319
361
  ?disabled=${this.disabled} ?required=${this.required} aria-invalid=${t?"true":h}
320
- aria-describedby=${i||h} @change=${a(this,qh,sv)} />
362
+ aria-describedby=${i||h} @change=${a(this,Wh,av)} />
321
363
  <span class="box" part="box">${e}</span>
322
- ${this.label||this.description?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${r(this,ai)}-d">${this.description}</span>`:h}</span>`:c`<slot></slot>`}
323
- </label>${t?c`<p class="error" id="${r(this,ai)}-err" role="alert">${t}</p>`:h}`}};vt=new WeakMap,qr=new WeakMap,ai=new WeakMap,Rl=new WeakMap,qh=new WeakSet,sv=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Bi.formAssociated=!0,Bi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Bi.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},Bi.styles=[E,w`
364
+ ${this.label||this.description?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${r(this,ni)}-d">${this.description}</span>`:h}</span>`:c`<slot></slot>`}
365
+ </label>${t?c`<p class="error" id="${r(this,ni)}-err" role="alert">${t}</p>`:h}`}};vt=new WeakMap,Or=new WeakMap,ni=new WeakMap,Hl=new WeakMap,Wh=new WeakSet,av=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Vi.formAssociated=!0,Vi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Vi.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},Vi.styles=[E,w`
324
366
  :host { display: inline-flex; flex-direction: column; }
325
367
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; }
326
368
  /* The 16px box (18px on touch screens, owner standard 1.6) sits centred on the label's first line (20px); the
@@ -346,12 +388,12 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
346
388
  /* 1.14: the field's own message, under the label text (past the box and its gap). */
347
389
  .error { margin: 0; padding-inline-start: var(--cm-space-24); font-size: var(--cm-type-body-xs-size); line-height: var(--cm-type-body-xs-line-height); color: var(--cm-text-critical); }
348
390
  :host([data-cm-invalid]) .box, :host([data-cm-invalid]) label:hover input:not(:disabled) + .box { border-color: var(--cm-border-critical); }
349
- `];$("cm-checkbox",Bi);var Hl,Br=class extends A{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;m(this,Hl,N("cm-radio"))}render(){let e=this.description?`${r(this,Hl)}-d`:null;return c`<div class="radio" part="radio" role="radio" id=${r(this,Hl)}
391
+ `];$("cm-checkbox",Vi);var Nl,Fr=class extends A{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;m(this,Nl,N("cm-radio"))}render(){let e=this.description?`${r(this,Nl)}-d`:null;return c`<div class="radio" part="radio" role="radio" id=${r(this,Nl)}
350
392
  aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":h}
351
393
  aria-describedby=${e??h} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
352
394
  <span class="dot" part="dot"></span>
353
395
  <span class="text"><span class="label">${this.label}<slot></slot></span>${e?c`<span class="desc" id=${e}>${this.description}</span>`:h}</span>
354
- </div>`}};Hl=new WeakMap,Br.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Br.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},Br.styles=[E,w`
396
+ </div>`}};Nl=new WeakMap,Fr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Fr.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},Fr.styles=[E,w`
355
397
  :host { display: inline-flex; }
356
398
  .radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; outline: none; }
357
399
  .dot {
@@ -373,16 +415,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
373
415
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
374
416
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-subtle); }
375
417
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
376
- `];$("cm-radio",Br);var j1=z("radioGroup",{required:"Please select one of these options."}),nt,Vr,ni,Nl,Pl,Il,ba,fe,Pu,Bh,Or,Iu,va,qu,Fh,Vh,Oh,Fr=class extends C{constructor(){super();m(this,fe);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;m(this,nt,this.attachInternals());m(this,Vr,new re(this,r(this,nt)));m(this,ni,N("cm-rg"));m(this,Nl,"");m(this,Pl,!0);m(this,Il,!1);m(this,ba,!1);m(this,Bh,()=>{a(this,fe,Pu).call(this),r(this,va).call(this)});m(this,va,()=>{let e=a(this,fe,Or).call(this),t=!1;for(let s of e)s.checked=!!this.value&&s.value===this.value&&!t,s.checked&&(t=!0),s.groupDisabled=this.disabled;let i=e.find(s=>s.checked&&!s.disabled)??a(this,fe,Iu).call(this)[0];for(let s of e)s._tabbable=s===i&&!this.disabled});m(this,Fh,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,fe,qu).call(this,t,!0)});m(this,Vh,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,fe,Iu).call(this),s=i.indexOf(t),l=se(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(s+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(s-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&a(this,fe,qu).call(this,d,!0)});this.addEventListener("keydown",r(this,Vh)),this.addEventListener("click",r(this,Fh))}connectedCallback(){super.connectedCallback(),a(this,fe,Pu).call(this)}get form(){return r(this,nt).form}get validity(){return r(this,nt).validity}get validationMessage(){return r(this,nt).validationMessage}checkValidity(){return r(this,nt).checkValidity()}reportValidity(){return r(this,Vr).report(()=>r(this,nt).reportValidity())}formResetCallback(){this.value=r(this,Nl),r(this,Vr).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(a(this,fe,Or).call(this).find(t=>t._tabbable)??a(this,fe,Or).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,Il)&&!r(this,ba)&&g(this,Pl,!1),g(this,Il,!0),r(this,va).call(this),r(this,nt).setFormValue(this.value||null,this.value);let t=a(this,fe,Or).call(this)[0];this.error?r(this,nt).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,nt).setValidity({valueMissing:!0},this.t("required"),t):r(this,nt).setValidity({}),r(this,Vr).sync()}render(){let e=r(this,Vr).message,t=[e&&`${r(this,ni)}-err`,this.helpText&&`${r(this,ni)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
377
- aria-labelledby=${a(this,fe,Oh).call(this)?`${r(this,ni)}-l`:h} aria-label=${a(this,fe,Oh).call(this)?h:this.getAttribute("aria-label")??h}
418
+ `];$("cm-radio",Fr);var G$=z("radioGroup",{required:"Please select one of these options."}),nt,jr,oi,Pl,Il,ql,xa,fe,Iu,Yh,Br,qu,wa,Ou,Xh,Jh,Gh,Vr=class extends C{constructor(){super();m(this,fe);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;m(this,nt,this.attachInternals());m(this,jr,new re(this,r(this,nt)));m(this,oi,N("cm-rg"));m(this,Pl,"");m(this,Il,!0);m(this,ql,!1);m(this,xa,!1);m(this,Yh,()=>{a(this,fe,Iu).call(this),r(this,wa).call(this)});m(this,wa,()=>{let e=a(this,fe,Br).call(this),t=!1;for(let s of e)s.checked=!!this.value&&s.value===this.value&&!t,s.checked&&(t=!0),s.groupDisabled=this.disabled;let i=e.find(s=>s.checked&&!s.disabled)??a(this,fe,qu).call(this)[0];for(let s of e)s._tabbable=s===i&&!this.disabled});m(this,Xh,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,fe,Ou).call(this,t,!0)});m(this,Jh,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,fe,qu).call(this),s=i.indexOf(t),l=se(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(s+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(s-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&a(this,fe,Ou).call(this,d,!0)});this.addEventListener("keydown",r(this,Jh)),this.addEventListener("click",r(this,Xh))}connectedCallback(){super.connectedCallback(),a(this,fe,Iu).call(this)}get form(){return r(this,nt).form}get validity(){return r(this,nt).validity}get validationMessage(){return r(this,nt).validationMessage}checkValidity(){return r(this,nt).checkValidity()}reportValidity(){return r(this,jr).report(()=>r(this,nt).reportValidity())}formResetCallback(){this.value=r(this,Pl),r(this,jr).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(a(this,fe,Br).call(this).find(t=>t._tabbable)??a(this,fe,Br).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,ql)&&!r(this,xa)&&g(this,Il,!1),g(this,ql,!0),r(this,wa).call(this),r(this,nt).setFormValue(this.value||null,this.value);let t=a(this,fe,Br).call(this)[0];this.error?r(this,nt).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,nt).setValidity({valueMissing:!0},this.t("required"),t):r(this,nt).setValidity({}),r(this,jr).sync()}render(){let e=r(this,jr).message,t=[e&&`${r(this,oi)}-err`,this.helpText&&`${r(this,oi)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
419
+ aria-labelledby=${a(this,fe,Gh).call(this)?`${r(this,oi)}-l`:h} aria-label=${a(this,fe,Gh).call(this)?h:this.getAttribute("aria-label")??h}
378
420
  aria-describedby=${t||h}
379
421
  aria-required=${this.required?"true":h} aria-invalid=${e?"true":h}
380
422
  aria-disabled=${this.disabled?"true":h}>
381
- <span class="label" id="${r(this,ni)}-l" part="label" ?hidden=${!a(this,fe,Oh).call(this)}>${this.label}<slot name="label"></slot>${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
382
- ${this.helpText?c`<p class="help" id="${r(this,ni)}-help">${this.helpText}</p>`:h}
383
- ${e?c`<p class="error" id="${r(this,ni)}-err" role="alert">${e}</p>`:h}
384
- <div class="options" part="options"><slot @slotchange=${r(this,Bh)}></slot></div>
385
- </div>`}};nt=new WeakMap,Vr=new WeakMap,ni=new WeakMap,Nl=new WeakMap,Pl=new WeakMap,Il=new WeakMap,ba=new WeakMap,fe=new WeakSet,Pu=function(){r(this,Pl)&&(this.value||(g(this,ba,!0),this.value=a(this,fe,Or).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,ba,!1))),g(this,Nl,this.value))},Bh=new WeakMap,Or=function(){return[...this.querySelectorAll("cm-radio")]},Iu=function(){return a(this,fe,Or).call(this).filter(e=>!e.disabled&&!this.disabled)},va=new WeakMap,qu=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,va).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Fh=new WeakMap,Vh=new WeakMap,Oh=function(){return!!this.label||!!this.querySelector("[slot=label]")},Fr.formAssociated=!0,Fr.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Fr.styles=[E,w`
423
+ <span class="label" id="${r(this,oi)}-l" part="label" ?hidden=${!a(this,fe,Gh).call(this)}>${this.label}<slot name="label"></slot>${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
424
+ ${this.helpText?c`<p class="help" id="${r(this,oi)}-help">${this.helpText}</p>`:h}
425
+ ${e?c`<p class="error" id="${r(this,oi)}-err" role="alert">${e}</p>`:h}
426
+ <div class="options" part="options"><slot @slotchange=${r(this,Yh)}></slot></div>
427
+ </div>`}};nt=new WeakMap,jr=new WeakMap,oi=new WeakMap,Pl=new WeakMap,Il=new WeakMap,ql=new WeakMap,xa=new WeakMap,fe=new WeakSet,Iu=function(){r(this,Il)&&(this.value||(g(this,xa,!0),this.value=a(this,fe,Br).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,xa,!1))),g(this,Pl,this.value))},Yh=new WeakMap,Br=function(){return[...this.querySelectorAll("cm-radio")]},qu=function(){return a(this,fe,Br).call(this).filter(e=>!e.disabled&&!this.disabled)},wa=new WeakMap,Ou=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,wa).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Xh=new WeakMap,Jh=new WeakMap,Gh=function(){return!!this.label||!!this.querySelector("[slot=label]")},Vr.formAssociated=!0,Vr.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Vr.styles=[E,w`
386
428
  :host { display: block; }
387
429
  .group { display: flex; flex-direction: column; gap: var(--cm-space-8); }
388
430
  .label { font-size: var(--cm-type-label-size); line-height: var(--cm-type-label-line-height); font-weight: var(--cm-type-label-weight); color: var(--cm-text-default); }
@@ -391,13 +433,13 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
391
433
  .error { color: var(--cm-text-critical); }
392
434
  .options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-12); padding-top: var(--cm-space-4); }
393
435
  :host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-24); }
394
- `];$("cm-radio-group",Fr);var ya,jr,ql,jh,av,Fi=class extends A{constructor(){super(...arguments);m(this,jh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;m(this,ya,this.attachInternals());m(this,jr,N("cm-tg"));m(this,ql,!1)}connectedCallback(){super.connectedCallback(),g(this,ql,this.checked)}get form(){return r(this,ya).form}checkValidity(){return r(this,ya).checkValidity()}formResetCallback(){this.checked=r(this,ql)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){r(this,ya).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return c`<label for=${r(this,jr)}>
395
- <input type="checkbox" role="switch" id=${r(this,jr)} .checked=${this.checked} ?disabled=${this.disabled}
436
+ `];$("cm-radio-group",Vr);var $a,Ur,Ol,Qh,nv,ji=class extends A{constructor(){super(...arguments);m(this,Qh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;m(this,$a,this.attachInternals());m(this,Ur,N("cm-tg"));m(this,Ol,!1)}connectedCallback(){super.connectedCallback(),g(this,Ol,this.checked)}get form(){return r(this,$a).form}checkValidity(){return r(this,$a).checkValidity()}formResetCallback(){this.checked=r(this,Ol)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){r(this,$a).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return c`<label for=${r(this,Ur)}>
437
+ <input type="checkbox" role="switch" id=${r(this,Ur)} .checked=${this.checked} ?disabled=${this.disabled}
396
438
  aria-label=${e?h:this.getAttribute("aria-label")??h}
397
- aria-describedby=${this.description?`${r(this,jr)}-d`:h} @change=${a(this,jh,av)} />
439
+ aria-describedby=${this.description?`${r(this,Ur)}-d`:h} @change=${a(this,Qh,nv)} />
398
440
  <span class="track" part="track"><span class="thumb" part="thumb"></span></span>
399
- ${e?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${r(this,jr)}-d">${this.description}</span>`:h}</span>`:h}
400
- </label>`}};ya=new WeakMap,jr=new WeakMap,ql=new WeakMap,jh=new WeakSet,av=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Fi.formAssociated=!0,Fi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Fi.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Fi.styles=[E,w`
441
+ ${e?c`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?c`<span class="desc" id="${r(this,Ur)}-d">${this.description}</span>`:h}</span>`:h}
442
+ </label>`}};$a=new WeakMap,Ur=new WeakMap,Ol=new WeakMap,Qh=new WeakSet,nv=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},ji.formAssociated=!0,ji.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},ji.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},ji.styles=[E,w`
401
443
  :host { display: inline-flex; }
402
444
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; }
403
445
  /* A 36 x 20 track with a 16px thumb; the invisible input is a 24px-tall target. */
@@ -425,52 +467,10 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
425
467
  :host([disabled]) .track { opacity: .5; }
426
468
  :host([disabled]) .label { color: var(--cm-text-secondary); }
427
469
  @media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
428
- `];$("cm-toggle",Fi);var xa=w`
429
- .pop {
430
- position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-4)); inset-inline: 0;
431
- background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
432
- border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-md); overflow: hidden;
433
- }
434
- .pop[hidden] { display: none; }
435
- .message { display: flex; align-items: center; gap: var(--cm-space-8); margin: 0; padding: var(--cm-space-12) var(--cm-space-20); font-size: 14px; color: var(--cm-text-tertiary); }
436
- .vh {
437
- position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
438
- clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
439
- }
440
- `;function Uh(o,n,e){let t=i=>{n()&&!i.composedPath().includes(o)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Vi=w`
441
- [role='group'] + [role='group'] { margin-block-start: var(--cm-space-4); padding-block-start: var(--cm-space-4); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
442
- [role='option'] + [role='group'], [role='group'] + [role='option'] { margin-block-start: var(--cm-space-4); padding-block-start: var(--cm-space-4); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
443
- .gh {
444
- display: flex; align-items: baseline; gap: var(--cm-space-8); padding: var(--cm-space-8) var(--cm-space-12) var(--cm-space-4);
445
- font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500; color: var(--cm-text-tertiary);
446
- }
447
- .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
448
- .gopts { list-style: none; margin: 0; padding: 0; }
449
- `;function wa(o){if(!o.some(t=>t.group))return o;let n=[],e=new Map;for(let t of o)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let s=[t];e.set(t.group,s),n.push({key:t.group,items:s})}}else{let i=n[n.length-1];i&&!i.key?i.items.push(t):n.push({key:"",items:[t]})}return n.flatMap(t=>t.items)}function Kh(o){let n=[];return o.forEach((e,t)=>{let i=e.group||"",s=n[n.length-1];s&&s.group===i?s.rows.push({row:e,index:t}):n.push({group:i,rows:[{row:e,index:t}]})}),n}var Wh=w`
450
- [role='listbox'] { padding-block: var(--cm-space-4); }
451
- [role='listbox'][hidden] { display: none; }
452
- [role='option'] {
453
- display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md); padding: var(--cm-space-8) var(--cm-space-12);
454
- font-size: 14px; line-height: 20px; color: var(--cm-text-default); text-decoration: none; cursor: pointer;
455
- }
456
- [role='option'].active { background: var(--cm-bg-hover); box-shadow: inset 2px 0 0 var(--cm-border-strong); }
457
- [role='option'].active:dir(rtl) { box-shadow: inset -2px 0 0 var(--cm-border-strong); }
458
- [role='option'] cm-icon { flex: none; color: var(--cm-icon-selected); }
459
- .text { flex: 1; min-width: 0; }
460
- .title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
461
- .desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
462
- .all { font-size: var(--cm-font-size-13); text-decoration: underline; }
463
- .gh { padding-inline: var(--cm-space-12); }
464
- kbd {
465
- flex: none; min-width: 20px; padding: 0 var(--cm-space-4); font: inherit; font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); text-align: center;
466
- color: var(--cm-text-tertiary); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-xs);
467
- }
468
- `;function Gh(o,n,e,t){return c`<div role="presentation" class="gh" id=${o}><span>${n}</span>${e!==void 0?c`<span class="count" aria-hidden="true">${e}</span><span class="vh">, ${t}</span>`:h}</div>`}function Yh(o,n=h){return c`${o.icon?c`<cm-icon name=${o.icon} size="16"></cm-icon>`:h}<span class="text"><span class="title">${o.title}</span>${o.description?c`<span class="vh">, </span><span class="desc">${o.description}</span>`:h}</span>${n}`}function Xh(o,n){let e=`${o.cls??""}${o.active?" active":""}`;return o.href?c`<a role="option" id=${o.id} class=${e} href=${o.href} tabindex="-1" aria-selected=${o.active?"true":"false"}
469
- aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</a>`:c`<div role="option" id=${o.id} class=${e} tabindex="-1" aria-selected=${o.active?"true":"false"}
470
- aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</div>`}function Jh(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var nk=z("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),ot,Kr,Ce,ka,Dt,Ea,Bl,W,Ou,Wr,Bu,Ol,$a,Ur,ji,Qh,Zh,Fl,ep,nv,tp,Ui=class extends C{constructor(){super(...arguments);m(this,W);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.size="default";this.loading=!1;this._active=-1;this._slotted=[];m(this,ot,this.attachInternals());m(this,Kr,new re(this,r(this,ot)));m(this,Ce,N("cm-sel"));m(this,ka,"");m(this,Dt,"");m(this,Ea,0);m(this,Bl,new MutationObserver(()=>a(this,W,Ou).call(this)));m(this,Wr,new we);m(this,Zh,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,W,Ol).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,W,Ol).call(this),a(this,W,ji).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,W,Qh).call(this,t);a(this,W,Ol).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?a(this,W,Ur).call(this,this._active):a(this,W,ji).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?a(this,W,Ur).call(this,this._active):a(this,W,ji).call(this,-1);break;case"Home":e.preventDefault(),a(this,W,ji).call(this,"first");break;case"End":e.preventDefault(),a(this,W,ji).call(this,"last");break;case"PageDown":e.preventDefault(),a(this,W,ji).call(this,10);break;case"PageUp":e.preventDefault(),a(this,W,ji).call(this,-10);break;case"Enter":e.preventDefault(),a(this,W,Ur).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),a(this,W,$a).call(this);break;case"Tab":a(this,W,Ur).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,Dt)&&Date.now()-r(this,Ea)<500){let i=a(this,W,Qh).call(this," ");i>=0&&(this._active=i)}else a(this,W,Ur).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,W,Qh).call(this,t);i>=0&&(this._active=i)}}});m(this,Fl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,W,$a).call(this)});m(this,ep,()=>{this.disabled||(this.open?a(this,W,$a).call(this):a(this,W,Ol).call(this))});m(this,tp,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,W,Ou).call(this),r(this,Bl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,Fl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Wr).close(),r(this,Bl).disconnect(),document.removeEventListener("pointerdown",r(this,Fl),!0)}get form(){return r(this,ot).form}get validity(){return r(this,ot).validity}get validationMessage(){return r(this,ot).validationMessage}checkValidity(){return r(this,ot).checkValidity()}reportValidity(){return r(this,Kr).report(()=>r(this,ot).reportValidity())}formResetCallback(){this.value=r(this,ka),this.open=!1,r(this,Kr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?wa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):wa(this._slotted)}firstUpdated(){r(this,ka)||g(this,ka,this.value)}updated(e){r(this,ot).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,ot).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,ot).setValidity({valueMissing:!0},this.t("required"),t):r(this,ot).setValidity({}),r(this,Kr).sync(),e.has("open")?this.open?r(this,Wr).open(this.renderRoot.querySelector("[role=listbox]"),this.renderRoot.querySelector(".box"),{align:"stretch"}):r(this,Wr).close():this.open&&e.has("items")&&r(this,Wr).place(),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,Ce)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(p=>p.value===this.value),i=r(this,Kr).message,s=[i&&`${r(this,Ce)}-err`,this.helpText&&`${r(this,Ce)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=(p,u)=>c`<li role="option" id="${r(this,Ce)}-o${u}" class=${u===this._active?"active":""}
470
+ `];$("cm-toggle",ji);var lk=z("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),ot,Wr,Ce,Ea,Rt,Ma,Fl,W,Bu,Gr,Fu,Bl,ka,Kr,Ui,Zh,ep,Vl,tp,ov,ip,Ki=class extends C{constructor(){super(...arguments);m(this,W);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.size="default";this.loading=!1;this._active=-1;this._slotted=[];m(this,ot,this.attachInternals());m(this,Wr,new re(this,r(this,ot)));m(this,Ce,N("cm-sel"));m(this,Ea,"");m(this,Rt,"");m(this,Ma,0);m(this,Fl,new MutationObserver(()=>a(this,W,Bu).call(this)));m(this,Gr,new we);m(this,ep,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,W,Bl).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,W,Bl).call(this),a(this,W,Ui).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,W,Zh).call(this,t);a(this,W,Bl).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?a(this,W,Kr).call(this,this._active):a(this,W,Ui).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?a(this,W,Kr).call(this,this._active):a(this,W,Ui).call(this,-1);break;case"Home":e.preventDefault(),a(this,W,Ui).call(this,"first");break;case"End":e.preventDefault(),a(this,W,Ui).call(this,"last");break;case"PageDown":e.preventDefault(),a(this,W,Ui).call(this,10);break;case"PageUp":e.preventDefault(),a(this,W,Ui).call(this,-10);break;case"Enter":e.preventDefault(),a(this,W,Kr).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),a(this,W,ka).call(this);break;case"Tab":a(this,W,Kr).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,Rt)&&Date.now()-r(this,Ma)<500){let i=a(this,W,Zh).call(this," ");i>=0&&(this._active=i)}else a(this,W,Kr).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,W,Zh).call(this,t);i>=0&&(this._active=i)}}});m(this,Vl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,W,ka).call(this)});m(this,tp,()=>{this.disabled||(this.open?a(this,W,ka).call(this):a(this,W,Bl).call(this))});m(this,ip,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,W,Bu).call(this),r(this,Fl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,Vl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Gr).close(),r(this,Fl).disconnect(),document.removeEventListener("pointerdown",r(this,Vl),!0)}get form(){return r(this,ot).form}get validity(){return r(this,ot).validity}get validationMessage(){return r(this,ot).validationMessage}checkValidity(){return r(this,ot).checkValidity()}reportValidity(){return r(this,Wr).report(()=>r(this,ot).reportValidity())}formResetCallback(){this.value=r(this,Ea),this.open=!1,r(this,Wr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?oa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):oa(this._slotted)}firstUpdated(){r(this,Ea)||g(this,Ea,this.value)}updated(e){r(this,ot).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,ot).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,ot).setValidity({valueMissing:!0},this.t("required"),t):r(this,ot).setValidity({}),r(this,Wr).sync(),e.has("open")?this.open?r(this,Gr).open(this.renderRoot.querySelector("[role=listbox]"),this.renderRoot.querySelector(".box"),{align:"stretch"}):r(this,Gr).close():this.open&&e.has("items")&&r(this,Gr).place(),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,Ce)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(p=>p.value===this.value),i=r(this,Wr).message,s=[i&&`${r(this,Ce)}-err`,this.helpText&&`${r(this,Ce)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=(p,u)=>c`<li role="option" id="${r(this,Ce)}-o${u}" class=${u===this._active?"active":""}
471
471
  aria-selected=${p.value===this.value?"true":"false"} aria-disabled=${p.disabled?"true":h}
472
- @pointerenter=${()=>!p.disabled&&(this._active=u)} @click=${()=>a(this,W,Ur).call(this,u)}>${p.label}</li>`;return c`<div class="field">
473
- ${this.label?c`<span class="label" id="${r(this,Ce)}-l" part="label" @click=${r(this,tp)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
472
+ @pointermove=${At(()=>{p.disabled||(this._active=u)})} @click=${()=>a(this,W,Kr).call(this,u)}>${p.label}</li>`;return c`<div class="field">
473
+ ${this.label?c`<span class="label" id="${r(this,Ce)}-l" part="label" @click=${r(this,ip)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
474
474
  <div class="wrap">
475
475
  <div class="box" part="box" role="combobox" tabindex=${this.disabled?"-1":"0"}
476
476
  aria-labelledby=${this.label?`${r(this,Ce)}-l`:h}
@@ -479,21 +479,21 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
479
479
  aria-activedescendant=${this.open&&this._active>=0?`${r(this,Ce)}-o${this._active}`:h}
480
480
  aria-required=${this.required?"true":h} aria-invalid=${i?"true":h}
481
481
  aria-disabled=${this.disabled?"true":h} aria-describedby=${s||h} aria-busy=${this.loading?"true":h}
482
- @click=${r(this,ep)} @keydown=${r(this,Zh)} @blur=${()=>a(this,W,$a).call(this)}>
483
- <span class="text ${t?"":"placeholder"}" id="${r(this,Ce)}-v">${t?a(this,W,nv).call(this,t):this.placeholder}</span>
482
+ @click=${r(this,tp)} @keydown=${r(this,ep)} @blur=${()=>a(this,W,ka).call(this)}>
483
+ <span class="text ${t?"":"placeholder"}" id="${r(this,Ce)}-v">${t?a(this,W,ov).call(this,t):this.placeholder}</span>
484
484
  ${this.loading?c`<span class="spin"><cm-spinner size="small" aria-hidden="true"></cm-spinner></span>`:c`<cm-icon class="chev" name="chevron-down" size="16"></cm-icon>`}
485
485
  </div>
486
486
  <ul role="listbox" id="${r(this,Ce)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${r(this,Ce)}-l`:h}
487
487
  aria-label=${!this.label&&l?l:h} ?hidden=${!this.open}
488
488
  @pointerdown=${p=>p.preventDefault()}>
489
- ${Kh(e).map((p,u)=>p.group?c`<li role="group" aria-labelledby="${r(this,Ce)}-g${u}"><div role="presentation" class="gh" id="${r(this,Ce)}-g${u}">${p.group}</div>
489
+ ${_h(e).map((p,u)=>p.group?c`<li role="group" aria-labelledby="${r(this,Ce)}-g${u}"><div role="presentation" class="gh" id="${r(this,Ce)}-g${u}">${p.group}</div>
490
490
  <ul role="none" class="gopts">${p.rows.map(({row:b,index:f})=>d(b,f))}</ul></li>`:p.rows.map(({row:b,index:f})=>d(b,f)))}
491
491
  </ul>
492
492
  </div>
493
493
  ${i?c`<p class="error" id="${r(this,Ce)}-err" role="alert">${i}</p>`:h}
494
494
  ${this.helpText?c`<p class="help" id="${r(this,Ce)}-help">${this.helpText}</p>`:h}
495
495
  <slot></slot>
496
- </div>`}};ot=new WeakMap,Kr=new WeakMap,Ce=new WeakMap,ka=new WeakMap,Dt=new WeakMap,Ea=new WeakMap,Bl=new WeakMap,W=new WeakSet,Ou=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,s={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(s.group=i.label),s}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,ka,this.value))},Wr=new WeakMap,Bu=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},Ol=function(e){if(this.disabled||this.loading)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:a(this,W,Bu).call(this)[0]??-1)},$a=function(){this.open=!1},Ur=function(e){let t=this.items[e];!t||t.disabled||(a(this,W,$a).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},ji=function(e){let t=a(this,W,Bu).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},Qh=function(e){let t=Date.now();g(this,Dt,t-r(this,Ea)>500?e:r(this,Dt)+e),g(this,Ea,t);let i=this.items,s=this._active<0?0:this._active,l=r(this,Dt).split("").every(u=>u===r(this,Dt)[0]),d=l?r(this,Dt)[0]:r(this,Dt),p=l||r(this,Dt).length===1?s+1:s;for(let u=0;u<i.length;u++){let b=(p+u)%i.length;if(!i[b].disabled&&i[b].label.toLowerCase().startsWith(d.toLowerCase()))return b}return-1},Zh=new WeakMap,Fl=new WeakMap,ep=new WeakMap,nv=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},tp=new WeakMap,Ui.formAssociated=!0,Ui.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Ui.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},size:{reflect:!0},loading:{type:Boolean,reflect:!0},_active:{state:!0},_slotted:{state:!0}},Ui.styles=[E,Ie,bt,ua,Vi,w`
496
+ </div>`}};ot=new WeakMap,Wr=new WeakMap,Ce=new WeakMap,Ea=new WeakMap,Rt=new WeakMap,Ma=new WeakMap,Fl=new WeakMap,W=new WeakSet,Bu=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,s={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(s.group=i.label),s}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,Ea,this.value))},Gr=new WeakMap,Fu=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},Bl=function(e){if(this.disabled||this.loading)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:a(this,W,Fu).call(this)[0]??-1)},ka=function(){this.open=!1},Kr=function(e){let t=this.items[e];!t||t.disabled||(a(this,W,ka).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Ui=function(e){let t=a(this,W,Fu).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},Zh=function(e){let t=Date.now();g(this,Rt,t-r(this,Ma)>500?e:r(this,Rt)+e),g(this,Ma,t);let i=this.items,s=this._active<0?0:this._active,l=r(this,Rt).split("").every(u=>u===r(this,Rt)[0]),d=l?r(this,Rt)[0]:r(this,Rt),p=l||r(this,Rt).length===1?s+1:s;for(let u=0;u<i.length;u++){let b=(p+u)%i.length;if(!i[b].disabled&&i[b].label.toLowerCase().startsWith(d.toLowerCase()))return b}return-1},ep=new WeakMap,Vl=new WeakMap,tp=new WeakMap,ov=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},ip=new WeakMap,Ki.formAssociated=!0,Ki.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Ki.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},size:{reflect:!0},loading:{type:Boolean,reflect:!0},_active:{state:!0},_slotted:{state:!0}},Ki.styles=[E,Ie,bt,ba,Hi,w`
497
497
  :host { display: block; position: relative; }
498
498
  .label { cursor: default; }
499
499
  .wrap { position: relative; }
@@ -526,16 +526,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
526
526
  [role='group'] { display: block; }
527
527
  slot { display: none; }
528
528
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
529
- `];$("cm-select",Ui);var uk=z("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),_a,ip,Vl,je,Ma,ov,lv,Fu,Ki=class extends C{constructor(){super(...arguments);m(this,je);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;m(this,_a,this.attachInternals());m(this,ip,N("cm-search"));m(this,Vl,"")}connectedCallback(){super.connectedCallback(),g(this,Vl,this.value)}get form(){return r(this,_a).form}checkValidity(){return r(this,_a).checkValidity()}formResetCallback(){this.value=r(this,Vl)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,_a).setFormValue(this.value)}render(){return c`<div class="box" part="box">
529
+ `];$("cm-select",Ki);var fk=z("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Ta,rp,jl,je,_a,lv,cv,Vu,Wi=class extends C{constructor(){super(...arguments);m(this,je);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;m(this,Ta,this.attachInternals());m(this,rp,N("cm-search"));m(this,jl,"")}connectedCallback(){super.connectedCallback(),g(this,jl,this.value)}get form(){return r(this,Ta).form}checkValidity(){return r(this,Ta).checkValidity()}formResetCallback(){this.value=r(this,jl)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,Ta).setFormValue(this.value)}render(){return c`<div class="box" part="box">
530
530
  <cm-icon class="icon" name="search" size="16"></cm-icon>
531
- <input id=${r(this,ip)} part="input" type="search" enterkeyhint="search" autocomplete="off"
531
+ <input id=${r(this,rp)} part="input" type="search" enterkeyhint="search" autocomplete="off"
532
532
  aria-label=${this.label} .value=${ee(this.value)} placeholder=${this.placeholder||h} ?disabled=${this.disabled}
533
- @input=${a(this,je,ov)} @change=${()=>a(this,je,Ma).call(this,"change")} @keydown=${a(this,je,lv)} />
534
- ${this.value&&!this.disabled?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${a(this,je,Fu)}><cm-icon name="close" size="16"></cm-icon></button>`:h}
533
+ @input=${a(this,je,lv)} @change=${()=>a(this,je,_a).call(this,"change")} @keydown=${a(this,je,cv)} />
534
+ ${this.value&&!this.disabled?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${a(this,je,Vu)}><cm-icon name="close" size="16"></cm-icon></button>`:h}
535
535
  ${this.filter?c`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
536
536
  aria-label=${this.filterCount>0?this.t("filterApplied",{label:this.filterLabel,count:this.filterCount}):this.filterLabel}
537
- @click=${()=>a(this,je,Ma).call(this,"cm-filter")}><cm-icon name="filter" size="16"></cm-icon>${this.filterCount>0?c`<span class="count" aria-hidden="true">${this.filterCount}</span>`:h}</button>`:h}
538
- </div>`}};_a=new WeakMap,ip=new WeakMap,Vl=new WeakMap,je=new WeakSet,Ma=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},ov=function(e){this.value=e.target.value},lv=function(e){e.key==="Enter"?a(this,je,Ma).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),a(this,je,Fu).call(this))},Fu=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),a(this,je,Ma).call(this,"input"),a(this,je,Ma).call(this,"change")},Ki.formAssociated=!0,Ki.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Ki.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},Ki.styles=[E,bt,w`
537
+ @click=${()=>a(this,je,_a).call(this,"cm-filter")}><cm-icon name="filter" size="16"></cm-icon>${this.filterCount>0?c`<span class="count" aria-hidden="true">${this.filterCount}</span>`:h}</button>`:h}
538
+ </div>`}};Ta=new WeakMap,rp=new WeakMap,jl=new WeakMap,je=new WeakSet,_a=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},lv=function(e){this.value=e.target.value},cv=function(e){e.key==="Enter"?a(this,je,_a).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),a(this,je,Vu).call(this))},Vu=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),a(this,je,_a).call(this,"input"),a(this,je,_a).call(this,"change")},Wi.formAssociated=!0,Wi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Wi.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},Wi.styles=[E,bt,w`
539
539
  :host { display: block; }
540
540
  :host([size='large']) { --_cm-field-h: var(--cm-control-height-lg, 40px); }
541
541
  @media (pointer: coarse) { :host([size='large']) { --_cm-field-h: var(--cm-control-height-touch, 44px); } button { width: 32px; height: 32px; } }
@@ -569,7 +569,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
569
569
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
570
570
  :host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
571
571
  :host([disabled]) button { cursor: not-allowed; }
572
- `];$("cm-search",Ki);var xk=z("tag",{remove:"Remove {label}"}),rp,cv,Gr=class extends C{constructor(){super(...arguments);m(this,rp);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${a(this,rp,cv)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};rp=new WeakSet,cv=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Gr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Gr.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Gr.styles=[E,w`
572
+ `];$("cm-search",Wi);var $k=z("tag",{remove:"Remove {label}"}),sp,dv,Yr=class extends C{constructor(){super(...arguments);m(this,sp);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${a(this,sp,dv)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};sp=new WeakSet,dv=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Yr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Yr.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Yr.styles=[E,w`
573
573
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
574
574
  .tag {
575
575
  display: inline-flex; align-items: center; gap: var(--cm-space-4); min-width: 0; height: 24px; padding: 0 var(--cm-space-8);
@@ -587,17 +587,17 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
587
587
  button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
588
588
  :host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); }
589
589
  :host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); background: none; }
590
- `];$("cm-tag",Gr);var Lk=z("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item.",grouped:"{group}: {label}",more:"+{count} more"}),Ue,Jr,ze,Wl,za,Gl,Yl,Xl,H,Vu,dv,jl,sp,Ul,li,Ta,Ca,oi,hv,Kl,ju,Uu,Yr,ap,np,Xr,pv,op,lp,cp,mv,uv,Wi=class extends C{constructor(){super(...arguments);m(this,H);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.size="default";this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.maxTags=3;this._query="";this._focusIn=!1;this._active=-1;this._slotted=[];this._typing=!1;m(this,Ue,this.attachInternals());m(this,Jr,new re(this,r(this,Ue)));m(this,ze,N("cm-cb"));m(this,Wl,null);m(this,za,new Map);m(this,Gl,new Map);m(this,Yl,new MutationObserver(()=>a(this,H,Vu).call(this)));m(this,Xl);m(this,li,new we);m(this,ap,()=>{this._focusIn=!0});m(this,np,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});m(this,op,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,H,Ca).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});m(this,lp,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,H,Kl).call(this,1):(a(this,H,Ca).call(this),e.altKey||a(this,H,Kl).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,H,Kl).call(this,-1):(a(this,H,Ca).call(this),a(this,H,Kl).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,H,ju).call(this,this._active)):r(this,H,sp)&&(e.preventDefault(),a(this,H,Uu).call(this,r(this,H,sp)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),a(this,H,oi).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",a(this,H,Ta).call(this)));break;case"ArrowLeft":case"ArrowRight":{let i=e.target;this.multiple&&this.values.length&&se(e,this)==="ArrowLeft"&&i.selectionStart===0&&i.selectionEnd===0&&(e.preventDefault(),a(this,H,oi).call(this),a(this,H,Xr).call(this,this.values.length-1));break}case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":a(this,H,oi).call(this);break;default:}});m(this,cp,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(a(this,H,oi).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?a(this,H,jl).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,H,Vu).call(this),r(this,Yl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,Xl,Uh(this,()=>this.open,()=>a(this,H,oi).call(this))),this.addEventListener("focusin",r(this,ap)),this.addEventListener("focusout",r(this,np))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,li).close(),r(this,Yl).disconnect(),(e=r(this,Xl))==null||e.call(this)}get form(){return r(this,Ue).form}get validity(){return r(this,Ue).validity}get validationMessage(){return r(this,Ue).validationMessage}checkValidity(){return r(this,Ue).checkValidity()}reportValidity(){return r(this,Jr).report(()=>r(this,Ue).reportValidity())}formResetCallback(){let e=r(this,Wl)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1,r(this,Jr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
591
- `):[]:this.value=e)}get items(){return this.options?.length?wa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):wa(this._slotted)}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){g(this,Wl,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,za).set(t.value,t.label),t.group&&r(this,Gl).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?a(this,H,jl).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=a(this,H,Ul).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.open;t&&!r(this,li).active?r(this,li).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,li).active?r(this,li).close():t&&r(this,li).place();let i=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);r(this,Ue).setFormValue(l,this.values.join(`
592
- `))}else r(this,Ue).setFormValue(null);else r(this,Ue).setFormValue(this.value||null,this.value);let s=this.multiple?!this.values.length:!this.value;this.error?r(this,Ue).setValidity({customError:!0},this.error,i):this.required&&s?r(this,Ue).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),i):r(this,Ue).setValidity({}),r(this,Jr).sync(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,ze)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),a(this,H,Ta).call(this))}focus(e){this.renderRoot.querySelector("input")?.focus(e)}render(){let e=a(this,H,Ul).call(this),t=r(this,Jr).message,i=[t&&`${r(this,ze)}-err`,this.helpText&&`${r(this,ze)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=u=>this.multiple?this.values.includes(u):u===this.value,d=(u,b)=>c`<li role="option" id="${r(this,ze)}-o${b}" class=${b===this._active?"active":""}
590
+ `];$("cm-tag",Yr);var Dk=z("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item.",grouped:"{group}: {label}",more:"+{count} more"}),Ue,Qr,ze,Gl,Sa,Yl,Xl,Jl,H,ju,hv,Ul,ap,Kl,ci,Ca,za,li,pv,Wl,Uu,Ku,Xr,np,op,Jr,mv,lp,cp,dp,uv,gv,Gi=class extends C{constructor(){super(...arguments);m(this,H);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.size="default";this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.maxTags=3;this._query="";this._focusIn=!1;this._active=-1;this._slotted=[];this._typing=!1;m(this,Ue,this.attachInternals());m(this,Qr,new re(this,r(this,Ue)));m(this,ze,N("cm-cb"));m(this,Gl,null);m(this,Sa,new Map);m(this,Yl,new Map);m(this,Xl,new MutationObserver(()=>a(this,H,ju).call(this)));m(this,Jl);m(this,ci,new we);m(this,np,()=>{this._focusIn=!0});m(this,op,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});m(this,lp,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,H,za).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});m(this,cp,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,H,Wl).call(this,1):(a(this,H,za).call(this),e.altKey||a(this,H,Wl).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,H,Wl).call(this,-1):(a(this,H,za).call(this),a(this,H,Wl).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,H,Uu).call(this,this._active)):r(this,H,ap)&&(e.preventDefault(),a(this,H,Ku).call(this,r(this,H,ap)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),a(this,H,li).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",a(this,H,Ca).call(this)));break;case"ArrowLeft":case"ArrowRight":{let i=e.target;this.multiple&&this.values.length&&se(e,this)==="ArrowLeft"&&i.selectionStart===0&&i.selectionEnd===0&&(e.preventDefault(),a(this,H,li).call(this),a(this,H,Jr).call(this,this.values.length-1));break}case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":a(this,H,li).call(this);break;default:}});m(this,dp,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(a(this,H,li).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?a(this,H,Ul).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,H,ju).call(this),r(this,Xl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,Jl,Mh(this,()=>this.open,()=>a(this,H,li).call(this))),this.addEventListener("focusin",r(this,np)),this.addEventListener("focusout",r(this,op))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ci).close(),r(this,Xl).disconnect(),(e=r(this,Jl))==null||e.call(this)}get form(){return r(this,Ue).form}get validity(){return r(this,Ue).validity}get validationMessage(){return r(this,Ue).validationMessage}checkValidity(){return r(this,Ue).checkValidity()}reportValidity(){return r(this,Qr).report(()=>r(this,Ue).reportValidity())}formResetCallback(){let e=r(this,Gl)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1,r(this,Qr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
591
+ `):[]:this.value=e)}get items(){return this.options?.length?oa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):oa(this._slotted)}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){g(this,Gl,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,Sa).set(t.value,t.label),t.group&&r(this,Yl).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?a(this,H,Ul).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=a(this,H,Kl).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.open;t&&!r(this,ci).active?r(this,ci).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,ci).active?r(this,ci).close():t&&r(this,ci).place();let i=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);r(this,Ue).setFormValue(l,this.values.join(`
592
+ `))}else r(this,Ue).setFormValue(null);else r(this,Ue).setFormValue(this.value||null,this.value);let s=this.multiple?!this.values.length:!this.value;this.error?r(this,Ue).setValidity({customError:!0},this.error,i):this.required&&s?r(this,Ue).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),i):r(this,Ue).setValidity({}),r(this,Qr).sync(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,ze)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),a(this,H,Ca).call(this))}focus(e){this.renderRoot.querySelector("input")?.focus(e)}render(){let e=a(this,H,Kl).call(this),t=r(this,Qr).message,i=[t&&`${r(this,ze)}-err`,this.helpText&&`${r(this,ze)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=u=>this.multiple?this.values.includes(u):u===this.value,d=(u,b)=>c`<li role="option" id="${r(this,ze)}-o${b}" class=${b===this._active?"active":""}
593
593
  aria-selected=${u.create?"false":l(u.value)?"true":"false"} aria-disabled=${u.disabled?"true":h}
594
- @pointerenter=${()=>!u.disabled&&(this._active=b)} @click=${()=>a(this,H,ju).call(this,b)}>
595
- ${u.create?c`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:u.label})}</span>`:c`${this.multiple?c`<cm-icon class="check" name="check" size="16"></cm-icon>`:h}<span>${a(this,H,mv).call(this,u.label)}</span>`}</li>`,p=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return c`<div class="field">
594
+ @pointermove=${At(()=>{u.disabled||(this._active=b)})} @click=${()=>a(this,H,Uu).call(this,b)}>
595
+ ${u.create?c`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:u.label})}</span>`:c`${this.multiple?c`<cm-icon class="check" name="check" size="16"></cm-icon>`:h}<span>${a(this,H,uv).call(this,u.label)}</span>`}</li>`,p=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return c`<div class="field">
596
596
  ${this.label?c`<label class="label" id="${r(this,ze)}-l" for="${r(this,ze)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
597
597
  <div class="wrap">
598
- <div class="box" part="box" @click=${u=>{u.target.closest("cm-tag[removable]")||a(this,H,Yr).call(this)}}>
598
+ <div class="box" part="box" @click=${u=>{u.target.closest("cm-tag[removable]")||a(this,H,Xr).call(this)}}>
599
599
  <div class="chips ${this.multiple&&this.values.length?`has-tags${this._focusIn||this.open?"":" idle"}`:""}">
600
- ${this.multiple?a(this,H,uv).call(this):h}
600
+ ${this.multiple?a(this,H,gv).call(this):h}
601
601
  <input id="${r(this,ze)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
602
602
  .value=${ee(this._query)} placeholder=${this.multiple&&this.values.length?h:this.placeholder||h}
603
603
  aria-label=${!this.label&&s?s:h}
@@ -605,16 +605,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
605
605
  aria-activedescendant=${this.open&&this._active>=0?`${r(this,ze)}-o${this._active}`:h}
606
606
  aria-invalid=${t?"true":h} aria-describedby=${i||h}
607
607
  aria-required=${this.required?"true":h} ?disabled=${this.disabled}
608
- @input=${r(this,op)} @keydown=${r(this,lp)} @blur=${r(this,cp)}
609
- @click=${()=>{this.open||a(this,H,Ca).call(this)}} @change=${u=>u.stopPropagation()} />
608
+ @input=${r(this,lp)} @keydown=${r(this,cp)} @blur=${r(this,dp)}
609
+ @click=${()=>{this.open||a(this,H,za).call(this)}} @change=${u=>u.stopPropagation()} />
610
610
  </div>
611
- <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?a(this,H,oi).call(this):(a(this,H,Ca).call(this),a(this,H,Yr).call(this))}}></cm-icon>
611
+ <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?a(this,H,li).call(this):(a(this,H,za).call(this),a(this,H,Xr).call(this))}}></cm-icon>
612
612
  </div>
613
613
  <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${u=>u.preventDefault()}>
614
614
  <ul role="listbox" id="${r(this,ze)}-list" part="listbox" ?hidden=${!e.length}
615
615
  aria-labelledby=${this.label?`${r(this,ze)}-l`:h} aria-label=${!this.label&&s?s:h}
616
616
  aria-multiselectable=${this.multiple?"true":h}>
617
- ${Kh(e).map((u,b)=>u.group?c`<li role="group" aria-labelledby="${r(this,ze)}-g${b}"><div role="presentation" class="gh" id="${r(this,ze)}-g${b}">${u.group}</div>
617
+ ${_h(e).map((u,b)=>u.group?c`<li role="group" aria-labelledby="${r(this,ze)}-g${b}"><div role="presentation" class="gh" id="${r(this,ze)}-g${b}">${u.group}</div>
618
618
  <ul role="none" class="gopts">${u.rows.map(({row:f,index:x})=>d(f,x))}</ul></li>`:u.rows.map(({row:f,index:x})=>d(f,x)))}
619
619
  </ul>
620
620
  ${this.loading?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?h:c`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
@@ -624,10 +624,10 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
624
624
  ${t?c`<p class="error" id="${r(this,ze)}-err" role="alert">${t}</p>`:h}
625
625
  ${this.helpText?c`<p class="help" id="${r(this,ze)}-help">${this.helpText}</p>`:h}
626
626
  <slot></slot>
627
- </div>`}};Ue=new WeakMap,Jr=new WeakMap,ze=new WeakMap,Wl=new WeakMap,za=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,H=new WeakSet,Vu=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,s={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(s.group=i.label),s}),!this.hasUpdated){let t=e.filter(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},dv=function(e){return this.items.find(t=>t.value===e)?.label??r(this,za).get(e)??e},jl=function(e){let t=a(this,H,dv).call(this,e);if(!this.showGroup)return t;let i=this.items.find(s=>s.value===e)?.group??r(this,Gl).get(e);return i?this.t("grouped",{group:i,label:t}):t},sp=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},Ul=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,H,sp);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},li=new WeakMap,Ta=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ca=function(){this.disabled||(this.open=!0)},oi=function(){this.open=!1,this._active=-1},hv=function(e=a(this,H,Ul).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},Kl=function(e){let t=a(this,H,hv).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},ju=function(e){let t=a(this,H,Ul).call(this)[e];if(!(!t||t.disabled)){if(t.create){a(this,H,Uu).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,a(this,H,Ta).call(this),a(this,H,Yr).call(this);return}a(this,H,oi).call(this),this._typing=!1,this._query=this.showGroup&&t.group?this.t("grouped",{group:t.group,label:t.label}):t.label,t.value!==this.value&&(this.value=t.value,a(this,H,Ta).call(this))}},Uu=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,za).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(a(this,H,oi).call(this),this.value=e,this._typing=!1,this._query=e),a(this,H,Ta).call(this))},Yr=function(){this.renderRoot.querySelector("input")?.focus()},ap=new WeakMap,np=new WeakMap,Xr=async function(e){await this.updateComplete;let t=this.renderRoot.querySelectorAll("cm-tag[data-i]");e>=0&&e<t.length?t[e].focus():a(this,H,Yr).call(this)},pv=function(e,t){let i=se(e,this),s=this.values.length-1;if(i==="ArrowLeft")e.preventDefault(),a(this,H,Xr).call(this,Math.max(0,t-1));else if(i==="ArrowRight")e.preventDefault(),a(this,H,Xr).call(this,t<s?t+1:-1);else if(i==="Home")e.preventDefault(),a(this,H,Xr).call(this,0);else if(i==="End")e.preventDefault(),a(this,H,Xr).call(this,s);else if(i==="Escape")e.preventDefault(),e.stopPropagation(),a(this,H,Yr).call(this);else if((i==="Backspace"||i==="Delete")&&!this.disabled){e.preventDefault(),this.removeValue(this.values[t]);let l=this.values.length;a(this,H,Xr).call(this,i==="Backspace"?t>0?t-1:l?0:-1:t<l?t:-1)}},op=new WeakMap,lp=new WeakMap,cp=new WeakMap,mv=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:c`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},uv=function(){let e=this.maxTags>0&&!this._focusIn&&!this.open&&this.values.length>this.maxTags?this.maxTags:this.values.length,t=this.values.length-e;return c`${this.values.slice(0,e).map((i,s)=>c`<cm-tag removable tabindex="-1" data-i=${s} part="tag" ?disabled=${this.disabled}
628
- remove-label=${this.t("remove",{label:a(this,H,jl).call(this,i)})}
629
- @keydown=${l=>a(this,H,pv).call(this,l,s)}
630
- @cm-remove=${()=>{this.removeValue(i),a(this,H,Yr).call(this)}}>${a(this,H,jl).call(this,i)}</cm-tag>`)}${t?c`<cm-tag class="more" part="more">${this.t("more",{count:t})}</cm-tag>`:h}`},Wi.formAssociated=!0,Wi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Wi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},size:{reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},maxTags:{type:Number,attribute:"max-tags"},_query:{state:!0},_focusIn:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Wi.styles=[E,bt,Ie,xa,ua,Vi,w`
627
+ </div>`}};Ue=new WeakMap,Qr=new WeakMap,ze=new WeakMap,Gl=new WeakMap,Sa=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,Jl=new WeakMap,H=new WeakSet,ju=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,s={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(s.group=i.label),s}),!this.hasUpdated){let t=e.filter(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},hv=function(e){return this.items.find(t=>t.value===e)?.label??r(this,Sa).get(e)??e},Ul=function(e){let t=a(this,H,hv).call(this,e);if(!this.showGroup)return t;let i=this.items.find(s=>s.value===e)?.group??r(this,Yl).get(e);return i?this.t("grouped",{group:i,label:t}):t},ap=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},Kl=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,H,ap);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},ci=new WeakMap,Ca=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},za=function(){this.disabled||(this.open=!0)},li=function(){this.open=!1,this._active=-1},pv=function(e=a(this,H,Kl).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},Wl=function(e){let t=a(this,H,pv).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},Uu=function(e){let t=a(this,H,Kl).call(this)[e];if(!(!t||t.disabled)){if(t.create){a(this,H,Ku).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,a(this,H,Ca).call(this),a(this,H,Xr).call(this);return}a(this,H,li).call(this),this._typing=!1,this._query=this.showGroup&&t.group?this.t("grouped",{group:t.group,label:t.label}):t.label,t.value!==this.value&&(this.value=t.value,a(this,H,Ca).call(this))}},Ku=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,Sa).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(a(this,H,li).call(this),this.value=e,this._typing=!1,this._query=e),a(this,H,Ca).call(this))},Xr=function(){this.renderRoot.querySelector("input")?.focus()},np=new WeakMap,op=new WeakMap,Jr=async function(e){await this.updateComplete;let t=this.renderRoot.querySelectorAll("cm-tag[data-i]");e>=0&&e<t.length?t[e].focus():a(this,H,Xr).call(this)},mv=function(e,t){let i=se(e,this),s=this.values.length-1;if(i==="ArrowLeft")e.preventDefault(),a(this,H,Jr).call(this,Math.max(0,t-1));else if(i==="ArrowRight")e.preventDefault(),a(this,H,Jr).call(this,t<s?t+1:-1);else if(i==="Home")e.preventDefault(),a(this,H,Jr).call(this,0);else if(i==="End")e.preventDefault(),a(this,H,Jr).call(this,s);else if(i==="Escape")e.preventDefault(),e.stopPropagation(),a(this,H,Xr).call(this);else if((i==="Backspace"||i==="Delete")&&!this.disabled){e.preventDefault(),this.removeValue(this.values[t]);let l=this.values.length;a(this,H,Jr).call(this,i==="Backspace"?t>0?t-1:l?0:-1:t<l?t:-1)}},lp=new WeakMap,cp=new WeakMap,dp=new WeakMap,uv=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:c`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},gv=function(){let e=this.maxTags>0&&!this._focusIn&&!this.open&&this.values.length>this.maxTags?this.maxTags:this.values.length,t=this.values.length-e;return c`${this.values.slice(0,e).map((i,s)=>c`<cm-tag removable tabindex="-1" data-i=${s} part="tag" ?disabled=${this.disabled}
628
+ remove-label=${this.t("remove",{label:a(this,H,Ul).call(this,i)})}
629
+ @keydown=${l=>a(this,H,mv).call(this,l,s)}
630
+ @cm-remove=${()=>{this.removeValue(i),a(this,H,Xr).call(this)}}>${a(this,H,Ul).call(this,i)}</cm-tag>`)}${t?c`<cm-tag class="more" part="more">${this.t("more",{count:t})}</cm-tag>`:h}`},Gi.formAssociated=!0,Gi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Gi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},size:{reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},showGroup:{type:Boolean,attribute:"show-group"},maxTags:{type:Number,attribute:"max-tags"},_query:{state:!0},_focusIn:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Gi.styles=[E,bt,Ie,na,ba,Hi,w`
631
631
  :host { display: block; position: relative; }
632
632
  .wrap { position: relative; }
633
633
  .box {
@@ -668,7 +668,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
668
668
  .create { font-style: normal; }
669
669
  slot { display: none; }
670
670
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
671
- `];$("cm-combobox",Wi);function Jl(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var g0={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function dp(o,n){let e=o.trim().toLowerCase().split("+").map(s=>s.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:g0[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let s of e)if(s==="mod")n?i.meta=!0:i.ctrl=!0;else if(s==="ctrl"||s==="control")i.ctrl=!0;else if(s==="meta"||s==="cmd"||s==="command")i.meta=!0;else if(s==="alt"||s==="option"||s==="opt")i.alt=!0;else if(s==="shift")i.shift=!0;else return null;return i}function Ku(o,n=Jl()){let e=dp(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function Wu(o,n,e=Jl()){let t=dp(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function hp(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var f0={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},b0={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},v0={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},y0=o=>v0[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function pp(o,n=Jl()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=dp(t,n);if(!i)return[o.trim()];let s=n?f0:b0,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(s[d]);e.push(y0(i.key))}return e}function gv(o,n=Jl()){if(/\s/.test(o.trim()))return"";let e=dp(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,s,l)=>s?`${s[0].toUpperCase()}${s.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var Fk=z("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),yt,Zl,ie,mp,Ql,ci,Sa,Gu,up,fv,gp,ec,Yu,bv,Qr=class extends C{constructor(){super(...arguments);m(this,ie);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;m(this,yt,N("cm-gs"));m(this,Zl);m(this,ci,new we);m(this,up,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,ie,Gu).call(this)});m(this,gp,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,ie,fv).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,ie,Ql)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,yt)}-o${this._active}`)?.click());break;case"Escape":r(this,ie,Ql)?(e.preventDefault(),e.stopPropagation(),a(this,ie,Sa).call(this)):this.value&&(e.preventDefault(),a(this,ie,Yu).call(this,!1));break;case"Tab":a(this,ie,Sa).call(this);break;default:}});m(this,ec,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||hp(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,Zl,Uh(this,()=>this.open,()=>a(this,ie,Sa).call(this))),document.addEventListener("keydown",r(this,ec))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ci).close(),(e=r(this,Zl))==null||e.call(this),document.removeEventListener("keydown",r(this,ec))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,ie,mp).call(this).length&&(this._active=-1)}updated(e){let t=r(this,ie,Ql);t&&!r(this,ci).active?r(this,ci).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,ci).active?r(this,ci).close():t&&r(this,ci).place(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,yt)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=a(this,ie,mp).call(this),t=r(this,ie,Ql),i=e.filter(u=>u.item).length,s=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(u=>u?.items?.length),p=(u,b,f="")=>{let x=++l;return Xh({id:`${r(this,yt)}-o${x}`,active:x===this._active,href:u.href,cls:f,onHover:()=>this._active=x,onChoose:v=>a(this,ie,bv).call(this,v,u)},b)};return c`<div class="wrap">
671
+ `];$("cm-combobox",Gi);function Ql(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var f0={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function hp(o,n){let e=o.trim().toLowerCase().split("+").map(s=>s.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:f0[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let s of e)if(s==="mod")n?i.meta=!0:i.ctrl=!0;else if(s==="ctrl"||s==="control")i.ctrl=!0;else if(s==="meta"||s==="cmd"||s==="command")i.meta=!0;else if(s==="alt"||s==="option"||s==="opt")i.alt=!0;else if(s==="shift")i.shift=!0;else return null;return i}function Wu(o,n=Ql()){let e=hp(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function Gu(o,n,e=Ql()){let t=hp(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function pp(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var b0={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},v0={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},y0={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},x0=o=>y0[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function mp(o,n=Ql()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=hp(t,n);if(!i)return[o.trim()];let s=n?b0:v0,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(s[d]);e.push(x0(i.key))}return e}function fv(o,n=Ql()){if(/\s/.test(o.trim()))return"";let e=hp(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,s,l)=>s?`${s[0].toUpperCase()}${s.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var jk=z("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),yt,ec,ie,up,Zl,di,La,Yu,gp,bv,fp,tc,Xu,vv,Zr=class extends C{constructor(){super(...arguments);m(this,ie);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;m(this,yt,N("cm-gs"));m(this,ec);m(this,di,new we);m(this,gp,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,ie,Yu).call(this)});m(this,fp,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,ie,bv).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,ie,Zl)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,yt)}-o${this._active}`)?.click());break;case"Escape":r(this,ie,Zl)?(e.preventDefault(),e.stopPropagation(),a(this,ie,La).call(this)):this.value&&(e.preventDefault(),a(this,ie,Xu).call(this,!1));break;case"Tab":a(this,ie,La).call(this);break;default:}});m(this,tc,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||pp(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,ec,Mh(this,()=>this.open,()=>a(this,ie,La).call(this))),document.addEventListener("keydown",r(this,tc))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,di).close(),(e=r(this,ec))==null||e.call(this),document.removeEventListener("keydown",r(this,tc))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,ie,up).call(this).length&&(this._active=-1)}updated(e){let t=r(this,ie,Zl);t&&!r(this,di).active?r(this,di).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,di).active?r(this,di).close():t&&r(this,di).place(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,yt)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=a(this,ie,up).call(this),t=r(this,ie,Zl),i=e.filter(u=>u.item).length,s=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(u=>u?.items?.length),p=(u,b,f="")=>{let x=++l;return Sh({id:`${r(this,yt)}-o${x}`,active:x===this._active,href:u.href,cls:f,onHover:()=>this._active=x,onChoose:v=>a(this,ie,vv).call(this,v,u)},b)};return c`<div class="wrap">
672
672
  <div class="box" part="box" @click=${u=>{u.target===u.currentTarget&&this.focus()}}>
673
673
  <cm-icon class="icon" name="search" size="16"></cm-icon>
674
674
 
@@ -677,22 +677,22 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
677
677
  aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${r(this,yt)}-list"
678
678
  aria-activedescendant=${t&&this._active>=0?`${r(this,yt)}-o${this._active}`:h}
679
679
  aria-keyshortcuts=${this.shortcut||h}
680
- @input=${r(this,up)} @keydown=${r(this,gp)}
680
+ @input=${r(this,gp)} @keydown=${r(this,fp)}
681
681
  @focus=${()=>{this.value.trim()&&(this.open=!0)}} @click=${()=>{this.value.trim()&&(this.open=!0)}} />
682
- ${this.value?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>a(this,ie,Yu).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?c`<kbd aria-hidden="true">${this.shortcut}</kbd>`:h}
682
+ ${this.value?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>a(this,ie,Xu).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?c`<kbd aria-hidden="true">${this.shortcut}</kbd>`:h}
683
683
  </div>
684
684
  <div class="pop" part="popover" ?hidden=${!t} @pointerdown=${u=>u.preventDefault()}>
685
685
  <div role="listbox" id="${r(this,yt)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
686
686
  ${d.map((u,b)=>{let f=u.total??u.items.length;return c`<div role="group" aria-labelledby="${r(this,yt)}-g${b}">
687
- ${Gh(`${r(this,yt)}-g${b}`,u.label,this.formatNumber(f),this.t("results",{count:f}))}
688
- ${u.items.map(x=>p({group:u,item:x,href:x.href},Yh(x)))}
687
+ ${Ch(`${r(this,yt)}-g${b}`,u.label,this.formatNumber(f),this.t("results",{count:f}))}
688
+ ${u.items.map(x=>p({group:u,item:x,href:x.href},zh(x)))}
689
689
  ${u.href?p({group:u,href:u.href},c`<span class="text">${u.seeAllLabel||this.seeAllLabel}</span>`,"all"):h}
690
690
  </div>`})}
691
691
  </div>
692
692
  ${this.loading?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?h:c`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
693
693
  </div>
694
694
  <span class="vh" role="status" aria-live="polite">${s}</span>
695
- </div>`}};yt=new WeakMap,Zl=new WeakMap,ie=new WeakSet,mp=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Ql=function(){return this.open&&!!this.value.trim()},ci=new WeakMap,Sa=function(){this.open=!1,this._active=-1},Gu=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},up=new WeakMap,fv=function(e){this._active=Jh(this._active,e,a(this,ie,mp).call(this).length)},gp=new WeakMap,ec=new WeakMap,Yu=function(e=!0){this.value="",a(this,ie,Sa).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,ie,Gu).call(this)},bv=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),a(this,ie,Sa).call(this)},Qr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Qr.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},Qr.styles=[E,Ie,xa,Vi,Wh,w`
695
+ </div>`}};yt=new WeakMap,ec=new WeakMap,ie=new WeakSet,up=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Zl=function(){return this.open&&!!this.value.trim()},di=new WeakMap,La=function(){this.open=!1,this._active=-1},Yu=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},gp=new WeakMap,bv=function(e){this._active=Lh(this._active,e,a(this,ie,up).call(this).length)},fp=new WeakMap,tc=new WeakMap,Xu=function(e=!0){this.value="",a(this,ie,La).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,ie,Yu).call(this)},vv=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),a(this,ie,La).call(this)},Zr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Zr.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},Zr.styles=[E,Ie,na,Hi,Th,w`
696
696
  :host { display: block; position: relative; }
697
697
  .wrap { position: relative; }
698
698
  .box {
@@ -722,15 +722,15 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
722
722
  overflow-y: auto; max-height: var(--cm-global-search-results-max-height, min(480px, calc(100dvh - 140px)));
723
723
  }
724
724
  @media (pointer: coarse) { .box { min-height: var(--cm-control-height-touch); } input { font-size: var(--cm-font-size-16); } }
725
- `];$("cm-global-search",Qr);var Xu=0,vv="",yv="";function tc(){if(Xu++===0){let o=document.documentElement;vv=o.style.overflow,yv=o.style.scrollbarGutter,window.innerWidth-o.clientWidth>0&&(o.style.scrollbarGutter="stable"),o.style.overflow="hidden"}}function Gi(){if(Xu>0&&--Xu===0){let o=document.documentElement;o.style.overflow=vv,o.style.scrollbarGutter=yv}}function Ju(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var La,di,Aa,Da,fp,bp,vp,yp,xp,wp,le=class extends C{constructor(){super(...arguments);m(this,Da);this.open=!1;this.label="";this.uid=N("cm-ovl");m(this,La,null);m(this,di,!1);m(this,Aa,!1);m(this,bp,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});m(this,vp,e=>{e.preventDefault(),this.requestClose("escape")});m(this,yp,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,Da,fp).call(this))});m(this,xp,e=>{g(this,Aa,e.target===e.currentTarget)});m(this,wp,e=>{if(e.target===e.currentTarget&&r(this,Aa)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}g(this,Aa,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}closeNow(){this.open=!1;let e=this.dialog;e?.open&&(e.close(),a(this,Da,fp).call(this))}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(g(this,La,Ju()),!this.isConnected)return;t.showModal(),r(this,di)||(tc(),g(this,di,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),a(this,Da,fp).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),r(this,di)&&(Gi(),g(this,di,!1))}renderHeader(e=h){return c`<header class="head" part="header">
725
+ `];$("cm-global-search",Zr);var Ju=0,yv="",xv="";function ic(){if(Ju++===0){let o=document.documentElement;yv=o.style.overflow,xv=o.style.scrollbarGutter,window.innerWidth-o.clientWidth>0&&(o.style.scrollbarGutter="stable"),o.style.overflow="hidden"}}function Yi(){if(Ju>0&&--Ju===0){let o=document.documentElement;o.style.overflow=yv,o.style.scrollbarGutter=xv}}function Qu(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var Aa,hi,Da,Ra,bp,vp,yp,xp,wp,$p,le=class extends C{constructor(){super(...arguments);m(this,Ra);this.open=!1;this.label="";this.uid=N("cm-ovl");m(this,Aa,null);m(this,hi,!1);m(this,Da,!1);m(this,vp,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});m(this,yp,e=>{e.preventDefault(),this.requestClose("escape")});m(this,xp,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,Ra,bp).call(this))});m(this,wp,e=>{g(this,Da,e.target===e.currentTarget)});m(this,$p,e=>{if(e.target===e.currentTarget&&r(this,Da)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}g(this,Da,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}closeNow(){this.open=!1;let e=this.dialog;e?.open&&(e.close(),a(this,Ra,bp).call(this))}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(g(this,Aa,Qu()),!this.isConnected)return;t.showModal(),r(this,hi)||(ic(),g(this,hi,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),a(this,Ra,bp).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),r(this,hi)&&(Yi(),g(this,hi,!1))}renderHeader(e=h){return c`<header class="head" part="header">
726
726
  <h2 id="${this.uid}-h">${this.heading}</h2>${e}
727
727
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
728
728
  <cm-icon name="close" size="18"></cm-icon></button>
729
729
  </header>`}renderDialog(e,t=""){return c`<dialog part="dialog" class=${t}
730
730
  aria-labelledby=${this.heading?`${this.uid}-h`:h}
731
731
  aria-label=${!this.heading&&this.label?this.label:h}
732
- @keydown=${r(this,bp)} @cancel=${r(this,vp)} @close=${r(this,yp)}
733
- @pointerdown=${r(this,xp)} @click=${r(this,wp)}>${e}</dialog>`}};La=new WeakMap,di=new WeakMap,Aa=new WeakMap,Da=new WeakSet,fp=function(){r(this,di)&&(Gi(),g(this,di,!1));let e=r(this,La);g(this,La,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},bp=new WeakMap,vp=new WeakMap,yp=new WeakMap,xp=new WeakMap,wp=new WeakMap,le.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},le.overlayStyles=[E,w`
732
+ @keydown=${r(this,vp)} @cancel=${r(this,yp)} @close=${r(this,xp)}
733
+ @pointerdown=${r(this,wp)} @click=${r(this,$p)}>${e}</dialog>`}};Aa=new WeakMap,hi=new WeakMap,Da=new WeakMap,Ra=new WeakSet,bp=function(){r(this,hi)&&(Yi(),g(this,hi,!1));let e=r(this,Aa);g(this,Aa,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},vp=new WeakMap,yp=new WeakMap,xp=new WeakMap,wp=new WeakMap,$p=new WeakMap,le.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},le.overlayStyles=[E,w`
734
734
  :host { display: contents; }
735
735
  dialog {
736
736
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: inherit;
@@ -762,7 +762,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
762
762
 
763
763
  }
764
764
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
765
- `];var rE=z("commandPalette",{label:"Command palette",placeholder:"Search or run a command",recent:"Recent",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all"}),xv=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function wv(o,n){let e=xv(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=xv([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var rc,De,Qu,Zu,ic,$p,kp,$v,kv,Ra=class extends le{constructor(){super();m(this,De);this.value="";this.results=[];this.actions=[];this.recent=[];this.loading=!1;this.shortcut="";this._active=-1;m(this,rc,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!Wu(e,this.shortcut)||!this.open&&!Ku(this.shortcut)&&hp(e)||this.open&&!Ku(this.shortcut)||(e.preventDefault(),this.toggle())});m(this,$p,e=>{this.value=e.target.value,this._active=a(this,De,ic).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});m(this,kp,e=>{let t=a(this,De,ic).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Jh(this._active,e.key==="ArrowDown"?1:-1,t);break;case"Home":case"End":if(e.shiftKey||!t)break;e.preventDefault(),this._active=e.key==="Home"?0:t-1;break;case"Enter":if(e.isComposing||this._active<0)break;e.preventDefault(),this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.click();break;default:}});this.label=void 0}toggle(){this.open?this.requestClose("method"):this.show()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",r(this,rc))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,rc))}willUpdate(e){if(super.willUpdate?.(e),e.has("open")&&!this.open&&e.get("open")&&(this.value="",this._active=-1),["results","actions","recent","loading","value","open"].some(t=>e.has(t))){let t=a(this,De,ic).call(this).length;(this._active>=t||this._active<0)&&(this._active=t?0:-1)}}updated(e){super.updated(e),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.scrollIntoView({block:"nearest"})}focusFirst(){let e=this.renderRoot.querySelector("input");e?.focus(),e?.select()}render(){let e=this.open?a(this,De,Zu).call(this):[],t=a(this,De,ic).call(this,e),i=r(this,De,Qu),s=t.filter(u=>u.item).length,l=!this.open||!i?"":this.loading?this.loadingText:t.length?this.t("results",{count:s}):this.emptyText,d=this.uid,p=-1;return this.renderDialog(c`<div class="panel" part="panel">
765
+ `];var aE=z("commandPalette",{label:"Command palette",placeholder:"Search or run a command",recent:"Recent",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all"}),wv=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function $v(o,n){let e=wv(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=wv([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var sc,De,Zu,eg,rc,kp,Ep,kv,Ev,Ha=class extends le{constructor(){super();m(this,De);this.value="";this.results=[];this.actions=[];this.recent=[];this.loading=!1;this.shortcut="";this._active=-1;m(this,sc,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!Gu(e,this.shortcut)||!this.open&&!Wu(this.shortcut)&&pp(e)||this.open&&!Wu(this.shortcut)||(e.preventDefault(),this.toggle())});m(this,kp,e=>{this.value=e.target.value,this._active=a(this,De,rc).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});m(this,Ep,e=>{let t=a(this,De,rc).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Lh(this._active,e.key==="ArrowDown"?1:-1,t);break;case"Home":case"End":if(e.shiftKey||!t)break;e.preventDefault(),this._active=e.key==="Home"?0:t-1;break;case"Enter":if(e.isComposing||this._active<0)break;e.preventDefault(),this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.click();break;default:}});this.label=void 0}toggle(){this.open?this.requestClose("method"):this.show()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",r(this,sc))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,sc))}willUpdate(e){if(super.willUpdate?.(e),e.has("open")&&!this.open&&e.get("open")&&(this.value="",this._active=-1),["results","actions","recent","loading","value","open"].some(t=>e.has(t))){let t=a(this,De,rc).call(this).length;(this._active>=t||this._active<0)&&(this._active=t?0:-1)}}updated(e){super.updated(e),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.scrollIntoView({block:"nearest"})}focusFirst(){let e=this.renderRoot.querySelector("input");e?.focus(),e?.select()}render(){let e=this.open?a(this,De,eg).call(this):[],t=a(this,De,rc).call(this,e),i=r(this,De,Zu),s=t.filter(u=>u.item).length,l=!this.open||!i?"":this.loading?this.loadingText:t.length?this.t("results",{count:s}):this.emptyText,d=this.uid,p=-1;return this.renderDialog(c`<div class="panel" part="panel">
766
766
  <div class="top">
767
767
  <div class="box" part="box">
768
768
  <cm-icon name="search" size="16"></cm-icon>
@@ -770,8 +770,8 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
770
770
  aria-label=${this.label} placeholder=${this.placeholder||h} .value=${ee(this.value)}
771
771
  aria-autocomplete="list" aria-expanded=${t.length?"true":"false"} aria-controls="${d}-list"
772
772
  aria-activedescendant=${this._active>=0&&t.length?`${d}-o${this._active}`:h}
773
- @input=${r(this,$p)} @keydown=${r(this,kp)} />
774
- <kbd class="esc" aria-hidden="true">${pp("escape")[0]}</kbd>
773
+ @input=${r(this,kp)} @keydown=${r(this,Ep)} />
774
+ <kbd class="esc" aria-hidden="true">${mp("escape")[0]}</kbd>
775
775
  </div>
776
776
  <button type="button" class="x" part="close" aria-label=${this.closeLabel} @click=${()=>this.requestClose("close-button")}>
777
777
  <cm-icon name="close" size="18"></cm-icon></button>
@@ -780,14 +780,14 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
780
780
  ${this.loading&&i?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:h}
781
781
  <div role="listbox" id="${d}-list" part="listbox" aria-label=${this.label} ?hidden=${!t.length}>
782
782
  ${e.map((u,b)=>c`<div role="group" aria-labelledby="${d}-g${b}">
783
- ${Gh(`${d}-g${b}`,u.group.label,u.group.total!==void 0?this.formatNumber(u.group.total):void 0,this.t("results",{count:u.group.total??0}))}
784
- ${u.rows.map(f=>{let x=++p,v=f.item;return Xh({id:`${d}-o${x}`,active:x===this._active,href:f.href,cls:v?"":"all",keyshortcuts:v?.shortcut?gv(v.shortcut):void 0,onHover:()=>this._active=x,onChoose:k=>a(this,De,$v).call(this,k,f)},v?Yh(v,a(this,De,kv).call(this,v.shortcut)):c`<span class="text">${f.group.seeAllLabel||this.seeAllLabel}</span>`)})}
783
+ ${Ch(`${d}-g${b}`,u.group.label,u.group.total!==void 0?this.formatNumber(u.group.total):void 0,this.t("results",{count:u.group.total??0}))}
784
+ ${u.rows.map(f=>{let x=++p,v=f.item;return Sh({id:`${d}-o${x}`,active:x===this._active,href:f.href,cls:v?"":"all",keyshortcuts:v?.shortcut?fv(v.shortcut):void 0,onHover:()=>this._active=x,onChoose:k=>a(this,De,kv).call(this,k,f)},v?zh(v,a(this,De,Ev).call(this,v.shortcut)):c`<span class="text">${f.group.seeAllLabel||this.seeAllLabel}</span>`)})}
785
785
  </div>`)}
786
786
  </div>
787
787
  ${i&&!this.loading&&!t.length?c`<p class="message" aria-hidden="true">${this.emptyText}</p>`:h}
788
788
  </div>
789
789
  <span class="vh" role="status" aria-live="polite">${l}</span>
790
- </div>`)}};rc=new WeakMap,De=new WeakSet,Qu=function(){return this.value.trim()},Zu=function(){let e=r(this,De,Qu),t=[],i=(s,l,d=!1)=>{let p=l.map(u=>({group:s,item:u,href:u.href}));d&&s.href&&p.push({group:s,href:s.href}),l.length&&t.push({group:s,rows:p})};if(!e)this.recent?.length&&i({label:this.recentLabel,items:this.recent},this.recent);else if(!this.loading)for(let s of this.results??[])s?.items?.length&&i(s,s.items,!0);for(let s of this.actions??[])s?.items?.length&&i(s,e?s.items.filter(l=>wv(l,e)):s.items);return t},ic=function(e=a(this,De,Zu).call(this)){return e.flatMap(t=>t.rows)},$p=new WeakMap,kp=new WeakMap,$v=function(e,t){if(this.closeNow(),!this.dispatchEvent(new CustomEvent("cm-select",{detail:{item:t.item,group:t.group,href:t.href},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}t.item?.run?.(t.item)},kv=function(e){return e?c`<span class="keys" aria-hidden="true">${pp(e).map(t=>c`<kbd>${t}</kbd>`)}</span>`:h},Ra.properties={...le.properties,label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},actions:{type:Array},recent:{type:Array},loading:{type:Boolean,reflect:!0},shortcut:{},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},recentLabel:{attribute:"recent-label",string:"recent"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},_active:{state:!0}},Ra.styles=[...le.overlayStyles,xa,Vi,Wh,w`
790
+ </div>`)}};sc=new WeakMap,De=new WeakSet,Zu=function(){return this.value.trim()},eg=function(){let e=r(this,De,Zu),t=[],i=(s,l,d=!1)=>{let p=l.map(u=>({group:s,item:u,href:u.href}));d&&s.href&&p.push({group:s,href:s.href}),l.length&&t.push({group:s,rows:p})};if(!e)this.recent?.length&&i({label:this.recentLabel,items:this.recent},this.recent);else if(!this.loading)for(let s of this.results??[])s?.items?.length&&i(s,s.items,!0);for(let s of this.actions??[])s?.items?.length&&i(s,e?s.items.filter(l=>$v(l,e)):s.items);return t},rc=function(e=a(this,De,eg).call(this)){return e.flatMap(t=>t.rows)},kp=new WeakMap,Ep=new WeakMap,kv=function(e,t){if(this.closeNow(),!this.dispatchEvent(new CustomEvent("cm-select",{detail:{item:t.item,group:t.group,href:t.href},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}t.item?.run?.(t.item)},Ev=function(e){return e?c`<span class="keys" aria-hidden="true">${mp(e).map(t=>c`<kbd>${t}</kbd>`)}</span>`:h},Ha.properties={...le.properties,label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},actions:{type:Array},recent:{type:Array},loading:{type:Boolean,reflect:!0},shortcut:{},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},recentLabel:{attribute:"recent-label",string:"recent"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},_active:{state:!0}},Ha.styles=[...le.overlayStyles,na,Hi,Th,w`
791
791
  dialog {
792
792
  position: fixed; inset: 0; margin: max(var(--cm-space-16), 12dvh) auto auto; height: fit-content;
793
793
  width: min(var(--cm-command-palette-width, 640px), calc(100vw - 32px));
@@ -828,7 +828,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
828
828
  .x { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
829
829
  [role='option'] { min-height: var(--cm-control-height-touch); }
830
830
  }
831
- `];$("cm-command-palette",Ra);var x0=/^(\d{4})-(\d{2})-(\d{2})$/;function R(o){let n=x0.exec(o??"");if(!n)return null;let e=new Date(+n[1],+n[2]-1,+n[3]);return e.getFullYear()===+n[1]&&e.getMonth()===+n[2]-1&&e.getDate()===+n[3]?e:null}var jt=(o,n=2)=>String(o).padStart(n,"0"),B=o=>`${jt(o.getFullYear(),4)}-${jt(o.getMonth()+1)}-${jt(o.getDate())}`,eg=()=>B(new Date),te=(o,n)=>new Date(o.getFullYear(),o.getMonth(),o.getDate()+n);function be(o,n){let e=new Date(o.getFullYear(),o.getMonth()+n,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(o.getDate(),t))}var Se=o=>new Date(o.getFullYear(),o.getMonth(),1),Zr=o=>new Date(o.getFullYear(),o.getMonth()+1,0);var w0=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function Ee(o){let n=w0.exec(o??"");return n?+n[1]*60+ +n[2]:null}var hi=o=>{let n=(Math.round(o)%1440+1440)%1440;return`${jt(Math.floor(n/60))}:${jt(n%60)}`};function xt(o){let[n="",e=""]=(o??"").split("T"),t=Ee(e);return{date:R(n)?n:"",time:t===null?"":hi(t)}}function Ut(o,n=!1){let{date:e,time:t}=xt(o),i=R(e);if(!i)return null;let s=t?Ee(t):n?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(s/60),s%60)}var _v=()=>{let o=new Date;return`${B(o)}T${jt(o.getHours())}:${jt(o.getMinutes())}`},Ev=new Map;function Ha(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=Ev.get(t);if(i)return i;let s={hour:e==="h23"?"2-digit":"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},l=new Intl.DateTimeFormat(o,s),d=l.resolvedOptions().hourCycle,p=k=>new Date(2e3,0,1,k,30),u=k=>(new Intl.DateTimeFormat(o,{hour:"numeric",hourCycle:"h12"}).formatToParts(p(k)).find(L=>L.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),b=(k,L)=>[...new Set([k,...L].filter(Boolean))],f=k=>k.replace(/[\u202f\u00a0]/g," "),x=f(l.formatToParts(p(9)).map(k=>k.type==="hour"?"{h}":k.type==="minute"?"{m}":k.value).join("")),v={format:k=>f(l.format(new Date(2e3,0,1,Math.floor(k/60),k%60))),dateTime:k=>ue(k,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},o),pattern:x,hour12:d==="h12"||d==="h11",am:b(u(9),["am","a"]),pm:b(u(15),["pm","p"])};return Ev.set(t,v),v}var Ep=(o,n)=>o.pattern.replace(/\{([hm])\}/g,(e,t)=>n[t]);function es(o,n){let e=o.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&n.pm.includes(t),s=!!t&&n.am.includes(t);if(t&&!i&&!s)return null;let l=e.match(/\d+/g)??[],d,p;if(l.length===1){let u=l[0];if(u.length<=2)d=+u,p=0;else if(u.length<=4)d=+u.slice(0,-2),p=+u.slice(-2);else return null}else if(l.length===2||l.length===3){if(l[0].length>2||l[1].length!==2)return null;d=+l[0],p=+l[1]}else return null;if(p>59)return null;if(s||i){if(d<1||d>12)return null;d=d%12+(i?12:0)}else if(d>23)return null;return hi(d*60+p)}var Na={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},sc=o=>Array.isArray(o)?o:typeof o=="string"?Na.fromAttribute(o):[];function Yi(o,n){let e=[n,wl(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function Pa(o){try{let n=new Intl.Locale(o),e=n.getWeekInfo?.()??n.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var Mv=new Map;function Ia(o){let n=Mv.get(o);if(n)return n;let e=v=>new Intl.DateTimeFormat(o,v),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),s=e({weekday:"long"}),l=new Date(2024,0,7),d=t.formatToParts(new Date(2026,10,15)),p=d.filter(v=>v.type==="day"||v.type==="month"||v.type==="year").map(v=>v.type),u=d.map(v=>v.type==="day"?"{d}":v.type==="month"?"{m}":v.type==="year"?"{y}":v.value).join(""),b=(v,k)=>Array.from({length:12},(L,P)=>new Intl.DateTimeFormat(v,{month:k}).format(new Date(2024,P,1)).toLowerCase().replace(/\./g,"")),f=Array.from({length:12},(v,k)=>[...new Set([b(o,"long")[k],b(o,"short")[k],b("en","long")[k],b("en","short")[k]])]),x={short:v=>t.format(v),long:v=>ue(v,{weekday:"long",day:"numeric",month:"long",year:"numeric"},o),medium:v=>ue(v,{day:"numeric",month:"short",year:"numeric"},o),monthYear:v=>ue(v,{month:"long",year:"numeric"},o),day:v=>ue(v,{day:"numeric"},o),weekdaysShort:Array.from({length:7},(v,k)=>i.format(te(l,k))),weekdaysLong:Array.from({length:7},(v,k)=>s.format(te(l,k))),pattern:p.length===3?u:"{y}-{m}-{d}",order:p.length===3?p:["year","month","day"],months:f};return Mv.set(o,x),x}var Mp=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function qa(o,n){let e=o.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,s,l,d=t.findIndex(u=>/\p{L}/u.test(u));if(d>=0){let u=t[d];s=n.months.findIndex(v=>v.some(k=>k===u||u.length>=3&&k.startsWith(u)))+1;let b=t.filter((v,k)=>k!==d);if(!s||b.some(v=>!/^\d+$/.test(v)))return null;let f=b.findIndex(v=>v.length===4),x=f>=0?f:1;i=+b[x],l=+b[1-x],b[x].length<=2&&(i+=2e3)}else{if(t.some(f=>!/^\d+$/.test(f)))return null;let u=t[0].length===4?["year","month","day"]:n.order,b=f=>t[u.indexOf(f)];if(i=+b("year"),s=+b("month"),l=+b("day"),b("year").length<=2)i+=2e3;else if(b("year").length!==4)return null}let p=`${jt(i,4)}-${jt(s)}-${jt(l)}`;return R(p)?p:null}function _p(o,n,e,t){let i=(e.getDay()-t+7)%7;switch(o){case"ArrowRight":return te(e,1);case"ArrowLeft":return te(e,-1);case"ArrowDown":return te(e,7);case"ArrowUp":return te(e,-7);case"Home":return te(e,-i);case"End":return te(e,6-i);case"PageDown":return be(e,n.shiftKey?12:1);case"PageUp":return be(e,n.shiftKey?-12:-1);default:return null}}var Kt=(o,n,e)=>n&&o<n?n:e&&o>e?e:o;function ac(o){let{fmt:n,firstDay:e,month:t,focus:i,min:s,max:l}=o,d=Se(t),p=(d.getDay()-e+7)%7,u=Zr(t).getDate(),b=[],f=Array(p).fill(null);for(let q=1;q<=u;q++)f.push(new Date(t.getFullYear(),t.getMonth(),q)),f.length===7&&(b.push(f),f=[]);f.length&&b.push([...f,...Array(7-f.length).fill(null)]);let x=Array.from({length:7},(q,O)=>(O+e)%7),v=eg(),k=!!s&&Zr(be(d,-1))<s,L=!!l&&be(d,1)>l,P=c`<thead class=${o.head==="title"?"vh-head":""}><tr>${x.map(q=>c`<th scope="col" abbr=${n.weekdaysLong[q]}><span aria-hidden="true">${n.weekdaysShort[q]}</span><span class="vh">${n.weekdaysLong[q]}</span></th>`)}</tr></thead>`,U=o.head==="title"?c`<h3 id="${o.id}-month" class="cal-month" part="calendar-month">${n.monthYear(t)}</h3>`:c`<div class="cal-head">
831
+ `];$("cm-command-palette",Ha);var w0=/^(\d{4})-(\d{2})-(\d{2})$/;function R(o){let n=w0.exec(o??"");if(!n)return null;let e=new Date(+n[1],+n[2]-1,+n[3]);return e.getFullYear()===+n[1]&&e.getMonth()===+n[2]-1&&e.getDate()===+n[3]?e:null}var Ut=(o,n=2)=>String(o).padStart(n,"0"),B=o=>`${Ut(o.getFullYear(),4)}-${Ut(o.getMonth()+1)}-${Ut(o.getDate())}`,tg=()=>B(new Date),te=(o,n)=>new Date(o.getFullYear(),o.getMonth(),o.getDate()+n);function be(o,n){let e=new Date(o.getFullYear(),o.getMonth()+n,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(o.getDate(),t))}var Se=o=>new Date(o.getFullYear(),o.getMonth(),1),es=o=>new Date(o.getFullYear(),o.getMonth()+1,0);var $0=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function Ee(o){let n=$0.exec(o??"");return n?+n[1]*60+ +n[2]:null}var pi=o=>{let n=(Math.round(o)%1440+1440)%1440;return`${Ut(Math.floor(n/60))}:${Ut(n%60)}`};function xt(o){let[n="",e=""]=(o??"").split("T"),t=Ee(e);return{date:R(n)?n:"",time:t===null?"":pi(t)}}function Kt(o,n=!1){let{date:e,time:t}=xt(o),i=R(e);if(!i)return null;let s=t?Ee(t):n?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(s/60),s%60)}var Tv=()=>{let o=new Date;return`${B(o)}T${Ut(o.getHours())}:${Ut(o.getMinutes())}`},Mv=new Map;function Na(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=Mv.get(t);if(i)return i;let s={hour:e==="h23"?"2-digit":"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},l=new Intl.DateTimeFormat(o,s),d=l.resolvedOptions().hourCycle,p=k=>new Date(2e3,0,1,k,30),u=k=>(new Intl.DateTimeFormat(o,{hour:"numeric",hourCycle:"h12"}).formatToParts(p(k)).find(L=>L.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),b=(k,L)=>[...new Set([k,...L].filter(Boolean))],f=k=>k.replace(/[\u202f\u00a0]/g," "),x=f(l.formatToParts(p(9)).map(k=>k.type==="hour"?"{h}":k.type==="minute"?"{m}":k.value).join("")),v={format:k=>f(l.format(new Date(2e3,0,1,Math.floor(k/60),k%60))),dateTime:k=>ue(k,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},o),pattern:x,hour12:d==="h12"||d==="h11",am:b(u(9),["am","a"]),pm:b(u(15),["pm","p"])};return Mv.set(t,v),v}var Mp=(o,n)=>o.pattern.replace(/\{([hm])\}/g,(e,t)=>n[t]);function ts(o,n){let e=o.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&n.pm.includes(t),s=!!t&&n.am.includes(t);if(t&&!i&&!s)return null;let l=e.match(/\d+/g)??[],d,p;if(l.length===1){let u=l[0];if(u.length<=2)d=+u,p=0;else if(u.length<=4)d=+u.slice(0,-2),p=+u.slice(-2);else return null}else if(l.length===2||l.length===3){if(l[0].length>2||l[1].length!==2)return null;d=+l[0],p=+l[1]}else return null;if(p>59)return null;if(s||i){if(d<1||d>12)return null;d=d%12+(i?12:0)}else if(d>23)return null;return pi(d*60+p)}var Pa={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},ac=o=>Array.isArray(o)?o:typeof o=="string"?Pa.fromAttribute(o):[];function Xi(o,n){let e=[n,$l(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function Ia(o){try{let n=new Intl.Locale(o),e=n.getWeekInfo?.()??n.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var _v=new Map;function qa(o){let n=_v.get(o);if(n)return n;let e=v=>new Intl.DateTimeFormat(o,v),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),s=e({weekday:"long"}),l=new Date(2024,0,7),d=t.formatToParts(new Date(2026,10,15)),p=d.filter(v=>v.type==="day"||v.type==="month"||v.type==="year").map(v=>v.type),u=d.map(v=>v.type==="day"?"{d}":v.type==="month"?"{m}":v.type==="year"?"{y}":v.value).join(""),b=(v,k)=>Array.from({length:12},(L,P)=>new Intl.DateTimeFormat(v,{month:k}).format(new Date(2024,P,1)).toLowerCase().replace(/\./g,"")),f=Array.from({length:12},(v,k)=>[...new Set([b(o,"long")[k],b(o,"short")[k],b("en","long")[k],b("en","short")[k]])]),x={short:v=>t.format(v),long:v=>ue(v,{weekday:"long",day:"numeric",month:"long",year:"numeric"},o),medium:v=>ue(v,{day:"numeric",month:"short",year:"numeric"},o),monthYear:v=>ue(v,{month:"long",year:"numeric"},o),day:v=>ue(v,{day:"numeric"},o),weekdaysShort:Array.from({length:7},(v,k)=>i.format(te(l,k))),weekdaysLong:Array.from({length:7},(v,k)=>s.format(te(l,k))),pattern:p.length===3?u:"{y}-{m}-{d}",order:p.length===3?p:["year","month","day"],months:f};return _v.set(o,x),x}var _p=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function Oa(o,n){let e=o.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,s,l,d=t.findIndex(u=>/\p{L}/u.test(u));if(d>=0){let u=t[d];s=n.months.findIndex(v=>v.some(k=>k===u||u.length>=3&&k.startsWith(u)))+1;let b=t.filter((v,k)=>k!==d);if(!s||b.some(v=>!/^\d+$/.test(v)))return null;let f=b.findIndex(v=>v.length===4),x=f>=0?f:1;i=+b[x],l=+b[1-x],b[x].length<=2&&(i+=2e3)}else{if(t.some(f=>!/^\d+$/.test(f)))return null;let u=t[0].length===4?["year","month","day"]:n.order,b=f=>t[u.indexOf(f)];if(i=+b("year"),s=+b("month"),l=+b("day"),b("year").length<=2)i+=2e3;else if(b("year").length!==4)return null}let p=`${Ut(i,4)}-${Ut(s)}-${Ut(l)}`;return R(p)?p:null}function Tp(o,n,e,t){let i=(e.getDay()-t+7)%7;switch(o){case"ArrowRight":return te(e,1);case"ArrowLeft":return te(e,-1);case"ArrowDown":return te(e,7);case"ArrowUp":return te(e,-7);case"Home":return te(e,-i);case"End":return te(e,6-i);case"PageDown":return be(e,n.shiftKey?12:1);case"PageUp":return be(e,n.shiftKey?-12:-1);default:return null}}var Wt=(o,n,e)=>n&&o<n?n:e&&o>e?e:o;function nc(o){let{fmt:n,firstDay:e,month:t,focus:i,min:s,max:l}=o,d=Se(t),p=(d.getDay()-e+7)%7,u=es(t).getDate(),b=[],f=Array(p).fill(null);for(let q=1;q<=u;q++)f.push(new Date(t.getFullYear(),t.getMonth(),q)),f.length===7&&(b.push(f),f=[]);f.length&&b.push([...f,...Array(7-f.length).fill(null)]);let x=Array.from({length:7},(q,O)=>(O+e)%7),v=tg(),k=!!s&&es(be(d,-1))<s,L=!!l&&be(d,1)>l,P=c`<thead class=${o.head==="title"?"vh-head":""}><tr>${x.map(q=>c`<th scope="col" abbr=${n.weekdaysLong[q]}><span aria-hidden="true">${n.weekdaysShort[q]}</span><span class="vh">${n.weekdaysLong[q]}</span></th>`)}</tr></thead>`,U=o.head==="title"?c`<h3 id="${o.id}-month" class="cal-month" part="calendar-month">${n.monthYear(t)}</h3>`:c`<div class="cal-head">
832
832
  ${o.hideNav==="previous"?c`<span class="cal-nav-gap"></span>`:c`<button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.previousLabel} ?disabled=${k} @click=${()=>o.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>`}
833
833
  <h2 id="${o.id}-month" class="cal-title" aria-live="polite">${n.monthYear(t)}</h2>
834
834
  ${o.hideNav==="next"?c`<span class="cal-nav-gap"></span>`:c`<button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.nextLabel} ?disabled=${L} @click=${()=>o.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>`}
@@ -841,7 +841,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
841
841
  aria-current=${ve===v?"date":h}
842
842
  aria-label="${n.long(O)}${Z?`, ${Z}`:""}"
843
843
  @click=${()=>!G&&o.onPick(O)} @pointerenter=${()=>o.onHover?.(O)}><span aria-hidden="true">${n.day(O)}</span></td>`})}</tr>`)}</tbody>
844
- </table>`}var Tp=w`
844
+ </table>`}var Cp=w`
845
845
  .pop {
846
846
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-8)); inset-inline-start: 0;
847
847
  width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-12);
@@ -875,7 +875,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
875
875
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
876
876
  }
877
877
  @media (max-width: 640px) { .day, .empty { height: 36px; } }
878
- `;function Cp(o,n){if(o.key!=="Tab")return;let e=[...n.querySelectorAll('button:not([disabled]), input:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=n.getRootNode(),i=e.indexOf(t.activeElement);o.preventDefault(),e[(i+(o.shiftKey?-1:1)+e.length)%e.length].focus()}var Oa=w`
878
+ `;function zp(o,n){if(o.key!=="Tab")return;let e=[...n.querySelectorAll('button:not([disabled]), input:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=n.getRootNode(),i=e.indexOf(t.activeElement);o.preventDefault(),e[(i+(o.shiftKey?-1:1)+e.length)%e.length].focus()}var Ba=w`
879
879
  ${bt}
880
880
  :host { display: block; position: relative; }
881
881
  .wrap { position: relative; }
@@ -907,69 +907,69 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
907
907
  .wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); }
908
908
  .wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
909
909
  .wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--_cm-field-pad); }
910
- `;var bE=z("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),ja,$e,rs,wt,Ua,gi,Zi,tt,lt,Ka,Wa,M,nc,Xi,Ga,zp,ts,Ba,pi,Ji,mi,ui,Sp,tg,Lp,Fa,is,Ap,ig,Tv,Dp,Cv,zv,fi,Ya,rg,Va,oc,lc,sg,Sv,Rp,ag,ng,Hp,Np,Pp,Ip,qp,cc,Qi=class extends C{constructor(){super(...arguments);m(this,M);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";m(this,ja,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._dateError="";this._timeError="";this._focus=new Date;m(this,$e,this.attachInternals());m(this,rs,new re(this,r(this,$e)));m(this,wt,N("cm-dp"));m(this,Ua,null);m(this,gi,!1);m(this,Zi,!1);m(this,tt,"");m(this,lt,"");m(this,Ka,!1);m(this,Wa,"");m(this,Ga,!1);m(this,fi,new we);m(this,Ya,!1);m(this,Rp,e=>{e.key==="Enter"?a(this,M,sg).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,M,Sv).call(this,e.key==="ArrowUp"?1:-1))});m(this,Hp,()=>{this.disabled||(this.open?this.open=!1:(a(this,M,lc).call(this),this.show()))});m(this,Np,e=>{e.key==="Enter"?a(this,M,lc).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,M,lc).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});m(this,Pp,e=>{let t=_p(se(e,this),e,this._focus,r(this,M,tg));if(t){e.preventDefault(),this._focus=Kt(t,r(this,M,mi),r(this,M,ui)),g(this,Zi,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,M,ag).call(this,this._focus))});m(this,Ip,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,M,ng).call(this);return}Cp(e,e.currentTarget)});m(this,qp,e=>{this._focus=Kt(be(this._focus,e),r(this,M,mi),r(this,M,ui))});m(this,cc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,ja)}set locale(e){let t=r(this,ja);g(this,ja,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Ua)===null&&g(this,Ua,this.value),document.addEventListener("pointerdown",r(this,cc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,fi).close(),document.removeEventListener("pointerdown",r(this,cc),!0)}get form(){return r(this,$e).form}get validity(){return r(this,$e).validity}get validationMessage(){return r(this,$e).validationMessage}get valueAsDate(){return this.time?this.value?Ut(this.value):null:R(this.value)}checkValidity(){return a(this,M,Dp).call(this),r(this,$e).checkValidity()}reportValidity(){return a(this,M,Dp).call(this),r(this,rs).report(()=>r(this,$e).reportValidity())}formResetCallback(){r(this,rs).reset(),this._dateError=this._timeError="",this.value=r(this,Ua)??"",this.time&&(a(this,M,ig).call(this,this.value),g(this,M,a(this,M,is).call(this,r(this,lt)),Xi)),this._text=a(this,M,Fa).call(this,r(this,M,pi)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(a(this,M,Tv).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=r(this,M,mi),s=r(this,M,ui);return i&&t<i||s&&t>s?!0:sc(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Ga)?(a(this,M,ig).call(this,this.value),r(this,Ka)||g(this,M,a(this,M,is).call(this,r(this,lt)),Xi)):this.time&&(e.has("locale")||e.has("hourCycle"))&&r(this,lt)&&g(this,M,a(this,M,is).call(this,r(this,lt)),Xi),(e.has("value")||e.has("time"))&&!r(this,gi)?this._text=a(this,M,Fa).call(this,r(this,M,pi)):e.has("locale")&&R(r(this,M,pi))&&(this._text=a(this,M,Fa).call(this,r(this,M,pi))),e.has("value")&&!r(this,Ya)&&(this._dateError=this._timeError=""),g(this,Ya,!1),g(this,gi,!1),g(this,Ka,!1),g(this,Ga,!1)}updated(e){this.open&&!r(this,fi).active?r(this,fi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,fi).active?r(this,fi).close():this.open&&r(this,fi).place(),r(this,$e).setFormValue(this.value||null,this.time?this.value:this._text),a(this,M,Dp).call(this),this.open&&r(this,Zi)&&(g(this,Zi,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,Zi,!1)}render(){let e=r(this,M,ts),t=R(r(this,M,pi)),i=[this._dateError,this._timeError].filter(Boolean).join(" "),s=r(this,rs).message,l=this.error||i||s,d=!this.error&&!i&&!!s,p=[l&&`${r(this,wt)}-err`,this.helpText&&`${r(this,wt)}-help`].filter(Boolean).join(" "),u=this.getAttribute("aria-label"),b=this.label||u||"",f=Se(this._focus);return c`<div class="field">
910
+ `;var yE=z("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Ua,$e,ss,wt,Ka,fi,er,tt,lt,Wa,Ga,M,oc,Ji,Ya,Sp,is,Fa,mi,Qi,ui,gi,Lp,ig,Ap,Va,rs,Dp,rg,Cv,Rp,zv,Sv,bi,Xa,sg,ja,lc,cc,ag,Lv,Hp,ng,og,Np,Pp,Ip,qp,Op,dc,Zi=class extends C{constructor(){super(...arguments);m(this,M);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";m(this,Ua,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._dateError="";this._timeError="";this._focus=new Date;m(this,$e,this.attachInternals());m(this,ss,new re(this,r(this,$e)));m(this,wt,N("cm-dp"));m(this,Ka,null);m(this,fi,!1);m(this,er,!1);m(this,tt,"");m(this,lt,"");m(this,Wa,!1);m(this,Ga,"");m(this,Ya,!1);m(this,bi,new we);m(this,Xa,!1);m(this,Hp,e=>{e.key==="Enter"?a(this,M,ag).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,M,Lv).call(this,e.key==="ArrowUp"?1:-1))});m(this,Np,()=>{this.disabled||(this.open?this.open=!1:(a(this,M,cc).call(this),this.show()))});m(this,Pp,e=>{e.key==="Enter"?a(this,M,cc).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,M,cc).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});m(this,Ip,e=>{let t=Tp(se(e,this),e,this._focus,r(this,M,ig));if(t){e.preventDefault(),this._focus=Wt(t,r(this,M,ui),r(this,M,gi)),g(this,er,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,M,ng).call(this,this._focus))});m(this,qp,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,M,og).call(this);return}zp(e,e.currentTarget)});m(this,Op,e=>{this._focus=Wt(be(this._focus,e),r(this,M,ui),r(this,M,gi))});m(this,dc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Ua)}set locale(e){let t=r(this,Ua);g(this,Ua,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Ka)===null&&g(this,Ka,this.value),document.addEventListener("pointerdown",r(this,dc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,bi).close(),document.removeEventListener("pointerdown",r(this,dc),!0)}get form(){return r(this,$e).form}get validity(){return r(this,$e).validity}get validationMessage(){return r(this,$e).validationMessage}get valueAsDate(){return this.time?this.value?Kt(this.value):null:R(this.value)}checkValidity(){return a(this,M,Rp).call(this),r(this,$e).checkValidity()}reportValidity(){return a(this,M,Rp).call(this),r(this,ss).report(()=>r(this,$e).reportValidity())}formResetCallback(){r(this,ss).reset(),this._dateError=this._timeError="",this.value=r(this,Ka)??"",this.time&&(a(this,M,rg).call(this,this.value),g(this,M,a(this,M,rs).call(this,r(this,lt)),Ji)),this._text=a(this,M,Va).call(this,r(this,M,mi)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(a(this,M,Cv).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=r(this,M,ui),s=r(this,M,gi);return i&&t<i||s&&t>s?!0:ac(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Ya)?(a(this,M,rg).call(this,this.value),r(this,Wa)||g(this,M,a(this,M,rs).call(this,r(this,lt)),Ji)):this.time&&(e.has("locale")||e.has("hourCycle"))&&r(this,lt)&&g(this,M,a(this,M,rs).call(this,r(this,lt)),Ji),(e.has("value")||e.has("time"))&&!r(this,fi)?this._text=a(this,M,Va).call(this,r(this,M,mi)):e.has("locale")&&R(r(this,M,mi))&&(this._text=a(this,M,Va).call(this,r(this,M,mi))),e.has("value")&&!r(this,Xa)&&(this._dateError=this._timeError=""),g(this,Xa,!1),g(this,fi,!1),g(this,Wa,!1),g(this,Ya,!1)}updated(e){this.open&&!r(this,bi).active?r(this,bi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,bi).active?r(this,bi).close():this.open&&r(this,bi).place(),r(this,$e).setFormValue(this.value||null,this.time?this.value:this._text),a(this,M,Rp).call(this),this.open&&r(this,er)&&(g(this,er,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,er,!1)}render(){let e=r(this,M,is),t=R(r(this,M,mi)),i=[this._dateError,this._timeError].filter(Boolean).join(" "),s=r(this,ss).message,l=this.error||i||s,d=!this.error&&!i&&!!s,p=[l&&`${r(this,wt)}-err`,this.helpText&&`${r(this,wt)}-help`].filter(Boolean).join(" "),u=this.getAttribute("aria-label"),b=this.label||u||"",f=Se(this._focus);return c`<div class="field">
911
911
  ${this.label?c`<label class="label" for="${r(this,wt)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
912
912
  <div class="wrap ${this.time?"timed":""}">
913
913
  <div class="box ${this._dateError&&!this.error||d?"invalid":""}" part="box">
914
914
  <input id="${r(this,wt)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
915
- .value=${ee(this._text)} placeholder=${this.placeholder||r(this,M,Lp)}
915
+ .value=${ee(this._text)} placeholder=${this.placeholder||r(this,M,Ap)}
916
916
  aria-label=${!this.label&&u?u:h}
917
917
  ?required=${this.required} ?disabled=${this.disabled}
918
918
  aria-invalid=${l?"true":h} aria-describedby=${p||h}
919
919
  @input=${x=>{x.stopPropagation(),this._text=x.target.value}}
920
- @change=${()=>a(this,M,lc).call(this)} @keydown=${r(this,Np)} />
920
+ @change=${()=>a(this,M,cc).call(this)} @keydown=${r(this,Pp)} />
921
921
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
922
922
  aria-label=${t?this.t(b?"changeFor":"change",{label:b,date:e.long(t)}):this.t(b?"chooseFor":"choose",{label:b})}
923
923
  aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,wt)}-pop"
924
- @click=${r(this,Hp)}><cm-icon name="calendar" size="16"></cm-icon></button>
924
+ @click=${r(this,Np)}><cm-icon name="calendar" size="16"></cm-icon></button>
925
925
  </div>
926
926
  ${this.time?c`<div class="box time ${this._timeError&&!this.error||d?"invalid":""}" part="time-box">
927
927
  <input class="time-in" part="time-input" type="text" autocomplete="off" spellcheck="false"
928
- .value=${ee(r(this,M,nc))} placeholder=${r(this,M,Ap)}
928
+ .value=${ee(r(this,M,oc))} placeholder=${r(this,M,Dp)}
929
929
  aria-label=${this.t(b?"timeFor":"time",{label:b})}
930
930
  ?required=${this.required} ?disabled=${this.disabled}
931
931
  aria-invalid=${l?"true":h} aria-describedby=${p||h}
932
- @input=${x=>{x.stopPropagation(),g(this,M,x.target.value,Xi)}}
933
- @change=${()=>a(this,M,sg).call(this)} @keydown=${r(this,Rp)} />
932
+ @input=${x=>{x.stopPropagation(),g(this,M,x.target.value,Ji)}}
933
+ @change=${()=>a(this,M,ag).call(this)} @keydown=${r(this,Hp)} />
934
934
  </div>`:h}
935
935
  <div class="pop" id="${r(this,wt)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
936
- ?hidden=${!this.open} @keydown=${r(this,Ip)}>
937
- ${this.open?c`<div class="cal">${ac({id:r(this,wt),fmt:e,firstDay:r(this,M,tg),month:f,focus:this._focus,min:r(this,M,mi),max:r(this,M,ui),isDisabled:x=>this.isUnavailable(B(x)),mark:x=>t&&B(x)===r(this,M,pi)?"selected":"",onPick:x=>a(this,M,ag).call(this,x),onKey:r(this,Pp),onMonth:r(this,qp),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:h}
936
+ ?hidden=${!this.open} @keydown=${r(this,qp)}>
937
+ ${this.open?c`<div class="cal">${nc({id:r(this,wt),fmt:e,firstDay:r(this,M,ig),month:f,focus:this._focus,min:r(this,M,ui),max:r(this,M,gi),isDisabled:x=>this.isUnavailable(B(x)),mark:x=>t&&B(x)===r(this,M,mi)?"selected":"",onPick:x=>a(this,M,ng).call(this,x),onKey:r(this,Ip),onMonth:r(this,Op),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:h}
938
938
  </div>
939
939
  </div>
940
940
  ${l?c`<p class="error" id="${r(this,wt)}-err" role="alert">${l}</p>`:h}
941
941
  ${this.helpText?c`<p class="help" id="${r(this,wt)}-help">${this.helpText}</p>`:h}
942
- </div>`}};ja=new WeakMap,$e=new WeakMap,rs=new WeakMap,wt=new WeakMap,Ua=new WeakMap,gi=new WeakMap,Zi=new WeakMap,tt=new WeakMap,lt=new WeakMap,Ka=new WeakMap,Wa=new WeakMap,M=new WeakSet,nc=function(){return r(this,Wa)},Xi=function(e){e!==r(this,Wa)&&(g(this,Wa,e),this.requestUpdate())},Ga=new WeakMap,zp=function(){return Yi(this,this.locale)},ts=function(){return Ia(r(this,M,zp))},Ba=function(){return Ha(r(this,M,zp),this.hourCycle)},pi=function(){return this.time?r(this,tt):this.value},Ji=function(e){return this.time&&e.trim().toLowerCase()==="now"?_v():e},mi=function(){return R(xt(a(this,M,Ji).call(this,this.min)).date||this.min)},ui=function(){return R(xt(a(this,M,Ji).call(this,this.max)).date||this.max)},Sp=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},tg=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Pa(r(this,M,zp)):(Math.trunc(e)%7+7)%7},Lp=function(){return Mp(r(this,M,ts),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Fa=function(e){let t=R(e);return t?r(this,M,ts).short(t):e},is=function(e){let t=Ee(e);return t===null?"":r(this,M,Ba).format(t)},Ap=function(){return Ep(r(this,M,Ba),{h:this.t("patternHour"),m:this.t("patternMinute")})},ig=function(e){let{date:t,time:i}=xt(e);g(this,tt,t),g(this,lt,t?i:"")},Tv=function(){let e=new Date,t=R(r(this,M,pi))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=Kt(t,r(this,M,mi),r(this,M,ui)),g(this,Zi,!0)},Dp=function(){a(this,M,Cv).call(this),r(this,rs).sync()},Cv=function(){let e=this.renderRoot.querySelector("input")??void 0,t=R(r(this,M,pi)),i=r(this,M,ts);this.error?r(this,$e).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,$e).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,M,Lp)}),e):this.time?a(this,M,zv).call(this,t,e):this.required&&!t?r(this,$e).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,M,mi)&&t<r(this,M,mi)?r(this,$e).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,M,mi))}),e):t&&r(this,M,ui)&&t>r(this,M,ui)?r(this,$e).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,M,ui))}),e):t&&this.isUnavailable(this.value)?r(this,$e).setValidity({customError:!0},this.t("unavailable"),e):r(this,$e).setValidity({})},zv=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,s=(f,x,v,k=t)=>r(this,$e).setValidity(f,this.t(x,v),k),l=Ee(r(this,lt));if(r(this,M,nc).trim()&&l===null)return s({badInput:!0},"badTime",{pattern:r(this,M,Ap)},i);if(!e&&l===null)return this.required?s({valueMissing:!0},"required"):r(this,$e).setValidity({});if(!e)return s({badInput:!0},"required");if(l===null)return s({badInput:!0},"timeMissing",void 0,i);let d=Ut(`${r(this,tt)}T${r(this,lt)}`),p=Ut(a(this,M,Ji).call(this,this.min)),u=Ut(a(this,M,Ji).call(this,this.max),!0),b=(f,x)=>xt(f).time?r(this,M,Ba).dateTime(x):r(this,M,ts).medium(x);if(p&&d<p)return s({rangeUnderflow:!0},"rangeUnderflow",{date:b(a(this,M,Ji).call(this,this.min),p)},i);if(u&&d>u)return s({rangeOverflow:!0},"rangeOverflow",{date:b(a(this,M,Ji).call(this,this.max),u)},i);if(l%r(this,M,Sp))return s({stepMismatch:!0},"stepMismatch",{count:r(this,M,Sp)},i);if(this.isUnavailable(r(this,tt)))return s({customError:!0},"unavailable");r(this,$e).setValidity({})},fi=new WeakMap,Ya=new WeakMap,rg=function(e){e!==this.value&&(g(this,Ya,!0),this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Va=function(e,t){g(this,tt,e),g(this,lt,t);let i=e&&t?`${e}T${t}`:"";g(this,Ga,!0),this.requestUpdate(),a(this,M,rg).call(this,i)},oc=function(e){this.time?a(this,M,Va).call(this,e,r(this,lt)):a(this,M,rg).call(this,e)},lc=function(){let e=this._text.trim();if(this._dateError="",!e){a(this,M,oc).call(this,"");return}let t=qa(e,r(this,M,ts));t?(a(this,M,oc).call(this,t),this._text=a(this,M,Fa).call(this,t)):(g(this,gi,!0),a(this,M,oc).call(this,""),this._dateError=this.t("badInput",{pattern:r(this,M,Lp)}))},sg=function(){let e=r(this,M,nc).trim(),t=e?es(e,r(this,M,Ba)):"";if(g(this,gi,!0),t===null){g(this,Ka,!0),a(this,M,Va).call(this,r(this,tt),""),this._timeError=this.t("badTime",{pattern:r(this,M,Ap)});return}this._timeError="",a(this,M,Va).call(this,r(this,tt),t),g(this,M,a(this,M,is).call(this,t),Xi)},Sv=function(e){let t=r(this,M,Sp),i=es(r(this,M,nc),r(this,M,Ba));if(!i){let p=xt(a(this,M,Ji).call(this,this.min)),u=new Date;if(i=p.time&&(!r(this,tt)||r(this,tt)===p.date)?p.time:hi(u.getHours()*60+u.getMinutes()),Ee(i)%t===0){g(this,gi,!0),a(this,M,Va).call(this,r(this,tt),i),g(this,M,a(this,M,is).call(this,i),Xi);return}e=1}let s=Ee(i),l=e>0?(Math.floor(s/t)+1)*t:(Math.ceil(s/t)-1)*t,d=hi(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,gi,!0),a(this,M,Va).call(this,r(this,tt),d),g(this,M,a(this,M,is).call(this,d),Xi)},Rp=new WeakMap,ag=function(e){let t=B(e);this.isUnavailable(t)||(this.open=!1,a(this,M,oc).call(this,t),this._text=a(this,M,Fa).call(this,t),this._dateError="",this.time&&!r(this,lt)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,M,ng).call(this))},ng=function(){this.renderRoot.querySelector(".trigger")?.focus()},Hp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,qp=new WeakMap,cc=new WeakMap,Qi.formAssociated=!0,Qi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Qi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Na},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_dateError:{state:!0},_timeError:{state:!0},_focus:{state:!0}},Qi.styles=[E,Ie,Oa,Tp,w`.pop { min-width: 0; }`];$("cm-date-picker",Qi);var TE=z("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month",thisWeek:"This week",lastWeek:"Last week",last28Days:"Last 28 days",last12Months:"Last 12 months",thisYear:"This year",lastYear:"Last year",quarterToDate:"Quarter to date",lastQuarter:"Last quarter",dayCount:{one:"{count} day",other:"{count} days"},custom:"Custom",apply:"Apply",cancel:"Cancel",noRange:"No dates chosen"}),og=(o,n)=>te(o,-((o.getDay()-n+7)%7)),Lv={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[te(o,-1),te(o,-1)]],"this-week":["This week",(o,n)=>[og(o,n),o]],"last-week":["Last week",(o,n)=>[te(og(o,n),-7),te(og(o,n),-1)]],"last-7-days":["Last 7 days",o=>[te(o,-6),o]],"last-28-days":["Last 28 days",o=>[te(o,-27),o]],"last-30-days":["Last 30 days",o=>[te(o,-29),o]],"last-90-days":["Last 90 days",o=>[te(o,-89),o]],"last-12-months":["Last 12 months",o=>[te(be(o,-12),1),o]],"this-month":["This month",o=>[Se(o),o]],"last-month":["Last month",o=>[Se(be(o,-1)),Zr(be(o,-1))]],"quarter-to-date":["Quarter to date",o=>[new Date(o.getFullYear(),o.getMonth()-o.getMonth()%3,1),o]],"last-quarter":["Last quarter",o=>{let n=new Date(o.getFullYear(),o.getMonth()-o.getMonth()%3-3,1);return[n,Zr(be(n,2))]}],"this-year":["This year",o=>[new Date(o.getFullYear(),0,1),o]],"last-year":["Last year",o=>[new Date(o.getFullYear()-1,0,1),new Date(o.getFullYear()-1,11,31)]]},$0=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function Op(o,n=new Date,e,t=0){if(typeof o=="object"&&o)return o;let i=Lv[o];if(!i||!Object.prototype.hasOwnProperty.call(Lv,o))return null;let s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[l,d]=i[1](s,t);return{label:e?.($0(o))||i[0],start:B(l),end:B(d)}}var k0=["custom","today","yesterday","this-week","last-7-days","last-week","last-28-days","last-30-days","this-month","last-month","last-90-days","quarter-to-date","this-year"],en,Me,as,Le,tn,rn,Ke,sn,Wt,ir,_,ss,dc,Bp,bi,er,Xa,hc,Ja,lg,Fp,pc,We,mc,Rt,vi,Av,uc,Qa,Vp,cg,dg,hg,pg,jp,mg,Za,bc,Up,vc,yc,xc,gc,fc,Dv,Rv,tr=class extends C{constructor(){super(...arguments);m(this,_);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";m(this,en,"");this.disabledDates=[];this.presets=[];this.preset="";this.months=1;this.confirm=!1;this.variant="";this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;this._view=Se(new Date);this._draftPreset="";this._dStartText="";this._dEndText="";m(this,Me,this.attachInternals());m(this,as,new re(this,r(this,Me)));m(this,Le,N("cm-drp"));m(this,tn,null);m(this,rn,!1);m(this,Ke,!1);m(this,sn,!1);m(this,Wt,!1);m(this,ir,!1);m(this,We,"start");m(this,vi,new we);m(this,bc,()=>{this.disabled||(this.open?this.open=!1:(r(this,_,ss)||(a(this,_,Qa).call(this,"start"),a(this,_,Qa).call(this,"end")),this.show()))});m(this,Up,e=>t=>{t.key==="Enter"?a(this,_,Qa).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,_,Qa).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});m(this,vc,e=>{let t=_p(se(e,this),e,this._focus,r(this,_,er));if(t){e.preventDefault(),this._focus=Kt(t,R(this.min),R(this.max)),a(this,_,Ja).call(this,this._focus),g(this,Wt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,_,Vp).call(this,this._focus))});m(this,yc,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,_,Za).call(this);return}Cp(e,e.currentTarget)});m(this,xc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,en)}set locale(e){let t=r(this,en);g(this,en,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,tn)||g(this,tn,[this.start,this.end,this.preset]),document.addEventListener("pointerdown",r(this,xc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,vi).close(),document.removeEventListener("pointerdown",r(this,xc),!0)}get form(){return r(this,Me).form}get validity(){return r(this,Me).validity}get validationMessage(){return r(this,Me).validationMessage}checkValidity(){return r(this,Me).checkValidity()}reportValidity(){return r(this,as).report(()=>r(this,Me).reportValidity())}formResetCallback(){[this.start,this.end,this.preset]=r(this,tn)??["","",""],this._startText=a(this,_,Rt).call(this,this.start),this._endText=a(this,_,Rt).call(this,this.end),this.open=!1,r(this,as).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=R(this.start)?this.start:"",this._draftEnd=R(this.end)?this.end:"",this._draftPreset=this.preset,this._hover=null,g(this,Ke,!1);let e=new Date,t=r(this,_,hc)===2?R(this.end)??R(this.start):R(this.start);this._view=Se(be(Kt(t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),1-r(this,_,hc))),this._focus=Kt(R(this.start)??t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),a(this,_,Ja).call(this,this._focus),g(this,We,"start"),g(this,Wt,!0),g(this,ir,!0),a(this,_,Xa).call(this),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=R(this.min),s=R(this.max);return i&&t<i||s&&t>s?!0:sc(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){if(e.has("preset")&&!r(this,rn)&&this.preset){let t=Op(this.preset,new Date,void 0,r(this,_,er));t&&(this.start=t.start,this.end=t.end)}g(this,rn,!1),r(this,sn)||(e.has("start")&&(this._startText=a(this,_,Rt).call(this,this.start)),e.has("end")&&(this._endText=a(this,_,Rt).call(this,this.end))),g(this,sn,!1),e.has("locale")&&(R(this.start)&&(this._startText=a(this,_,Rt).call(this,this.start)),R(this.end)&&(this._endText=a(this,_,Rt).call(this,this.end)))}updated(){this.open&&!r(this,vi).active?r(this,vi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,vi).active?r(this,vi).close():this.open&&r(this,vi).place();let e=R(this.start),t=R(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),r(this,Me).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let s=r(this,_,ss)?[]:[...this.renderRoot.querySelectorAll(".box input")],l=this.renderRoot.querySelector(".trigger")??void 0,[d,p]=[s[0]??l,s[1]??l],u=r(this,_,bi),b=R(this.min),f=R(this.max);if(this.error?r(this,Me).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?r(this,Me).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,_,mc)}),d):this._endText.trim()&&!t?r(this,Me).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,_,mc)}),p):this.required&&(!e||!t)?r(this,Me).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?r(this,Me).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&b&&e<b||t&&b&&t<b?r(this,Me).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(b)}),d):e&&f&&e>f||t&&f&&t>f?r(this,Me).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium(f)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,Me).setValidity({customError:!0},this.t("unavailable"),d):r(this,Me).setValidity({}),r(this,as).sync(),this.open&&r(this,Wt)&&(g(this,Wt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),this.open&&r(this,ir)){g(this,ir,!1);let x=this.renderRoot.querySelector(".r-months"),v=R(this._draftStart)??this._focus,k=x?.querySelector(`[data-month="${B(Se(v)).slice(0,7)}"]`),L=x?.querySelector(".r-week");x&&k&&(x.scrollTop=k.offsetTop-(L?.offsetHeight??0))}}render(){let e=r(this,_,bi),t=R(this.start),i=R(this.end),s=r(this,as).message,l=[s&&`${r(this,Le)}-err`,this.helpText&&`${r(this,Le)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=this.open?r(this,_,Fp):[],[b,f,x]=r(this,_,dc)?[this._draftStart,this._draftEnd,this._draftPreset]:[this.start,this.end,this.preset],v=!r(this,Ke)&&!!x&&u.some(K=>K.key===x),k=K=>!r(this,Ke)&&(v?K.key===x:K.start===b&&K.end===f),L=r(this,Ke)||!u.some(k)&&!!(b||f),P=r(this,_,hc),U=K=>ac({id:P===1?r(this,Le):`${r(this,Le)}-m${K}`,fmt:e,firstDay:r(this,_,er),month:be(this._view,K),focus:this._focus,min:R(this.min),max:R(this.max),isDisabled:Z=>this.isUnavailable(B(Z)),mark:Z=>a(this,_,gc).call(this,Z),note:Z=>{let zt=a(this,_,gc).call(this,Z);return zt==="start"?this.t("startNote"):zt==="end"?this.t("endNote"):""},onPick:Z=>a(this,_,Vp).call(this,Z),onKey:r(this,vc),onMonth:Z=>{this._view=be(this._view,Z),this._focus=Kt(be(this._focus,Z),R(this.min),R(this.max)),a(this,_,Ja).call(this,this._focus)},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:Z=>{r(this,We)==="end"&&(this._hover=Z)},hideNav:P===1?void 0:K===0?"next":"previous"}),q=R(this._draftStart),O=R(this._draftEnd),ve=r(this,We)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(R(this._draftStart))}):this.t("chooseStart"),G=K=>{let Z=K==="start"?this._startText:this._endText;return c`<input id="${r(this,Le)}-${K}" type="text" autocomplete="off" spellcheck="false"
943
- .value=${ee(Z)} placeholder=${r(this,_,mc)}
942
+ </div>`}};Ua=new WeakMap,$e=new WeakMap,ss=new WeakMap,wt=new WeakMap,Ka=new WeakMap,fi=new WeakMap,er=new WeakMap,tt=new WeakMap,lt=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,M=new WeakSet,oc=function(){return r(this,Ga)},Ji=function(e){e!==r(this,Ga)&&(g(this,Ga,e),this.requestUpdate())},Ya=new WeakMap,Sp=function(){return Xi(this,this.locale)},is=function(){return qa(r(this,M,Sp))},Fa=function(){return Na(r(this,M,Sp),this.hourCycle)},mi=function(){return this.time?r(this,tt):this.value},Qi=function(e){return this.time&&e.trim().toLowerCase()==="now"?Tv():e},ui=function(){return R(xt(a(this,M,Qi).call(this,this.min)).date||this.min)},gi=function(){return R(xt(a(this,M,Qi).call(this,this.max)).date||this.max)},Lp=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},ig=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ia(r(this,M,Sp)):(Math.trunc(e)%7+7)%7},Ap=function(){return _p(r(this,M,is),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Va=function(e){let t=R(e);return t?r(this,M,is).short(t):e},rs=function(e){let t=Ee(e);return t===null?"":r(this,M,Fa).format(t)},Dp=function(){return Mp(r(this,M,Fa),{h:this.t("patternHour"),m:this.t("patternMinute")})},rg=function(e){let{date:t,time:i}=xt(e);g(this,tt,t),g(this,lt,t?i:"")},Cv=function(){let e=new Date,t=R(r(this,M,mi))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=Wt(t,r(this,M,ui),r(this,M,gi)),g(this,er,!0)},Rp=function(){a(this,M,zv).call(this),r(this,ss).sync()},zv=function(){let e=this.renderRoot.querySelector("input")??void 0,t=R(r(this,M,mi)),i=r(this,M,is);this.error?r(this,$e).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,$e).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,M,Ap)}),e):this.time?a(this,M,Sv).call(this,t,e):this.required&&!t?r(this,$e).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,M,ui)&&t<r(this,M,ui)?r(this,$e).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,M,ui))}),e):t&&r(this,M,gi)&&t>r(this,M,gi)?r(this,$e).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,M,gi))}),e):t&&this.isUnavailable(this.value)?r(this,$e).setValidity({customError:!0},this.t("unavailable"),e):r(this,$e).setValidity({})},Sv=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,s=(f,x,v,k=t)=>r(this,$e).setValidity(f,this.t(x,v),k),l=Ee(r(this,lt));if(r(this,M,oc).trim()&&l===null)return s({badInput:!0},"badTime",{pattern:r(this,M,Dp)},i);if(!e&&l===null)return this.required?s({valueMissing:!0},"required"):r(this,$e).setValidity({});if(!e)return s({badInput:!0},"required");if(l===null)return s({badInput:!0},"timeMissing",void 0,i);let d=Kt(`${r(this,tt)}T${r(this,lt)}`),p=Kt(a(this,M,Qi).call(this,this.min)),u=Kt(a(this,M,Qi).call(this,this.max),!0),b=(f,x)=>xt(f).time?r(this,M,Fa).dateTime(x):r(this,M,is).medium(x);if(p&&d<p)return s({rangeUnderflow:!0},"rangeUnderflow",{date:b(a(this,M,Qi).call(this,this.min),p)},i);if(u&&d>u)return s({rangeOverflow:!0},"rangeOverflow",{date:b(a(this,M,Qi).call(this,this.max),u)},i);if(l%r(this,M,Lp))return s({stepMismatch:!0},"stepMismatch",{count:r(this,M,Lp)},i);if(this.isUnavailable(r(this,tt)))return s({customError:!0},"unavailable");r(this,$e).setValidity({})},bi=new WeakMap,Xa=new WeakMap,sg=function(e){e!==this.value&&(g(this,Xa,!0),this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},ja=function(e,t){g(this,tt,e),g(this,lt,t);let i=e&&t?`${e}T${t}`:"";g(this,Ya,!0),this.requestUpdate(),a(this,M,sg).call(this,i)},lc=function(e){this.time?a(this,M,ja).call(this,e,r(this,lt)):a(this,M,sg).call(this,e)},cc=function(){let e=this._text.trim();if(this._dateError="",!e){a(this,M,lc).call(this,"");return}let t=Oa(e,r(this,M,is));t?(a(this,M,lc).call(this,t),this._text=a(this,M,Va).call(this,t)):(g(this,fi,!0),a(this,M,lc).call(this,""),this._dateError=this.t("badInput",{pattern:r(this,M,Ap)}))},ag=function(){let e=r(this,M,oc).trim(),t=e?ts(e,r(this,M,Fa)):"";if(g(this,fi,!0),t===null){g(this,Wa,!0),a(this,M,ja).call(this,r(this,tt),""),this._timeError=this.t("badTime",{pattern:r(this,M,Dp)});return}this._timeError="",a(this,M,ja).call(this,r(this,tt),t),g(this,M,a(this,M,rs).call(this,t),Ji)},Lv=function(e){let t=r(this,M,Lp),i=ts(r(this,M,oc),r(this,M,Fa));if(!i){let p=xt(a(this,M,Qi).call(this,this.min)),u=new Date;if(i=p.time&&(!r(this,tt)||r(this,tt)===p.date)?p.time:pi(u.getHours()*60+u.getMinutes()),Ee(i)%t===0){g(this,fi,!0),a(this,M,ja).call(this,r(this,tt),i),g(this,M,a(this,M,rs).call(this,i),Ji);return}e=1}let s=Ee(i),l=e>0?(Math.floor(s/t)+1)*t:(Math.ceil(s/t)-1)*t,d=pi(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,fi,!0),a(this,M,ja).call(this,r(this,tt),d),g(this,M,a(this,M,rs).call(this,d),Ji)},Hp=new WeakMap,ng=function(e){let t=B(e);this.isUnavailable(t)||(this.open=!1,a(this,M,lc).call(this,t),this._text=a(this,M,Va).call(this,t),this._dateError="",this.time&&!r(this,lt)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,M,og).call(this))},og=function(){this.renderRoot.querySelector(".trigger")?.focus()},Np=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,qp=new WeakMap,Op=new WeakMap,dc=new WeakMap,Zi.formAssociated=!0,Zi.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Zi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Pa},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_dateError:{state:!0},_timeError:{state:!0},_focus:{state:!0}},Zi.styles=[E,Ie,Ba,Cp,w`.pop { min-width: 0; }`];$("cm-date-picker",Zi);var zE=z("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month",thisWeek:"This week",lastWeek:"Last week",last28Days:"Last 28 days",last12Months:"Last 12 months",thisYear:"This year",lastYear:"Last year",quarterToDate:"Quarter to date",lastQuarter:"Last quarter",dayCount:{one:"{count} day",other:"{count} days"},custom:"Custom",apply:"Apply",cancel:"Cancel",noRange:"No dates chosen"}),lg=(o,n)=>te(o,-((o.getDay()-n+7)%7)),Av={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[te(o,-1),te(o,-1)]],"this-week":["This week",(o,n)=>[lg(o,n),o]],"last-week":["Last week",(o,n)=>[te(lg(o,n),-7),te(lg(o,n),-1)]],"last-7-days":["Last 7 days",o=>[te(o,-6),o]],"last-28-days":["Last 28 days",o=>[te(o,-27),o]],"last-30-days":["Last 30 days",o=>[te(o,-29),o]],"last-90-days":["Last 90 days",o=>[te(o,-89),o]],"last-12-months":["Last 12 months",o=>[te(be(o,-12),1),o]],"this-month":["This month",o=>[Se(o),o]],"last-month":["Last month",o=>[Se(be(o,-1)),es(be(o,-1))]],"quarter-to-date":["Quarter to date",o=>[new Date(o.getFullYear(),o.getMonth()-o.getMonth()%3,1),o]],"last-quarter":["Last quarter",o=>{let n=new Date(o.getFullYear(),o.getMonth()-o.getMonth()%3-3,1);return[n,es(be(n,2))]}],"this-year":["This year",o=>[new Date(o.getFullYear(),0,1),o]],"last-year":["Last year",o=>[new Date(o.getFullYear()-1,0,1),new Date(o.getFullYear()-1,11,31)]]},k0=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function Bp(o,n=new Date,e,t=0){if(typeof o=="object"&&o)return o;let i=Av[o];if(!i||!Object.prototype.hasOwnProperty.call(Av,o))return null;let s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[l,d]=i[1](s,t);return{label:e?.(k0(o))||i[0],start:B(l),end:B(d)}}var E0=["custom","today","yesterday","this-week","last-7-days","last-week","last-28-days","last-30-days","this-month","last-month","last-90-days","quarter-to-date","this-year"],tn,Me,ns,Le,rn,sn,Ke,an,Gt,rr,_,as,hc,Fp,vi,tr,Ja,pc,Qa,cg,Vp,mc,We,uc,Ht,yi,Dv,gc,Za,jp,dg,hg,pg,mg,Up,ug,en,vc,Kp,yc,xc,wc,fc,bc,Rv,Hv,ir=class extends C{constructor(){super(...arguments);m(this,_);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";m(this,tn,"");this.disabledDates=[];this.presets=[];this.preset="";this.months=1;this.confirm=!1;this.variant="";this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;this._view=Se(new Date);this._draftPreset="";this._dStartText="";this._dEndText="";m(this,Me,this.attachInternals());m(this,ns,new re(this,r(this,Me)));m(this,Le,N("cm-drp"));m(this,rn,null);m(this,sn,!1);m(this,Ke,!1);m(this,an,!1);m(this,Gt,!1);m(this,rr,!1);m(this,We,"start");m(this,yi,new we);m(this,vc,()=>{this.disabled||(this.open?this.open=!1:(r(this,_,as)||(a(this,_,Za).call(this,"start"),a(this,_,Za).call(this,"end")),this.show()))});m(this,Kp,e=>t=>{t.key==="Enter"?a(this,_,Za).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,_,Za).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});m(this,yc,e=>{let t=Tp(se(e,this),e,this._focus,r(this,_,tr));if(t){e.preventDefault(),this._focus=Wt(t,R(this.min),R(this.max)),a(this,_,Qa).call(this,this._focus),g(this,Gt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,_,jp).call(this,this._focus))});m(this,xc,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,_,en).call(this);return}zp(e,e.currentTarget)});m(this,wc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,tn)}set locale(e){let t=r(this,tn);g(this,tn,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,rn)||g(this,rn,[this.start,this.end,this.preset]),document.addEventListener("pointerdown",r(this,wc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,yi).close(),document.removeEventListener("pointerdown",r(this,wc),!0)}get form(){return r(this,Me).form}get validity(){return r(this,Me).validity}get validationMessage(){return r(this,Me).validationMessage}checkValidity(){return r(this,Me).checkValidity()}reportValidity(){return r(this,ns).report(()=>r(this,Me).reportValidity())}formResetCallback(){[this.start,this.end,this.preset]=r(this,rn)??["","",""],this._startText=a(this,_,Ht).call(this,this.start),this._endText=a(this,_,Ht).call(this,this.end),this.open=!1,r(this,ns).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=R(this.start)?this.start:"",this._draftEnd=R(this.end)?this.end:"",this._draftPreset=this.preset,this._hover=null,g(this,Ke,!1);let e=new Date,t=r(this,_,pc)===2?R(this.end)??R(this.start):R(this.start);this._view=Se(be(Wt(t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),1-r(this,_,pc))),this._focus=Wt(R(this.start)??t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),a(this,_,Qa).call(this,this._focus),g(this,We,"start"),g(this,Gt,!0),g(this,rr,!0),a(this,_,Ja).call(this),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=R(this.min),s=R(this.max);return i&&t<i||s&&t>s?!0:ac(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){if(e.has("preset")&&!r(this,sn)&&this.preset){let t=Bp(this.preset,new Date,void 0,r(this,_,tr));t&&(this.start=t.start,this.end=t.end)}g(this,sn,!1),r(this,an)||(e.has("start")&&(this._startText=a(this,_,Ht).call(this,this.start)),e.has("end")&&(this._endText=a(this,_,Ht).call(this,this.end))),g(this,an,!1),e.has("locale")&&(R(this.start)&&(this._startText=a(this,_,Ht).call(this,this.start)),R(this.end)&&(this._endText=a(this,_,Ht).call(this,this.end)))}updated(){this.open&&!r(this,yi).active?r(this,yi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,yi).active?r(this,yi).close():this.open&&r(this,yi).place();let e=R(this.start),t=R(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),r(this,Me).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let s=r(this,_,as)?[]:[...this.renderRoot.querySelectorAll(".box input")],l=this.renderRoot.querySelector(".trigger")??void 0,[d,p]=[s[0]??l,s[1]??l],u=r(this,_,vi),b=R(this.min),f=R(this.max);if(this.error?r(this,Me).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?r(this,Me).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,_,uc)}),d):this._endText.trim()&&!t?r(this,Me).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,_,uc)}),p):this.required&&(!e||!t)?r(this,Me).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?r(this,Me).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&b&&e<b||t&&b&&t<b?r(this,Me).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(b)}),d):e&&f&&e>f||t&&f&&t>f?r(this,Me).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium(f)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,Me).setValidity({customError:!0},this.t("unavailable"),d):r(this,Me).setValidity({}),r(this,ns).sync(),this.open&&r(this,Gt)&&(g(this,Gt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),this.open&&r(this,rr)){g(this,rr,!1);let x=this.renderRoot.querySelector(".r-months"),v=R(this._draftStart)??this._focus,k=x?.querySelector(`[data-month="${B(Se(v)).slice(0,7)}"]`),L=x?.querySelector(".r-week");x&&k&&(x.scrollTop=k.offsetTop-(L?.offsetHeight??0))}}render(){let e=r(this,_,vi),t=R(this.start),i=R(this.end),s=r(this,ns).message,l=[s&&`${r(this,Le)}-err`,this.helpText&&`${r(this,Le)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=this.open?r(this,_,Vp):[],[b,f,x]=r(this,_,hc)?[this._draftStart,this._draftEnd,this._draftPreset]:[this.start,this.end,this.preset],v=!r(this,Ke)&&!!x&&u.some(K=>K.key===x),k=K=>!r(this,Ke)&&(v?K.key===x:K.start===b&&K.end===f),L=r(this,Ke)||!u.some(k)&&!!(b||f),P=r(this,_,pc),U=K=>nc({id:P===1?r(this,Le):`${r(this,Le)}-m${K}`,fmt:e,firstDay:r(this,_,tr),month:be(this._view,K),focus:this._focus,min:R(this.min),max:R(this.max),isDisabled:Z=>this.isUnavailable(B(Z)),mark:Z=>a(this,_,fc).call(this,Z),note:Z=>{let zt=a(this,_,fc).call(this,Z);return zt==="start"?this.t("startNote"):zt==="end"?this.t("endNote"):""},onPick:Z=>a(this,_,jp).call(this,Z),onKey:r(this,yc),onMonth:Z=>{this._view=be(this._view,Z),this._focus=Wt(be(this._focus,Z),R(this.min),R(this.max)),a(this,_,Qa).call(this,this._focus)},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:Z=>{r(this,We)==="end"&&(this._hover=Z)},hideNav:P===1?void 0:K===0?"next":"previous"}),q=R(this._draftStart),O=R(this._draftEnd),ve=r(this,We)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(R(this._draftStart))}):this.t("chooseStart"),G=K=>{let Z=K==="start"?this._startText:this._endText;return c`<input id="${r(this,Le)}-${K}" type="text" autocomplete="off" spellcheck="false"
943
+ .value=${ee(Z)} placeholder=${r(this,_,uc)}
944
944
  aria-label=${K==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
945
945
  ?required=${this.required} ?disabled=${this.disabled}
946
946
  aria-invalid=${s?"true":h} aria-describedby=${l||h}
947
- @input=${zt=>{zt.stopPropagation();let Er=zt.target.value;K==="start"?this._startText=Er:this._endText=Er}}
948
- @change=${()=>a(this,_,Qa).call(this,K)} @keydown=${r(this,Up).call(this,K)} />`};return c`<div class="field" role="group" aria-labelledby=${this.label?`${r(this,Le)}-l`:h} aria-label=${!this.label&&d?d:h}>
947
+ @input=${zt=>{zt.stopPropagation();let Mr=zt.target.value;K==="start"?this._startText=Mr:this._endText=Mr}}
948
+ @change=${()=>a(this,_,Za).call(this,K)} @keydown=${r(this,Kp).call(this,K)} />`};return c`<div class="field" role="group" aria-labelledby=${this.label?`${r(this,Le)}-l`:h} aria-label=${!this.label&&d?d:h}>
949
949
  ${this.label?c`<span class="label" id="${r(this,Le)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
950
- ${r(this,_,ss)?a(this,_,Rv).call(this,p,s,l):c`<div class="wrap">
950
+ ${r(this,_,as)?a(this,_,Hv).call(this,p,s,l):c`<div class="wrap">
951
951
  <div class="box" part="box">
952
952
  ${G("start")}<span class="sep" aria-hidden="true">–</span>${G("end")}
953
953
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
954
954
  aria-label=${t&&i?this.t(p?"changeFor":"change",{label:p,start:e.long(t),end:e.long(i)}):this.t(p?"chooseFor":"choose",{label:p})}
955
955
  aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,Le)}-pop"
956
- @click=${r(this,bc)}><cm-icon name="calendar" size="16"></cm-icon></button>
956
+ @click=${r(this,vc)}><cm-icon name="calendar" size="16"></cm-icon></button>
957
957
  </div>
958
958
  <div class="pop" id="${r(this,Le)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
959
- ?hidden=${!this.open} @keydown=${r(this,yc)}>
959
+ ?hidden=${!this.open} @keydown=${r(this,xc)}>
960
960
  ${this.open?c`<div class="body">
961
- ${u.length||r(this,_,pc)?c`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(K=>c`<li>
961
+ ${u.length||r(this,_,mc)?c`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(K=>c`<li>
962
962
  <button type="button" class="preset" data-preset=${K.key||h} aria-pressed=${k(K)?"true":"false"}
963
- @click=${()=>a(this,_,cg).call(this,K)}>${K.label}</button></li>`)}${r(this,_,pc)?c`<li>
963
+ @click=${()=>a(this,_,dg).call(this,K)}>${K.label}</button></li>`)}${r(this,_,mc)?c`<li>
964
964
  <button type="button" class="preset" data-preset="custom" aria-pressed=${L?"true":"false"}
965
- @click=${()=>a(this,_,dg).call(this)}>${this.t("custom")}</button></li>`:h}</ul>`:h}
965
+ @click=${()=>a(this,_,hg).call(this)}>${this.t("custom")}</button></li>`:h}</ul>`:h}
966
966
  <div>
967
967
  <div class="cals">${Array.from({length:P},(K,Z)=>c`<div class="cal">${U(Z)}</div>`)}</div>
968
968
  <p class="status" aria-live="polite">${ve}</p>
969
- ${r(this,_,dc)&&!r(this,_,ss)?c`<div class="foot" part="footer">
969
+ ${r(this,_,hc)&&!r(this,_,as)?c`<div class="foot" part="footer">
970
970
  <span class="draft">${q&&O?`${e.medium(q)} \u2013 ${e.medium(O)}`:q?`${e.medium(q)} \u2013`:this.t("noRange")}</span>
971
- <button type="button" class="act" @click=${()=>a(this,_,mg).call(this)}>${this.t("cancel")}</button>
972
- <button type="button" class="act primary" ?disabled=${!q||!O} @click=${()=>a(this,_,hg).call(this)}>${this.t("apply")}</button>
971
+ <button type="button" class="act" @click=${()=>a(this,_,ug).call(this)}>${this.t("cancel")}</button>
972
+ <button type="button" class="act primary" ?disabled=${!q||!O} @click=${()=>a(this,_,pg).call(this)}>${this.t("apply")}</button>
973
973
  </div>`:h}
974
974
  </div>
975
975
  </div>`:h}
@@ -977,47 +977,47 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
977
977
  </div>`}
978
978
  ${s?c`<p class="error" id="${r(this,Le)}-err" role="alert">${s}</p>`:h}
979
979
  ${this.helpText?c`<p class="help" id="${r(this,Le)}-help">${this.helpText}</p>`:h}
980
- </div>`}};en=new WeakMap,Me=new WeakMap,as=new WeakMap,Le=new WeakMap,tn=new WeakMap,rn=new WeakMap,Ke=new WeakMap,sn=new WeakMap,Wt=new WeakMap,ir=new WeakMap,_=new WeakSet,ss=function(){return this.variant==="report"},dc=function(){return this.confirm||r(this,_,ss)},Bp=function(){return Yi(this,this.locale)},bi=function(){return Ia(r(this,_,Bp))},er=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Pa(r(this,_,Bp)):(Math.trunc(e)%7+7)%7},Xa=function(){this._dStartText=a(this,_,Rt).call(this,this._draftStart),this._dEndText=a(this,_,Rt).call(this,this._draftEnd)},hc=function(){return Number(this.months)!==2||typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches?1:2},Ja=function(e){let t=r(this,_,hc),i=Se(e);i<this._view?this._view=i:i>=be(this._view,t)&&(this._view=be(i,1-t))},lg=function(){let e=sc(this.presets);return e.length||!r(this,_,ss)?e:k0},Fp=function(){return r(this,_,lg).flatMap(e=>{let t=Op(e,new Date,i=>this.t(i),r(this,_,er));return t?[{...t,key:typeof e=="string"?e:""}]:[]})},pc=function(){return r(this,_,lg).includes("custom")},We=new WeakMap,mc=function(){return Mp(r(this,_,bi),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Rt=function(e){let t=R(e);return t?r(this,_,bi).short(t):e},vi=new WeakMap,Av=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},uc=function(e,t,i){let s=i??r(this,_,Fp).find(l=>l.key&&l.start===e&&l.end===t)?.key??"";s!==this.preset&&(g(this,rn,!0),this.preset=s),!(e===this.start&&t===this.end)&&(this.start=e,this.end=t,a(this,_,Av).call(this))},Qa=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?qa(t,r(this,_,bi)):"";t&&!i&&g(this,sn,!0);let s=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,_,uc).call(this,...s),i&&(e==="start"?this._startText=a(this,_,Rt).call(this,i):this._endText=a(this,_,Rt).call(this,i))},Vp=function(e){let t=B(e);if(!this.isUnavailable(t)){if(this._draftPreset="",g(this,Ke,!0),r(this,We)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",g(this,We,"end"),this._focus=e,g(this,Wt,!0),a(this,_,Xa).call(this);return}if(this._draftEnd=t,a(this,_,Xa).call(this),g(this,We,"start"),r(this,_,dc)){this._focus=e,g(this,Wt,!0);return}this.open=!1,a(this,_,uc).call(this,this._draftStart,t,""),a(this,_,Za).call(this)}},cg=function(e){if(r(this,_,dc)){this._draftStart=e.start,this._draftEnd=e.end,this._draftPreset=e.key,g(this,Ke,!1),g(this,We,"start");let t=R(e.end);this._focus=Kt(t,R(this.min),R(this.max)),a(this,_,Ja).call(this,R(e.start)),a(this,_,Ja).call(this,t),g(this,ir,!0),a(this,_,Xa).call(this);return}this.open=!1,a(this,_,uc).call(this,e.start,e.end,e.key),a(this,_,Za).call(this)},dg=function(){g(this,Ke,!0),this._draftPreset="",g(this,We,"start"),g(this,Wt,!0),this.requestUpdate()},hg=function(){!this._draftStart||!this._draftEnd||(this.open=!1,a(this,_,uc).call(this,this._draftStart,this._draftEnd,r(this,Ke)?"":this._draftPreset||void 0),a(this,_,Za).call(this))},pg=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim(),i=t?qa(t,r(this,_,bi)):"";if(i===null||i&&this.isUnavailable(i)){this.requestUpdate();return}g(this,Ke,!0),this._draftPreset="",e==="start"?(this._draftStart=i,i&&this._draftEnd&&this._draftEnd<i&&(this._draftEnd="")):i&&this._draftStart&&i<this._draftStart?(this._draftEnd=this._draftStart,this._draftStart=i):this._draftEnd=i,g(this,We,this._draftStart&&!this._draftEnd?"end":"start");let s=R(i);s&&(this._focus=s,g(this,ir,e==="start")),a(this,_,Xa).call(this)},jp=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim();if(!t)return!1;let i=qa(t,r(this,_,bi));return!i||this.isUnavailable(i)},mg=function(){this.open=!1,a(this,_,Za).call(this)},Za=function(){this.renderRoot.querySelector(".trigger")?.focus()},bc=new WeakMap,Up=new WeakMap,vc=new WeakMap,yc=new WeakMap,xc=new WeakMap,gc=function(e){let t=B(e),i=this._draftStart,s=this._draftEnd||(r(this,We)==="end"&&i?B(this._hover??this._focus):"");return t===i?"start":t===s&&s>i?"end":i&&s&&t>i&&t<s?"in-range":""},fc=function(e,t,i){let s=R(e),l=R(t);if(!s)return"";let d=new Intl.DateTimeFormat(r(this,_,Bp),{day:"numeric",month:"short",...i?{year:"numeric"}:{}}),p=d.formatRange;return(!l||+s==+l?d.format(s):p?p.call(d,s,l):`${d.format(s)} \u2013 ${d.format(l)}`).replace(/[\u202f\u2009\u00a0]/g," ")},Dv=function(){let e=[new Date,R(this._draftStart),R(this._draftEnd),this._focus].filter(p=>!!p).map(Number),t=be(Se(new Date(Math.min(...e))),-12),i=be(Se(new Date(Math.max(...e))),2),s=R(this.min),l=R(this.max);s&&Se(s)>t&&(t=Se(s)),l&&Se(l)<i&&(i=Se(l)),t>i&&(t=i);let d=[];for(let p=t;p<=i&&d.length<600;p=be(p,1))d.push(p);return d},Rv=function(e,t,i){let s=r(this,_,bi),l=R(this.start),d=R(this.end),p=this.open?r(this,_,Fp):[],[u,b,f]=[this._draftStart,this._draftEnd,this._draftPreset],x=!r(this,Ke)&&!!f&&p.some(X=>X.key===f),v=X=>!r(this,Ke)&&(x?X.key===f:X.start===u&&X.end===b),k=r(this,Ke)||!p.some(v)&&!!(u||b),L=new Date().getFullYear(),P=this.preset&&this.preset!=="custom"?Op(this.preset,new Date,X=>this.t(X),r(this,_,er))?.label??"":l&&d&&r(this,_,pc)?this.t("custom"):"",U=l&&d?a(this,_,fc).call(this,this.start,this.end,!0):"",q=Array.from({length:7},(X,St)=>(St+r(this,_,er))%7),O=R(u),ve=R(b),G=O&&ve?Math.round((+ve-+O)/864e5)+1:0,K=r(this,We)==="end"&&u?this.t("chooseEnd",{date:s.medium(O)}):this.t("chooseStart"),Z=l&&d?this.t(e?"changeFor":"change",{label:e,start:s.long(l),end:s.long(d)}):this.t(e?"chooseFor":"choose",{label:e}),zt=X=>{let St=a(this,_,jp).call(this,X);return c`<label class="r-in"><span>${X==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}</span>
981
- <input id="${r(this,Le)}-d${X}" type="text" autocomplete="off" spellcheck="false" placeholder=${r(this,_,mc)}
980
+ </div>`}};tn=new WeakMap,Me=new WeakMap,ns=new WeakMap,Le=new WeakMap,rn=new WeakMap,sn=new WeakMap,Ke=new WeakMap,an=new WeakMap,Gt=new WeakMap,rr=new WeakMap,_=new WeakSet,as=function(){return this.variant==="report"},hc=function(){return this.confirm||r(this,_,as)},Fp=function(){return Xi(this,this.locale)},vi=function(){return qa(r(this,_,Fp))},tr=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ia(r(this,_,Fp)):(Math.trunc(e)%7+7)%7},Ja=function(){this._dStartText=a(this,_,Ht).call(this,this._draftStart),this._dEndText=a(this,_,Ht).call(this,this._draftEnd)},pc=function(){return Number(this.months)!==2||typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches?1:2},Qa=function(e){let t=r(this,_,pc),i=Se(e);i<this._view?this._view=i:i>=be(this._view,t)&&(this._view=be(i,1-t))},cg=function(){let e=ac(this.presets);return e.length||!r(this,_,as)?e:E0},Vp=function(){return r(this,_,cg).flatMap(e=>{let t=Bp(e,new Date,i=>this.t(i),r(this,_,tr));return t?[{...t,key:typeof e=="string"?e:""}]:[]})},mc=function(){return r(this,_,cg).includes("custom")},We=new WeakMap,uc=function(){return _p(r(this,_,vi),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Ht=function(e){let t=R(e);return t?r(this,_,vi).short(t):e},yi=new WeakMap,Dv=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},gc=function(e,t,i){let s=i??r(this,_,Vp).find(l=>l.key&&l.start===e&&l.end===t)?.key??"";s!==this.preset&&(g(this,sn,!0),this.preset=s),!(e===this.start&&t===this.end)&&(this.start=e,this.end=t,a(this,_,Dv).call(this))},Za=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?Oa(t,r(this,_,vi)):"";t&&!i&&g(this,an,!0);let s=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,_,gc).call(this,...s),i&&(e==="start"?this._startText=a(this,_,Ht).call(this,i):this._endText=a(this,_,Ht).call(this,i))},jp=function(e){let t=B(e);if(!this.isUnavailable(t)){if(this._draftPreset="",g(this,Ke,!0),r(this,We)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",g(this,We,"end"),this._focus=e,g(this,Gt,!0),a(this,_,Ja).call(this);return}if(this._draftEnd=t,a(this,_,Ja).call(this),g(this,We,"start"),r(this,_,hc)){this._focus=e,g(this,Gt,!0);return}this.open=!1,a(this,_,gc).call(this,this._draftStart,t,""),a(this,_,en).call(this)}},dg=function(e){if(r(this,_,hc)){this._draftStart=e.start,this._draftEnd=e.end,this._draftPreset=e.key,g(this,Ke,!1),g(this,We,"start");let t=R(e.end);this._focus=Wt(t,R(this.min),R(this.max)),a(this,_,Qa).call(this,R(e.start)),a(this,_,Qa).call(this,t),g(this,rr,!0),a(this,_,Ja).call(this);return}this.open=!1,a(this,_,gc).call(this,e.start,e.end,e.key),a(this,_,en).call(this)},hg=function(){g(this,Ke,!0),this._draftPreset="",g(this,We,"start"),g(this,Gt,!0),this.requestUpdate()},pg=function(){!this._draftStart||!this._draftEnd||(this.open=!1,a(this,_,gc).call(this,this._draftStart,this._draftEnd,r(this,Ke)?"":this._draftPreset||void 0),a(this,_,en).call(this))},mg=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim(),i=t?Oa(t,r(this,_,vi)):"";if(i===null||i&&this.isUnavailable(i)){this.requestUpdate();return}g(this,Ke,!0),this._draftPreset="",e==="start"?(this._draftStart=i,i&&this._draftEnd&&this._draftEnd<i&&(this._draftEnd="")):i&&this._draftStart&&i<this._draftStart?(this._draftEnd=this._draftStart,this._draftStart=i):this._draftEnd=i,g(this,We,this._draftStart&&!this._draftEnd?"end":"start");let s=R(i);s&&(this._focus=s,g(this,rr,e==="start")),a(this,_,Ja).call(this)},Up=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim();if(!t)return!1;let i=Oa(t,r(this,_,vi));return!i||this.isUnavailable(i)},ug=function(){this.open=!1,a(this,_,en).call(this)},en=function(){this.renderRoot.querySelector(".trigger")?.focus()},vc=new WeakMap,Kp=new WeakMap,yc=new WeakMap,xc=new WeakMap,wc=new WeakMap,fc=function(e){let t=B(e),i=this._draftStart,s=this._draftEnd||(r(this,We)==="end"&&i?B(this._hover??this._focus):"");return t===i?"start":t===s&&s>i?"end":i&&s&&t>i&&t<s?"in-range":""},bc=function(e,t,i){let s=R(e),l=R(t);if(!s)return"";let d=new Intl.DateTimeFormat(r(this,_,Fp),{day:"numeric",month:"short",...i?{year:"numeric"}:{}}),p=d.formatRange;return(!l||+s==+l?d.format(s):p?p.call(d,s,l):`${d.format(s)} \u2013 ${d.format(l)}`).replace(/[\u202f\u2009\u00a0]/g," ")},Rv=function(){let e=[new Date,R(this._draftStart),R(this._draftEnd),this._focus].filter(p=>!!p).map(Number),t=be(Se(new Date(Math.min(...e))),-12),i=be(Se(new Date(Math.max(...e))),2),s=R(this.min),l=R(this.max);s&&Se(s)>t&&(t=Se(s)),l&&Se(l)<i&&(i=Se(l)),t>i&&(t=i);let d=[];for(let p=t;p<=i&&d.length<600;p=be(p,1))d.push(p);return d},Hv=function(e,t,i){let s=r(this,_,vi),l=R(this.start),d=R(this.end),p=this.open?r(this,_,Vp):[],[u,b,f]=[this._draftStart,this._draftEnd,this._draftPreset],x=!r(this,Ke)&&!!f&&p.some(X=>X.key===f),v=X=>!r(this,Ke)&&(x?X.key===f:X.start===u&&X.end===b),k=r(this,Ke)||!p.some(v)&&!!(u||b),L=new Date().getFullYear(),P=this.preset&&this.preset!=="custom"?Bp(this.preset,new Date,X=>this.t(X),r(this,_,tr))?.label??"":l&&d&&r(this,_,mc)?this.t("custom"):"",U=l&&d?a(this,_,bc).call(this,this.start,this.end,!0):"",q=Array.from({length:7},(X,St)=>(St+r(this,_,tr))%7),O=R(u),ve=R(b),G=O&&ve?Math.round((+ve-+O)/864e5)+1:0,K=r(this,We)==="end"&&u?this.t("chooseEnd",{date:s.medium(O)}):this.t("chooseStart"),Z=l&&d?this.t(e?"changeFor":"change",{label:e,start:s.long(l),end:s.long(d)}):this.t(e?"chooseFor":"choose",{label:e}),zt=X=>{let St=a(this,_,Up).call(this,X);return c`<label class="r-in"><span>${X==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}</span>
981
+ <input id="${r(this,Le)}-d${X}" type="text" autocomplete="off" spellcheck="false" placeholder=${r(this,_,uc)}
982
982
  .value=${ee(X==="start"?this._dStartText:this._dEndText)} aria-invalid=${St?"true":h}
983
983
  @input=${me=>{me.stopPropagation();let Ve=me.target.value;X==="start"?this._dStartText=Ve:this._dEndText=Ve}}
984
- @change=${me=>{me.stopPropagation(),a(this,_,pg).call(this,X)}}
985
- @keydown=${me=>{me.key==="Enter"&&(me.preventDefault(),a(this,_,pg).call(this,X))}} /></label>`},Er=X=>c`<li>
986
- <button type="button" class="preset" data-preset=${X.key||h} aria-pressed=${v(X)?"true":"false"} @click=${()=>a(this,_,cg).call(this,X)}>
987
- <span class="p-label">${X.label}</span><span class="p-span">${a(this,_,fc).call(this,X.start,X.end,R(X.start).getFullYear()!==L||R(X.end).getFullYear()!==L)}</span>
984
+ @change=${me=>{me.stopPropagation(),a(this,_,mg).call(this,X)}}
985
+ @keydown=${me=>{me.key==="Enter"&&(me.preventDefault(),a(this,_,mg).call(this,X))}} /></label>`},Mr=X=>c`<li>
986
+ <button type="button" class="preset" data-preset=${X.key||h} aria-pressed=${v(X)?"true":"false"} @click=${()=>a(this,_,dg).call(this,X)}>
987
+ <span class="p-label">${X.label}</span><span class="p-span">${a(this,_,bc).call(this,X.start,X.end,R(X.start).getFullYear()!==L||R(X.end).getFullYear()!==L)}</span>
988
988
  </button></li>`;return c`<div class="wrap">
989
989
  <button type="button" class="trigger summary" part="trigger" ?disabled=${this.disabled}
990
990
  aria-label=${P?`${P}, ${Z}`:Z} aria-describedby=${i||h}
991
991
  aria-invalid=${t?"true":h}
992
- aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,Le)}-pop" @click=${r(this,bc)}>
992
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,Le)}-pop" @click=${r(this,vc)}>
993
993
  ${P?c`<span class="chip">${P}</span>`:h}
994
994
  <span class="range ${U?"":"empty"}">${U||this.t("choose")}</span>
995
995
  <cm-icon name="chevron-down" size="16"></cm-icon>
996
996
  </button>
997
997
  <div class="pop r-pop" id="${r(this,Le)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
998
- ?hidden=${!this.open} @keydown=${r(this,yc)}>
998
+ ?hidden=${!this.open} @keydown=${r(this,xc)}>
999
999
  ${this.open?c`<div class="r-body">
1000
1000
  <ul class="presets r-presets" part="presets" aria-label=${this.t("presets")}>
1001
- ${r(this,_,pc)?c`<li class="custom"><button type="button" class="preset" data-preset="custom" aria-pressed=${k?"true":"false"}
1002
- @click=${()=>a(this,_,dg).call(this)}><span class="p-label">${this.t("custom")}</span></button></li>`:h}
1003
- ${p.map(Er)}
1001
+ ${r(this,_,mc)?c`<li class="custom"><button type="button" class="preset" data-preset="custom" aria-pressed=${k?"true":"false"}
1002
+ @click=${()=>a(this,_,hg).call(this)}><span class="p-label">${this.t("custom")}</span></button></li>`:h}
1003
+ ${p.map(Mr)}
1004
1004
  </ul>
1005
1005
  <div class="r-main">
1006
1006
  <div class="r-inputs">${zt("start")}<span class="sep" aria-hidden="true">–</span>${zt("end")}</div>
1007
1007
  <div class="r-months" part="months">
1008
1008
  <div class="r-week" aria-hidden="true">${q.map(X=>c`<span>${s.weekdaysShort[X]}</span>`)}</div>
1009
- ${r(this,_,Dv).map(X=>{let St=B(X).slice(0,7);return c`<div class="r-month" data-month=${St}>${ac({id:`${r(this,Le)}-${St}`,fmt:s,firstDay:r(this,_,er),month:X,focus:this._focus,head:"title",min:R(this.min),max:R(this.max),isDisabled:me=>this.isUnavailable(B(me)),mark:me=>a(this,_,gc).call(this,me),note:me=>{let Ve=a(this,_,gc).call(this,me);return Ve==="start"?this.t("startNote"):Ve==="end"?this.t("endNote"):""},onPick:me=>a(this,_,Vp).call(this,me),onKey:r(this,vc),onMonth:()=>{},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:me=>{r(this,We)==="end"&&(this._hover=me)}})}</div>`})}
1009
+ ${r(this,_,Rv).map(X=>{let St=B(X).slice(0,7);return c`<div class="r-month" data-month=${St}>${nc({id:`${r(this,Le)}-${St}`,fmt:s,firstDay:r(this,_,tr),month:X,focus:this._focus,head:"title",min:R(this.min),max:R(this.max),isDisabled:me=>this.isUnavailable(B(me)),mark:me=>a(this,_,fc).call(this,me),note:me=>{let Ve=a(this,_,fc).call(this,me);return Ve==="start"?this.t("startNote"):Ve==="end"?this.t("endNote"):""},onPick:me=>a(this,_,jp).call(this,me),onKey:r(this,yc),onMonth:()=>{},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:me=>{r(this,We)==="end"&&(this._hover=me)}})}</div>`})}
1010
1010
  </div>
1011
1011
  <p class="status vh" aria-live="polite">${K}</p>
1012
1012
  </div>
1013
1013
  </div>
1014
1014
  <div class="foot r-foot" part="footer">
1015
- <span class="draft">${O&&ve?c`${a(this,_,fc).call(this,u,b,!0)} <span class="count">· ${this.t("dayCount",{count:G})}</span>`:O?`${a(this,_,fc).call(this,u,"",!0)} \u2013`:this.t("noRange")}</span>
1016
- <button type="button" class="act" @click=${()=>a(this,_,mg).call(this)}>${this.t("cancel")}</button>
1017
- <button type="button" class="act primary" ?disabled=${!O||!ve||a(this,_,jp).call(this,"start")||a(this,_,jp).call(this,"end")} @click=${()=>a(this,_,hg).call(this)}>${this.t("apply")}</button>
1015
+ <span class="draft">${O&&ve?c`${a(this,_,bc).call(this,u,b,!0)} <span class="count">· ${this.t("dayCount",{count:G})}</span>`:O?`${a(this,_,bc).call(this,u,"",!0)} \u2013`:this.t("noRange")}</span>
1016
+ <button type="button" class="act" @click=${()=>a(this,_,ug).call(this)}>${this.t("cancel")}</button>
1017
+ <button type="button" class="act primary" ?disabled=${!O||!ve||a(this,_,Up).call(this,"start")||a(this,_,Up).call(this,"end")} @click=${()=>a(this,_,pg).call(this)}>${this.t("apply")}</button>
1018
1018
  </div>`:h}
1019
1019
  </div>
1020
- </div>`},tr.formAssociated=!0,tr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},tr.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Na},isDateDisabled:{attribute:!1},presets:{converter:Na},preset:{reflect:!0},months:{type:Number,reflect:!0},confirm:{type:Boolean,reflect:!0},variant:{reflect:!0},_dStartText:{state:!0},_dEndText:{state:!0},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0},_view:{state:!0},_draftPreset:{state:!0}},tr.styles=[E,Ie,Oa,Tp,w`
1020
+ </div>`},ir.formAssociated=!0,ir.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},ir.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:Pa},isDateDisabled:{attribute:!1},presets:{converter:Pa},preset:{reflect:!0},months:{type:Number,reflect:!0},confirm:{type:Boolean,reflect:!0},variant:{reflect:!0},_dStartText:{state:!0},_dEndText:{state:!0},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0},_view:{state:!0},_draftPreset:{state:!0}},ir.styles=[E,Ie,Ba,Cp,w`
1021
1021
  :host([data-cm-invalid]) .box { border-color: var(--cm-border-critical); }
1022
1022
  .sep { flex: none; color: var(--cm-text-tertiary); }
1023
1023
  input { flex: 0 1 6.6em; }
@@ -1126,33 +1126,33 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1126
1126
  .r-presets { flex: none; }
1127
1127
  .r-months { flex-basis: min(312px, 40vh); }
1128
1128
  }
1129
- `];$("cm-date-range-picker",tr);var IE=z("timePicker",{showTimes:"Show times",times:"Times",timesFor:"Times for {label}",patternHour:"hh",patternMinute:"mm",badInput:"Enter a time like {pattern}.",required:"Enter or choose a time.",rangeUnderflow:"Choose {time} or later.",rangeOverflow:"Choose {time} or earlier.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),on,Re,ns,$t,ln,cn,yi,F,Hv,rr,an,Nv,ug,nn,Kp,Pv,gg,Iv,Wp,Gp,fg,Yp,Xp,Jp,wc,sr=class extends C{constructor(){super(...arguments);m(this,F);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.min="";this.max="";this.step=1;this.hourCycle="";m(this,on,"");this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._active=-1;m(this,Re,this.attachInternals());m(this,ns,new re(this,r(this,Re)));m(this,$t,N("cm-tp"));m(this,ln,null);m(this,cn,!1);m(this,yi,new we);m(this,Yp,e=>{let t=r(this,F,Kp);switch(e.key){case"ArrowDown":case"ArrowUp":{if(e.preventDefault(),!this.open){this.show();return}if(!t.length)return;let i=e.key==="ArrowDown"?1:-1;this._active=this._active<0?0:Math.min(t.length-1,Math.max(0,this._active+i));return}case"PageDown":case"PageUp":if(!this.open||!t.length)return;e.preventDefault(),this._active=Math.min(t.length-1,Math.max(0,this._active+(e.key==="PageDown"?6:-6)));return;case"Enter":this.open&&this._active>=0&&t[this._active]!==void 0?(e.preventDefault(),a(this,F,fg).call(this,t[this._active])):(this.open=!1,a(this,F,Gp).call(this));return;case"Escape":this.open&&(e.preventDefault(),e.stopPropagation(),this.open=!1);return;case"Tab":this.open=!1;return;default:}});m(this,Xp,e=>{if(e.stopPropagation(),this._text=e.target.value,this.open){let t=es(this._text,r(this,F,rr));t&&(this._active=a(this,F,gg).call(this,t))}});m(this,Jp,()=>{this.disabled||(this.open?this.open=!1:(a(this,F,Gp).call(this),this.show()),this.renderRoot.querySelector("input")?.focus())});m(this,wc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,on)}set locale(e){let t=r(this,on);g(this,on,e??""),this.requestUpdate("locale",t)}get valueAsNumber(){return Ee(this.value)}connectedCallback(){super.connectedCallback(),r(this,ln)===null&&g(this,ln,this.value),document.addEventListener("pointerdown",r(this,wc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,yi).close(),document.removeEventListener("pointerdown",r(this,wc),!0)}get form(){return r(this,Re).form}get validity(){return r(this,Re).validity}get validationMessage(){return r(this,Re).validationMessage}checkValidity(){return r(this,Re).checkValidity()}reportValidity(){return r(this,ns).report(()=>r(this,Re).reportValidity())}formResetCallback(){this.value=r(this,ln)??"",this._text=a(this,F,nn).call(this,this.value),this.open=!1,r(this,ns).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(this._active=a(this,F,gg).call(this,Ee(this.value)!==null?this.value:es(this._text,r(this,F,rr))??a(this,F,Pv).call(this)),this.open=!0)}close(){this.open=!1}willUpdate(e){e.has("value")&&!r(this,cn)?this._text=a(this,F,nn).call(this,this.value):(e.has("locale")||e.has("hourCycle"))&&Ee(this.value)!==null&&(this._text=a(this,F,nn).call(this,this.value)),g(this,cn,!1)}updated(e){this.open&&!r(this,yi).active?r(this,yi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch",gap:4}):!this.open&&r(this,yi).active?r(this,yi).close():this.open&&r(this,yi).place(),this.open&&a(this,F,Iv).call(this,e.has("open"));let t=Ee(this.value);r(this,Re).setFormValue(t===null?null:this.value,this.value);let i=this.renderRoot.querySelector("input")??void 0,s=Ee(this.min),l=Ee(this.max),d=r(this,F,rr);this.error?r(this,Re).setValidity({customError:!0},this.error,i):this._text.trim()&&t===null?r(this,Re).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,F,ug)}),i):this.required&&t===null?r(this,Re).setValidity({valueMissing:!0},this.t("required"),i):t!==null&&s!==null&&t<s?r(this,Re).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{time:d.format(s)}),i):t!==null&&l!==null&&t>l?r(this,Re).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{time:d.format(l)}),i):t!==null&&t%r(this,F,an)?r(this,Re).setValidity({stepMismatch:!0},this.t("stepMismatch",{count:r(this,F,an)}),i):r(this,Re).setValidity({}),r(this,ns).sync()}render(){let e=r(this,F,rr),t=r(this,ns).message,i=[t&&`${r(this,$t)}-err`,this.helpText&&`${r(this,$t)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=this.label||s||"",d=this.open?r(this,F,Kp):[],p=Ee(this.value),u=`${r(this,$t)}-list`;return c`<div class="field">
1129
+ `];$("cm-date-range-picker",ir);var BE=z("timePicker",{showTimes:"Show times",times:"Times",timesFor:"Times for {label}",patternHour:"hh",patternMinute:"mm",badInput:"Enter a time like {pattern}.",required:"Enter or choose a time.",rangeUnderflow:"Choose {time} or later.",rangeOverflow:"Choose {time} or earlier.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),ln,Re,os,$t,cn,dn,xi,F,Nv,sr,nn,Pv,gg,on,Wp,Iv,fg,qv,Gp,Yp,bg,Xp,Jp,Qp,$c,ar=class extends C{constructor(){super(...arguments);m(this,F);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.min="";this.max="";this.step=1;this.hourCycle="";m(this,ln,"");this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._active=-1;m(this,Re,this.attachInternals());m(this,os,new re(this,r(this,Re)));m(this,$t,N("cm-tp"));m(this,cn,null);m(this,dn,!1);m(this,xi,new we);m(this,Xp,e=>{let t=r(this,F,Wp);switch(e.key){case"ArrowDown":case"ArrowUp":{if(e.preventDefault(),!this.open){this.show();return}if(!t.length)return;let i=e.key==="ArrowDown"?1:-1;this._active=this._active<0?0:Math.min(t.length-1,Math.max(0,this._active+i));return}case"PageDown":case"PageUp":if(!this.open||!t.length)return;e.preventDefault(),this._active=Math.min(t.length-1,Math.max(0,this._active+(e.key==="PageDown"?6:-6)));return;case"Enter":this.open&&this._active>=0&&t[this._active]!==void 0?(e.preventDefault(),a(this,F,bg).call(this,t[this._active])):(this.open=!1,a(this,F,Yp).call(this));return;case"Escape":this.open&&(e.preventDefault(),e.stopPropagation(),this.open=!1);return;case"Tab":this.open=!1;return;default:}});m(this,Jp,e=>{if(e.stopPropagation(),this._text=e.target.value,this.open){let t=ts(this._text,r(this,F,sr));t&&(this._active=a(this,F,fg).call(this,t))}});m(this,Qp,()=>{this.disabled||(this.open?this.open=!1:(a(this,F,Yp).call(this),this.show()),this.renderRoot.querySelector("input")?.focus())});m(this,$c,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,ln)}set locale(e){let t=r(this,ln);g(this,ln,e??""),this.requestUpdate("locale",t)}get valueAsNumber(){return Ee(this.value)}connectedCallback(){super.connectedCallback(),r(this,cn)===null&&g(this,cn,this.value),document.addEventListener("pointerdown",r(this,$c),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,xi).close(),document.removeEventListener("pointerdown",r(this,$c),!0)}get form(){return r(this,Re).form}get validity(){return r(this,Re).validity}get validationMessage(){return r(this,Re).validationMessage}checkValidity(){return r(this,Re).checkValidity()}reportValidity(){return r(this,os).report(()=>r(this,Re).reportValidity())}formResetCallback(){this.value=r(this,cn)??"",this._text=a(this,F,on).call(this,this.value),this.open=!1,r(this,os).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(this._active=a(this,F,fg).call(this,Ee(this.value)!==null?this.value:ts(this._text,r(this,F,sr))??a(this,F,Iv).call(this)),this.open=!0)}close(){this.open=!1}willUpdate(e){e.has("value")&&!r(this,dn)?this._text=a(this,F,on).call(this,this.value):(e.has("locale")||e.has("hourCycle"))&&Ee(this.value)!==null&&(this._text=a(this,F,on).call(this,this.value)),g(this,dn,!1)}updated(e){this.open&&!r(this,xi).active?r(this,xi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch",gap:4}):!this.open&&r(this,xi).active?r(this,xi).close():this.open&&r(this,xi).place(),this.open&&a(this,F,qv).call(this,e.has("open"));let t=Ee(this.value);r(this,Re).setFormValue(t===null?null:this.value,this.value);let i=this.renderRoot.querySelector("input")??void 0,s=Ee(this.min),l=Ee(this.max),d=r(this,F,sr);this.error?r(this,Re).setValidity({customError:!0},this.error,i):this._text.trim()&&t===null?r(this,Re).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,F,gg)}),i):this.required&&t===null?r(this,Re).setValidity({valueMissing:!0},this.t("required"),i):t!==null&&s!==null&&t<s?r(this,Re).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{time:d.format(s)}),i):t!==null&&l!==null&&t>l?r(this,Re).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{time:d.format(l)}),i):t!==null&&t%r(this,F,nn)?r(this,Re).setValidity({stepMismatch:!0},this.t("stepMismatch",{count:r(this,F,nn)}),i):r(this,Re).setValidity({}),r(this,os).sync()}render(){let e=r(this,F,sr),t=r(this,os).message,i=[t&&`${r(this,$t)}-err`,this.helpText&&`${r(this,$t)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=this.label||s||"",d=this.open?r(this,F,Wp):[],p=Ee(this.value),u=`${r(this,$t)}-list`;return c`<div class="field">
1130
1130
  ${this.label?c`<label class="label" for="${r(this,$t)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
1131
1131
  <div class="wrap">
1132
1132
  <div class="box" part="box">
1133
1133
  <input id="${r(this,$t)}-in" part="input" type="text" autocomplete="off" spellcheck="false" inputmode="text"
1134
1134
  role="combobox" aria-autocomplete="none" aria-expanded=${this.open?"true":"false"} aria-controls=${u}
1135
1135
  aria-activedescendant=${this.open&&this._active>=0&&d[this._active]!==void 0?`${r(this,$t)}-o${d[this._active]}`:h}
1136
- .value=${ee(this._text)} placeholder=${this.placeholder||r(this,F,ug)}
1136
+ .value=${ee(this._text)} placeholder=${this.placeholder||r(this,F,gg)}
1137
1137
  aria-label=${!this.label&&s?s:h}
1138
1138
  ?required=${this.required} ?disabled=${this.disabled}
1139
1139
  aria-invalid=${t?"true":h} aria-describedby=${i||h}
1140
- @input=${r(this,Xp)} @change=${()=>a(this,F,Gp).call(this)} @keydown=${r(this,Yp)} />
1140
+ @input=${r(this,Jp)} @change=${()=>a(this,F,Yp).call(this)} @keydown=${r(this,Xp)} />
1141
1141
  <button type="button" class="trigger" part="trigger" tabindex="-1" ?disabled=${this.disabled}
1142
1142
  aria-label=${this.t("showTimes")} aria-expanded=${this.open?"true":"false"} aria-controls=${u}
1143
- @pointerdown=${b=>b.preventDefault()} @click=${r(this,Jp)}><cm-icon name="clock" size="16"></cm-icon></button>
1143
+ @pointerdown=${b=>b.preventDefault()} @click=${r(this,Qp)}><cm-icon name="clock" size="16"></cm-icon></button>
1144
1144
  </div>
1145
1145
  <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${b=>b.preventDefault()}>
1146
1146
  <ul role="listbox" id=${u} part="listbox" aria-label=${this.t(l?"timesFor":"times",{label:l})}>
1147
- ${d.map((b,f)=>c`<li role="option" id="${r(this,$t)}-o${b}" data-value=${hi(b)}
1147
+ ${d.map((b,f)=>c`<li role="option" id="${r(this,$t)}-o${b}" data-value=${pi(b)}
1148
1148
  class=${f===this._active?"active":""} aria-selected=${b===p?"true":"false"}
1149
- @pointerenter=${()=>{this._active=f}} @click=${()=>a(this,F,fg).call(this,b)}>${e.format(b)}</li>`)}
1149
+ @pointermove=${At(()=>{this._active=f})} @click=${()=>a(this,F,bg).call(this,b)}>${e.format(b)}</li>`)}
1150
1150
  </ul>
1151
1151
  </div>
1152
1152
  </div>
1153
1153
  ${t?c`<p class="error" id="${r(this,$t)}-err" role="alert">${t}</p>`:h}
1154
1154
  ${this.helpText?c`<p class="help" id="${r(this,$t)}-help">${this.helpText}</p>`:h}
1155
- </div>`}};on=new WeakMap,Re=new WeakMap,ns=new WeakMap,$t=new WeakMap,ln=new WeakMap,cn=new WeakMap,yi=new WeakMap,F=new WeakSet,Hv=function(){return Yi(this,this.locale)},rr=function(){return Ha(r(this,F,Hv),this.hourCycle)},an=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=720?e:1},Nv=function(){let e=Math.trunc(Number(this.interval));return e>=1&&e<=720?e:r(this,F,an)>=5?r(this,F,an):30},ug=function(){return Ep(r(this,F,rr),{h:this.t("patternHour"),m:this.t("patternMinute")})},nn=function(e){let t=Ee(e);return t===null?"":r(this,F,rr).format(t)},Kp=function(){let e=Ee(this.min)??0,t=Ee(this.max)??1439,i=r(this,F,Nv),s=r(this,F,an),l=[];for(let d=Math.ceil(e/i)*i;d<=t&&l.length<1440;d+=i)d%s===0&&l.push(d);return l},Pv=function(){let e=new Date;return hi(e.getHours()*60+e.getMinutes())},gg=function(e){let t=r(this,F,Kp);if(!t.length)return-1;let i=Ee(e);if(i===null)return 0;let s=t.findIndex(l=>l>=i);return s===-1?t.length-1:s},Iv=function(e){let t=this.renderRoot.querySelector("[role=listbox]"),i=this.renderRoot.querySelector("[role=option].active");if(!t||!i)return;let s=i.offsetTop-t.offsetTop,l=s+i.offsetHeight;e?t.scrollTop=s-(t.clientHeight-i.offsetHeight)/2:s<t.scrollTop?t.scrollTop=s:l>t.scrollTop+t.clientHeight&&(t.scrollTop=l-t.clientHeight)},Wp=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Gp=function(){let e=this._text.trim(),t=e?es(e,r(this,F,rr)):"";if(t===null){g(this,cn,!0),a(this,F,Wp).call(this,""),this.requestUpdate();return}a(this,F,Wp).call(this,t),this._text=a(this,F,nn).call(this,t)},fg=function(e){let t=hi(e);this.open=!1,a(this,F,Wp).call(this,t),this._text=a(this,F,nn).call(this,t),this.renderRoot.querySelector("input")?.focus()},Yp=new WeakMap,Xp=new WeakMap,Jp=new WeakMap,wc=new WeakMap,sr.formAssociated=!0,sr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},sr.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},min:{},max:{},step:{type:Number},interval:{type:Number},hourCycle:{attribute:"hour-cycle"},locale:{noAccessor:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_active:{state:!0}},sr.styles=[E,Ie,Oa,ua,w`
1155
+ </div>`}};ln=new WeakMap,Re=new WeakMap,os=new WeakMap,$t=new WeakMap,cn=new WeakMap,dn=new WeakMap,xi=new WeakMap,F=new WeakSet,Nv=function(){return Xi(this,this.locale)},sr=function(){return Na(r(this,F,Nv),this.hourCycle)},nn=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=720?e:1},Pv=function(){let e=Math.trunc(Number(this.interval));return e>=1&&e<=720?e:r(this,F,nn)>=5?r(this,F,nn):30},gg=function(){return Mp(r(this,F,sr),{h:this.t("patternHour"),m:this.t("patternMinute")})},on=function(e){let t=Ee(e);return t===null?"":r(this,F,sr).format(t)},Wp=function(){let e=Ee(this.min)??0,t=Ee(this.max)??1439,i=r(this,F,Pv),s=r(this,F,nn),l=[];for(let d=Math.ceil(e/i)*i;d<=t&&l.length<1440;d+=i)d%s===0&&l.push(d);return l},Iv=function(){let e=new Date;return pi(e.getHours()*60+e.getMinutes())},fg=function(e){let t=r(this,F,Wp);if(!t.length)return-1;let i=Ee(e);if(i===null)return 0;let s=t.findIndex(l=>l>=i);return s===-1?t.length-1:s},qv=function(e){let t=this.renderRoot.querySelector("[role=listbox]"),i=this.renderRoot.querySelector("[role=option].active");if(!t||!i)return;let s=i.offsetTop-t.offsetTop,l=s+i.offsetHeight;e?t.scrollTop=s-(t.clientHeight-i.offsetHeight)/2:s<t.scrollTop?t.scrollTop=s:l>t.scrollTop+t.clientHeight&&(t.scrollTop=l-t.clientHeight)},Gp=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Yp=function(){let e=this._text.trim(),t=e?ts(e,r(this,F,sr)):"";if(t===null){g(this,dn,!0),a(this,F,Gp).call(this,""),this.requestUpdate();return}a(this,F,Gp).call(this,t),this._text=a(this,F,on).call(this,t)},bg=function(e){let t=pi(e);this.open=!1,a(this,F,Gp).call(this,t),this._text=a(this,F,on).call(this,t),this.renderRoot.querySelector("input")?.focus()},Xp=new WeakMap,Jp=new WeakMap,Qp=new WeakMap,$c=new WeakMap,ar.formAssociated=!0,ar.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},ar.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},min:{},max:{},step:{type:Number},interval:{type:Number},hourCycle:{attribute:"hour-cycle"},locale:{noAccessor:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_active:{state:!0}},ar.styles=[E,Ie,Ba,ba,w`
1156
1156
  :host([data-cm-invalid]) .box { border-color: var(--cm-border-critical); }
1157
1157
  :host { max-width: 100%; }
1158
1158
  .pop {
@@ -1166,56 +1166,56 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1166
1166
  [role='option'][aria-selected='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
1167
1167
  [role='option'][aria-selected='true'].active { background: var(--cm-action-primary-hover); }
1168
1168
  input { font-variant-numeric: tabular-nums; }
1169
- `];$("cm-time-picker",sr);var UE=z("fileUpload",{prompt:"Drag files here or {browse}",browse:"Browse",drop:"Drop files to upload",uploading:"Uploading {name}",cancel:"Cancel uploading {name}",cancelShort:"Cancel",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function E0(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var ct,xi,de,wi,j,$c,bg,Qp,Zp,vg,yg,xg,wg,os,qv,Ov,$g,Bv,Fv,ar=class extends C{constructor(){super(...arguments);m(this,j);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";this._progress=new Map;this._fileErrors=new Map;this._over=!1;m(this,ct,this.attachInternals());m(this,xi,new re(this,r(this,ct)));m(this,de,N("cm-fu"));m(this,wi,new Map)}get form(){return r(this,ct).form}get validity(){return r(this,ct).validity}get validationMessage(){return r(this,ct).validationMessage}checkValidity(){return r(this,ct).checkValidity()}reportValidity(){return r(this,xi).report(()=>r(this,ct).reportValidity())}formResetCallback(){r(this,xi).reset(),this.files=[],this._rejected="",this._progress=new Map,this._fileErrors=new Map}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,wi).values())URL.revokeObjectURL(e);r(this,wi).clear()}updated(e){if(e.has("files"))for(let[l,d]of r(this,wi))this.files.includes(l)||(URL.revokeObjectURL(d),r(this,wi).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);r(this,ct).setFormValue(this.files.length?t:null);let i=(r(this,j,$c)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,s=this.error||this._rejected;s?r(this,ct).setValidity({customError:!0},s,i):this.required&&!this.files.length?r(this,ct).setValidity({valueMissing:!0},this.t("required"),i):r(this,ct).setValidity({}),r(this,xi).sync()}addFiles(e){let t=[...e],i=[],s=[],l=[];for(let p of t)E0(p,r(this,j,bg))?this.maxSize&&p.size>this.maxSize?(s.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,j,Zp).call(this,this.maxSize)}))):i.push(p):(s.push(p),l.push(this.t("wrongType",{name:p.name})));let d=r(this,j,Qp)?[...this.files,...i]:i.slice(-1);!r(this,j,Qp)&&!i.length&&(d=this.files),r(this,j,Qp)&&this.maxFiles&&d.length>this.maxFiles&&(s.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),s.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:s}})),d!==this.files&&(d.length!==this.files.length||d.some((p,u)=>p!==this.files[u]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}setProgress(e,t){let i=new Map(this._progress);t==null?i.delete(e):i.set(e,Math.min(100,Math.max(0,Number(t)||0))),this._progress=i}setFileError(e,t){let i=new Map(this._fileErrors);t?i.set(e,t):i.delete(e),this._fileErrors=i}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this._progress.has(e)&&this.setProgress(e,null),this._fileErrors.has(e)&&this.setFileError(e,""),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(r(this,j,$c))return a(this,j,Fv).call(this);let e=this.error||this._rejected||r(this,xi).message,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
1169
+ `];$("cm-time-picker",ar);var GE=z("fileUpload",{prompt:"Drag files here or {browse}",browse:"Browse",drop:"Drop files to upload",uploading:"Uploading {name}",cancel:"Cancel uploading {name}",cancelShort:"Cancel",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function M0(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var ct,wi,de,$i,j,kc,vg,Zp,em,yg,xg,wg,$g,ls,Ov,Bv,kg,Fv,Vv,nr=class extends C{constructor(){super(...arguments);m(this,j);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";this._progress=new Map;this._fileErrors=new Map;this._over=!1;m(this,ct,this.attachInternals());m(this,wi,new re(this,r(this,ct)));m(this,de,N("cm-fu"));m(this,$i,new Map)}get form(){return r(this,ct).form}get validity(){return r(this,ct).validity}get validationMessage(){return r(this,ct).validationMessage}checkValidity(){return r(this,ct).checkValidity()}reportValidity(){return r(this,wi).report(()=>r(this,ct).reportValidity())}formResetCallback(){r(this,wi).reset(),this.files=[],this._rejected="",this._progress=new Map,this._fileErrors=new Map}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,$i).values())URL.revokeObjectURL(e);r(this,$i).clear()}updated(e){if(e.has("files"))for(let[l,d]of r(this,$i))this.files.includes(l)||(URL.revokeObjectURL(d),r(this,$i).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);r(this,ct).setFormValue(this.files.length?t:null);let i=(r(this,j,kc)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,s=this.error||this._rejected;s?r(this,ct).setValidity({customError:!0},s,i):this.required&&!this.files.length?r(this,ct).setValidity({valueMissing:!0},this.t("required"),i):r(this,ct).setValidity({}),r(this,wi).sync()}addFiles(e){let t=[...e],i=[],s=[],l=[];for(let p of t)M0(p,r(this,j,vg))?this.maxSize&&p.size>this.maxSize?(s.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,j,em).call(this,this.maxSize)}))):i.push(p):(s.push(p),l.push(this.t("wrongType",{name:p.name})));let d=r(this,j,Zp)?[...this.files,...i]:i.slice(-1);!r(this,j,Zp)&&!i.length&&(d=this.files),r(this,j,Zp)&&this.maxFiles&&d.length>this.maxFiles&&(s.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),s.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:s}})),d!==this.files&&(d.length!==this.files.length||d.some((p,u)=>p!==this.files[u]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}setProgress(e,t){let i=new Map(this._progress);t==null?i.delete(e):i.set(e,Math.min(100,Math.max(0,Number(t)||0))),this._progress=i}setFileError(e,t){let i=new Map(this._fileErrors);t?i.set(e,t):i.delete(e),this._fileErrors=i}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this._progress.has(e)&&this.setProgress(e,null),this._fileErrors.has(e)&&this.setFileError(e,""),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(r(this,j,kc))return a(this,j,Vv).call(this);let e=this.error||this._rejected||r(this,wi).message,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
1170
1170
  ${this.label||this.hint&&i?c`<div class="head">
1171
1171
  ${this.label?c`<span class="label" id="${r(this,de)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
1172
1172
  ${this.hint&&i?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h}
1173
1173
  </div>`:h}
1174
1174
  ${i?c`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
1175
- ${this.files.map(s=>a(this,j,Ov).call(this,s))}
1176
- ${t?c`<li>${a(this,j,$g).call(this,!0)}</li>`:h}
1177
- </ul>`:a(this,j,$g).call(this,!1)}
1175
+ ${this.files.map(s=>a(this,j,Bv).call(this,s))}
1176
+ ${t?c`<li>${a(this,j,kg).call(this,!0)}</li>`:h}
1177
+ </ul>`:a(this,j,kg).call(this,!1)}
1178
1178
  ${e?c`<p class="msg" id="${r(this,de)}-msg" role="alert">${e}</p>`:h}
1179
- `}};ct=new WeakMap,xi=new WeakMap,de=new WeakMap,wi=new WeakMap,j=new WeakSet,$c=function(){return this.variant==="photo"},bg=function(){return this.accept||(r(this,j,$c)?"image/*":"")},Qp=function(){return this.multiple&&!r(this,j,$c)},Zp=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},vg=function(e){let t=r(this,wi).get(e);return t||(t=URL.createObjectURL(e),r(this,wi).set(e,t)),t},yg=function(e){return this._progress.has(e)},xg=function(e){let t=this.dispatchEvent(new CustomEvent("cm-cancel",{detail:{file:e},bubbles:!0,composed:!0,cancelable:!0}));this.setProgress(e,null),t&&this.removeFile(e)},wg=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},os=function(e){this.toggleAttribute("data-over",e),this._over=e},qv=function(){if(this._over)return this.t("drop");let[e,t]=this.prompt.split("{browse}");return t===void 0?e:c`${e}<span class="browse">${this.t("browse")}</span>${t}`},Ov=function(e){let t=a(this,j,yg).call(this,e),i=this._fileErrors.get(e)??"",s=`${r(this,de)}-e${this.files.indexOf(e)}`,l=this._progress.get(e)??0;return c`<li class="item"><div class="file ${t?"busy":""} ${i?"invalid":""}">
1180
- ${e.type.startsWith("image/")?c`<img src=${a(this,j,vg).call(this,e)} alt=${e.name} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${e.name}</span><span class="size">${a(this,j,Zp).call(this,e.size)}</span></div>`}
1179
+ `}};ct=new WeakMap,wi=new WeakMap,de=new WeakMap,$i=new WeakMap,j=new WeakSet,kc=function(){return this.variant==="photo"},vg=function(){return this.accept||(r(this,j,kc)?"image/*":"")},Zp=function(){return this.multiple&&!r(this,j,kc)},em=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},yg=function(e){let t=r(this,$i).get(e);return t||(t=URL.createObjectURL(e),r(this,$i).set(e,t)),t},xg=function(e){return this._progress.has(e)},wg=function(e){let t=this.dispatchEvent(new CustomEvent("cm-cancel",{detail:{file:e},bubbles:!0,composed:!0,cancelable:!0}));this.setProgress(e,null),t&&this.removeFile(e)},$g=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},ls=function(e){this.toggleAttribute("data-over",e),this._over=e},Ov=function(){if(this._over)return this.t("drop");let[e,t]=this.prompt.split("{browse}");return t===void 0?e:c`${e}<span class="browse">${this.t("browse")}</span>${t}`},Bv=function(e){let t=a(this,j,xg).call(this,e),i=this._fileErrors.get(e)??"",s=`${r(this,de)}-e${this.files.indexOf(e)}`,l=this._progress.get(e)??0;return c`<li class="item"><div class="file ${t?"busy":""} ${i?"invalid":""}">
1180
+ ${e.type.startsWith("image/")?c`<img src=${a(this,j,yg).call(this,e)} alt=${e.name} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${e.name}</span><span class="size">${a(this,j,em).call(this,e.size)}</span></div>`}
1181
1181
  ${t?c`<div class="bar" part="progress" role="progressbar" aria-label=${this.t("uploading",{name:e.name})}
1182
1182
  aria-valuemin="0" aria-valuemax="100" aria-valuenow=${Math.round(l)}><span style="inline-size:${l}%"></span></div>`:h}
1183
- ${this.disabled?h:t?c`<button type="button" class="remove" aria-label=${this.t("cancel",{name:e.name})} @click=${()=>a(this,j,xg).call(this,e)}><cm-icon name="close" size="12"></cm-icon></button>`:c`<button type="button" class="remove" aria-label=${this.t("remove",{name:e.name})} aria-describedby=${i?s:h}
1183
+ ${this.disabled?h:t?c`<button type="button" class="remove" aria-label=${this.t("cancel",{name:e.name})} @click=${()=>a(this,j,wg).call(this,e)}><cm-icon name="close" size="12"></cm-icon></button>`:c`<button type="button" class="remove" aria-label=${this.t("remove",{name:e.name})} aria-describedby=${i?s:h}
1184
1184
  @click=${()=>this.removeFile(e)}><cm-icon name="close" size="12"></cm-icon></button>`}
1185
- </div>${i?c`<p class="ferr" id=${s} role="alert">${i}</p>`:h}</li>`},$g=function(e){let t=this.error||this._rejected||r(this,xi).message,i=[this.hint&&`${r(this,de)}-hint`,t&&`${r(this,de)}-msg`].filter(Boolean).join(" ");return c`<label class="zone ${e?"tile":"row"} ${t&&!e?"invalid":""}" part="zone"
1186
- @dragenter=${()=>a(this,j,os).call(this,!0)} @dragleave=${()=>a(this,j,os).call(this,!1)} @drop=${()=>a(this,j,os).call(this,!1)}>
1185
+ </div>${i?c`<p class="ferr" id=${s} role="alert">${i}</p>`:h}</li>`},kg=function(e){let t=this.error||this._rejected||r(this,wi).message,i=[this.hint&&`${r(this,de)}-hint`,t&&`${r(this,de)}-msg`].filter(Boolean).join(" ");return c`<label class="zone ${e?"tile":"row"} ${t&&!e?"invalid":""}" part="zone"
1186
+ @dragenter=${()=>a(this,j,ls).call(this,!0)} @dragleave=${()=>a(this,j,ls).call(this,!1)} @drop=${()=>a(this,j,ls).call(this,!1)}>
1187
1187
  <input type="file" id=${r(this,de)} accept=${this.accept||h} capture=${this.capture||h} ?multiple=${this.multiple} ?disabled=${this.disabled}
1188
1188
  ?required=${this.required&&!this.files.length}
1189
1189
  aria-labelledby=${[this.label&&`${r(this,de)}-l`,`${r(this,de)}-p`].filter(Boolean).join(" ")}
1190
1190
  aria-describedby=${i||h} aria-invalid=${t?"true":h}
1191
- @change=${a(this,j,wg)} @cancel=${s=>s.stopPropagation()} />
1191
+ @change=${a(this,j,$g)} @cancel=${s=>s.stopPropagation()} />
1192
1192
  ${e?c`<cm-icon name="plus" size="24"></cm-icon><span id="${r(this,de)}-p">${this.t("addMore")}</span>`:c`<span class="ico"><cm-icon name="upload" size="20"></cm-icon></span>
1193
- <span class="words"><span id="${r(this,de)}-p">${a(this,j,qv).call(this)}</span>${this.hint?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h}</span>`}
1194
- </label>`},Bv=function(){this.renderRoot.querySelector("input[type=file]")?.click()},Fv=function(){let e=this.files[0],t=this.error||this._rejected||e&&this._fileErrors.get(e)||r(this,xi).message,i=!!e&&a(this,j,yg).call(this,e),s=this.label||this.t("photo"),l=[this.hint&&`${r(this,de)}-hint`,t&&`${r(this,de)}-msg`].filter(Boolean).join(" "),d=u=>c`<input type="file" id=${r(this,de)} accept=${r(this,j,bg)} capture=${this.capture||h}
1193
+ <span class="words"><span id="${r(this,de)}-p">${a(this,j,Ov).call(this)}</span>${this.hint?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h}</span>`}
1194
+ </label>`},Fv=function(){this.renderRoot.querySelector("input[type=file]")?.click()},Vv=function(){let e=this.files[0],t=this.error||this._rejected||e&&this._fileErrors.get(e)||r(this,wi).message,i=!!e&&a(this,j,xg).call(this,e),s=this.label||this.t("photo"),l=[this.hint&&`${r(this,de)}-hint`,t&&`${r(this,de)}-msg`].filter(Boolean).join(" "),d=u=>c`<input type="file" id=${r(this,de)} accept=${r(this,j,vg)} capture=${this.capture||h}
1195
1195
  ?disabled=${this.disabled} ?required=${this.required&&!e} tabindex=${u?"-1":h} aria-hidden=${u?"true":h}
1196
1196
  ?hidden=${u} aria-labelledby=${u?h:`${r(this,de)}-p`} aria-describedby=${!u&&l||h} aria-invalid=${t?"true":h}
1197
- @change=${a(this,j,wg)} @cancel=${b=>b.stopPropagation()} />`,p=this.hint?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h;return c`
1197
+ @change=${a(this,j,$g)} @cancel=${b=>b.stopPropagation()} />`,p=this.hint?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h;return c`
1198
1198
  ${e?c`<div class="shot ${i?"busy":""}" part="photo">
1199
- ${e.type.startsWith("image/")?c`<img src=${a(this,j,vg).call(this,e)} alt=${s} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${e.name}</span><span class="size">${a(this,j,Zp).call(this,e.size)}</span></div>`}
1199
+ ${e.type.startsWith("image/")?c`<img src=${a(this,j,yg).call(this,e)} alt=${s} />`:c`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${e.name}</span><span class="size">${a(this,j,em).call(this,e.size)}</span></div>`}
1200
1200
  ${i?c`<div class="bar" part="progress" role="progressbar" aria-label=${this.t("uploading",{name:e.name})}
1201
1201
  aria-valuemin="0" aria-valuemax="100" aria-valuenow=${Math.round(this._progress.get(e)??0)}><span style="inline-size:${this._progress.get(e)??0}%"></span></div>`:h}
1202
1202
  </div>
1203
1203
  <p class="caption" aria-hidden="true">${this.label}</p>
1204
1204
  ${d(!0)}
1205
1205
  ${this.disabled?h:i?c`<div class="actions" part="actions">
1206
- <button type="button" class="action" aria-label=${this.t("cancel",{name:s})} @click=${()=>a(this,j,xg).call(this,e)}><cm-icon name="close" size="16"></cm-icon>${this.t("cancelShort")}</button>
1206
+ <button type="button" class="action" aria-label=${this.t("cancel",{name:s})} @click=${()=>a(this,j,wg).call(this,e)}><cm-icon name="close" size="16"></cm-icon>${this.t("cancelShort")}</button>
1207
1207
  </div>`:c`<div class="actions" part="actions">
1208
- <button type="button" class="action retake" aria-label=${this.t("retakeName",{name:s})} aria-describedby=${t?`${r(this,de)}-msg`:h} @click=${a(this,j,Bv)}><cm-icon name="camera" size="16"></cm-icon>${this.t("retake")}</button>
1208
+ <button type="button" class="action retake" aria-label=${this.t("retakeName",{name:s})} aria-describedby=${t?`${r(this,de)}-msg`:h} @click=${a(this,j,Fv)}><cm-icon name="camera" size="16"></cm-icon>${this.t("retake")}</button>
1209
1209
  <button type="button" class="action" aria-label=${this.t("removeName",{name:s})} @click=${()=>this.removeFile(e)}><cm-icon name="trash" size="16"></cm-icon>${this.t("removePhoto")}</button>
1210
1210
  </div>`}`:c`<label class="zone photo ${t?"invalid":""}" part="zone photo"
1211
- @dragenter=${()=>a(this,j,os).call(this,!0)} @dragleave=${()=>a(this,j,os).call(this,!1)} @drop=${()=>a(this,j,os).call(this,!1)}>
1211
+ @dragenter=${()=>a(this,j,ls).call(this,!0)} @dragleave=${()=>a(this,j,ls).call(this,!1)} @drop=${()=>a(this,j,ls).call(this,!1)}>
1212
1212
  ${d(!1)}
1213
1213
  <cm-icon name="camera" size="24"></cm-icon>
1214
1214
  <span class="photo-label" id="${r(this,de)}-p" part="label">${this.label||this.t("takePhoto")}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
1215
1215
  ${p}
1216
1216
  </label>`}
1217
1217
  ${t?c`<p class="msg" id="${r(this,de)}-msg" role="alert">${t}</p>`:h}
1218
- `},ar.formAssociated=!0,ar.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},ar.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},variant:{reflect:!0},capture:{reflect:!0},_rejected:{state:!0},_progress:{state:!0},_fileErrors:{state:!0},_over:{state:!0}},ar.styles=[E,w`
1218
+ `},nr.formAssociated=!0,nr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},nr.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},variant:{reflect:!0},capture:{reflect:!0},_rejected:{state:!0},_progress:{state:!0},_fileErrors:{state:!0},_over:{state:!0}},nr.styles=[E,w`
1219
1219
  :host { display: block; }
1220
1220
  .head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-8); margin-bottom: var(--cm-space-12); }
1221
1221
  .label { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
@@ -1299,75 +1299,75 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1299
1299
  @media (max-width: 640px) {
1300
1300
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
1301
1301
  }
1302
- `];$("cm-file-upload",ar);var $i=(o,n,e)=>Math.min(e,Math.max(n,o)),ls=(o,n=0)=>{let e=10**n;return Math.round(o*e)/e};function ds(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}function em(o,n){let e=/^(-?\d*\.?\d+(?:e-?\d+)?)(%)?$/i.exec(o.trim());if(!e)return null;let t=parseFloat(e[1]);return e[2]?t/100*n:t}function jv(o){let n=/^(-?\d*\.?\d+)(deg|turn|rad|grad)?$/i.exec(o.trim());if(!n)return null;let e=parseFloat(n[1]),t=(n[2]??"deg").toLowerCase();return((t==="turn"?e*360:t==="rad"?e*180/Math.PI:t==="grad"?e*.9:e)%360+360)%360}function M0(o){let n=o.trim(),e;if(n.includes(","))e=n.split(",").map(t=>t.trim());else{let[t,i]=n.split("/").map(s=>s.trim());e=t.split(/\s+/),i!==void 0&&e.push(i)}return e.length===3||e.length===4?e:null}function qe(o){let n=(o??"").trim().toLowerCase();if(!n)return null;if(n==="transparent")return{r:0,g:0,b:0,a:0};let e=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(n);if(e){let u=e[1];u.length<=4&&(u=[...u].map(f=>f+f).join(""));let b=f=>parseInt(u.slice(f,f+2),16);return{r:b(0),g:b(2),b:b(4),a:u.length===8?ls(b(6)/255,3):1}}let t=/^(rgba?|hsla?)\((.*)\)$/.exec(n);if(!t)return null;let i=M0(t[2]);if(!i)return null;let s=i[3]===void 0?1:em(i[3],1);if(s===null)return null;if(t[1].startsWith("rgb")){let[u,b,f]=i.slice(0,3).map(x=>em(x,255));return u===null||b===null||f===null?null:{r:$i(Math.round(u),0,255),g:$i(Math.round(b),0,255),b:$i(Math.round(f),0,255),a:$i(ls(s,3),0,1)}}let l=jv(i[0]),d=em(i[1].endsWith("%")?i[1]:`${i[1]}%`,100),p=em(i[2].endsWith("%")?i[2]:`${i[2]}%`,100);return l===null||d===null||p===null?null:{...Mc({h:l,s:$i(d,0,100),l:$i(p,0,100),a:1}),a:$i(ls(s,3),0,1)}}function im({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=0;return u&&(b=d===i?(s-l)/u%6:d===s?(l-i)/u+2:(i-s)/u+4),{h:(b*60+360)%360,s:d?u/d*100:0,v:d*100,a:t}}function rm({h:o,s:n,v:e,a:t}){let i=n/100,s=e/100,l=d=>{let p=(d+o/60)%6;return s-s*i*Math.max(0,Math.min(p,4-p,1))};return{r:Math.round(l(5)*255),g:Math.round(l(3)*255),b:Math.round(l(1)*255),a:t}}function Ec({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=(d+p)/2,f=u?u/(1-Math.abs(2*b-1)):0;return{h:im({r:o,g:n,b:e,a:t}).h,s:f*100,l:b*100,a:t}}function Mc({h:o,s:n,l:e,a:t}){let i=n/100,s=e/100,l=u=>(u+o/30)%12,d=i*Math.min(s,1-s),p=u=>s-d*Math.max(-1,Math.min(l(u)-3,9-l(u),1));return{r:Math.round(p(0)*255),g:Math.round(p(8)*255),b:Math.round(p(4)*255),a:t}}var tm=o=>Math.round(o).toString(16).padStart(2,"0"),kc=({r:o,g:n,b:e})=>`#${tm(o)}${tm(n)}${tm(e)}`;function hs(o,n="hex"){let e=ls($i(o.a,0,1),2),t=e<1;if(n==="rgb")return t?`rgba(${o.r}, ${o.g}, ${o.b}, ${e})`:`rgb(${o.r}, ${o.g}, ${o.b})`;if(n==="hsl"){let{h:i,s,l}=Ec(o),d=`${Math.round(i)}, ${Math.round(s)}%, ${Math.round(l)}%`;return t?`hsla(${d}, ${e})`:`hsl(${d})`}return t?`${kc(o)}${tm(e*255)}`:kc(o)}function _0(o){let n=[],e=0,t=0;for(let i=0;i<o.length;i++)o[i]==="("?e++:o[i]===")"?e--:o[i]===","&&e===0&&(n.push(o.slice(t,i).trim()),t=i+1);return n.push(o.slice(t).trim()),n}var Vv={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};function Ht(o){let n=/^(linear|radial)-gradient\((.*)\)$/i.exec((o??"").trim());if(!n)return null;let e=n[1].toLowerCase(),t=_0(n[2]),i=180,s=t[0]?.toLowerCase().replace(/\s+/g," ")??"";if(e==="linear"){let p=jv(s);p!==null&&/[a-z]/.test(s)?(i=p,t.shift()):s in Vv&&(i=Vv[s],t.shift())}else/^(circle|ellipse|closest|farthest|at )/.test(s)&&!qe(s.split(" ")[0])&&t.shift();let l=t.map(p=>{let u=/^(.*?)(?:\s+(-?\d*\.?\d+)%)?$/.exec(p);return{color:qe(u[1]),position:u[2]===void 0?void 0:$i(parseFloat(u[2]),0,100)}});if(l.length<2||l.some(p=>!p.color))return null;let d=l.map((p,u)=>({color:p.color,position:p.position??ls(u/(l.length-1)*100,1)}));return{type:e,angle:Math.round(i),stops:d}}function cs(o,n="hex"){let e=[...o.stops].sort((t,i)=>t.position-i.position).map(t=>`${hs(t.color,n)} ${ls(t.position,1)}%`).join(", ");return o.type==="radial"?`radial-gradient(circle, ${e})`:`linear-gradient(${Math.round(o.angle)}deg, ${e})`}function Uv(o,n){let e=[...o.stops].sort((t,i)=>t.position-i.position);if(n<=e[0].position)return{...e[0].color};for(let t=1;t<e.length;t++)if(n<=e[t].position){let i=e[t-1],s=e[t],l=(n-i.position)/(s.position-i.position||1),d=(p,u)=>p+(u-p)*l;return{r:Math.round(d(i.color.r,s.color.r)),g:Math.round(d(i.color.g,s.color.g)),b:Math.round(d(i.color.b,s.color.b)),a:ls(d(i.color.a,s.color.a),2)}}return{...e[e.length-1].color}}function _c(o,n){let e=qe(o),t=qe(n);if(e&&t)return e.r===t.r&&e.g===t.g&&e.b===t.b&&Math.abs(e.a-t.a)<.005;let i=Ht(o),s=Ht(n);return!!i&&!!s&&cs(i)===cs(s)}var kg=o=>!!qe(o)||!!Ht(o);var dn=16;function sm(o,n,e=16){let t=n.trim().toLowerCase();return[n.trim(),...o.filter(i=>i.trim().toLowerCase()!==t)].slice(0,e)}function Eg(o="default",n=16){let e=`cm-recent-colors:${o}`,t=()=>{try{let i=JSON.parse(localStorage.getItem(e)??"[]");return Array.isArray(i)?i.filter(s=>typeof s=="string").slice(0,n):[]}catch{return[]}};return{recentColors:async()=>t(),async addRecentColor(i){let s=sm(t(),i,n);try{localStorage.setItem(e,JSON.stringify(s))}catch{}return s}}}function T0(o){let n=o.baseUrl.replace(/\/+$/,""),e=async(t,i={})=>{let s=typeof o.headers=="function"?await o.headers():o.headers??{},l=await(o.fetch??fetch)(`${n}${t}`,{credentials:o.credentials??"same-origin",...i,headers:{Accept:"application/json",...i.body?{"Content-Type":"application/json"}:{},...s}});if(!l.ok)throw new Error(`Colour API ${t}: HTTP ${l.status}`);let d=await l.json();return Array.isArray(d?.colors)?d.colors:[]};return{brandColors:()=>e("/brand-colors"),recentColors:async()=>(await e("/recent-colors")).filter(t=>typeof t=="string"),addRecentColor:async t=>(await e("/recent-colors",{method:"POST",body:JSON.stringify({color:t})})).filter(i=>typeof i=="string")}}var iM=z("colorPicker",{label:"Colour picker",solid:"Solid",gradient:"Gradient",area:"Saturation and brightness",areaValue:"Saturation {s}%, brightness {v}%",hue:"Hue",opacity:"Opacity",format:"Colour format",hex:"Hex",rgb:"RGB",hsl:"HSL",red:"Red",green:"Green",blue:"Blue",saturation:"Saturation",lightness:"Lightness",eyedropper:"Pick a colour from the screen",gradientType:"Gradient type",linear:"Linear",radial:"Radial",angle:"Angle",stops:"Gradient stops",stop:"Stop {n}, {color} at {position}%",addStop:"Add stop",removeStop:"Remove stop",brand:"Brand colours",recent:"Recent",palette:"Palette",swatch:"{name}, {value}"}),Kv=["#000000","#707070","#c9c9c9","#de0000","#ad5500","#f1a953","#ffc107","#81bb47","#3c7c00","#5394d9","#2e6faf","#446beb"].map(o=>({value:o})),C0=["hex","rgb","hsl"],Mg=o=>(o??[]).flatMap(n=>{let e=typeof n=="string"?{value:n}:n;return e&&typeof e.value=="string"&&(qe(e.value)||Ht(e.value))?[{value:e.value.trim(),name:e.name}]:[]}),lm,Sc,mn,Lc,ki,T,_g,Tg,Wv,nr,ps,dt,Cg,zg,Sg,Gv,Yv,Tc,Xv,Lg,Ag,Jv,am,Dg,Qv,Cc,nm,zc,Rg,Zv,ey,ty,hn,Hg,iy,ry,om,sy,pn=class extends C{constructor(){super(...arguments);m(this,T);this.value="";this.format="hex";this.formats="hex rgb hsl";this.alpha=!1;this.gradient=!1;this.recentKey="";this.maxRecent=16;this.eyedropper=!0;this.disabled=!1;this._hsva={h:0,s:0,v:0,a:1};this._grad=null;this._stop=0;this._brand=[];this._recent=[];this._drafts={};m(this,lm,N("cm-cp"));m(this,Sc);m(this,mn);m(this,Lc);m(this,ki,null)}connectedCallback(){super.connectedCallback(),a(this,T,Tg).call(this)}get allowedFormats(){let e=String(this.formats??"").split(/[\s,]+/).filter(t=>C0.includes(t));return e.length?e:["hex"]}get palette(){return this.swatches?Mg(this.swatches):Kv}get brand(){return this.brandColors?Mg(this.brandColors):this._brand}get recent(){return(this.recentColors??this._recent).filter(t=>qe(t)||this.gradient&&Ht(t)).filter(t=>this.alpha||(qe(t)?.a??1)===1).slice(0,this.maxRecent||16)}willUpdate(e){e.has("recentKey")&&g(this,Lc,void 0),(e.has("source")||e.has("recentKey"))&&a(this,T,Tg).call(this),e.has("format")&&!this.allowedFormats.includes(this.format)&&(this.format=this.allowedFormats[0]),e.has("value")&&this.value!==r(this,Sc)&&a(this,T,Wv).call(this)}render(){let{h:e,s:t,v:i,a:s}=this._hsva,l=r(this,T,ps),d=kc(l),p=this.allowedFormats,u=this._grad,b=this.matches(":dir(rtl)"),f=this.eyedropper&&typeof window<"u"&&"EyeDropper"in window,x=u?cs({...u,type:"linear",angle:b?270:90}):"";return c`<div class="panel" role="group" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1302
+ `];$("cm-file-upload",nr);var ki=(o,n,e)=>Math.min(e,Math.max(n,o)),cs=(o,n=0)=>{let e=10**n;return Math.round(o*e)/e};function hs(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}function tm(o,n){let e=/^(-?\d*\.?\d+(?:e-?\d+)?)(%)?$/i.exec(o.trim());if(!e)return null;let t=parseFloat(e[1]);return e[2]?t/100*n:t}function Uv(o){let n=/^(-?\d*\.?\d+)(deg|turn|rad|grad)?$/i.exec(o.trim());if(!n)return null;let e=parseFloat(n[1]),t=(n[2]??"deg").toLowerCase();return((t==="turn"?e*360:t==="rad"?e*180/Math.PI:t==="grad"?e*.9:e)%360+360)%360}function _0(o){let n=o.trim(),e;if(n.includes(","))e=n.split(",").map(t=>t.trim());else{let[t,i]=n.split("/").map(s=>s.trim());e=t.split(/\s+/),i!==void 0&&e.push(i)}return e.length===3||e.length===4?e:null}function qe(o){let n=(o??"").trim().toLowerCase();if(!n)return null;if(n==="transparent")return{r:0,g:0,b:0,a:0};let e=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(n);if(e){let u=e[1];u.length<=4&&(u=[...u].map(f=>f+f).join(""));let b=f=>parseInt(u.slice(f,f+2),16);return{r:b(0),g:b(2),b:b(4),a:u.length===8?cs(b(6)/255,3):1}}let t=/^(rgba?|hsla?)\((.*)\)$/.exec(n);if(!t)return null;let i=_0(t[2]);if(!i)return null;let s=i[3]===void 0?1:tm(i[3],1);if(s===null)return null;if(t[1].startsWith("rgb")){let[u,b,f]=i.slice(0,3).map(x=>tm(x,255));return u===null||b===null||f===null?null:{r:ki(Math.round(u),0,255),g:ki(Math.round(b),0,255),b:ki(Math.round(f),0,255),a:ki(cs(s,3),0,1)}}let l=Uv(i[0]),d=tm(i[1].endsWith("%")?i[1]:`${i[1]}%`,100),p=tm(i[2].endsWith("%")?i[2]:`${i[2]}%`,100);return l===null||d===null||p===null?null:{..._c({h:l,s:ki(d,0,100),l:ki(p,0,100),a:1}),a:ki(cs(s,3),0,1)}}function rm({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=0;return u&&(b=d===i?(s-l)/u%6:d===s?(l-i)/u+2:(i-s)/u+4),{h:(b*60+360)%360,s:d?u/d*100:0,v:d*100,a:t}}function sm({h:o,s:n,v:e,a:t}){let i=n/100,s=e/100,l=d=>{let p=(d+o/60)%6;return s-s*i*Math.max(0,Math.min(p,4-p,1))};return{r:Math.round(l(5)*255),g:Math.round(l(3)*255),b:Math.round(l(1)*255),a:t}}function Mc({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=(d+p)/2,f=u?u/(1-Math.abs(2*b-1)):0;return{h:rm({r:o,g:n,b:e,a:t}).h,s:f*100,l:b*100,a:t}}function _c({h:o,s:n,l:e,a:t}){let i=n/100,s=e/100,l=u=>(u+o/30)%12,d=i*Math.min(s,1-s),p=u=>s-d*Math.max(-1,Math.min(l(u)-3,9-l(u),1));return{r:Math.round(p(0)*255),g:Math.round(p(8)*255),b:Math.round(p(4)*255),a:t}}var im=o=>Math.round(o).toString(16).padStart(2,"0"),Ec=({r:o,g:n,b:e})=>`#${im(o)}${im(n)}${im(e)}`;function ps(o,n="hex"){let e=cs(ki(o.a,0,1),2),t=e<1;if(n==="rgb")return t?`rgba(${o.r}, ${o.g}, ${o.b}, ${e})`:`rgb(${o.r}, ${o.g}, ${o.b})`;if(n==="hsl"){let{h:i,s,l}=Mc(o),d=`${Math.round(i)}, ${Math.round(s)}%, ${Math.round(l)}%`;return t?`hsla(${d}, ${e})`:`hsl(${d})`}return t?`${Ec(o)}${im(e*255)}`:Ec(o)}function T0(o){let n=[],e=0,t=0;for(let i=0;i<o.length;i++)o[i]==="("?e++:o[i]===")"?e--:o[i]===","&&e===0&&(n.push(o.slice(t,i).trim()),t=i+1);return n.push(o.slice(t).trim()),n}var jv={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};function Nt(o){let n=/^(linear|radial)-gradient\((.*)\)$/i.exec((o??"").trim());if(!n)return null;let e=n[1].toLowerCase(),t=T0(n[2]),i=180,s=t[0]?.toLowerCase().replace(/\s+/g," ")??"";if(e==="linear"){let p=Uv(s);p!==null&&/[a-z]/.test(s)?(i=p,t.shift()):s in jv&&(i=jv[s],t.shift())}else/^(circle|ellipse|closest|farthest|at )/.test(s)&&!qe(s.split(" ")[0])&&t.shift();let l=t.map(p=>{let u=/^(.*?)(?:\s+(-?\d*\.?\d+)%)?$/.exec(p);return{color:qe(u[1]),position:u[2]===void 0?void 0:ki(parseFloat(u[2]),0,100)}});if(l.length<2||l.some(p=>!p.color))return null;let d=l.map((p,u)=>({color:p.color,position:p.position??cs(u/(l.length-1)*100,1)}));return{type:e,angle:Math.round(i),stops:d}}function ds(o,n="hex"){let e=[...o.stops].sort((t,i)=>t.position-i.position).map(t=>`${ps(t.color,n)} ${cs(t.position,1)}%`).join(", ");return o.type==="radial"?`radial-gradient(circle, ${e})`:`linear-gradient(${Math.round(o.angle)}deg, ${e})`}function Kv(o,n){let e=[...o.stops].sort((t,i)=>t.position-i.position);if(n<=e[0].position)return{...e[0].color};for(let t=1;t<e.length;t++)if(n<=e[t].position){let i=e[t-1],s=e[t],l=(n-i.position)/(s.position-i.position||1),d=(p,u)=>p+(u-p)*l;return{r:Math.round(d(i.color.r,s.color.r)),g:Math.round(d(i.color.g,s.color.g)),b:Math.round(d(i.color.b,s.color.b)),a:cs(d(i.color.a,s.color.a),2)}}return{...e[e.length-1].color}}function Tc(o,n){let e=qe(o),t=qe(n);if(e&&t)return e.r===t.r&&e.g===t.g&&e.b===t.b&&Math.abs(e.a-t.a)<.005;let i=Nt(o),s=Nt(n);return!!i&&!!s&&ds(i)===ds(s)}var Eg=o=>!!qe(o)||!!Nt(o);var hn=16;function am(o,n,e=16){let t=n.trim().toLowerCase();return[n.trim(),...o.filter(i=>i.trim().toLowerCase()!==t)].slice(0,e)}function Mg(o="default",n=16){let e=`cm-recent-colors:${o}`,t=()=>{try{let i=JSON.parse(localStorage.getItem(e)??"[]");return Array.isArray(i)?i.filter(s=>typeof s=="string").slice(0,n):[]}catch{return[]}};return{recentColors:async()=>t(),async addRecentColor(i){let s=am(t(),i,n);try{localStorage.setItem(e,JSON.stringify(s))}catch{}return s}}}function C0(o){let n=o.baseUrl.replace(/\/+$/,""),e=async(t,i={})=>{let s=typeof o.headers=="function"?await o.headers():o.headers??{},l=await(o.fetch??fetch)(`${n}${t}`,{credentials:o.credentials??"same-origin",...i,headers:{Accept:"application/json",...i.body?{"Content-Type":"application/json"}:{},...s}});if(!l.ok)throw new Error(`Colour API ${t}: HTTP ${l.status}`);let d=await l.json();return Array.isArray(d?.colors)?d.colors:[]};return{brandColors:()=>e("/brand-colors"),recentColors:async()=>(await e("/recent-colors")).filter(t=>typeof t=="string"),addRecentColor:async t=>(await e("/recent-colors",{method:"POST",body:JSON.stringify({color:t})})).filter(i=>typeof i=="string")}}var aM=z("colorPicker",{label:"Colour picker",solid:"Solid",gradient:"Gradient",area:"Saturation and brightness",areaValue:"Saturation {s}%, brightness {v}%",hue:"Hue",opacity:"Opacity",format:"Colour format",hex:"Hex",rgb:"RGB",hsl:"HSL",red:"Red",green:"Green",blue:"Blue",saturation:"Saturation",lightness:"Lightness",eyedropper:"Pick a colour from the screen",gradientType:"Gradient type",linear:"Linear",radial:"Radial",angle:"Angle",stops:"Gradient stops",stop:"Stop {n}, {color} at {position}%",addStop:"Add stop",removeStop:"Remove stop",brand:"Brand colours",recent:"Recent",palette:"Palette",swatch:"{name}, {value}"}),Wv=["#000000","#707070","#c9c9c9","#de0000","#ad5500","#f1a953","#ffc107","#81bb47","#3c7c00","#5394d9","#2e6faf","#446beb"].map(o=>({value:o})),z0=["hex","rgb","hsl"],_g=o=>(o??[]).flatMap(n=>{let e=typeof n=="string"?{value:n}:n;return e&&typeof e.value=="string"&&(qe(e.value)||Nt(e.value))?[{value:e.value.trim(),name:e.name}]:[]}),cm,Lc,un,Ac,Ei,T,Tg,Cg,Gv,or,ms,dt,zg,Sg,Lg,Yv,Xv,Cc,Jv,Ag,Dg,Qv,nm,Rg,Zv,zc,om,Sc,Hg,ey,ty,iy,pn,Ng,ry,sy,lm,ay,mn=class extends C{constructor(){super(...arguments);m(this,T);this.value="";this.format="hex";this.formats="hex rgb hsl";this.alpha=!1;this.gradient=!1;this.recentKey="";this.maxRecent=16;this.eyedropper=!0;this.disabled=!1;this._hsva={h:0,s:0,v:0,a:1};this._grad=null;this._stop=0;this._brand=[];this._recent=[];this._drafts={};m(this,cm,N("cm-cp"));m(this,Lc);m(this,un);m(this,Ac);m(this,Ei,null)}connectedCallback(){super.connectedCallback(),a(this,T,Cg).call(this)}get allowedFormats(){let e=String(this.formats??"").split(/[\s,]+/).filter(t=>z0.includes(t));return e.length?e:["hex"]}get palette(){return this.swatches?_g(this.swatches):Wv}get brand(){return this.brandColors?_g(this.brandColors):this._brand}get recent(){return(this.recentColors??this._recent).filter(t=>qe(t)||this.gradient&&Nt(t)).filter(t=>this.alpha||(qe(t)?.a??1)===1).slice(0,this.maxRecent||16)}willUpdate(e){e.has("recentKey")&&g(this,Ac,void 0),(e.has("source")||e.has("recentKey"))&&a(this,T,Cg).call(this),e.has("format")&&!this.allowedFormats.includes(this.format)&&(this.format=this.allowedFormats[0]),e.has("value")&&this.value!==r(this,Lc)&&a(this,T,Gv).call(this)}render(){let{h:e,s:t,v:i,a:s}=this._hsva,l=r(this,T,ms),d=Ec(l),p=this.allowedFormats,u=this._grad,b=this.matches(":dir(rtl)"),f=this.eyedropper&&typeof window<"u"&&"EyeDropper"in window,x=u?ds({...u,type:"linear",angle:b?270:90}):"";return c`<div class="panel" role="group" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1303
1303
  ${this.gradient?c`<div class="tabs" role="radiogroup" aria-label=${this.t("label")}>
1304
- <button type="button" role="radio" aria-checked=${u?"false":"true"} tabindex=${u?"-1":"0"} @click=${()=>a(this,T,Cc).call(this,!1)}
1305
- @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,Cc).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[1]?.focus()))}}>${this.t("solid")}</button>
1306
- <button type="button" role="radio" aria-checked=${u?"true":"false"} tabindex=${u?"0":"-1"} @click=${()=>a(this,T,Cc).call(this,!0)}
1307
- @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,Cc).call(this,!1),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[0]?.focus()))}}>${this.t("gradient")}</button>
1304
+ <button type="button" role="radio" aria-checked=${u?"false":"true"} tabindex=${u?"-1":"0"} @click=${()=>a(this,T,zc).call(this,!1)}
1305
+ @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,zc).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[1]?.focus()))}}>${this.t("solid")}</button>
1306
+ <button type="button" role="radio" aria-checked=${u?"true":"false"} tabindex=${u?"0":"-1"} @click=${()=>a(this,T,zc).call(this,!0)}
1307
+ @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,zc).call(this,!1),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[0]?.focus()))}}>${this.t("gradient")}</button>
1308
1308
  </div>`:h}
1309
1309
  ${u?c`<div class="row">
1310
- <select aria-label=${this.t("gradientType")} @change=${v=>{v.stopPropagation(),a(this,T,nm).call(this,{type:v.target.value})}}>
1310
+ <select aria-label=${this.t("gradientType")} @change=${v=>{v.stopPropagation(),a(this,T,om).call(this,{type:v.target.value})}}>
1311
1311
  <option value="linear" .selected=${ee(u.type==="linear")}>${this.t("linear")}</option><option value="radial" .selected=${ee(u.type==="radial")}>${this.t("radial")}</option>
1312
1312
  </select>
1313
1313
  ${u.type==="linear"?c`<input class="box num" type="text" inputmode="numeric" aria-label=${this.t("angle")} .value=${ee(this._drafts.angle??`${u.angle}\xB0`)}
1314
1314
  @input=${v=>{v.stopPropagation(),this._drafts={...this._drafts,angle:v.target.value}}}
1315
- @change=${v=>{v.stopPropagation();let k=parseFloat(v.target.value);this._drafts={},Number.isFinite(k)&&a(this,T,nm).call(this,{angle:(Math.round(k)%360+360)%360})}} />`:h}
1315
+ @change=${v=>{v.stopPropagation();let k=parseFloat(v.target.value);this._drafts={},Number.isFinite(k)&&a(this,T,om).call(this,{angle:(Math.round(k)%360+360)%360})}} />`:h}
1316
1316
  <button type="button" class="icon-btn" aria-label=${this.t("removeStop")} title=${this.t("removeStop")} ?disabled=${u.stops.length<=2}
1317
- @click=${()=>a(this,T,Hg).call(this,this._stop)}><cm-icon name="trash" size="16"></cm-icon></button>
1317
+ @click=${()=>a(this,T,Ng).call(this,this._stop)}><cm-icon name="trash" size="16"></cm-icon></button>
1318
1318
  </div>
1319
- <div class="bar checker" role="group" aria-label=${this.t("stops")} @pointerdown=${a(this,T,Zv)}>
1319
+ <div class="bar checker" role="group" aria-label=${this.t("stops")} @pointerdown=${a(this,T,ey)}>
1320
1320
  <span class="fill" style="background:${x}"></span>
1321
1321
  ${u.stops.map((v,k)=>c`<button type="button" class="handle" role="slider" aria-orientation="horizontal"
1322
1322
  aria-valuemin="0" aria-valuemax="100" aria-valuenow=${Math.round(v.position)}
1323
- aria-label=${this.t("stop",{n:k+1,color:hs(v.color,this.format),position:Math.round(v.position)})}
1324
- aria-current=${k===this._stop?"true":"false"} style="inset-inline-start:${v.position}%;background:${hs(v.color)}"
1325
- @pointerdown=${L=>a(this,T,ey).call(this,L,k)} @pointermove=${L=>a(this,T,ty).call(this,L,k)}
1326
- @pointerup=${a(this,T,Tc)} @pointercancel=${a(this,T,Tc)} @focus=${()=>{this._stop!==k&&a(this,T,zc).call(this,k)}}
1327
- @keydown=${L=>a(this,T,iy).call(this,L,k)}></button>`)}
1323
+ aria-label=${this.t("stop",{n:k+1,color:ps(v.color,this.format),position:Math.round(v.position)})}
1324
+ aria-current=${k===this._stop?"true":"false"} style="inset-inline-start:${v.position}%;background:${ps(v.color)}"
1325
+ @pointerdown=${L=>a(this,T,ty).call(this,L,k)} @pointermove=${L=>a(this,T,iy).call(this,L,k)}
1326
+ @pointerup=${a(this,T,Cc)} @pointercancel=${a(this,T,Cc)} @focus=${()=>{this._stop!==k&&a(this,T,Sc).call(this,k)}}
1327
+ @keydown=${L=>a(this,T,ry).call(this,L,k)}></button>`)}
1328
1328
  </div>`:h}
1329
1329
  <div class="area" part="area" tabindex="0" role="slider" aria-label=${this.t("area")}
1330
1330
  aria-valuetext=${this.t("areaValue",{s:Math.round(t),v:Math.round(i)})} aria-valuenow=${Math.round(t)} aria-valuemin="0" aria-valuemax="100"
1331
1331
  style="background-color:hsl(${e} 100% 50%)"
1332
- @pointerdown=${a(this,T,Gv)} @pointermove=${a(this,T,Yv)} @pointerup=${a(this,T,Tc)} @pointercancel=${a(this,T,Tc)} @keydown=${a(this,T,Xv)}>
1332
+ @pointerdown=${a(this,T,Yv)} @pointermove=${a(this,T,Xv)} @pointerup=${a(this,T,Cc)} @pointercancel=${a(this,T,Cc)} @keydown=${a(this,T,Jv)}>
1333
1333
  <span class="thumb" style="left:${b?100-t:t}%;top:${100-i}%;background:${d}"></span>
1334
1334
  </div>
1335
1335
  <div class="sliders">
1336
- <span class="preview checker" aria-hidden="true"><span style="background:${u?cs(u):hs(l)}"></span></span>
1336
+ <span class="preview checker" aria-hidden="true"><span style="background:${u?ds(u):ps(l)}"></span></span>
1337
1337
  <div class="stack">
1338
1338
  <input type="range" class="hue" min="0" max="360" step="1" .value=${ee(String(Math.round(e)))} aria-label=${this.t("hue")}
1339
- @input=${v=>a(this,T,Lg).call(this,v,!1)} @change=${v=>a(this,T,Lg).call(this,v,!0)} />
1339
+ @input=${v=>a(this,T,Ag).call(this,v,!1)} @change=${v=>a(this,T,Ag).call(this,v,!0)} />
1340
1340
  ${this.alpha?c`<div class="alpha-wrap checker"><input type="range" min="0" max="100" step="1" .value=${ee(String(Math.round(s*100)))}
1341
1341
  aria-label=${this.t("opacity")} aria-valuetext="${Math.round(s*100)}%"
1342
1342
  style="--track:linear-gradient(to ${b?"left":"right"}, transparent, ${d})"
1343
- @input=${v=>a(this,T,Ag).call(this,v,!1)} @change=${v=>a(this,T,Ag).call(this,v,!0)} /></div>`:h}
1343
+ @input=${v=>a(this,T,Dg).call(this,v,!1)} @change=${v=>a(this,T,Dg).call(this,v,!0)} /></div>`:h}
1344
1344
  </div>
1345
1345
  </div>
1346
1346
  <div class="row">
1347
- ${p.length>1?c`<select aria-label=${this.t("format")} @change=${a(this,T,Jv)}>
1347
+ ${p.length>1?c`<select aria-label=${this.t("format")} @change=${a(this,T,Qv)}>
1348
1348
  ${p.map(v=>c`<option value=${v} ?selected=${v===this.format} .selected=${ee(v===this.format)}>${this.t(v)}</option>`)}
1349
1349
  </select>`:h}
1350
- ${a(this,T,sy).call(this)}
1351
- ${f?c`<button type="button" class="icon-btn" aria-label=${this.t("eyedropper")} title=${this.t("eyedropper")} @click=${a(this,T,Qv)}>
1350
+ ${a(this,T,ay).call(this)}
1351
+ ${f?c`<button type="button" class="icon-btn" aria-label=${this.t("eyedropper")} title=${this.t("eyedropper")} @click=${a(this,T,Zv)}>
1352
1352
  <cm-icon name="eyedropper" size="16"></cm-icon></button>`:h}
1353
1353
  </div>
1354
- ${a(this,T,om).call(this,"brand",this.brand)}
1355
- ${a(this,T,om).call(this,"recent",this.recent.map(v=>({value:v})))}
1356
- ${a(this,T,om).call(this,"palette",this.palette)}
1357
- </div>`}};lm=new WeakMap,Sc=new WeakMap,mn=new WeakMap,Lc=new WeakMap,ki=new WeakMap,T=new WeakSet,_g=function(){if(this.source)return this.source;if(this.recentKey)return r(this,Lc)??g(this,Lc,Eg(this.recentKey))},Tg=async function(){let e=a(this,T,_g).call(this);if(!e||e===r(this,mn))return;g(this,mn,e);let[t,i]=await Promise.allSettled([e.brandColors?.()??Promise.resolve([]),e.recentColors?.()??Promise.resolve([])]);r(this,mn)===e&&(t.status==="fulfilled"&&Array.isArray(t.value)&&(this._brand=Mg(t.value)),i.status==="fulfilled"&&Array.isArray(i.value)&&(this._recent=i.value.filter(s=>typeof s=="string")))},Wv=function(){let e=(this.value??"").trim(),t=this.gradient?Ht(e):null;if(t)this._grad=t,this._stop=Math.min(this._stop,t.stops.length-1),a(this,T,nr).call(this,t.stops[this._stop].color);else{this._grad=null;let i=qe(e);i&&a(this,T,nr).call(this,i)}/^rgba?\(/i.test(e)&&this.allowedFormats.includes("rgb")?this.format="rgb":/^hsla?\(/i.test(e)&&this.allowedFormats.includes("hsl")&&(this.format="hsl"),this._drafts={}},nr=function(e){let t=im(e);(t.s===0||t.v===0)&&(t.h=this._hsva.h),t.v===0&&(t.s=this._hsva.s),this._hsva={...t,a:this.alpha?e.a:1}},ps=function(){return rm(this._hsva)},dt=function(e=!1){let t;if(this._grad){let s=this._grad.stops.map((l,d)=>d===this._stop?{...l,color:r(this,T,ps)}:l);this._grad={...this._grad,stops:s},t=cs(this._grad,this.format)}else t=hs(r(this,T,ps),this.format);let i=t!==this.value;g(this,Sc,t),this.value=t,i&&a(this,T,Cg).call(this,"input"),e&&a(this,T,zg).call(this)},Cg=function(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))},zg=function(){a(this,T,Cg).call(this,"change");let e=this.value;if(!e||[...this.brand,...this.palette].some(l=>_c(l.value,e)))return;let t=this.recentColors??this._recent;if(t[0]&&_c(t[0],e))return;let i=sm(t,e,Math.max(this.maxRecent||16,16));this._recent=i,this.dispatchEvent(new CustomEvent("cm-recent-change",{detail:{colors:i},bubbles:!0,composed:!0})),a(this,T,_g).call(this)?.addRecentColor?.(e)?.then(l=>{Array.isArray(l)&&(this._recent=l)}).catch(()=>{})},Sg=function(e){let t=e.currentTarget.getBoundingClientRect(),i=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),l=getComputedStyle(this).direction==="rtl";this._hsva={...this._hsva,s:(l?1-i:i)*100,v:(1-s)*100},a(this,T,dt).call(this)},Gv=function(e){if(e.button!==0)return;let t=e.currentTarget;try{t.setPointerCapture(e.pointerId)}catch{}t.focus(),g(this,ki,"area"),a(this,T,Sg).call(this,e)},Yv=function(e){r(this,ki)==="area"&&a(this,T,Sg).call(this,e)},Tc=function(){r(this,ki)!==null&&(g(this,ki,null),a(this,T,zg).call(this))},Xv=function(e){let t=e.shiftKey?10:1,i=getComputedStyle(this).direction==="rtl",{s,v:l}=this._hsva;if(e.key==="ArrowRight")s+=i?-t:t;else if(e.key==="ArrowLeft")s+=i?t:-t;else if(e.key==="ArrowUp")l+=t;else if(e.key==="ArrowDown")l-=t;else if(e.key==="Home")s=0;else if(e.key==="End")s=100;else if(e.key==="PageUp")l=100;else if(e.key==="PageDown")l=0;else return;e.preventDefault(),this._hsva={...this._hsva,s:Math.min(100,Math.max(0,s)),v:Math.min(100,Math.max(0,l))},a(this,T,dt).call(this,!0)},Lg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,h:Number(e.target.value)},a(this,T,dt).call(this,t)},Ag=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,a:Number(e.target.value)/100},a(this,T,dt).call(this,t)},Jv=function(e){e.stopPropagation(),this.format=e.target.value,this._drafts={},this.value&&a(this,T,dt).call(this,!0)},am=function(e,t,i){e.stopPropagation();let s=e.target.value,l=a(this,T,Dg).call(this,t,s);if(!l){this._drafts={...this._drafts,[t]:s};return}this._drafts=i?{}:{...this._drafts,[t]:s},a(this,T,nr).call(this,l),a(this,T,dt).call(this,i)},Dg=function(e,t){let i=r(this,T,ps);if(e==="hex"){let d=t.trim();if(!/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(d))return null;let p=qe(d);return p&&(this.alpha&&/^#?[0-9a-f]{8}$/i.test(d)?p:{...p,a:this._hsva.a})}let s=Number(t);if(t.trim()===""||!Number.isFinite(s))return null;if(e==="a")return s>=0&&s<=100?{...i,a:s/100}:null;if(e==="r"||e==="g"||e==="b")return s>=0&&s<=255?{...i,[e]:Math.round(s)}:null;let l=Ec(i);return e==="h"?s>=0&&s<=360?Mc({...l,h:s%360,a:i.a}):null:(e==="s"||e==="l")&&s>=0&&s<=100?Mc({...l,[e]:s,a:i.a}):null},Qv=async function(){let e=window.EyeDropper;if(e)try{let{sRGBHex:t}=await new e().open(),i=qe(t);if(!i)return;a(this,T,nr).call(this,{...i,a:this._hsva.a}),a(this,T,dt).call(this,!0)}catch{}},Cc=function(e){if(e!==!!this._grad){if(e){let t=r(this,T,ps),i=rm({...this._hsva,h:(this._hsva.h+60)%360,s:Math.max(this._hsva.s,40),v:Math.max(this._hsva.v,60)});this._grad={type:"linear",angle:90,stops:[{color:t,position:0},{color:i,position:100}]},this._stop=0}else this._grad=null;a(this,T,dt).call(this,!0)}},nm=function(e,t=!0){this._grad&&(this._grad={...this._grad,...e},a(this,T,dt).call(this,t))},zc=function(e){this._grad&&(this._stop=e,a(this,T,nr).call(this,this._grad.stops[e].color),this._drafts={})},Rg=function(e,t){let i=t.getBoundingClientRect(),s=Math.min(1,Math.max(0,(e.clientX-i.left)/i.width));return Math.round((getComputedStyle(this).direction==="rtl"?1-s:s)*100)},Zv=function(e){if(!this._grad||e.button!==0||e.target.closest(".handle"))return;let t=a(this,T,Rg).call(this,e,e.currentTarget),i=Uv(this._grad,t),s=[...this._grad.stops,{color:i,position:t}];this._grad={...this._grad,stops:s},a(this,T,zc).call(this,s.length-1),a(this,T,dt).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[s.length-1]?.focus())},ey=function(e,t){if(e.button===0){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}a(this,T,zc).call(this,t),g(this,ki,t)}},ty=function(e,t){if(r(this,ki)!==t||!this._grad)return;let i=this.renderRoot.querySelector(".bar");a(this,T,hn).call(this,t,a(this,T,Rg).call(this,e,i),!1)},hn=function(e,t,i){if(!this._grad)return;let s=this._grad.stops.map((l,d)=>d===e?{...l,position:Math.min(100,Math.max(0,t))}:l);a(this,T,nm).call(this,{stops:s},i)},Hg=function(e){if(!this._grad||this._grad.stops.length<=2)return;let t=this._grad.stops.filter((i,s)=>s!==e);this._grad={...this._grad,stops:t},a(this,T,zc).call(this,Math.min(e,t.length-1)),a(this,T,dt).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[this._stop]?.focus())},iy=function(e,t){if(!this._grad)return;let i=e.shiftKey?10:1,s=getComputedStyle(this).direction==="rtl",l=this._grad.stops[t].position;if(e.key==="ArrowRight"||e.key==="ArrowUp")a(this,T,hn).call(this,t,l+(s&&e.key==="ArrowRight"?-i:i),!0);else if(e.key==="ArrowLeft"||e.key==="ArrowDown")a(this,T,hn).call(this,t,l-(s&&e.key==="ArrowLeft"?-i:i),!0);else if(e.key==="Home")a(this,T,hn).call(this,t,0,!0);else if(e.key==="End")a(this,T,hn).call(this,t,100,!0);else if(e.key==="Delete"||e.key==="Backspace")a(this,T,Hg).call(this,t);else return;e.preventDefault()},ry=function(e){let t=Ht(e);if(t&&this.gradient)this._grad=t,this._stop=0,a(this,T,nr).call(this,t.stops[0].color);else{let i=qe(e);if(!i)return;this._grad=null,a(this,T,nr).call(this,i)}this._drafts={},a(this,T,dt).call(this,!0)},om=function(e,t){if(!t.length)return h;let i=`${r(this,lm)}-${e}`;return c`<div class="group" role="group" aria-labelledby=${i}>
1354
+ ${a(this,T,lm).call(this,"brand",this.brand)}
1355
+ ${a(this,T,lm).call(this,"recent",this.recent.map(v=>({value:v})))}
1356
+ ${a(this,T,lm).call(this,"palette",this.palette)}
1357
+ </div>`}};cm=new WeakMap,Lc=new WeakMap,un=new WeakMap,Ac=new WeakMap,Ei=new WeakMap,T=new WeakSet,Tg=function(){if(this.source)return this.source;if(this.recentKey)return r(this,Ac)??g(this,Ac,Mg(this.recentKey))},Cg=async function(){let e=a(this,T,Tg).call(this);if(!e||e===r(this,un))return;g(this,un,e);let[t,i]=await Promise.allSettled([e.brandColors?.()??Promise.resolve([]),e.recentColors?.()??Promise.resolve([])]);r(this,un)===e&&(t.status==="fulfilled"&&Array.isArray(t.value)&&(this._brand=_g(t.value)),i.status==="fulfilled"&&Array.isArray(i.value)&&(this._recent=i.value.filter(s=>typeof s=="string")))},Gv=function(){let e=(this.value??"").trim(),t=this.gradient?Nt(e):null;if(t)this._grad=t,this._stop=Math.min(this._stop,t.stops.length-1),a(this,T,or).call(this,t.stops[this._stop].color);else{this._grad=null;let i=qe(e);i&&a(this,T,or).call(this,i)}/^rgba?\(/i.test(e)&&this.allowedFormats.includes("rgb")?this.format="rgb":/^hsla?\(/i.test(e)&&this.allowedFormats.includes("hsl")&&(this.format="hsl"),this._drafts={}},or=function(e){let t=rm(e);(t.s===0||t.v===0)&&(t.h=this._hsva.h),t.v===0&&(t.s=this._hsva.s),this._hsva={...t,a:this.alpha?e.a:1}},ms=function(){return sm(this._hsva)},dt=function(e=!1){let t;if(this._grad){let s=this._grad.stops.map((l,d)=>d===this._stop?{...l,color:r(this,T,ms)}:l);this._grad={...this._grad,stops:s},t=ds(this._grad,this.format)}else t=ps(r(this,T,ms),this.format);let i=t!==this.value;g(this,Lc,t),this.value=t,i&&a(this,T,zg).call(this,"input"),e&&a(this,T,Sg).call(this)},zg=function(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))},Sg=function(){a(this,T,zg).call(this,"change");let e=this.value;if(!e||[...this.brand,...this.palette].some(l=>Tc(l.value,e)))return;let t=this.recentColors??this._recent;if(t[0]&&Tc(t[0],e))return;let i=am(t,e,Math.max(this.maxRecent||16,16));this._recent=i,this.dispatchEvent(new CustomEvent("cm-recent-change",{detail:{colors:i},bubbles:!0,composed:!0})),a(this,T,Tg).call(this)?.addRecentColor?.(e)?.then(l=>{Array.isArray(l)&&(this._recent=l)}).catch(()=>{})},Lg=function(e){let t=e.currentTarget.getBoundingClientRect(),i=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),l=getComputedStyle(this).direction==="rtl";this._hsva={...this._hsva,s:(l?1-i:i)*100,v:(1-s)*100},a(this,T,dt).call(this)},Yv=function(e){if(e.button!==0)return;let t=e.currentTarget;try{t.setPointerCapture(e.pointerId)}catch{}t.focus(),g(this,Ei,"area"),a(this,T,Lg).call(this,e)},Xv=function(e){r(this,Ei)==="area"&&a(this,T,Lg).call(this,e)},Cc=function(){r(this,Ei)!==null&&(g(this,Ei,null),a(this,T,Sg).call(this))},Jv=function(e){let t=e.shiftKey?10:1,i=getComputedStyle(this).direction==="rtl",{s,v:l}=this._hsva;if(e.key==="ArrowRight")s+=i?-t:t;else if(e.key==="ArrowLeft")s+=i?t:-t;else if(e.key==="ArrowUp")l+=t;else if(e.key==="ArrowDown")l-=t;else if(e.key==="Home")s=0;else if(e.key==="End")s=100;else if(e.key==="PageUp")l=100;else if(e.key==="PageDown")l=0;else return;e.preventDefault(),this._hsva={...this._hsva,s:Math.min(100,Math.max(0,s)),v:Math.min(100,Math.max(0,l))},a(this,T,dt).call(this,!0)},Ag=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,h:Number(e.target.value)},a(this,T,dt).call(this,t)},Dg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,a:Number(e.target.value)/100},a(this,T,dt).call(this,t)},Qv=function(e){e.stopPropagation(),this.format=e.target.value,this._drafts={},this.value&&a(this,T,dt).call(this,!0)},nm=function(e,t,i){e.stopPropagation();let s=e.target.value,l=a(this,T,Rg).call(this,t,s);if(!l){this._drafts={...this._drafts,[t]:s};return}this._drafts=i?{}:{...this._drafts,[t]:s},a(this,T,or).call(this,l),a(this,T,dt).call(this,i)},Rg=function(e,t){let i=r(this,T,ms);if(e==="hex"){let d=t.trim();if(!/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(d))return null;let p=qe(d);return p&&(this.alpha&&/^#?[0-9a-f]{8}$/i.test(d)?p:{...p,a:this._hsva.a})}let s=Number(t);if(t.trim()===""||!Number.isFinite(s))return null;if(e==="a")return s>=0&&s<=100?{...i,a:s/100}:null;if(e==="r"||e==="g"||e==="b")return s>=0&&s<=255?{...i,[e]:Math.round(s)}:null;let l=Mc(i);return e==="h"?s>=0&&s<=360?_c({...l,h:s%360,a:i.a}):null:(e==="s"||e==="l")&&s>=0&&s<=100?_c({...l,[e]:s,a:i.a}):null},Zv=async function(){let e=window.EyeDropper;if(e)try{let{sRGBHex:t}=await new e().open(),i=qe(t);if(!i)return;a(this,T,or).call(this,{...i,a:this._hsva.a}),a(this,T,dt).call(this,!0)}catch{}},zc=function(e){if(e!==!!this._grad){if(e){let t=r(this,T,ms),i=sm({...this._hsva,h:(this._hsva.h+60)%360,s:Math.max(this._hsva.s,40),v:Math.max(this._hsva.v,60)});this._grad={type:"linear",angle:90,stops:[{color:t,position:0},{color:i,position:100}]},this._stop=0}else this._grad=null;a(this,T,dt).call(this,!0)}},om=function(e,t=!0){this._grad&&(this._grad={...this._grad,...e},a(this,T,dt).call(this,t))},Sc=function(e){this._grad&&(this._stop=e,a(this,T,or).call(this,this._grad.stops[e].color),this._drafts={})},Hg=function(e,t){let i=t.getBoundingClientRect(),s=Math.min(1,Math.max(0,(e.clientX-i.left)/i.width));return Math.round((getComputedStyle(this).direction==="rtl"?1-s:s)*100)},ey=function(e){if(!this._grad||e.button!==0||e.target.closest(".handle"))return;let t=a(this,T,Hg).call(this,e,e.currentTarget),i=Kv(this._grad,t),s=[...this._grad.stops,{color:i,position:t}];this._grad={...this._grad,stops:s},a(this,T,Sc).call(this,s.length-1),a(this,T,dt).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[s.length-1]?.focus())},ty=function(e,t){if(e.button===0){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}a(this,T,Sc).call(this,t),g(this,Ei,t)}},iy=function(e,t){if(r(this,Ei)!==t||!this._grad)return;let i=this.renderRoot.querySelector(".bar");a(this,T,pn).call(this,t,a(this,T,Hg).call(this,e,i),!1)},pn=function(e,t,i){if(!this._grad)return;let s=this._grad.stops.map((l,d)=>d===e?{...l,position:Math.min(100,Math.max(0,t))}:l);a(this,T,om).call(this,{stops:s},i)},Ng=function(e){if(!this._grad||this._grad.stops.length<=2)return;let t=this._grad.stops.filter((i,s)=>s!==e);this._grad={...this._grad,stops:t},a(this,T,Sc).call(this,Math.min(e,t.length-1)),a(this,T,dt).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[this._stop]?.focus())},ry=function(e,t){if(!this._grad)return;let i=e.shiftKey?10:1,s=getComputedStyle(this).direction==="rtl",l=this._grad.stops[t].position;if(e.key==="ArrowRight"||e.key==="ArrowUp")a(this,T,pn).call(this,t,l+(s&&e.key==="ArrowRight"?-i:i),!0);else if(e.key==="ArrowLeft"||e.key==="ArrowDown")a(this,T,pn).call(this,t,l-(s&&e.key==="ArrowLeft"?-i:i),!0);else if(e.key==="Home")a(this,T,pn).call(this,t,0,!0);else if(e.key==="End")a(this,T,pn).call(this,t,100,!0);else if(e.key==="Delete"||e.key==="Backspace")a(this,T,Ng).call(this,t);else return;e.preventDefault()},sy=function(e){let t=Nt(e);if(t&&this.gradient)this._grad=t,this._stop=0,a(this,T,or).call(this,t.stops[0].color);else{let i=qe(e);if(!i)return;this._grad=null,a(this,T,or).call(this,i)}this._drafts={},a(this,T,dt).call(this,!0)},lm=function(e,t){if(!t.length)return h;let i=`${r(this,cm)}-${e}`;return c`<div class="group" role="group" aria-labelledby=${i}>
1358
1358
  <h3 id=${i}>${this.t(e)}</h3>
1359
- <div class="sws">${t.map(s=>{let l=s.name?this.t("swatch",{name:s.name,value:s.value}):s.value,d=!!this.value&&_c(s.value,this.value);return c`<button type="button" class="sw checker" part="swatch" aria-pressed=${d?"true":"false"} aria-label=${l} title=${s.name||s.value}
1360
- @click=${()=>a(this,T,ry).call(this,s.value)}><span style="background:${s.value}"></span></button>`})}</div>
1361
- </div>`},sy=function(){let e=r(this,T,ps),t=this._drafts,i=this.format,s=(d,p,u,b=!0)=>c`<input class="box ${b?"num":""}"
1359
+ <div class="sws">${t.map(s=>{let l=s.name?this.t("swatch",{name:s.name,value:s.value}):s.value,d=!!this.value&&Tc(s.value,this.value);return c`<button type="button" class="sw checker" part="swatch" aria-pressed=${d?"true":"false"} aria-label=${l} title=${s.name||s.value}
1360
+ @click=${()=>a(this,T,sy).call(this,s.value)}><span style="background:${s.value}"></span></button>`})}</div>
1361
+ </div>`},ay=function(){let e=r(this,T,ms),t=this._drafts,i=this.format,s=(d,p,u,b=!0)=>c`<input class="box ${b?"num":""}"
1362
1362
  type="text" inputmode=${b?"numeric":"text"} autocomplete="off" spellcheck="false" aria-label=${p}
1363
- .value=${ee(t[d]??String(u))} aria-invalid=${t[d]!==void 0&&!a(this,T,Dg).call(this,d,t[d])?"true":h}
1364
- @input=${f=>a(this,T,am).call(this,f,d,!1)} @change=${f=>a(this,T,am).call(this,f,d,!0)}
1365
- @keydown=${f=>{f.key==="Enter"&&a(this,T,am).call(this,f,d,!0)}} />`,l=Ec(e);return c`<div class="boxes">
1366
- ${i==="hex"?s("hex",this.t("hex"),kc(e),!1):h}
1363
+ .value=${ee(t[d]??String(u))} aria-invalid=${t[d]!==void 0&&!a(this,T,Rg).call(this,d,t[d])?"true":h}
1364
+ @input=${f=>a(this,T,nm).call(this,f,d,!1)} @change=${f=>a(this,T,nm).call(this,f,d,!0)}
1365
+ @keydown=${f=>{f.key==="Enter"&&a(this,T,nm).call(this,f,d,!0)}} />`,l=Mc(e);return c`<div class="boxes">
1366
+ ${i==="hex"?s("hex",this.t("hex"),Ec(e),!1):h}
1367
1367
  ${i==="rgb"?[s("r",this.t("red"),e.r),s("g",this.t("green"),e.g),s("b",this.t("blue"),e.b)]:h}
1368
1368
  ${i==="hsl"?[s("h",this.t("hue"),Math.round(l.h)),s("s",this.t("saturation"),Math.round(l.s)),s("l",this.t("lightness"),Math.round(l.l))]:h}
1369
1369
  ${this.alpha?s("a",this.t("opacity"),Math.round(this._hsva.a*100)):h}
1370
- </div>`},pn.properties={value:{},format:{reflect:!0},formats:{},alpha:{type:Boolean},gradient:{type:Boolean},swatches:{type:Array},brandColors:{type:Array,attribute:"brand-colors"},recentColors:{type:Array,attribute:"recent-colors"},source:{attribute:!1},recentKey:{attribute:"recent-key"},maxRecent:{type:Number,attribute:"max-recent"},eyedropper:{type:Boolean},disabled:{type:Boolean,reflect:!0},_hsva:{state:!0},_grad:{state:!0},_stop:{state:!0},_brand:{state:!0},_recent:{state:!0},_drafts:{state:!0}},pn.styles=[E,w`
1370
+ </div>`},mn.properties={value:{},format:{reflect:!0},formats:{},alpha:{type:Boolean},gradient:{type:Boolean},swatches:{type:Array},brandColors:{type:Array,attribute:"brand-colors"},recentColors:{type:Array,attribute:"recent-colors"},source:{attribute:!1},recentKey:{attribute:"recent-key"},maxRecent:{type:Number,attribute:"max-recent"},eyedropper:{type:Boolean},disabled:{type:Boolean,reflect:!0},_hsva:{state:!0},_grad:{state:!0},_stop:{state:!0},_brand:{state:!0},_recent:{state:!0},_drafts:{state:!0}},mn.styles=[E,w`
1371
1371
  :host { display: block; inline-size: 272px; max-inline-size: 100%; color: var(--cm-text-default); font-size: var(--cm-font-size-13); }
1372
1372
  :host([disabled]) { opacity: 0.5; pointer-events: none; }
1373
1373
  .panel { display: flex; flex-direction: column; gap: var(--cm-space-12); }
@@ -1447,15 +1447,15 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1447
1447
  .sw[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--cm-bg-surface), 0 0 0 4px var(--cm-border-strong); }
1448
1448
  .sw:focus-visible { outline-offset: 4px; }
1449
1449
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1450
- `];$("cm-color-picker",pn);var mM=z("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",invalidAny:"Enter a colour such as #2e6faf or rgb(46, 111, 175).",value:"Colour value",valueNamed:"{label}, colour value",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),z0=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}],S0={fromAttribute:o=>o===null?!1:o==="native"?"native":!0,toAttribute:o=>o==="native"?"native":o?"":null},L0=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function A0(o){let n=L0(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var it,us,gs,kt,Ac,fs,V,un,ms,Dc,Ei,Ng,ay,ny,Pg,oy,ly,cy,dy,hy,py,my,uy,or=class extends C{constructor(){super(...arguments);m(this,V);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.alpha=!1;this.gradient=!1;this.formats="hex";this.recentKey="";this._open=!1;this.required=!1;this.disabled=!1;this._invalid=!1;m(this,it,this.attachInternals());m(this,us,new we);m(this,gs,new re(this,r(this,it)));m(this,kt,N("cm-cf"));m(this,Ac,"");m(this,fs);m(this,Dc,e=>{this._open&&!e.composedPath().includes(this)&&(this._open=!1)})}connectedCallback(){super.connectedCallback(),g(this,Ac,a(this,V,ms).call(this,this.value)??this.value),document.addEventListener("pointerdown",r(this,Dc),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,Dc),!0),r(this,us).close()}show(){!this.disabled&&this.picker&&this.picker!=="native"&&(this._open=!0)}close(){this._open=!1}get form(){return r(this,it).form}get validity(){return r(this,it).validity}get validationMessage(){return r(this,it).validationMessage}checkValidity(){return r(this,it).checkValidity()}reportValidity(){return r(this,gs).report(()=>r(this,it).reportValidity())}formResetCallback(){r(this,gs).reset(),this.value=r(this,Ac),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=ds(t?.value??"")??(r(this,V,un)&&t?.value&&kg(t.value)?t.value.trim():null);return i?[{value:i,name:t.name}]:[]}):z0.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=a(this,V,ms).call(this,this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==r(this,fs)&&(this._draft=void 0,this._invalid=!1),g(this,fs,void 0)}}updated(e){if(e.has("_open")){let s=this.renderRoot.querySelector(".pop");this._open?(r(this,us).open(s,this.renderRoot.querySelector(".anchor"),{align:"start",gap:8})||s?.setAttribute("data-open",""),this.renderRoot.querySelector("cm-color-picker")?.updateComplete.then(()=>{this.renderRoot.querySelector("cm-color-picker")?.shadowRoot?.querySelector(".area")?.focus()})):e.get("_open")&&(r(this,us).close(),s?.removeAttribute("data-open"))}else this._open&&r(this,us).place();let t=!this.value||a(this,V,ms).call(this,this.value)!==null;r(this,it).setFormValue(this.value&&t?this.value:null,this.value);let i=this.renderRoot.querySelector(".input")??void 0;this.error?r(this,it).setValidity({customError:!0},this.error,i):this._invalid||!t?r(this,it).setValidity({patternMismatch:!0},this.t(r(this,V,un)?"invalidAny":"invalid"),i):this.required&&!this.value?r(this,it).setValidity({valueMissing:!0},this.t("required"),i):r(this,it).setValidity({}),r(this,gs).sync()}render(){let e=this.items,t=a(this,V,ms).call(this,this.value??""),i=e.findIndex(x=>x.value===t),s=r(this,V,un),l=this.error||(this._invalid||this.value&&!t?this.t(s?"invalidAny":"invalid"):"")||r(this,gs).message,d=t?ds(t):null,p=t?`background:${t}`:h,u=[l&&`${r(this,kt)}-err`,this.helpText&&`${r(this,kt)}-help`].filter(Boolean).join(" ")||h,b=this.getAttribute("aria-label"),f=this.label||b||"";return c`<div class="field">
1450
+ `];$("cm-color-picker",mn);var fM=z("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",invalidAny:"Enter a colour such as #2e6faf or rgb(46, 111, 175).",value:"Colour value",valueNamed:"{label}, colour value",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),S0=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}],L0={fromAttribute:o=>o===null?!1:o==="native"?"native":!0,toAttribute:o=>o==="native"?"native":o?"":null},A0=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function D0(o){let n=A0(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var it,gs,fs,kt,Dc,bs,V,gn,us,Rc,Mi,Pg,ny,oy,Ig,ly,cy,dy,hy,py,my,uy,gy,lr=class extends C{constructor(){super(...arguments);m(this,V);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.alpha=!1;this.gradient=!1;this.formats="hex";this.recentKey="";this._open=!1;this.required=!1;this.disabled=!1;this._invalid=!1;m(this,it,this.attachInternals());m(this,gs,new we);m(this,fs,new re(this,r(this,it)));m(this,kt,N("cm-cf"));m(this,Dc,"");m(this,bs);m(this,Rc,e=>{this._open&&!e.composedPath().includes(this)&&(this._open=!1)})}connectedCallback(){super.connectedCallback(),g(this,Dc,a(this,V,us).call(this,this.value)??this.value),document.addEventListener("pointerdown",r(this,Rc),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,Rc),!0),r(this,gs).close()}show(){!this.disabled&&this.picker&&this.picker!=="native"&&(this._open=!0)}close(){this._open=!1}get form(){return r(this,it).form}get validity(){return r(this,it).validity}get validationMessage(){return r(this,it).validationMessage}checkValidity(){return r(this,it).checkValidity()}reportValidity(){return r(this,fs).report(()=>r(this,it).reportValidity())}formResetCallback(){r(this,fs).reset(),this.value=r(this,Dc),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=hs(t?.value??"")??(r(this,V,gn)&&t?.value&&Eg(t.value)?t.value.trim():null);return i?[{value:i,name:t.name}]:[]}):S0.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=a(this,V,us).call(this,this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==r(this,bs)&&(this._draft=void 0,this._invalid=!1),g(this,bs,void 0)}}updated(e){if(e.has("_open")){let s=this.renderRoot.querySelector(".pop");this._open?(r(this,gs).open(s,this.renderRoot.querySelector(".anchor"),{align:"start",gap:8})||s?.setAttribute("data-open",""),this.renderRoot.querySelector("cm-color-picker")?.updateComplete.then(()=>{this.renderRoot.querySelector("cm-color-picker")?.shadowRoot?.querySelector(".area")?.focus()})):e.get("_open")&&(r(this,gs).close(),s?.removeAttribute("data-open"))}else this._open&&r(this,gs).place();let t=!this.value||a(this,V,us).call(this,this.value)!==null;r(this,it).setFormValue(this.value&&t?this.value:null,this.value);let i=this.renderRoot.querySelector(".input")??void 0;this.error?r(this,it).setValidity({customError:!0},this.error,i):this._invalid||!t?r(this,it).setValidity({patternMismatch:!0},this.t(r(this,V,gn)?"invalidAny":"invalid"),i):this.required&&!this.value?r(this,it).setValidity({valueMissing:!0},this.t("required"),i):r(this,it).setValidity({}),r(this,fs).sync()}render(){let e=this.items,t=a(this,V,us).call(this,this.value??""),i=e.findIndex(x=>x.value===t),s=r(this,V,gn),l=this.error||(this._invalid||this.value&&!t?this.t(s?"invalidAny":"invalid"):"")||r(this,fs).message,d=t?hs(t):null,p=t?`background:${t}`:h,u=[l&&`${r(this,kt)}-err`,this.helpText&&`${r(this,kt)}-help`].filter(Boolean).join(" ")||h,b=this.getAttribute("aria-label"),f=this.label||b||"";return c`<div class="field">
1451
1451
  ${this.label?c`<span class="label" id="${r(this,kt)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
1452
1452
  ${e.length?c`<div class="swatches" part="swatches" role="radiogroup"
1453
1453
  aria-labelledby=${this.label?`${r(this,kt)}-l`:h} aria-label=${!this.label&&b?b:h}
1454
1454
  aria-required=${this.required?"true":h} aria-describedby=${u}>
1455
1455
  ${e.map((x,v)=>{let k=x.name?this.t("swatch",{name:x.name,hex:x.value}):x.value;return c`<button type="button" class="swatch" part="swatch" role="radio" aria-checked=${v===i?"true":"false"}
1456
1456
  aria-label=${k} title=${x.name||x.value} tabindex=${v===(i>=0?i:0)?"0":"-1"} ?disabled=${this.disabled}
1457
- style="background-color:${x.value};color:${A0(x.value)}"
1458
- @click=${()=>a(this,V,Ng).call(this,v)} @keydown=${L=>a(this,V,ay).call(this,L,v)}><cm-icon name="check" size="16"></cm-icon></button>`})}
1457
+ style="background-color:${x.value};color:${D0(x.value)}"
1458
+ @click=${()=>a(this,V,Pg).call(this,v)} @keydown=${L=>a(this,V,ny).call(this,L,v)}><cm-icon name="check" size="16"></cm-icon></button>`})}
1459
1459
  </div>`:h}
1460
1460
  <div class="row">
1461
1461
  ${this.picker&&this.picker!=="native"?c`<span class="anchor"><button type="button" class="pick checker-bg" part="picker" ?disabled=${this.disabled}
@@ -1466,15 +1466,15 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1466
1466
  <cm-icon name="edit" size="12" aria-hidden="true"></cm-icon>
1467
1467
  </button>
1468
1468
  <div class="pop" id="${r(this,kt)}-pop" role="dialog" aria-label=${f?this.t("pickerNamed",{label:f}):this.t("picker")}
1469
- @keydown=${a(this,V,my)}>
1470
- ${this._open?c`<cm-color-picker .value=${this.value} .format=${a(this,V,uy).call(this)} .formats=${this.formats} .alpha=${this.alpha}
1469
+ @keydown=${a(this,V,uy)}>
1470
+ ${this._open?c`<cm-color-picker .value=${this.value} .format=${a(this,V,gy).call(this)} .formats=${this.formats} .alpha=${this.alpha}
1471
1471
  .gradient=${this.gradient} .swatches=${this.swatches?this.items:void 0} .brandColors=${this.brandColors}
1472
1472
  .recentColors=${this.recentColors} .source=${this.source} .recentKey=${this.recentKey}
1473
- @input=${a(this,V,hy)} @change=${a(this,V,py)}></cm-color-picker>`:h}
1473
+ @input=${a(this,V,py)} @change=${a(this,V,my)}></cm-color-picker>`:h}
1474
1474
  </div></span>`:this.picker?c`<label class="pick" part="picker" style=${d?`background-color:${d}`:h}>
1475
1475
  <input type="color" .value=${ee(d??"#000000")} ?disabled=${this.disabled}
1476
1476
  aria-label=${f?this.t("pickerNamed",{label:f}):this.t("picker")}
1477
- @input=${a(this,V,cy)} @change=${a(this,V,dy)} />
1477
+ @input=${a(this,V,dy)} @change=${a(this,V,hy)} />
1478
1478
  <cm-icon name="edit" size="12" aria-hidden="true"></cm-icon>
1479
1479
  </label>`:c`<span class="preview" part="preview" aria-hidden="true" style=${p}></span>`}
1480
1480
  <input part="input" id=${r(this,kt)} type="text" inputmode="text" autocomplete="off" spellcheck="false"
@@ -1482,11 +1482,11 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1482
1482
  aria-label=${s?f?this.t("valueNamed",{label:f}):this.t("value"):f?this.t("hexNamed",{label:f}):this.t("hex")}
1483
1483
  ?required=${this.required} ?disabled=${this.disabled}
1484
1484
  aria-invalid=${l?"true":h} aria-describedby=${u}
1485
- @input=${a(this,V,ny)} @change=${a(this,V,oy)} @keydown=${a(this,V,ly)} />
1485
+ @input=${a(this,V,oy)} @change=${a(this,V,ly)} @keydown=${a(this,V,cy)} />
1486
1486
  </div>
1487
1487
  ${l?c`<p class="error" id="${r(this,kt)}-err" role="alert">${l}</p>`:h}
1488
1488
  ${this.helpText?c`<p class="help" id="${r(this,kt)}-help">${this.helpText}</p>`:h}
1489
- </div>`}};it=new WeakMap,us=new WeakMap,gs=new WeakMap,kt=new WeakMap,Ac=new WeakMap,fs=new WeakMap,V=new WeakSet,un=function(){return this.alpha||this.gradient||/rgb|hsl/.test(this.formats??"")},ms=function(e){let t=(e??"").trim(),i=ds(t);if(i)return i;if(!r(this,V,un))return null;if(/^#[0-9a-f]{4}$|^#[0-9a-f]{8}$/i.test(t))return this.alpha?t.toLowerCase():null;if(Ht(t))return this.gradient?t:null;let s=qe(t);return s&&(this.alpha||s.a===1)?t:null},Dc=new WeakMap,Ei=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},Ng=function(e){let t=this.items[e];!t||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".swatch")[e]?.focus()),this._draft=void 0,this._invalid=!1,t.value!==this.value&&(this.value=t.value,a(this,V,Ei).call(this,"input","change")))},ay=function(e,t){let i=this.items.length,s=se(e,this),l;if(s==="ArrowRight"||e.key==="ArrowDown")l=(t+1)%i;else if(s==="ArrowLeft"||e.key==="ArrowUp")l=(t-1+i)%i;else if(e.key==="Home")l=0;else if(e.key==="End")l=i-1;else if(e.key===" "||e.key==="Enter")l=t;else return;e.preventDefault(),a(this,V,Ng).call(this,l)},ny=function(e){e.stopPropagation();let t=e.target.value;this._draft=t;let i=/^#?[0-9a-f]{6}$/i.test(t.trim())?ds(t):r(this,V,un)&&/\)\s*$|^#[0-9a-f]{8}$/i.test(t.trim())?a(this,V,ms).call(this,t):null;i&&i!==this.value&&(g(this,fs,i),this.value=i,a(this,V,Ei).call(this,"input")),this._invalid&&(i||!t.trim())&&(this._invalid=!1)},Pg=function(){if(this._draft===void 0)return;let e=this._draft.trim(),t=e?a(this,V,ms).call(this,e):"";if(t===null){this._invalid=!0;return}let i=this.value;this.value=t,this._draft=void 0,this._invalid=!1,t!==i&&a(this,V,Ei).call(this,"input"),a(this,V,Ei).call(this,"change")},oy=function(e){e.stopPropagation(),a(this,V,Pg).call(this)},ly=function(e){e.key==="Enter"&&a(this,V,Pg).call(this)},cy=function(e){e.stopPropagation();let t=ds(e.target.value);!t||t===this.value||(this.value=t,this._draft=void 0,this._invalid=!1,a(this,V,Ei).call(this,"input"))},dy=function(e){e.stopPropagation(),a(this,V,Ei).call(this,"change")},hy=function(e){e.stopPropagation();let t=e.target.value;t!==this.value&&(g(this,fs,t),this.value=t,this._draft=void 0,this._invalid=!1,a(this,V,Ei).call(this,"input"))},py=function(e){e.stopPropagation(),a(this,V,Ei).call(this,"change")},my=function(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this._open=!1,this.updateComplete.then(()=>this.renderRoot.querySelector("button.pick")?.focus()))},uy=function(){let e=this.value??"";return/^rgba?\(|gradient\(.*rgba?\(/i.test(e)?"rgb":/^hsla?\(|gradient\(.*hsla?\(/i.test(e)?"hsl":"hex"},or.formAssociated=!0,or.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},or.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},swatches:{type:Array},picker:{converter:S0,reflect:!0},alpha:{type:Boolean},gradient:{type:Boolean},formats:{},brandColors:{type:Array,attribute:"brand-colors"},recentColors:{type:Array,attribute:"recent-colors"},source:{attribute:!1},recentKey:{attribute:"recent-key"},_open:{state:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_draft:{state:!0},_invalid:{state:!0}},or.styles=[E,bt,Ie,w`
1489
+ </div>`}};it=new WeakMap,gs=new WeakMap,fs=new WeakMap,kt=new WeakMap,Dc=new WeakMap,bs=new WeakMap,V=new WeakSet,gn=function(){return this.alpha||this.gradient||/rgb|hsl/.test(this.formats??"")},us=function(e){let t=(e??"").trim(),i=hs(t);if(i)return i;if(!r(this,V,gn))return null;if(/^#[0-9a-f]{4}$|^#[0-9a-f]{8}$/i.test(t))return this.alpha?t.toLowerCase():null;if(Nt(t))return this.gradient?t:null;let s=qe(t);return s&&(this.alpha||s.a===1)?t:null},Rc=new WeakMap,Mi=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},Pg=function(e){let t=this.items[e];!t||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".swatch")[e]?.focus()),this._draft=void 0,this._invalid=!1,t.value!==this.value&&(this.value=t.value,a(this,V,Mi).call(this,"input","change")))},ny=function(e,t){let i=this.items.length,s=se(e,this),l;if(s==="ArrowRight"||e.key==="ArrowDown")l=(t+1)%i;else if(s==="ArrowLeft"||e.key==="ArrowUp")l=(t-1+i)%i;else if(e.key==="Home")l=0;else if(e.key==="End")l=i-1;else if(e.key===" "||e.key==="Enter")l=t;else return;e.preventDefault(),a(this,V,Pg).call(this,l)},oy=function(e){e.stopPropagation();let t=e.target.value;this._draft=t;let i=/^#?[0-9a-f]{6}$/i.test(t.trim())?hs(t):r(this,V,gn)&&/\)\s*$|^#[0-9a-f]{8}$/i.test(t.trim())?a(this,V,us).call(this,t):null;i&&i!==this.value&&(g(this,bs,i),this.value=i,a(this,V,Mi).call(this,"input")),this._invalid&&(i||!t.trim())&&(this._invalid=!1)},Ig=function(){if(this._draft===void 0)return;let e=this._draft.trim(),t=e?a(this,V,us).call(this,e):"";if(t===null){this._invalid=!0;return}let i=this.value;this.value=t,this._draft=void 0,this._invalid=!1,t!==i&&a(this,V,Mi).call(this,"input"),a(this,V,Mi).call(this,"change")},ly=function(e){e.stopPropagation(),a(this,V,Ig).call(this)},cy=function(e){e.key==="Enter"&&a(this,V,Ig).call(this)},dy=function(e){e.stopPropagation();let t=hs(e.target.value);!t||t===this.value||(this.value=t,this._draft=void 0,this._invalid=!1,a(this,V,Mi).call(this,"input"))},hy=function(e){e.stopPropagation(),a(this,V,Mi).call(this,"change")},py=function(e){e.stopPropagation();let t=e.target.value;t!==this.value&&(g(this,bs,t),this.value=t,this._draft=void 0,this._invalid=!1,a(this,V,Mi).call(this,"input"))},my=function(e){e.stopPropagation(),a(this,V,Mi).call(this,"change")},uy=function(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this._open=!1,this.updateComplete.then(()=>this.renderRoot.querySelector("button.pick")?.focus()))},gy=function(){let e=this.value??"";return/^rgba?\(|gradient\(.*rgba?\(/i.test(e)?"rgb":/^hsla?\(|gradient\(.*hsla?\(/i.test(e)?"hsl":"hex"},lr.formAssociated=!0,lr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},lr.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},swatches:{type:Array},picker:{converter:L0,reflect:!0},alpha:{type:Boolean},gradient:{type:Boolean},formats:{},brandColors:{type:Array,attribute:"brand-colors"},recentColors:{type:Array,attribute:"recent-colors"},source:{attribute:!1},recentKey:{attribute:"recent-key"},_open:{state:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_draft:{state:!0},_invalid:{state:!0}},lr.styles=[E,bt,Ie,w`
1490
1490
  :host { display: block; }
1491
1491
  .swatches { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); padding: 4px; margin: -4px; }
1492
1492
  .swatch {
@@ -1539,18 +1539,18 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1539
1539
  .pop:not(:popover-open):not([data-open]) { display: none; }
1540
1540
  .anchor { position: relative; }
1541
1541
  :host([disabled]) .preview { opacity: 0.4; }
1542
- `];$("cm-color-field",or);var wM=z("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),Ig=3,cm=.7,D0=.0055,dm="#000000",gy=8,Rc=2,R0=400,H0=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),ht,vs,Hc,gn,Nc,Et,Mt,_t,cr,dr,Ge,Pc,hr,fn,D,qg,hm,Og,Mi,pm,Bg,Fg,fy,Vg,mm,jg,um,by,Ug,vy,bs,gm,Kg,Wg,yy,Gg,xy,Yg,wy,$y,lr=class extends C{constructor(){super(...arguments);m(this,D);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";m(this,ht,this.attachInternals());m(this,vs,new re(this,r(this,ht)));m(this,Hc,N("cm-sig"));m(this,gn,"");m(this,Nc,"");m(this,Et,[]);m(this,Mt);m(this,_t);m(this,cr,"");m(this,dr,0);m(this,Ge);m(this,Pc,"");m(this,hr);m(this,fn,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,D,qg).call(this):(g(this,gn,this.value),g(this,Nc,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),r(this,hr)?.disconnect(),g(this,hr,void 0),cancelAnimationFrame(r(this,dr)),g(this,dr,0),r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0))}get form(){return r(this,ht).form}get validity(){return r(this,ht).validity}get validationMessage(){return r(this,ht).validationMessage}checkValidity(){return r(this,ht).checkValidity()}reportValidity(){return r(this,vs).report(()=>r(this,ht).reportValidity())}formResetCallback(){r(this,vs).reset(),g(this,Et,[]),g(this,Mt,void 0),g(this,_t,void 0),r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0)),this.typedName=r(this,Nc),r(this,gn)?(g(this,cr,""),this.value=r(this,gn)):this.updateComplete.then(()=>a(this,D,bs).call(this,!1)),a(this,D,Mi).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!r(this,Et).length&&!r(this,_t)}toDataURL(){return a(this,D,Kg).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,D,Kg).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,Et,[]),g(this,Mt,void 0),g(this,_t,void 0),a(this,D,Mi).call(this)),a(this,D,bs).call(this,!0)}undo(){this.mode==="draw"&&(r(this,Et).length?r(this,Et).pop():g(this,_t,void 0),g(this,Mt,void 0),a(this,D,Mi).call(this),a(this,D,bs).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==r(this,cr)){let t=this.value??"";if(g(this,cr,t),g(this,Et,[]),g(this,Mt,void 0),!t)g(this,_t,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.addEventListener("load",()=>{r(this,_t)===i&&a(this,D,Mi).call(this)}),i.src=t,g(this,_t,i),this.mode="draw"}a(this,D,Mi).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,cr,t),this.value=t}}firstUpdated(){a(this,D,qg).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,D,bs).call(this,!1)),a(this,D,um).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,D,um).call(this),r(this,ht).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?r(this,ht).setValidity({customError:!0},this.error,t):this.required&&this.empty?r(this,ht).setValidity({valueMissing:!0},this.t("required"),t):r(this,ht).setValidity({}),r(this,vs).sync()}render(){let e=r(this,Hc),t=this.getAttribute("aria-label"),i=r(this,vs).message,s=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!r(this,Et).length&&!r(this,_t),p=u=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${u}"
1542
+ `];$("cm-color-field",lr);var EM=z("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),qg=3,dm=.7,R0=.0055,hm="#000000",fy=8,Hc=2,H0=400,N0=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),ht,ys,Nc,fn,Pc,Et,Mt,_t,dr,hr,Ge,Ic,pr,bn,D,Og,pm,Bg,_i,mm,Fg,Vg,by,jg,um,Ug,gm,vy,Kg,yy,vs,fm,Wg,Gg,xy,Yg,wy,Xg,$y,ky,cr=class extends C{constructor(){super(...arguments);m(this,D);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";m(this,ht,this.attachInternals());m(this,ys,new re(this,r(this,ht)));m(this,Nc,N("cm-sig"));m(this,fn,"");m(this,Pc,"");m(this,Et,[]);m(this,Mt);m(this,_t);m(this,dr,"");m(this,hr,0);m(this,Ge);m(this,Ic,"");m(this,pr);m(this,bn,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,D,Og).call(this):(g(this,fn,this.value),g(this,Pc,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),r(this,pr)?.disconnect(),g(this,pr,void 0),cancelAnimationFrame(r(this,hr)),g(this,hr,0),r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0))}get form(){return r(this,ht).form}get validity(){return r(this,ht).validity}get validationMessage(){return r(this,ht).validationMessage}checkValidity(){return r(this,ht).checkValidity()}reportValidity(){return r(this,ys).report(()=>r(this,ht).reportValidity())}formResetCallback(){r(this,ys).reset(),g(this,Et,[]),g(this,Mt,void 0),g(this,_t,void 0),r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0)),this.typedName=r(this,Pc),r(this,fn)?(g(this,dr,""),this.value=r(this,fn)):this.updateComplete.then(()=>a(this,D,vs).call(this,!1)),a(this,D,_i).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!r(this,Et).length&&!r(this,_t)}toDataURL(){return a(this,D,Wg).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,D,Wg).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,Et,[]),g(this,Mt,void 0),g(this,_t,void 0),a(this,D,_i).call(this)),a(this,D,vs).call(this,!0)}undo(){this.mode==="draw"&&(r(this,Et).length?r(this,Et).pop():g(this,_t,void 0),g(this,Mt,void 0),a(this,D,_i).call(this),a(this,D,vs).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==r(this,dr)){let t=this.value??"";if(g(this,dr,t),g(this,Et,[]),g(this,Mt,void 0),!t)g(this,_t,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.addEventListener("load",()=>{r(this,_t)===i&&a(this,D,_i).call(this)}),i.src=t,g(this,_t,i),this.mode="draw"}a(this,D,_i).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,dr,t),this.value=t}}firstUpdated(){a(this,D,Og).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,D,vs).call(this,!1)),a(this,D,gm).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,D,gm).call(this),r(this,ht).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?r(this,ht).setValidity({customError:!0},this.error,t):this.required&&this.empty?r(this,ht).setValidity({valueMissing:!0},this.t("required"),t):r(this,ht).setValidity({}),r(this,ys).sync()}render(){let e=r(this,Nc),t=this.getAttribute("aria-label"),i=r(this,ys).message,s=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!r(this,Et).length&&!r(this,_t),p=u=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${u}"
1543
1543
  aria-selected=${this.mode===u?"true":"false"} aria-controls="${e}-panel-${u}"
1544
1544
  tabindex=${this.mode===u?"0":"-1"} ?disabled=${this.disabled}
1545
- @click=${()=>a(this,D,Wg).call(this,u,!0)} @keydown=${a(this,D,yy)}>${this.t(u)}</button>`;return c`<div class="field">
1545
+ @click=${()=>a(this,D,Gg).call(this,u,!0)} @keydown=${a(this,D,xy)}>${this.t(u)}</button>`;return c`<div class="field">
1546
1546
  ${this.label?c`<span class="label" id="${e}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
1547
1547
  <div class="bar">
1548
1548
  <div class="tabs" role="tablist" part="tabs"
1549
1549
  aria-labelledby=${this.label?`${e}-l`:h}
1550
1550
  aria-label=${this.label?h:t||this.t("modes")}>${p("draw")}${p("type")}</div>
1551
1551
  <div class="actions">
1552
- ${this.mode==="draw"?c`<button type="button" class="act" part="undo" aria-label=${this.t("undoLabel")} ?disabled=${this.disabled||d} @click=${a(this,D,wy)}>${this.t("undo")}</button>`:h}
1553
- <button type="button" class="act" part="clear" aria-label=${this.t("clearLabel")} ?disabled=${this.disabled||l} @click=${a(this,D,$y)}>${this.t("clear")}</button>
1552
+ ${this.mode==="draw"?c`<button type="button" class="act" part="undo" aria-label=${this.t("undoLabel")} ?disabled=${this.disabled||d} @click=${a(this,D,$y)}>${this.t("undo")}</button>`:h}
1553
+ <button type="button" class="act" part="clear" aria-label=${this.t("clearLabel")} ?disabled=${this.disabled||l} @click=${a(this,D,ky)}>${this.t("clear")}</button>
1554
1554
  </div>
1555
1555
  </div>
1556
1556
  <div class="panel panel-draw" role="tabpanel" id="${e}-panel-draw" aria-labelledby="${e}-tab-draw"
@@ -1560,8 +1560,8 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1560
1560
  ${d?c`<span class="here" aria-hidden="true">${this.t("signHere")}</span>`:h}
1561
1561
  <canvas part="canvas" role="img" aria-label=${d?this.t("pad"):this.t("padSigned")}
1562
1562
  aria-describedby=${[`${e}-instr`,s].filter(Boolean).join(" ")}
1563
- @pointerdown=${a(this,D,fy)} @pointermove=${a(this,D,Vg)} @pointerup=${a(this,D,mm)} @pointercancel=${a(this,D,mm)}
1564
- @lostpointercapture=${a(this,D,mm)} @transitionend=${()=>a(this,D,pm).call(this)}></canvas>
1563
+ @pointerdown=${a(this,D,by)} @pointermove=${a(this,D,jg)} @pointerup=${a(this,D,um)} @pointercancel=${a(this,D,um)}
1564
+ @lostpointercapture=${a(this,D,um)} @transitionend=${()=>a(this,D,mm).call(this)}></canvas>
1565
1565
  </div>
1566
1566
  <span class="vh" id="${e}-instr">${this.t("instructions")}</span>
1567
1567
  </div>
@@ -1573,13 +1573,13 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1573
1573
  aria-label=${this.label?`${this.label}: ${this.t("typeLabel")}`:this.t("typeLabel")}
1574
1574
  aria-required=${this.required?"true":h} aria-invalid=${i?"true":h}
1575
1575
  aria-describedby=${s||h} ?disabled=${this.disabled}
1576
- @input=${a(this,D,by)} @change=${a(this,D,vy)} />
1576
+ @input=${a(this,D,vy)} @change=${a(this,D,yy)} />
1577
1577
  </div>
1578
1578
  </div>
1579
1579
  ${i?c`<p class="error" id="${e}-err" role="alert">${i}</p>`:h}
1580
1580
  ${this.helpText?c`<p class="help" id="${e}-help">${this.helpText}</p>`:h}
1581
1581
  <div class="vh" role="status" aria-live="polite">${this._announce}</div>
1582
- </div>`}};ht=new WeakMap,vs=new WeakMap,Hc=new WeakMap,gn=new WeakMap,Nc=new WeakMap,Et=new WeakMap,Mt=new WeakMap,_t=new WeakMap,cr=new WeakMap,dr=new WeakMap,Ge=new WeakMap,Pc=new WeakMap,hr=new WeakMap,fn=new WeakMap,D=new WeakSet,qg=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||r(this,hr)||(g(this,hr,new ResizeObserver(()=>a(this,D,Og).call(this))),r(this,hr).observe(e))},hm=function(){return this.renderRoot.querySelector("canvas")},Og=function(){let e=r(this,D,hm);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,fn,t);let s=window.devicePixelRatio||1,l=Math.round(t*s),d=Math.round(i*s);(e.width!==l||e.height!==d)&&(e.width=l,e.height=d),a(this,D,pm).call(this)},Mi=function(){r(this,dr)||g(this,dr,requestAnimationFrame(()=>{g(this,dr,0),a(this,D,pm).call(this)}))},pm=function(){let e=r(this,D,hm);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||r(this,fn);if(!i)return;let s=e.width/i;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),t.setTransform(s,0,0,s,0,0);let l=getComputedStyle(e).color||dm;a(this,D,Bg).call(this,t,i,l,!0)},Bg=function(e,t,i,s){let l=t/Ig,d=r(this,_t);if(d?.complete&&d.naturalWidth){let p=Math.min(t*.9/d.naturalWidth,l*.9/d.naturalHeight),u=d.naturalWidth*p,b=d.naturalHeight*p,f=(t-u)/2,x=(l-b)/2;if(s&&!I0(i,dm)){let v=document.createElement("canvas");v.width=Math.max(1,Math.round(u*2)),v.height=Math.max(1,Math.round(b*2));let k=v.getContext("2d");k.drawImage(d,0,0,v.width,v.height),k.globalCompositeOperation="source-in",k.fillStyle=i,k.fillRect(0,0,v.width,v.height),e.drawImage(v,f,x,u,b)}else e.drawImage(d,f,x,u,b)}e.strokeStyle=i,e.fillStyle=i,e.lineCap="round",e.lineJoin="round";for(let p of r(this,Et))N0(e,p,t)},Fg=function(e,t){let i=e.pointerType==="pen"&&e.pressure>0?e.pressure:.5;return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.width,p:i}},fy=function(e){if(this.disabled||r(this,Mt)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.currentTarget;e.preventDefault();try{t.setPointerCapture(e.pointerId)}catch{}let i=[a(this,D,Fg).call(this,e,t.getBoundingClientRect())];g(this,Mt,{id:e.pointerId,stroke:i}),r(this,Et).push(i),a(this,D,Mi).call(this)},Vg=function(e){let t=r(this,Mt);if(!t||e.pointerId!==t.id)return;e.preventDefault();let i=e.currentTarget.getBoundingClientRect(),s=typeof e.getCoalescedEvents=="function"?e.getCoalescedEvents():[];for(let l of s.length?s:[e]){let d=a(this,D,Fg).call(this,l,i),p=t.stroke[t.stroke.length-1];Math.hypot(d.x-p.x,d.y-p.y)*i.width<1.5||t.stroke.push(d)}a(this,D,Mi).call(this)},mm=function(e){let t=r(this,Mt);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,D,Vg).call(this,e),g(this,Mt,void 0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}a(this,D,Mi).call(this),a(this,D,bs).call(this,!0)}},jg=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},um=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${r(this,D,jg)}`,i=!0;try{i=e.check(t,this.typedName||"Signature")}catch{}i||e.load(t,this.typedName||"Signature").then(()=>{this.mode==="type"&&this.typedName.trim()&&a(this,D,bs).call(this,!1)},()=>{})},by=function(e){e.stopPropagation(),r(this,Ge)?clearTimeout(r(this,Ge)):g(this,Pc,this.value),this.typedName=e.target.value,g(this,Ge,setTimeout(()=>a(this,D,Ug).call(this),R0)),a(this,D,um).call(this)},Ug=function(){r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0),this.value!==r(this,Pc)&&a(this,D,gm).call(this))},vy=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,D,Ug).call(this))},bs=function(e){let t=this.empty?"":this.toDataURL(),i=t!==this.value;i&&(g(this,cr,t),this.value=t),this.requestUpdate(),e&&i&&a(this,D,gm).call(this)},gm=function(){let e={value:this.value,empty:this.empty,mode:this.mode};this.dispatchEvent(new CustomEvent("cm-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Kg=function(){if(this.empty)return;let e=Math.max(r(this,D,hm)?.clientWidth||r(this,fn)||600,300),t=e/Ig,i=document.createElement("canvas");i.width=Math.round(e*Rc),i.height=Math.round(t*Rc);let s=i.getContext("2d",{willReadFrequently:!0});if(s.scale(Rc,Rc),this.mode==="type"){let l=Math.min(t*.45,64),d=r(this,D,jg);s.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),u=e-2*gy,b=s.measureText(p).width;b>u&&(l*=u/b,s.font=`400 ${l}px ${d}`),s.direction=getComputedStyle(this).direction==="rtl"?"rtl":"ltr",s.textAlign="center",s.textBaseline="alphabetic",s.fillStyle=dm,s.fillText(p,e/2,t*cm)}else a(this,D,Bg).call(this,s,e,dm,!1);return P0(i,gy*Rc)},Wg=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${r(this,Hc)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,D,Og).call(this),this.value!==i&&a(this,D,gm).call(this)})},yy=function(e){let t=se(e,this),i;if(t==="ArrowRight"||t==="ArrowLeft")i=this.mode==="draw"?"type":"draw";else if(e.key==="Home")i="draw";else if(e.key==="End")i="type";else return;e.preventDefault(),a(this,D,Wg).call(this,i,!0)},Gg=function(e){a(this,D,xy).call(this,this.t(e))},xy=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Yg=function(e){this.updateComplete.then(()=>{let t=this.shadowRoot?.activeElement;if(!e||t&&!t.disabled)return;(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))?.focus()})},wy=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,D,Gg).call(this,"undone"),a(this,D,Yg).call(this,e)},$y=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,D,Gg).call(this,"cleared"),a(this,D,Yg).call(this,e)},lr.formAssociated=!0,lr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},lr.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},mode:{reflect:!0},typedName:{attribute:"typed-name"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_announce:{state:!0}},lr.styles=[E,w`
1582
+ </div>`}};ht=new WeakMap,ys=new WeakMap,Nc=new WeakMap,fn=new WeakMap,Pc=new WeakMap,Et=new WeakMap,Mt=new WeakMap,_t=new WeakMap,dr=new WeakMap,hr=new WeakMap,Ge=new WeakMap,Ic=new WeakMap,pr=new WeakMap,bn=new WeakMap,D=new WeakSet,Og=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||r(this,pr)||(g(this,pr,new ResizeObserver(()=>a(this,D,Bg).call(this))),r(this,pr).observe(e))},pm=function(){return this.renderRoot.querySelector("canvas")},Bg=function(){let e=r(this,D,pm);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,bn,t);let s=window.devicePixelRatio||1,l=Math.round(t*s),d=Math.round(i*s);(e.width!==l||e.height!==d)&&(e.width=l,e.height=d),a(this,D,mm).call(this)},_i=function(){r(this,hr)||g(this,hr,requestAnimationFrame(()=>{g(this,hr,0),a(this,D,mm).call(this)}))},mm=function(){let e=r(this,D,pm);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||r(this,bn);if(!i)return;let s=e.width/i;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),t.setTransform(s,0,0,s,0,0);let l=getComputedStyle(e).color||hm;a(this,D,Fg).call(this,t,i,l,!0)},Fg=function(e,t,i,s){let l=t/qg,d=r(this,_t);if(d?.complete&&d.naturalWidth){let p=Math.min(t*.9/d.naturalWidth,l*.9/d.naturalHeight),u=d.naturalWidth*p,b=d.naturalHeight*p,f=(t-u)/2,x=(l-b)/2;if(s&&!q0(i,hm)){let v=document.createElement("canvas");v.width=Math.max(1,Math.round(u*2)),v.height=Math.max(1,Math.round(b*2));let k=v.getContext("2d");k.drawImage(d,0,0,v.width,v.height),k.globalCompositeOperation="source-in",k.fillStyle=i,k.fillRect(0,0,v.width,v.height),e.drawImage(v,f,x,u,b)}else e.drawImage(d,f,x,u,b)}e.strokeStyle=i,e.fillStyle=i,e.lineCap="round",e.lineJoin="round";for(let p of r(this,Et))P0(e,p,t)},Vg=function(e,t){let i=e.pointerType==="pen"&&e.pressure>0?e.pressure:.5;return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.width,p:i}},by=function(e){if(this.disabled||r(this,Mt)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.currentTarget;e.preventDefault();try{t.setPointerCapture(e.pointerId)}catch{}let i=[a(this,D,Vg).call(this,e,t.getBoundingClientRect())];g(this,Mt,{id:e.pointerId,stroke:i}),r(this,Et).push(i),a(this,D,_i).call(this)},jg=function(e){let t=r(this,Mt);if(!t||e.pointerId!==t.id)return;e.preventDefault();let i=e.currentTarget.getBoundingClientRect(),s=typeof e.getCoalescedEvents=="function"?e.getCoalescedEvents():[];for(let l of s.length?s:[e]){let d=a(this,D,Vg).call(this,l,i),p=t.stroke[t.stroke.length-1];Math.hypot(d.x-p.x,d.y-p.y)*i.width<1.5||t.stroke.push(d)}a(this,D,_i).call(this)},um=function(e){let t=r(this,Mt);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,D,jg).call(this,e),g(this,Mt,void 0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}a(this,D,_i).call(this),a(this,D,vs).call(this,!0)}},Ug=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},gm=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${r(this,D,Ug)}`,i=!0;try{i=e.check(t,this.typedName||"Signature")}catch{}i||e.load(t,this.typedName||"Signature").then(()=>{this.mode==="type"&&this.typedName.trim()&&a(this,D,vs).call(this,!1)},()=>{})},vy=function(e){e.stopPropagation(),r(this,Ge)?clearTimeout(r(this,Ge)):g(this,Ic,this.value),this.typedName=e.target.value,g(this,Ge,setTimeout(()=>a(this,D,Kg).call(this),H0)),a(this,D,gm).call(this)},Kg=function(){r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0),this.value!==r(this,Ic)&&a(this,D,fm).call(this))},yy=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,D,Kg).call(this))},vs=function(e){let t=this.empty?"":this.toDataURL(),i=t!==this.value;i&&(g(this,dr,t),this.value=t),this.requestUpdate(),e&&i&&a(this,D,fm).call(this)},fm=function(){let e={value:this.value,empty:this.empty,mode:this.mode};this.dispatchEvent(new CustomEvent("cm-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Wg=function(){if(this.empty)return;let e=Math.max(r(this,D,pm)?.clientWidth||r(this,bn)||600,300),t=e/qg,i=document.createElement("canvas");i.width=Math.round(e*Hc),i.height=Math.round(t*Hc);let s=i.getContext("2d",{willReadFrequently:!0});if(s.scale(Hc,Hc),this.mode==="type"){let l=Math.min(t*.45,64),d=r(this,D,Ug);s.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),u=e-2*fy,b=s.measureText(p).width;b>u&&(l*=u/b,s.font=`400 ${l}px ${d}`),s.direction=getComputedStyle(this).direction==="rtl"?"rtl":"ltr",s.textAlign="center",s.textBaseline="alphabetic",s.fillStyle=hm,s.fillText(p,e/2,t*dm)}else a(this,D,Fg).call(this,s,e,hm,!1);return I0(i,fy*Hc)},Gg=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${r(this,Nc)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,D,Bg).call(this),this.value!==i&&a(this,D,fm).call(this)})},xy=function(e){let t=se(e,this),i;if(t==="ArrowRight"||t==="ArrowLeft")i=this.mode==="draw"?"type":"draw";else if(e.key==="Home")i="draw";else if(e.key==="End")i="type";else return;e.preventDefault(),a(this,D,Gg).call(this,i,!0)},Yg=function(e){a(this,D,wy).call(this,this.t(e))},wy=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Xg=function(e){this.updateComplete.then(()=>{let t=this.shadowRoot?.activeElement;if(!e||t&&!t.disabled)return;(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))?.focus()})},$y=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,D,Yg).call(this,"undone"),a(this,D,Xg).call(this,e)},ky=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,D,Yg).call(this,"cleared"),a(this,D,Xg).call(this,e)},cr.formAssociated=!0,cr.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},cr.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},mode:{reflect:!0},typedName:{attribute:"typed-name"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_announce:{state:!0}},cr.styles=[E,w`
1583
1583
  :host { display: block; }
1584
1584
  .field { display: flex; flex-direction: column; gap: var(--cm-space-8); }
1585
1585
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -1609,7 +1609,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1609
1609
  .act:disabled { background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed; }
1610
1610
  .panel:focus { outline: none; }
1611
1611
  .pad {
1612
- position: relative; width: 100%; aspect-ratio: ${Ig} / 1; overflow: hidden; container-type: inline-size;
1612
+ position: relative; width: 100%; aspect-ratio: ${qg} / 1; overflow: hidden; container-type: inline-size;
1613
1613
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
1614
1614
  }
1615
1615
  .panel:focus-visible .pad, .pad:focus-within { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
@@ -1620,15 +1620,15 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1620
1620
  color: var(--cm-text-default); transition-property: color; transition-duration: 1ms; /* scale-exempt: not motion; a 1ms colour transition makes a theme change fire transitionend so the ink repaints */
1621
1621
  }
1622
1622
  .line {
1623
- position: absolute; inset-inline: var(--cm-space-12); top: ${cm*100}%; height: 0;
1623
+ position: absolute; inset-inline: var(--cm-space-12); top: ${dm*100}%; height: 0;
1624
1624
  border-top: var(--cm-border-1) dashed var(--cm-border-input); pointer-events: none;
1625
1625
  }
1626
1626
  .here {
1627
- position: absolute; inset-inline-start: var(--cm-space-12); bottom: calc(${(1-cm)*100}% + 4px);
1627
+ position: absolute; inset-inline-start: var(--cm-space-12); bottom: calc(${(1-dm)*100}% + 4px);
1628
1628
  font-size: 12px; color: var(--cm-text-tertiary); pointer-events: none; user-select: none;
1629
1629
  }
1630
1630
  .typed {
1631
- position: absolute; inset-inline: var(--cm-space-12); bottom: calc(${(1-cm)*100}% - 0.18em);
1631
+ position: absolute; inset-inline: var(--cm-space-12); bottom: calc(${(1-dm)*100}% - 0.18em);
1632
1632
  width: calc(100% - 2 * var(--cm-space-12)); padding: 0; margin: 0;
1633
1633
  font-family: var(--cm-signature-font, 'Dancing Script', 'Segoe Script', 'Bradley Hand', 'Snell Roundhand', 'Brush Script MT', cursive);
1634
1634
  font-size: clamp(24px, 9cqi, 48px); font-weight: 400; line-height: 1.25; text-align: center; /* scale-exempt: a typed signature scales with the pad, like handwriting */
@@ -1645,19 +1645,19 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1645
1645
  @media (pointer: coarse) { .act, .tab { min-height: var(--cm-control-height-touch); } }
1646
1646
 
1647
1647
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1648
- `];function N0(o,n,e){let t=d=>e*D0*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],s=n[0];for(let d=1;d<n.length-1;d++){let p=H0(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(s)),o.quadraticCurveTo(...i(n[d]),...i(p)),o.lineWidth=t(n[d].p),o.stroke(),s=p}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(s)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function P0(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,s=t,l=e,d=-1,p=-1;for(let b=0;b<t;b++){let f=b*e*4;for(let x=0;x<e;x++)i[f+x*4+3]>8&&(x<l&&(l=x),x>d&&(d=x),b<s&&(s=b),p=b)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=p-s+1+2*n,u.getContext("2d").drawImage(o,l,s,d-l+1,p-s+1,n,n,d-l+1,p-s+1),u}function I0(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let s=parseInt(i[1],16);return`${s>>16&255},${s>>8&255},${s&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",lr);var CM=z("optionGroup",{required:"Please select one of these options."}),Tt,ys,xs,bn,Ic,Yt,Xg,Jg,ky,Gt=class extends C{constructor(){super(...arguments);m(this,Yt);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];m(this,Tt,this.attachInternals());m(this,ys,new re(this,r(this,Tt),()=>this.renderRoot.querySelector('button[tabindex="0"]')?.focus()));m(this,xs,N("cm-og"));m(this,bn,"");m(this,Ic,new MutationObserver(()=>a(this,Yt,Xg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,Yt,Xg).call(this),r(this,Ic).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Ic).disconnect()}get form(){return r(this,Tt).form}get validity(){return r(this,Tt).validity}get validationMessage(){return r(this,Tt).validationMessage}checkValidity(){return r(this,Tt).checkValidity()}reportValidity(){return r(this,ys).report(()=>r(this,Tt).reportValidity())}formResetCallback(){this.value=r(this,bn),r(this,ys).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,bn)||g(this,bn,this.value)}updated(){r(this,Tt).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,Tt).setValidity({valueMissing:!0},this.t("required"),e):r(this,Tt).setValidity({}),r(this,ys).sync()}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),s=this.getAttribute("aria-label"),l=r(this,ys).message;return c`
1649
- ${this.label?c`<span class="label" id="${r(this,xs)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
1648
+ `];function P0(o,n,e){let t=d=>e*R0*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],s=n[0];for(let d=1;d<n.length-1;d++){let p=N0(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(s)),o.quadraticCurveTo(...i(n[d]),...i(p)),o.lineWidth=t(n[d].p),o.stroke(),s=p}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(s)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function I0(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,s=t,l=e,d=-1,p=-1;for(let b=0;b<t;b++){let f=b*e*4;for(let x=0;x<e;x++)i[f+x*4+3]>8&&(x<l&&(l=x),x>d&&(d=x),b<s&&(s=b),p=b)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=p-s+1+2*n,u.getContext("2d").drawImage(o,l,s,d-l+1,p-s+1,n,n,d-l+1,p-s+1),u}function q0(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let s=parseInt(i[1],16);return`${s>>16&255},${s>>8&255},${s&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",cr);var LM=z("optionGroup",{required:"Please select one of these options."}),Tt,xs,ws,vn,qc,Xt,Jg,Qg,Ey,Yt=class extends C{constructor(){super(...arguments);m(this,Xt);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];m(this,Tt,this.attachInternals());m(this,xs,new re(this,r(this,Tt),()=>this.renderRoot.querySelector('button[tabindex="0"]')?.focus()));m(this,ws,N("cm-og"));m(this,vn,"");m(this,qc,new MutationObserver(()=>a(this,Xt,Jg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,Xt,Jg).call(this),r(this,qc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,qc).disconnect()}get form(){return r(this,Tt).form}get validity(){return r(this,Tt).validity}get validationMessage(){return r(this,Tt).validationMessage}checkValidity(){return r(this,Tt).checkValidity()}reportValidity(){return r(this,xs).report(()=>r(this,Tt).reportValidity())}formResetCallback(){this.value=r(this,vn),r(this,xs).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,vn)||g(this,vn,this.value)}updated(){r(this,Tt).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,Tt).setValidity({valueMissing:!0},this.t("required"),e):r(this,Tt).setValidity({}),r(this,xs).sync()}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),s=this.getAttribute("aria-label"),l=r(this,xs).message;return c`
1649
+ ${this.label?c`<span class="label" id="${r(this,ws)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
1650
1650
  <div class="options" part="options" role="radiogroup"
1651
- aria-labelledby=${this.label?`${r(this,xs)}-l`:h} aria-label=${!this.label&&s?s:h}
1651
+ aria-labelledby=${this.label?`${r(this,ws)}-l`:h} aria-label=${!this.label&&s?s:h}
1652
1652
  aria-required=${this.required?"true":h} aria-invalid=${l?"true":h}
1653
- aria-describedby=${l?`${r(this,xs)}-err`:h}>
1653
+ aria-describedby=${l?`${r(this,ws)}-err`:h}>
1654
1654
  ${e.map((d,p)=>c`<button type="button" role="radio" part="option" class=${d.tone==="critical"||d.tone==="success"?`tone-${d.tone}`:h} aria-checked=${d.value===this.value?"true":"false"}
1655
1655
  tabindex=${p===i?"0":"-1"} ?disabled=${this.disabled||!!d.disabled}
1656
- @click=${()=>a(this,Yt,Jg).call(this,p)} @keydown=${u=>a(this,Yt,ky).call(this,u,p)}>${d.label}</button>`)}
1656
+ @click=${()=>a(this,Xt,Qg).call(this,p)} @keydown=${u=>a(this,Xt,Ey).call(this,u,p)}>${d.label}</button>`)}
1657
1657
  </div>
1658
- ${l?c`<p class="error" id="${r(this,xs)}-err" role="alert">${l}</p>`:h}
1658
+ ${l?c`<p class="error" id="${r(this,ws)}-err" role="alert">${l}</p>`:h}
1659
1659
  <slot></slot>
1660
- `}};Tt=new WeakMap,ys=new WeakMap,xs=new WeakMap,bn=new WeakMap,Ic=new WeakMap,Yt=new WeakSet,Xg=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled},s=t.getAttribute("tone");return(s==="critical"||s==="success")&&(i.tone=s),i}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,bn,this.value))},Jg=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},ky=function(e,t){let i=se(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight"||e.key==="ArrowDown")d=s[(l+1)%s.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,Yt,Jg).call(this,d)},Gt.formAssociated=!0,Gt.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},Gt.styles=[E,w`
1660
+ `}};Tt=new WeakMap,xs=new WeakMap,ws=new WeakMap,vn=new WeakMap,qc=new WeakMap,Xt=new WeakSet,Jg=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled},s=t.getAttribute("tone");return(s==="critical"||s==="success")&&(i.tone=s),i}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",g(this,vn,this.value))},Qg=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Ey=function(e,t){let i=se(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight"||e.key==="ArrowDown")d=s[(l+1)%s.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,Xt,Qg).call(this,d)},Yt.formAssociated=!0,Yt.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},Yt.styles=[E,w`
1661
1661
  :host { display: block; }
1662
1662
  .label {
1663
1663
  display: block; margin-bottom: var(--cm-space-8);
@@ -1691,7 +1691,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1691
1691
  /* 1.14: the field's own message under the options. */
1692
1692
  .error { margin: var(--cm-space-8) 0 0; font-size: var(--cm-type-body-xs-size); line-height: var(--cm-type-body-xs-line-height); color: var(--cm-text-critical); }
1693
1693
  @media (pointer: coarse) { button { min-height: var(--cm-control-height-touch, 44px); } }
1694
- `];$("cm-option-group",Gt);var HM=z("segmentedControl",{required:"Please select one of these options."}),vn=class extends Gt{constructor(){super(...arguments);this.size="default"}};vn.properties={...Gt.properties,size:{reflect:!0}},vn.styles=[E,w`
1694
+ `];$("cm-option-group",Yt);var IM=z("segmentedControl",{required:"Please select one of these options."}),yn=class extends Yt{constructor(){super(...arguments);this.size="default"}};yn.properties={...Yt.properties,size:{reflect:!0}},yn.styles=[E,w`
1695
1695
  :host { display: inline-block; vertical-align: middle; max-width: 100%; --_h: var(--cm-control-height-md, 36px); }
1696
1696
  :host([size='small']) { --_h: var(--cm-control-height-sm, 32px); }
1697
1697
  @media (pointer: coarse) { :host, :host([size='small']) { --_h: var(--cm-control-height-touch, 44px); } }
@@ -1721,7 +1721,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1721
1721
  button[aria-checked='true']:disabled { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
1722
1722
  :host([disabled]) .options { background: var(--cm-bg-input-filled); }
1723
1723
  slot { display: none; }
1724
- `];$("cm-segmented-control",vn);var OM=z("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),qc,Qg,yn=class extends C{constructor(){super(...arguments);m(this,qc);this.heading="";this.description="";this.breadcrumbs=[];this.backHref="";this.backLabel="";this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=this.backHref?{href:this.backHref,label:this.backLabel}:[...e].reverse().find(i=>i.href);return c`<header part="header">
1724
+ `];$("cm-segmented-control",yn);var VM=z("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Oc,Zg,xn=class extends C{constructor(){super(...arguments);m(this,Oc);this.heading="";this.description="";this.breadcrumbs=[];this.backHref="";this.backLabel="";this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=this.backHref?{href:this.backHref,label:this.backLabel}:[...e].reverse().find(i=>i.href);return c`<header part="header">
1725
1725
  <div class=${this.description?"lead described":"lead"}>
1726
1726
  ${t?c`<a class=${this.backHref?"back always":"back"} part="back" href=${t.href} aria-label=${t.label?this.t("back",{label:t.label}):this.t("backOnly")}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:h}
1727
1727
  <div class="titles">
@@ -1735,12 +1735,12 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1735
1735
  </div>
1736
1736
  <div class="actions">
1737
1737
  ${this.pagination?c`<div class="arrows" role="group" aria-label=${this.t("records")}>
1738
- <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>a(this,qc,Qg).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
1739
- <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>a(this,qc,Qg).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
1738
+ <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>a(this,Oc,Zg).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
1739
+ <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>a(this,Oc,Zg).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
1740
1740
  </div>`:h}
1741
1741
  <slot name="actions"></slot>
1742
1742
  </div>
1743
- </header>`}};qc=new WeakSet,Qg=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},yn.properties={heading:{},description:{},breadcrumbs:{type:Array},backHref:{attribute:"back-href"},backLabel:{attribute:"back-label"},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},yn.styles=[E,w`
1743
+ </header>`}};Oc=new WeakSet,Zg=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},xn.properties={heading:{},description:{},breadcrumbs:{type:Array},backHref:{attribute:"back-href"},backLabel:{attribute:"back-label"},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},xn.styles=[E,w`
1744
1744
  :host { display: block; }
1745
1745
  header {
1746
1746
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-12) var(--cm-space-20);
@@ -1798,7 +1798,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1798
1798
  h1 { font-size: var(--cm-type-heading-lg-resp-size); line-height: var(--cm-type-heading-lg-resp-line-height); }
1799
1799
  .actions { gap: var(--cm-space-8); }
1800
1800
  }
1801
- `];$("cm-page-header",yn);var KM=z("actionBar",{label:"Actions"}),xn=class extends C{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
1801
+ `];$("cm-page-header",xn);var YM=z("actionBar",{label:"Actions"}),wn=class extends C{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
1802
1802
  <div class="lead">
1803
1803
  ${e?c`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:h}
1804
1804
  <div class="text">
@@ -1808,7 +1808,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1808
1808
  </div>
1809
1809
  </div>
1810
1810
  <div class="actions"><slot name="actions"></slot></div>
1811
- </div>`}};xn.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},xn.styles=[E,w`
1811
+ </div>`}};wn.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},wn.styles=[E,w`
1812
1812
  :host { display: block; }
1813
1813
  :host([sticky]) { position: sticky; bottom: 0; z-index: 10; }
1814
1814
  .bar {
@@ -1839,13 +1839,13 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1839
1839
 
1840
1840
  .actions { gap: var(--cm-space-8); }
1841
1841
  }
1842
- `];$("cm-action-bar",xn);var JM=z("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Xt,ws,Oc,Ye,Zg,ef,tf,Ey,My,wn=class extends C{constructor(){super(...arguments);m(this,Ye);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";m(this,Xt,null);m(this,ws,()=>{this.open=!0});m(this,Oc,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,Ye,Zg).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,Ye,ef).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,Ye,Zg).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1842
+ `];$("cm-action-bar",wn);var e2=z("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Jt,$s,Bc,Ye,ef,tf,rf,My,_y,$n=class extends C{constructor(){super(...arguments);m(this,Ye);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";m(this,Jt,null);m(this,$s,()=>{this.open=!0});m(this,Bc,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,Ye,ef).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,Ye,tf).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,Ye,ef).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1843
1843
  <p class="message" part="message" role="status">${this.open?this.message:""}</p>
1844
1844
  <div class="actions">
1845
- <cm-button size="large" ?disabled=${this.loading} @click=${a(this,Ye,My)}>${this.discardLabel}</cm-button>
1846
- <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${a(this,Ye,Ey)}>${this.saveLabel}</cm-button>
1845
+ <cm-button size="large" ?disabled=${this.loading} @click=${a(this,Ye,_y)}>${this.discardLabel}</cm-button>
1846
+ <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${a(this,Ye,My)}>${this.saveLabel}</cm-button>
1847
1847
  </div>
1848
- </div>`}};Xt=new WeakMap,ws=new WeakMap,Oc=new WeakMap,Ye=new WeakSet,Zg=function(){a(this,Ye,ef).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(g(this,Xt,e),e.addEventListener("input",r(this,ws)),e.addEventListener("change",r(this,ws)),e.addEventListener("reset",r(this,Oc)))},ef=function(){let e=r(this,Xt);e&&(e.removeEventListener("input",r(this,ws)),e.removeEventListener("change",r(this,ws)),e.removeEventListener("reset",r(this,Oc)),g(this,Xt,null))},tf=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},Ey=function(){this.loading||this.saveDisabled||a(this,Ye,tf).call(this,"cm-save")&&r(this,Xt)&&r(this,Xt).requestSubmit()},My=function(){this.loading||a(this,Ye,tf).call(this,"cm-discard")&&r(this,Xt)&&(r(this,Xt).reset(),this.open=!1)},wn.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},wn.styles=[E,w`
1848
+ </div>`}};Jt=new WeakMap,$s=new WeakMap,Bc=new WeakMap,Ye=new WeakSet,ef=function(){a(this,Ye,tf).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(g(this,Jt,e),e.addEventListener("input",r(this,$s)),e.addEventListener("change",r(this,$s)),e.addEventListener("reset",r(this,Bc)))},tf=function(){let e=r(this,Jt);e&&(e.removeEventListener("input",r(this,$s)),e.removeEventListener("change",r(this,$s)),e.removeEventListener("reset",r(this,Bc)),g(this,Jt,null))},rf=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},My=function(){this.loading||this.saveDisabled||a(this,Ye,rf).call(this,"cm-save")&&r(this,Jt)&&r(this,Jt).requestSubmit()},_y=function(){this.loading||a(this,Ye,rf).call(this,"cm-discard")&&r(this,Jt)&&(r(this,Jt).reset(),this.open=!1)},$n.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},$n.styles=[E,w`
1849
1849
  :host { display: block; position: sticky; bottom: 0; z-index: 20; }
1850
1850
  :host(:not([open])) { display: none; }
1851
1851
  .bar {
@@ -1861,14 +1861,14 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1861
1861
  .message { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; }
1862
1862
 
1863
1863
  }
1864
- `];$("cm-save-bar",wn);var r2=z("infoItem",{edit:"Edit {label}"}),$n=class extends A{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this.variant="default";this.layout="stacked";this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="panel" aria-label=${this.heading||h}>
1864
+ `];$("cm-save-bar",$n);var n2=z("infoItem",{edit:"Edit {label}"}),kn=class extends A{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this.variant="default";this.layout="stacked";this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="panel" aria-label=${this.heading||h}>
1865
1865
  ${this.heading||this.action?c`<header>
1866
1866
  <div class="title" role="heading" aria-level=${e} part="title">${this.heading}</div>
1867
1867
  ${this.action?c`<button class="action" type="button" part="action" aria-label=${this.actionLabel||h}
1868
1868
  @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:h}
1869
1869
  </header>`:h}
1870
1870
  <div class="items" role=${this._list?"list":h}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
1871
- </section>`}};$n.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},variant:{reflect:!0},layout:{reflect:!0},_list:{state:!0}},$n.styles=[E,w`
1871
+ </section>`}};kn.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},variant:{reflect:!0},layout:{reflect:!0},_list:{state:!0}},kn.styles=[E,w`
1872
1872
  :host { display: block; }
1873
1873
  section {
1874
1874
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
@@ -1893,9 +1893,9 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1893
1893
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: baseline;
1894
1894
  column-gap: var(--cm-space-12); grid-column: 1 / -1; --_cm-info-value-gap: 0px;
1895
1895
  }
1896
- `];$("cm-info-panel",$n);var kn=class extends C{constructor(){super(...arguments);this.label="";this.half=!1;this.editable=!1;this.editLabel=""}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){let e=c`<div class="value" part="value"><slot></slot></div>`;return this.editable?c`<div class="label" part="label">${this.label}</div><div class="row">${e}<button class="edit" part="edit" type="button"
1896
+ `];$("cm-info-panel",kn);var En=class extends C{constructor(){super(...arguments);this.label="";this.half=!1;this.editable=!1;this.editLabel=""}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){let e=c`<div class="value" part="value"><slot></slot></div>`;return this.editable?c`<div class="label" part="label">${this.label}</div><div class="row">${e}<button class="edit" part="edit" type="button"
1897
1897
  aria-label=${this.editLabel||this.t("edit",{label:this.label})}
1898
- @click=${()=>this.dispatchEvent(new CustomEvent("cm-edit",{bubbles:!0,composed:!0}))}><cm-icon name="edit" size="16"></cm-icon></button></div>`:c`<div class="label" part="label">${this.label}</div>${e}`}};kn.properties={label:{},half:{type:Boolean,reflect:!0},editable:{type:Boolean,reflect:!0},editLabel:{attribute:"edit-label"}},kn.styles=[E,w`
1898
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-edit",{bubbles:!0,composed:!0}))}><cm-icon name="edit" size="16"></cm-icon></button></div>`:c`<div class="label" part="label">${this.label}</div>${e}`}};En.properties={label:{},half:{type:Boolean,reflect:!0},editable:{type:Boolean,reflect:!0},editLabel:{attribute:"edit-label"}},En.styles=[E,w`
1899
1899
  :host { display: block; grid-column: 1 / -1; min-width: 0; }
1900
1900
  :host([half]) { grid-column: auto; }
1901
1901
  .label { font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); color: var(--cm-text-tertiary); }
@@ -1914,16 +1914,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1914
1914
  .edit:hover { background: var(--cm-bg-hover); color: var(--cm-icon-selected); }
1915
1915
  .edit:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1916
1916
  @media (pointer: coarse) { .edit::after { content: ''; position: absolute; inset: -8px; } }
1917
- `];$("cm-info-item",kn);var $s,En=class extends A{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;m(this,$s,N("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return c`<div class="wrap" part="accordion">
1917
+ `];$("cm-info-item",En);var ks,Mn=class extends A{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;m(this,ks,N("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return c`<div class="wrap" part="accordion">
1918
1918
  <div class="h" role="heading" aria-level=${e}>
1919
- <button type="button" part="toggle" id="${r(this,$s)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,$s)}-body"
1919
+ <button type="button" part="toggle" id="${r(this,ks)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,ks)}-body"
1920
1920
  ?disabled=${this.disabled} @click=${this.toggle}>
1921
1921
  <span>${this.heading}</span>
1922
1922
  <span class="chev" aria-hidden="true"><cm-icon name="chevron-down" size="16"></cm-icon></span>
1923
1923
  </button>
1924
1924
  </div>
1925
- <div class="body" part="body" id="${r(this,$s)}-body" role="region" aria-labelledby="${r(this,$s)}-btn" ?hidden=${!this.open}><slot></slot></div>
1926
- </div>`}};$s=new WeakMap,En.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},En.styles=[E,w`
1925
+ <div class="body" part="body" id="${r(this,ks)}-body" role="region" aria-labelledby="${r(this,ks)}-btn" ?hidden=${!this.open}><slot></slot></div>
1926
+ </div>`}};ks=new WeakMap,Mn.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Mn.styles=[E,w`
1927
1927
  :host { display: block; }
1928
1928
  .wrap { border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
1929
1929
  .h { margin: 0; font: inherit; }
@@ -1946,24 +1946,24 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
1946
1946
  .body[hidden] { display: none; }
1947
1947
 
1948
1948
 
1949
- `];$("cm-accordion",En);var rt,ks,rf,_y,Mn=class extends A{constructor(){super(...arguments);m(this,rt);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="default";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return a(this,rt,_y).call(this,e);let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size=${this.size==="large"||this.size==="small"?"48":"24"}></cm-icon>`:h;return c`<div class="wrap" part="empty-state">
1949
+ `];$("cm-accordion",Mn);var rt,Es,sf,Ty,_n=class extends A{constructor(){super(...arguments);m(this,rt);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="default";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return a(this,rt,Ty).call(this,e);let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size=${this.size==="large"||this.size==="small"?"48":"24"}></cm-icon>`:h;return c`<div class="wrap" part="empty-state">
1950
1950
  <div class="circle" part="circle" aria-hidden=${this.hasImage?h:"true"}>
1951
- <slot name="image" @slotchange=${i=>a(this,rt,ks).call(this,i,"hasImage")}>${t}</slot>
1951
+ <slot name="image" @slotchange=${i=>a(this,rt,Es).call(this,i,"hasImage")}>${t}</slot>
1952
1952
  </div>
1953
1953
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1954
- <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>a(this,rt,ks).call(this,i,"hasText")}></slot></div>
1955
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,rt,ks).call(this,i,"hasActions")}></slot></div>${this.action?c`<div class="actions">${a(this,rt,rf).call(this)}</div>`:h}
1956
- </div>`}};rt=new WeakSet,ks=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(s=>s.nodeType===1||s.textContent.trim()),this.requestUpdate()},rf=function(){return this.action?this.actionHref?c`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:c`<button class="text-action" type="button" part="action"
1957
- @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:h},_y=function(e){let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h;return c`<div class="wrap inline" part="empty-state">
1954
+ <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>a(this,rt,Es).call(this,i,"hasText")}></slot></div>
1955
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,rt,Es).call(this,i,"hasActions")}></slot></div>${this.action?c`<div class="actions">${a(this,rt,sf).call(this)}</div>`:h}
1956
+ </div>`}};rt=new WeakSet,Es=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(s=>s.nodeType===1||s.textContent.trim()),this.requestUpdate()},sf=function(){return this.action?this.actionHref?c`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:c`<button class="text-action" type="button" part="action"
1957
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:h},Ty=function(e){let t=this.image?c`<img src=${this.image} alt="" part="image">`:this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h;return c`<div class="wrap inline" part="empty-state">
1958
1958
  <span class="icon" part="circle" aria-hidden=${this.hasImage?h:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
1959
- <slot name="image" @slotchange=${i=>a(this,rt,ks).call(this,i,"hasImage")}>${t}</slot>
1959
+ <slot name="image" @slotchange=${i=>a(this,rt,Es).call(this,i,"hasImage")}>${t}</slot>
1960
1960
  </span>
1961
1961
  <div class="line">
1962
1962
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1963
- <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>a(this,rt,ks).call(this,i,"hasText")}></slot></span>${a(this,rt,rf).call(this)}
1964
- <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,rt,ks).call(this,i,"hasActions")}></slot></span>
1963
+ <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>a(this,rt,Es).call(this,i,"hasText")}></slot></span>${a(this,rt,sf).call(this)}
1964
+ <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,rt,Es).call(this,i,"hasActions")}></slot></span>
1965
1965
  </div>
1966
- </div>`},Mn.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},Mn.styles=[E,w`
1966
+ </div>`},_n.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},_n.styles=[E,w`
1967
1967
  :host { display: block; }
1968
1968
  /* Default (1.6): a 48px tile with a 24px icon, then 12px to a 16/24 heading, 4px to 13/18 text, 12px to the actions. */
1969
1969
  .wrap {
@@ -2012,7 +2012,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2012
2012
  :host([size='large']) .circle { width: 120px; height: 120px; }
2013
2013
  :host([size='large']) .title { margin-top: var(--cm-space-16); }
2014
2014
  }
2015
- `];$("cm-empty-state",Mn);var Ty={small:34,medium:40,large:50,xlarge:186},_n=class extends A{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=Ty[this.size]??Ty.large;return c`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return c`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return c`${Array.from({length:e},(t,i)=>c`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};_n.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},_n.styles=[E,w`
2015
+ `];$("cm-empty-state",_n);var Cy={small:34,medium:40,large:50,xlarge:186},Tn=class extends A{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=Cy[this.size]??Cy.large;return c`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return c`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return c`${Array.from({length:e},(t,i)=>c`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};Tn.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},Tn.styles=[E,w`
2016
2016
  :host { display: block; --cm-skeleton-height: 120px; }
2017
2017
  :host([variant='thumbnail']) { display: inline-block; vertical-align: middle; }
2018
2018
  .bone {
@@ -2027,17 +2027,17 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2027
2027
  .bone { animation: none; background: var(--cm-thumb-bg); }
2028
2028
  }
2029
2029
  @media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
2030
- `];$("cm-skeleton",_n);var q0=[472,90,90,251],O0=[94,266,134,191,138],Tn=class extends C{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>c`<span class="bone" style="height:${i}px"></span>`);return c`<div class="wrap" part="skeleton-display" aria-busy="true">
2030
+ `];$("cm-skeleton",Tn);var O0=[472,90,90,251],B0=[94,266,134,191,138],Cn=class extends C{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>c`<span class="bone" style="height:${i}px"></span>`);return c`<div class="wrap" part="skeleton-display" aria-busy="true">
2031
2031
  <span class="sr" role="status">${this.label}</span>
2032
2032
  <div class="page" aria-hidden="true">
2033
2033
  ${this.navigation?c`<span class="bone nav"></span>`:h}
2034
2034
  <span class="bone head"></span>
2035
2035
  <div class="body">
2036
- <div class="col main">${e(this.layout==="one-column"?[472,251]:q0)}</div>
2037
- <div class="col side">${e(O0)}</div>
2036
+ <div class="col main">${e(this.layout==="one-column"?[472,251]:O0)}</div>
2037
+ <div class="col side">${e(B0)}</div>
2038
2038
  </div>
2039
2039
  </div>
2040
- </div>`}};Tn.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Tn.styles=[E,w`
2040
+ </div>`}};Cn.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Cn.styles=[E,w`
2041
2041
  :host { display: block; }
2042
2042
  .page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-8); }
2043
2043
  :host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
@@ -2061,11 +2061,11 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2061
2061
  .body { grid-template-columns: minmax(0, 1fr); }
2062
2062
  .head { height: 60px; }
2063
2063
  }
2064
- `];$("cm-skeleton-display",Tn);var k2=z("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),fm,Cy,Cn=class extends C{constructor(){super(...arguments);m(this,fm);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=a(this,fm,Cy).call(this);return c`<article part="comment">
2064
+ `];$("cm-skeleton-display",Cn);var _2=z("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),bm,zy,zn=class extends C{constructor(){super(...arguments);m(this,bm);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=a(this,bm,zy).call(this);return c`<article part="comment">
2065
2065
  ${e?c`<time class="meta" part="time" datetime=${this.datetime||h}>${e}</time>`:h}
2066
2066
  <div class="body" part="body"><slot></slot></div>
2067
2067
  ${this.author?c`<div class="meta" part="author">– ${this.author}</div>`:h}
2068
- </article>`}};fm=new WeakSet,Cy=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:ue(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},Cn.properties={author:{},datetime:{},time:{}},Cn.styles=[E,w`
2068
+ </article>`}};bm=new WeakSet,zy=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:ue(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},zn.properties={author:{},datetime:{},time:{}},zn.styles=[E,w`
2069
2069
  :host { display: block; }
2070
2070
  article {
2071
2071
  display: flex; flex-direction: column; gap: var(--cm-space-4); padding: var(--cm-space-12);
@@ -2073,16 +2073,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2073
2073
  }
2074
2074
  .meta { font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); }
2075
2075
  .body { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); overflow-wrap: anywhere; }
2076
- `];$("cm-comment",Cn);var Bc,bm,zy,zn=class extends C{constructor(){super(...arguments);m(this,bm);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;m(this,Bc,N("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="comment-box" aria-labelledby="${r(this,Bc)}-h">
2077
- <div class="title" id="${r(this,Bc)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
2076
+ `];$("cm-comment",zn);var Fc,vm,Sy,Sn=class extends C{constructor(){super(...arguments);m(this,vm);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;m(this,Fc,N("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<section part="comment-box" aria-labelledby="${r(this,Fc)}-h">
2077
+ <div class="title" id="${r(this,Fc)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
2078
2078
  <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||h} .value=${this.value}
2079
2079
  ?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
2080
- @keydown=${a(this,bm,zy)}></textarea>
2080
+ @keydown=${a(this,vm,Sy)}></textarea>
2081
2081
  <div class="actions"><cm-button variant="primary" ?disabled=${this.disabled} @click=${()=>this.submit()}>${this.action}</cm-button></div>
2082
2082
  <div class="list" role="list" ?hidden=${!this.hasComments}>
2083
2083
  <slot @slotchange=${t=>{this.hasComments=t.target.assignedElements().length>0,this.requestUpdate()}}></slot>
2084
2084
  </div>
2085
- </section>`}};Bc=new WeakMap,bm=new WeakSet,zy=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},zn.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},zn.styles=[E,w`
2085
+ </section>`}};Fc=new WeakMap,vm=new WeakSet,Sy=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},Sn.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Sn.styles=[E,w`
2086
2086
  :host { display: block; }
2087
2087
  section { display: flex; flex-direction: column; gap: var(--cm-space-12); }
2088
2088
  .title { margin: 0; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
@@ -2102,8 +2102,8 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2102
2102
 
2103
2103
  .actions { justify-content: flex-end; }
2104
2104
  }
2105
- `];$("cm-comment-box",zn);var vm='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',Ae,Ln,pr,mr,_i,An,Dn,pt,sf,ym,xm,wm,$m,Rn,Sy,Es,af,nf,Ti,Sn=class extends A{constructor(){super(...arguments);m(this,pt);this.content="";this.placement="top";this.delay=400;this.open=!1;this.visualOnly=!1;this._side="top";m(this,Ae);m(this,Ln);m(this,pr,[]);m(this,mr);m(this,_i);m(this,An,!1);m(this,Dn,!1);m(this,ym,()=>{g(this,An,!0),clearTimeout(r(this,_i)),this.open||g(this,_i,setTimeout(()=>this.show(),this.delay))});m(this,xm,()=>{g(this,An,!1),clearTimeout(r(this,_i)),r(this,Dn)||this.hide()});m(this,wm,()=>{g(this,Dn,!0),this.show()});m(this,$m,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,Dn,!1),r(this,An)||this.hide())});m(this,Rn,e=>{e.key==="Escape"&&this.open&&this.hide()});m(this,Es,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(a(this,pt,nf).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(vm)&&i.then(()=>{t.shadowRoot?.querySelector(vm)&&r(this,Es).call(this)}),r(this,Ae)||(g(this,Ae,document.createElement("span")),r(this,Ae).id=N("cm-tooltip"),r(this,Ae).hidden=!0,r(this,Ae).slot="description"),r(this,Ae).textContent=this.content,r(this,Ae).isConnected||this.append(r(this,Ae));let s=a(this,pt,Sy).call(this,t);if(g(this,Ln,s),s.getRootNode()===r(this,Ae).getRootNode()){let l=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);l.includes(r(this,Ae).id)||s.setAttribute("aria-describedby",[...l,r(this,Ae).id].join(" "))}else"ariaDescribedByElements"in s?(a(this,pt,af).call(this,s),g(this,mr,new MutationObserver(()=>{s.getAttribute("aria-describedby")!==""&&a(this,pt,af).call(this,s)})),r(this,mr).observe(s,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,Ae).id)});m(this,Ti,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let s=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),l=e.getBoundingClientRect(),d=8,p=8,u=innerWidth,b=innerHeight,f=getComputedStyle(this).direction==="rtl",x=O=>O==="start"?f?"right":"left":O==="end"?f?"left":"right":O,v={top:s.top-d-l.height>=p,bottom:s.bottom+d+l.height<=b-p,left:s.left-d-l.width>=p,right:s.right+d+l.width<=u-p},k={top:"bottom",bottom:"top",left:"right",right:"left"},L=x(this.placement);!v[L]&&v[k[L]]&&(L=k[L]);let P,U;L==="top"||L==="bottom"?(P=s.left+s.width/2-l.width/2,U=L==="top"?s.top-d-l.height:s.bottom+d):(U=s.top+s.height/2-l.height/2,P=L==="left"?s.left-d-l.width:s.right+d),P=Math.min(Math.max(p,P),u-p-l.width),U=Math.min(Math.max(p,U),b-p-l.height),e.style.transform=`translate(${Math.round(P)}px, ${Math.round(U)}px)`;let q={top:"top",bottom:"bottom",left:f?"end":"start",right:f?"start":"end"};this._side=q[L]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,ym)),this.addEventListener("pointerleave",r(this,xm)),this.addEventListener("focusin",r(this,wm)),this.addEventListener("focusout",r(this,$m)),this.addEventListener("keydown",r(this,Rn)),this.hasUpdated&&r(this,Es).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,pt,nf).call(this),a(this,pt,sf).call(this),clearTimeout(r(this,_i))}show(){clearTimeout(r(this,_i)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,Rn),!0),addEventListener("scroll",r(this,Ti),!0),addEventListener("resize",r(this,Ti)),this.updateComplete.then(r(this,Ti)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,_i)),this.open&&(this.open=!1,a(this,pt,sf).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,Es).call(this),this.content?this.open&&r(this,Ti).call(this):this.hide())}render(){return c`<slot @slotchange=${r(this,Es)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
2106
- data-side=${this._side}>${this.content}</div>`}};Ae=new WeakMap,Ln=new WeakMap,pr=new WeakMap,mr=new WeakMap,_i=new WeakMap,An=new WeakMap,Dn=new WeakMap,pt=new WeakSet,sf=function(){document.removeEventListener("keydown",r(this,Rn),!0),removeEventListener("scroll",r(this,Ti),!0),removeEventListener("resize",r(this,Ti))},ym=new WeakMap,xm=new WeakMap,wm=new WeakMap,$m=new WeakMap,Rn=new WeakMap,Sy=function(e){return e.matches(vm)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(vm)??e},Es=new WeakMap,af=function(e){g(this,pr,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=r(this,pr).map(s=>t.getElementById(s)).filter(s=>!!s);e.ariaDescribedByElements=[...i,r(this,Ae)]},nf=function(){let e=r(this,Ln);if(!(!e||!r(this,Ae))){if(r(this,mr))r(this,mr).disconnect(),g(this,mr,void 0),r(this,pr).length?e.setAttribute("aria-describedby",r(this,pr).join(" ")):e.removeAttribute("aria-describedby"),g(this,pr,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==r(this,Ae).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}g(this,Ln,void 0)}},Ti=new WeakMap,Sn.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Sn.styles=[E,w`
2105
+ `];$("cm-comment-box",Sn);var ym='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',Ae,An,mr,ur,Ti,Dn,Rn,pt,af,xm,wm,$m,km,Hn,Ly,Ms,nf,of,Ci,Ln=class extends A{constructor(){super(...arguments);m(this,pt);this.content="";this.placement="top";this.delay=400;this.open=!1;this.visualOnly=!1;this._side="top";m(this,Ae);m(this,An);m(this,mr,[]);m(this,ur);m(this,Ti);m(this,Dn,!1);m(this,Rn,!1);m(this,xm,()=>{g(this,Dn,!0),clearTimeout(r(this,Ti)),this.open||g(this,Ti,setTimeout(()=>this.show(),this.delay))});m(this,wm,()=>{g(this,Dn,!1),clearTimeout(r(this,Ti)),r(this,Rn)||this.hide()});m(this,$m,()=>{g(this,Rn,!0),this.show()});m(this,km,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,Rn,!1),r(this,Dn)||this.hide())});m(this,Hn,e=>{e.key==="Escape"&&this.open&&this.hide()});m(this,Ms,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(a(this,pt,of).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(ym)&&i.then(()=>{t.shadowRoot?.querySelector(ym)&&r(this,Ms).call(this)}),r(this,Ae)||(g(this,Ae,document.createElement("span")),r(this,Ae).id=N("cm-tooltip"),r(this,Ae).hidden=!0,r(this,Ae).slot="description"),r(this,Ae).textContent=this.content,r(this,Ae).isConnected||this.append(r(this,Ae));let s=a(this,pt,Ly).call(this,t);if(g(this,An,s),s.getRootNode()===r(this,Ae).getRootNode()){let l=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);l.includes(r(this,Ae).id)||s.setAttribute("aria-describedby",[...l,r(this,Ae).id].join(" "))}else"ariaDescribedByElements"in s?(a(this,pt,nf).call(this,s),g(this,ur,new MutationObserver(()=>{s.getAttribute("aria-describedby")!==""&&a(this,pt,nf).call(this,s)})),r(this,ur).observe(s,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,Ae).id)});m(this,Ci,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let s=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),l=e.getBoundingClientRect(),d=8,p=8,u=innerWidth,b=innerHeight,f=getComputedStyle(this).direction==="rtl",x=O=>O==="start"?f?"right":"left":O==="end"?f?"left":"right":O,v={top:s.top-d-l.height>=p,bottom:s.bottom+d+l.height<=b-p,left:s.left-d-l.width>=p,right:s.right+d+l.width<=u-p},k={top:"bottom",bottom:"top",left:"right",right:"left"},L=x(this.placement);!v[L]&&v[k[L]]&&(L=k[L]);let P,U;L==="top"||L==="bottom"?(P=s.left+s.width/2-l.width/2,U=L==="top"?s.top-d-l.height:s.bottom+d):(U=s.top+s.height/2-l.height/2,P=L==="left"?s.left-d-l.width:s.right+d),P=Math.min(Math.max(p,P),u-p-l.width),U=Math.min(Math.max(p,U),b-p-l.height),e.style.transform=`translate(${Math.round(P)}px, ${Math.round(U)}px)`;let q={top:"top",bottom:"bottom",left:f?"end":"start",right:f?"start":"end"};this._side=q[L]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,xm)),this.addEventListener("pointerleave",r(this,wm)),this.addEventListener("focusin",r(this,$m)),this.addEventListener("focusout",r(this,km)),this.addEventListener("keydown",r(this,Hn)),this.hasUpdated&&r(this,Ms).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,pt,of).call(this),a(this,pt,af).call(this),clearTimeout(r(this,Ti))}show(){clearTimeout(r(this,Ti)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,Hn),!0),addEventListener("scroll",r(this,Ci),!0),addEventListener("resize",r(this,Ci)),this.updateComplete.then(r(this,Ci)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,Ti)),this.open&&(this.open=!1,a(this,pt,af).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,Ms).call(this),this.content?this.open&&r(this,Ci).call(this):this.hide())}render(){return c`<slot @slotchange=${r(this,Ms)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
2106
+ data-side=${this._side}>${this.content}</div>`}};Ae=new WeakMap,An=new WeakMap,mr=new WeakMap,ur=new WeakMap,Ti=new WeakMap,Dn=new WeakMap,Rn=new WeakMap,pt=new WeakSet,af=function(){document.removeEventListener("keydown",r(this,Hn),!0),removeEventListener("scroll",r(this,Ci),!0),removeEventListener("resize",r(this,Ci))},xm=new WeakMap,wm=new WeakMap,$m=new WeakMap,km=new WeakMap,Hn=new WeakMap,Ly=function(e){return e.matches(ym)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(ym)??e},Ms=new WeakMap,nf=function(e){g(this,mr,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=r(this,mr).map(s=>t.getElementById(s)).filter(s=>!!s);e.ariaDescribedByElements=[...i,r(this,Ae)]},of=function(){let e=r(this,An);if(!(!e||!r(this,Ae))){if(r(this,ur))r(this,ur).disconnect(),g(this,ur,void 0),r(this,mr).length?e.setAttribute("aria-describedby",r(this,mr).join(" ")):e.removeAttribute("aria-describedby"),g(this,mr,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==r(this,Ae).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}g(this,An,void 0)}},Ci=new WeakMap,Ln.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Ln.styles=[E,w`
2107
2107
  :host { display: inline-block; position: relative; }
2108
2108
  .tip {
2109
2109
  position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
@@ -2120,7 +2120,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2120
2120
  :host([open]) .tip { opacity: 1; visibility: visible; transition: opacity var(--cm-duration-fast) var(--cm-easing-standard); }
2121
2121
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
2122
2122
  @media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
2123
- `];$("cm-tooltip",Sn);var D2=z("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),R2=z("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),B0=7,Fc=new Set,Vc;function Ly(o,n){n?Fc.add(o):Fc.delete(o),Fc.size&&!Vc&&(Vc=setInterval(()=>Fc.forEach(e=>e.requestUpdate()),6e4)),!Fc.size&&Vc&&(clearInterval(Vc),Vc=void 0)}var jc,_s,Nt,of,km,Ay,Hn=class extends C{constructor(){super(...arguments);m(this,Nt);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;m(this,jc,N("cm-tl"));m(this,_s)}connectedCallback(){super.connectedCallback(),Ly(this,!0)}disconnectedCallback(){super.disconnectedCallback(),Ly(this,!1),r(this,_s)?.disconnect(),g(this,_s,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,_s,new ResizeObserver(()=>a(this,Nt,of).call(this))),r(this,_s).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,Nt,of).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,s=Math.floor(Math.abs(t)/6e4);if(s<1)return this.t("justNow");if(s<60)return this.t(i?"inMinutes":"minutesAgo",{count:s});let l=Math.floor(s/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<B0?this.t(i?"inDays":"daysAgo",{count:d}):ue(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?ue(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",s=this.lines>0&&!this.expanded,l=e?t?c`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
2123
+ `];$("cm-tooltip",Ln);var N2=z("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),P2=z("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),F0=7,Vc=new Set,jc;function Ay(o,n){n?Vc.add(o):Vc.delete(o),Vc.size&&!jc&&(jc=setInterval(()=>Vc.forEach(e=>e.requestUpdate()),6e4)),!Vc.size&&jc&&(clearInterval(jc),jc=void 0)}var Uc,Ts,Pt,lf,Em,Dy,Nn=class extends C{constructor(){super(...arguments);m(this,Pt);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;m(this,Uc,N("cm-tl"));m(this,Ts)}connectedCallback(){super.connectedCallback(),Ay(this,!0)}disconnectedCallback(){super.disconnectedCallback(),Ay(this,!1),r(this,Ts)?.disconnect(),g(this,Ts,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,Ts,new ResizeObserver(()=>a(this,Pt,lf).call(this))),r(this,Ts).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,Pt,lf).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,s=Math.floor(Math.abs(t)/6e4);if(s<1)return this.t("justNow");if(s<60)return this.t(i?"inMinutes":"minutesAgo",{count:s});let l=Math.floor(s/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<F0?this.t(i?"inDays":"daysAgo",{count:d}):ue(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?ue(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",s=this.lines>0&&!this.expanded,l=e?t?c`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
2124
2124
  <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:c`<span class="dot"></span>`}</span>
2125
2125
  <div class="main">
2126
2126
  <div class="head">
@@ -2128,14 +2128,14 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2128
2128
  <slot name="badge"></slot></span>
2129
2129
  ${l}
2130
2130
  </div>
2131
- <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${d=>a(this,Nt,km).call(this,d,"_meta")}>${this.meta}</slot></div>
2132
- <div class="body ${s?"clamp":""}" id="${r(this,jc)}-body" part="body" ?hidden=${!this._body}
2133
- style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${d=>a(this,Nt,km).call(this,d,"_body")}></slot></div>
2131
+ <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${d=>a(this,Pt,Em).call(this,d,"_meta")}>${this.meta}</slot></div>
2132
+ <div class="body ${s?"clamp":""}" id="${r(this,Uc)}-body" part="body" ?hidden=${!this._body}
2133
+ style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${d=>a(this,Pt,Em).call(this,d,"_body")}></slot></div>
2134
2134
  ${this._body&&this._overflow?c`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
2135
- aria-controls="${r(this,jc)}-body" @click=${a(this,Nt,Ay)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:h}
2136
- <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${d=>a(this,Nt,km).call(this,d,"_actions")}></slot></div>
2135
+ aria-controls="${r(this,Uc)}-body" @click=${a(this,Pt,Dy)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:h}
2136
+ <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${d=>a(this,Pt,Em).call(this,d,"_actions")}></slot></div>
2137
2137
  </div>
2138
- </div>`}};jc=new WeakMap,_s=new WeakMap,Nt=new WeakSet,of=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},km=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(s=>s.nodeType===Node.ELEMENT_NODE||(s.textContent??"").trim())},Ay=function(){this.expanded=!this.expanded},Hn.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},Hn.styles=[E,w`
2138
+ </div>`}};Uc=new WeakMap,Ts=new WeakMap,Pt=new WeakSet,lf=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},Em=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(s=>s.nodeType===Node.ELEMENT_NODE||(s.textContent??"").trim())},Dy=function(){this.expanded=!this.expanded},Nn.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},Nn.styles=[E,w`
2139
2139
  :host { display: block; min-width: 0; font-size: 14px; line-height: 20px; }
2140
2140
  .item { display: flex; gap: var(--cm-space-12); align-items: flex-start; }
2141
2141
  .icon {
@@ -2180,16 +2180,16 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2180
2180
  [hidden] { display: none !important; }
2181
2181
  .sr { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
2182
2182
  ::slotted([slot='badge']) { flex: none; }
2183
- `];$("cm-timeline-item",Hn);var Uc,Nn,Ts,lf,Dy,Ms=class extends C{constructor(){super(...arguments);m(this,Ts);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];m(this,Uc,new MutationObserver(()=>a(this,Ts,lf).call(this)));m(this,Nn,!1)}connectedCallback(){super.connectedCallback(),a(this,Ts,lf).call(this),r(this,Uc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Uc).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,Nn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,s)=>{this._items[s]&&i.assign(this._items[s])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),r(this,Nn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Nn,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?c`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>c`<div class="sk">
2183
+ `];$("cm-timeline-item",Nn);var Kc,Pn,Cs,cf,Ry,_s=class extends C{constructor(){super(...arguments);m(this,Cs);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];m(this,Kc,new MutationObserver(()=>a(this,Cs,cf).call(this)));m(this,Pn,!1)}connectedCallback(){super.connectedCallback(),a(this,Cs,cf).call(this),r(this,Kc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Kc).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,Pn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,s)=>{this._items[s]&&i.assign(this._items[s])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),r(this,Pn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Pn,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?c`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>c`<div class="sk">
2184
2184
  <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:h;return c`
2185
2185
  ${e.length?c`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
2186
2186
  ${e.map(()=>c`<li><slot></slot></li>`)}
2187
2187
  </ol>`:h}
2188
2188
  ${i}
2189
2189
  ${!e.length&&!t?c`<slot class="empty"></slot>`:h}
2190
- ${this.hasMore&&e.length?c`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${a(this,Ts,Dy)}>${this.moreLabel}</cm-button></div>`:h}
2190
+ ${this.hasMore&&e.length?c`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${a(this,Cs,Ry)}>${this.moreLabel}</cm-button></div>`:h}
2191
2191
  <span class="sr" role="status">${t?this.t("loading"):""}</span>
2192
- `}};Uc=new WeakMap,Nn=new WeakMap,Ts=new WeakSet,lf=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},Dy=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},Ms.shadowRootOptions={...A.shadowRootOptions,slotAssignment:"manual"},Ms.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},Ms.styles=[E,w`
2192
+ `}};Kc=new WeakMap,Pn=new WeakMap,Cs=new WeakSet,cf=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},Ry=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},_s.shadowRootOptions={...A.shadowRootOptions,slotAssignment:"manual"},_s.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},_s.styles=[E,w`
2193
2193
  :host { display: block; }
2194
2194
  ol { margin: 0; padding: 0; list-style: none; }
2195
2195
  ol:focus { outline: none; }
@@ -2212,14 +2212,14 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2212
2212
  @media (max-width: 640px) {
2213
2213
  .more { padding-inline-start: 0; }
2214
2214
  }
2215
- `];$("cm-timeline",Ms);var O2=z("smartTip",{newTab:"(opens in a new tab)"}),B2=z("smartTips",{heading:"Smart tips",tourAction:"Start"}),Pn=class extends C{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
2215
+ `];$("cm-timeline",_s);var V2=z("smartTip",{newTab:"(opens in a new tab)"}),j2=z("smartTips",{heading:"Smart tips",tourAction:"Start"}),In=class extends C{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
2216
2216
  <span class="text">
2217
2217
  <span class="title" part="heading">${this.heading}</span>
2218
2218
  <span class="desc" part="description"><slot></slot></span>
2219
2219
  ${e?c`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:h}
2220
2220
  </span>
2221
2221
  <span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
2222
- </a>`}};Pn.properties={heading:{},href:{},target:{}},Pn.styles=[E,w`
2222
+ </a>`}};In.properties={heading:{},href:{},target:{}},In.styles=[E,w`
2223
2223
  :host { display: block; }
2224
2224
  a {
2225
2225
  display: flex; align-items: flex-start; gap: var(--cm-space-8); padding: var(--cm-space-16);
@@ -2236,7 +2236,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2236
2236
  }
2237
2237
  a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
2238
2238
  a:hover .title { text-decoration: underline; }
2239
- `];$("cm-smart-tip",Pn);var In=class extends C{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<div class="card" part="smart-tips">
2239
+ `];$("cm-smart-tip",In);var qn=class extends C{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<div class="card" part="smart-tips">
2240
2240
  ${this.tourHeading?c`<div class="tour" part="tour">
2241
2241
  <span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="16"></cm-icon>
2242
2242
  </span>
@@ -2247,7 +2247,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2247
2247
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
2248
2248
  <div class="list" role="list"><slot></slot></div>
2249
2249
  </section>
2250
- </div>`}};In.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},In.styles=[E,w`
2250
+ </div>`}};qn.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},qn.styles=[E,w`
2251
2251
  :host { display: block; }
2252
2252
  .card { display: flex; flex-direction: column; gap: var(--cm-space-8); }
2253
2253
  .tour {
@@ -2264,24 +2264,24 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2264
2264
  margin: var(--cm-space-8) 0 var(--cm-space-16); text-align: center; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600;
2265
2265
  }
2266
2266
  .list { display: flex; flex-direction: column; gap: var(--cm-space-8); }
2267
- `];$("cm-smart-tips",In);var K2=z("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),Ci,On,Ry,Hy,qn=class extends C{constructor(){super(...arguments);m(this,On);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;m(this,Ci,N("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),i=this.total?(t-1)*this.pageSize+1:0,s=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
2267
+ `];$("cm-smart-tips",qn);var Y2=z("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),zi,Bn,Hy,Ny,On=class extends C{constructor(){super(...arguments);m(this,Bn);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;m(this,zi,N("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),i=this.total?(t-1)*this.pageSize+1:0,s=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
2268
2268
  <nav part="bar" aria-label=${this.label}>
2269
2269
  ${l.length?c`<div class="rows" part="rows">
2270
- <label for="${r(this,Ci)}-s">${this.t("rows")}</label>
2271
- <span class="field"><select id="${r(this,Ci)}-s" @change=${a(this,On,Ry)}>
2270
+ <label for="${r(this,zi)}-s">${this.t("rows")}</label>
2271
+ <span class="field"><select id="${r(this,zi)}-s" @change=${a(this,Bn,Hy)}>
2272
2272
  ${(l.includes(this.pageSize)?l:[...l,this.pageSize].sort((d,p)=>d-p)).map(d=>c`<option value=${d} ?selected=${d===this.pageSize}>${d}</option>`)}
2273
2273
  </select><cm-icon name="chevron-down" size="12"></cm-icon></span>
2274
2274
  </div>`:h}
2275
2275
  <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:s,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():h}</div>
2276
2276
  <div class="pages" part="pages">
2277
2277
  <span class="counter">
2278
- <label for="${r(this,Ci)}-p">${this.t("page")}</label>
2279
- <input id="${r(this,Ci)}-p" type="number" inputmode="numeric" min="1" max=${e}
2280
- .value=${this._draft??String(t)} aria-describedby="${r(this,Ci)}-of"
2278
+ <label for="${r(this,zi)}-p">${this.t("page")}</label>
2279
+ <input id="${r(this,zi)}-p" type="number" inputmode="numeric" min="1" max=${e}
2280
+ .value=${this._draft??String(t)} aria-describedby="${r(this,zi)}-of"
2281
2281
  @input=${d=>this._draft=d.target.value}
2282
- @keydown=${a(this,On,Hy)}
2282
+ @keydown=${a(this,Bn,Ny)}
2283
2283
  @change=${d=>this.goTo(Number(d.target.value))} />
2284
- <span id="${r(this,Ci)}-of">${this.t("of",{count:e})}</span>
2284
+ <span id="${r(this,zi)}-of">${this.t("of",{count:e})}</span>
2285
2285
  </span>
2286
2286
  <span class="arrows">
2287
2287
  <button class="prev" type="button" part="previous" aria-label=${this.t("previous")} ?disabled=${t<=1}
@@ -2291,7 +2291,7 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2291
2291
  </span>
2292
2292
  </div>
2293
2293
  </nav>
2294
- `}};Ci=new WeakMap,On=new WeakSet,Ry=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},Hy=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},qn.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},qn.styles=[E,w`
2294
+ `}};zi=new WeakMap,Bn=new WeakSet,Hy=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},Ny=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},On.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},On.styles=[E,w`
2295
2295
  :host { display: block; }
2296
2296
  nav {
2297
2297
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 48px; padding: 0 var(--cm-space-16);
@@ -2334,17 +2334,17 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2334
2334
  select, input { height: var(--cm-control-height-touch); }
2335
2335
  button { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
2336
2336
  }
2337
- `];$("cm-pagination",qn);var Q2=z("statusTabs",{label:"Status",option:"{label} ({count})"}),Fn,Wc,_e,Kc,Ny,cf,Py,df,Iy,Bn=class extends C{constructor(){super(...arguments);m(this,_e);this.value="";this.tabs=[];this.controls="";this.size="large";this.mobile="scroll";this._more="";m(this,Fn,new ResizeObserver(()=>a(this,_e,Kc).call(this)));this._slotted=[];m(this,Wc,new MutationObserver(()=>a(this,_e,cf).call(this)))}connectedCallback(){super.connectedCallback(),a(this,_e,cf).call(this),r(this,Wc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Wc).disconnect(),r(this,Fn).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,Fn).observe(e),e.addEventListener("scroll",()=>a(this,_e,Kc).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,_e,Kc).call(this))}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){let t=this.renderRoot.querySelector(".pick select");t&&t.offsetParent!==null?t.focus(e):this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(e){a(this,_e,Kc).call(this);for(let s of this.renderRoot.querySelectorAll(".tabs > *"))r(this,Fn).observe(s);if(!("ariaControlsElements"in Element.prototype))return;let t=this.getRootNode(),i=this.controls?t.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button, select"))s.ariaControlsElements=i?[i]:null}render(){let e=this.items,t=a(this,_e,Py).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
2337
+ `];$("cm-pagination",On);var t_=z("statusTabs",{label:"Status",option:"{label} ({count})"}),Vn,Gc,_e,Wc,Py,df,Iy,hf,qy,Fn=class extends C{constructor(){super(...arguments);m(this,_e);this.value="";this.tabs=[];this.controls="";this.size="large";this.mobile="scroll";this._more="";m(this,Vn,new ResizeObserver(()=>a(this,_e,Wc).call(this)));this._slotted=[];m(this,Gc,new MutationObserver(()=>a(this,_e,df).call(this)))}connectedCallback(){super.connectedCallback(),a(this,_e,df).call(this),r(this,Gc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Gc).disconnect(),r(this,Vn).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,Vn).observe(e),e.addEventListener("scroll",()=>a(this,_e,Wc).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,_e,Wc).call(this))}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){let t=this.renderRoot.querySelector(".pick select");t&&t.offsetParent!==null?t.focus(e):this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(e){a(this,_e,Wc).call(this);for(let s of this.renderRoot.querySelectorAll(".tabs > *"))r(this,Vn).observe(s);if(!("ariaControlsElements"in Element.prototype))return;let t=this.getRootNode(),i=this.controls?t.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button, select"))s.ariaControlsElements=i?[i]:null}render(){let e=this.items,t=a(this,_e,Iy).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
2338
2338
  <div class=${`tabs${this._more?` more-${this._more}`:""}`} part="tabs" role="tablist" aria-label=${i}>
2339
2339
  ${e.map((s,l)=>c`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
2340
2340
  tabindex=${l===t?"0":"-1"} ?disabled=${!!s.disabled}
2341
- @click=${()=>a(this,_e,df).call(this,l)} @keydown=${d=>a(this,_e,Iy).call(this,d,l)}><span class="label" data-text=${s.label}>${s.label}</span>${s.count!==void 0&&!Number.isNaN(s.count)?c`<span class="sr">, </span><span class="count" part="count">${this.formatNumber(s.count)}</span>`:h}</button>`)}
2341
+ @click=${()=>a(this,_e,hf).call(this,l)} @keydown=${d=>a(this,_e,qy).call(this,d,l)}><span class="label" data-text=${s.label}>${s.label}</span>${s.count!==void 0&&!Number.isNaN(s.count)?c`<span class="sr">, </span><span class="count" part="count">${this.formatNumber(s.count)}</span>`:h}</button>`)}
2342
2342
  </div>
2343
- ${this.mobile==="select"?c`<div class="pick"><select part="select" aria-label=${i} @change=${a(this,_e,Ny)}>
2343
+ ${this.mobile==="select"?c`<div class="pick"><select part="select" aria-label=${i} @change=${a(this,_e,Py)}>
2344
2344
  ${e.map((s,l)=>c`<option value=${s.value} ?disabled=${!!s.disabled} ?selected=${l===t} .selected=${l===t}>${s.count!==void 0&&!Number.isNaN(s.count)?this.t("option",{label:s.label,count:s.count}):s.label}</option>`)}
2345
2345
  </select><cm-icon name="chevron-down" size="16"></cm-icon></div>`:h}
2346
2346
  <slot></slot>
2347
- `}};Fn=new WeakMap,Wc=new WeakMap,_e=new WeakSet,Kc=function(){let e=this.renderRoot.querySelector(".tabs");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},Ny=function(e){let t=e.target.value;t!==this.value&&(this.value=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},cf=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},Py=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},df=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Iy=function(e,t){let i=se(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight")d=s[(l+1)%s.length];else if(i==="ArrowLeft")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,_e,df).call(this,d)},Bn.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},mobile:{reflect:!0},_slotted:{state:!0},_more:{state:!0}},Bn.styles=[E,w`
2347
+ `}};Vn=new WeakMap,Gc=new WeakMap,_e=new WeakSet,Wc=function(){let e=this.renderRoot.querySelector(".tabs");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},Py=function(e){let t=e.target.value;t!==this.value&&(this.value=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},df=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},Iy=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},hf=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},qy=function(e,t){let i=se(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight")d=s[(l+1)%s.length];else if(i==="ArrowLeft")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,_e,hf).call(this,d)},Fn.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},mobile:{reflect:!0},_slotted:{state:!0},_more:{state:!0}},Fn.styles=[E,w`
2348
2348
  :host { display: block; }
2349
2349
  /* A 40px row: 14px labels (medium; semibold when chosen) over a 2px underline on a hairline. */
2350
2350
  .tabs {
@@ -2403,20 +2403,20 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2403
2403
  :host([mobile='select']) .tabs { display: none; }
2404
2404
  :host([mobile='select']) .pick { display: block; }
2405
2405
  }
2406
- `];$("cm-status-tabs",Bn);var s_=z("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),Em,Gc,zi,hf,qy,Oy,Vn=class extends C{constructor(){super(...arguments);m(this,zi);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;m(this,Em,N("cm-th"));m(this,Gc,new MutationObserver(()=>a(this,zi,hf).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,zi,hf).call(this),r(this,Gc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Gc).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return c`
2406
+ `];$("cm-status-tabs",Fn);var o_=z("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),Mm,Yc,Si,pf,Oy,By,jn=class extends C{constructor(){super(...arguments);m(this,Si);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;m(this,Mm,N("cm-th"));m(this,Yc,new MutationObserver(()=>a(this,Si,pf).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,Si,pf).call(this),r(this,Yc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Yc).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return c`
2407
2407
  <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":h}
2408
2408
  style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
2409
2409
  ${this.selectable?c`<span class="cell" role=${e?"columnheader":h}><span class="check">
2410
- <input id="${r(this,Em)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
2411
- @change=${a(this,zi,Oy)} />
2410
+ <input id="${r(this,Mm)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
2411
+ @change=${a(this,Si,By)} />
2412
2412
  <span class="box" aria-hidden="true">${this.indeterminate?c`<span class="dash"></span>`:this.checked?c`<cm-icon name="check" size="14"></cm-icon>`:h}</span>
2413
2413
  </span></span>`:h}
2414
2414
  ${t.map(i=>{let s=this.sort===i.key,l=s?this.direction==="descending"?"descending":"ascending":"none",d=i.hidden?c`<span class="sr">${i.label}</span>`:i.label;return c`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":h}
2415
- aria-sort=${e&&i.sortable?l:h}>${i.sortable?c`<button type="button" class=${s?"on":""} @click=${()=>a(this,zi,qy).call(this,i)}>${d}${e?h:c`<span class="sr">${s?this.t("sorted",{direction:this.t(l)}):this.t("sortable")}</span>`}<cm-icon
2415
+ aria-sort=${e&&i.sortable?l:h}>${i.sortable?c`<button type="button" class=${s?"on":""} @click=${()=>a(this,Si,Oy).call(this,i)}>${d}${e?h:c`<span class="sr">${s?this.t("sorted",{direction:this.t(l)}):this.t("sortable")}</span>`}<cm-icon
2416
2416
  name=${s&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:d}</span>`})}
2417
2417
  </div>
2418
2418
  <slot></slot>
2419
- `}};Em=new WeakMap,Gc=new WeakMap,zi=new WeakSet,hf=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},qy=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},Oy=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},Vn.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},Vn.styles=[E,w`
2419
+ `}};Mm=new WeakMap,Yc=new WeakMap,Si=new WeakSet,pf=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},Oy=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},By=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},jn.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},jn.styles=[E,w`
2420
2420
  :host { display: block; }
2421
2421
  slot { display: none; } /* <option> children are column data, not content */
2422
2422
  .bar {
@@ -2471,10 +2471,10 @@ var wb=o=>{throw TypeError(o)};var hu=(o,n,e)=>n.has(o)||wb("Cannot "+e);var r=(
2471
2471
  :host([resource-rows][mobile='stack']) .bar:not(.sel) { display: flex; flex-wrap: wrap; gap: var(--cm-space-4) var(--cm-space-12); padding-block: var(--cm-space-8); }
2472
2472
  :host([resource-rows][mobile='stack']) .bar:not(.sel) > .cell:first-child { flex: 1 1 100%; }
2473
2473
  }
2474
- `];$("cm-table-header",Vn);var F0=`
2474
+ `];$("cm-table-header",jn);var V0=`
2475
2475
  [data-cm-density="compact"] { --cm-table-row-height: 40px; --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
2476
2476
  [data-cm-density="comfortable"] { --cm-table-row-height: 48px; --cm-resource-row-height: 56px; --cm-resource-row-padding: 8px; --cm-resource-media-size: 40px; }
2477
- `,Mm=null,By=new WeakSet;function _m(o){if(typeof document>"u"||typeof CSSStyleSheet>"u")return;let n=[document],e=o.getRootNode();e instanceof ShadowRoot&&n.push(e);for(let t of n)if(!By.has(t)){By.add(t);try{Mm||(Mm=new CSSStyleSheet,Mm.replaceSync(F0)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,Mm]}catch{}}}var m_=z("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}",scrollHint:"Scroll for more",columns:"Columns",showColumns:"Show columns",resize:"Resize {column} column",resized:"{column} column, {width} pixels wide",viewAll:"View all fields",viewLess:"Hide fields",rowAction:"{action}, {name}"}),Fy=48,Vy=16,jy=!1,V0=`
2477
+ `,_m=null,Fy=new WeakSet;function Tm(o){if(typeof document>"u"||typeof CSSStyleSheet>"u")return;let n=[document],e=o.getRootNode();e instanceof ShadowRoot&&n.push(e);for(let t of n)if(!Fy.has(t)){Fy.add(t);try{_m||(_m=new CSSStyleSheet,_m.replaceSync(V0)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,_m]}catch{}}}var f_=z("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}",scrollHint:"Scroll for more",columns:"Columns",showColumns:"Show columns",resize:"Resize {column} column",resized:"{column} column, {width} pixels wide",viewAll:"View all fields",viewLess:"Hide fields",rowAction:"{action}, {name}"}),Vy=48,jy=16,Uy=!1,j0=`
2478
2478
  cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); font-variant-numeric: tabular-nums; color: var(--cm-text-default); }
2479
2479
  cm-data-table > table caption { text-align: start; font-weight: 600; font-size: var(--cm-font-size-16); line-height: var(--cm-line-height-16); padding-block-end: var(--cm-space-8); }
2480
2480
  cm-data-table > table th, cm-data-table > table td { box-sizing: border-box; }
@@ -2529,52 +2529,52 @@ cm-data-table:has(> table) { container-type: inline-size; }
2529
2529
  cm-data-table[mobile='cards'] > table td[data-type='controls'] { display: block; text-align: start; padding-block-start: var(--cm-space-8); }
2530
2530
  cm-data-table[mobile='cards'] > table td[data-type='controls'] > * { min-inline-size: 0; }
2531
2531
  }
2532
- `;function j0(){if(jy||typeof document>"u")return;jy=!0;let o=new CSSStyleSheet;o.replaceSync(V0),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var Yc=o=>o.type==="numeric"||o.type==="money",U0=o=>(o.align??(Yc(o)||o.type==="actions"?"end":"start"))==="end",K0=o=>!o.type||o.type==="text";function Uy(o){if(typeof o=="number")return o;let n=String(o??"").trim(),e=/^\(.*\)$/.test(n)||/^-|^[^\d]*-\s*\d/.test(n),t=n.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var Ky=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),Wy=new Map;function W0(o){let n=Wy.get(o??"");if(!n){try{n=new Intl.Collator(o,{numeric:!0,sensitivity:"base"})}catch{n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Wy.set(o??"",n)}return n}function Gy(o,n,e,t){let i=s=>s==null||s==="";return i(o)||i(n)?i(o)===i(n)?0:i(o)?1:-1:e==="numeric"||e==="money"?(Uy(o)||0)-(Uy(n)||0):e==="date"?(Ky(o)||0)-(Ky(n)||0):W0(t).compare(String(o),String(n))}var Yy=o=>o.parentElement??o.getRootNode().host??null,Yn,Xn,Xc,Jn,Cs,Qn,zs,Lm,S,pf,mf,uf,Xy,gf,Jy,Qy,Zy,Ss,jn,Un,Tm,Kn,Wn,Cm,ff,bf,vf,ex,tx,yf,xf,zm,ix,rx,sx,ur,Sm,Zn,ax,nx,ox,lx,cx,dx,hx,Gn=class extends C{constructor(){super(...arguments);m(this,S);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this.mobile="scroll";this.rowActions="hover";this.resizable=!1;this.columnPicker=!1;this._light=!1;this._announce="";this._widths={};this._expanded=new Set;this._picker=!1;this._overflows=!1;m(this,Yn,!1);m(this,Xn,N("cm-dt"));m(this,Xc,new MutationObserver(()=>a(this,S,pf).call(this)));m(this,Jn,typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a(this,S,jn).call(this)));m(this,Cs,[]);m(this,Qn,0);m(this,zs,-1);m(this,Lm,e=>{e.target?.closest?.("[data-lines]")&&a(this,S,Cm).call(this,e)});m(this,Ss,()=>{r(this,Qn)||!this.stickyHeader||g(this,Qn,requestAnimationFrame(()=>{g(this,Qn,0),a(this,S,jn).call(this)}))});m(this,ur,new we);m(this,Zn,e=>{let t=this.renderRoot.querySelector(".tools");t&&!e.composedPath().includes(t)&&a(this,S,Sm).call(this,!1)})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerover",r(this,Lm)),_m(this),a(this,S,pf).call(this),r(this,Xc).observe(this,{childList:!0,subtree:!0}),document.addEventListener("scroll",r(this,Ss),{capture:!0,passive:!0}),window.addEventListener("resize",r(this,Ss),{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,ur).close(),r(this,Xc).disconnect(),r(this,Jn)?.disconnect(),g(this,Cs,[]),document.removeEventListener("scroll",r(this,Ss),{capture:!0}),window.removeEventListener("resize",r(this,Ss)),document.removeEventListener("pointerdown",r(this,Zn),{capture:!0})}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(s=>s.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((s,l)=>[s,l]).sort(([s,l],[d,p])=>{let u=s[t.key],b=d[t.key],f=u==null||u==="",x=b==null||b==="";return f||x?f===x?l-p:f?1:-1:i*Gy(u,b,t.type,this.locale)||l-p}).map(([s])=>s)}get visibleColumns(){return(this.columns??[]).filter(e=>e.visible!==!1)}updated(e){if(this._picker&&!r(this,ur).active?r(this,ur).open(this.renderRoot.querySelector(".panel"),this.renderRoot.querySelector(".pick"),{align:"end"}):!this._picker&&r(this,ur).active&&r(this,ur).close(),r(this,Yn)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,Yn,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,S,uf).call(this,t.label,this.direction)}if(e.has("columns")){let t=e.get("columns")??[],i={...this._widths},s=!1;for(let l of this.columns??[]){let d=t.find(p=>p.key===l.key);l.width!==void 0&&d?.width!==l.width&&i[l.key]!==void 0&&(delete i[l.key],s=!0)}s&&(this._widths=i)}a(this,S,Zy).call(this),a(this,S,jn).call(this)}render(){let e=c`<span class="sr" role="status">${this._announce}</span>`,t=c`<p class="hint" part="scroll-hint" aria-hidden="true">${this.t("scrollHint")}<cm-icon name="chevron-right" size="16"></cm-icon></p>`,i=c`<span class="fade s" aria-hidden="true"></span><span class="fade e" aria-hidden="true"></span>`,s=this.stickyHeader||this.stickyFirstColumn||this._overflows;if(this._light)return c`<div class="frame" part="frame"><div class="wrap"><div class="scroll" part="scroll" tabindex=${this._overflows?"0":h}
2532
+ `;function U0(){if(Uy||typeof document>"u")return;Uy=!0;let o=new CSSStyleSheet;o.replaceSync(j0),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var Xc=o=>o.type==="numeric"||o.type==="money",K0=o=>(o.align??(Xc(o)||o.type==="actions"?"end":"start"))==="end",W0=o=>!o.type||o.type==="text";function Ky(o){if(typeof o=="number")return o;let n=String(o??"").trim(),e=/^\(.*\)$/.test(n)||/^-|^[^\d]*-\s*\d/.test(n),t=n.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var Wy=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),Gy=new Map;function G0(o){let n=Gy.get(o??"");if(!n){try{n=new Intl.Collator(o,{numeric:!0,sensitivity:"base"})}catch{n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Gy.set(o??"",n)}return n}function Yy(o,n,e,t){let i=s=>s==null||s==="";return i(o)||i(n)?i(o)===i(n)?0:i(o)?1:-1:e==="numeric"||e==="money"?(Ky(o)||0)-(Ky(n)||0):e==="date"?(Wy(o)||0)-(Wy(n)||0):G0(t).compare(String(o),String(n))}var Xy=o=>o.parentElement??o.getRootNode().host??null,Xn,Jn,Jc,Qn,zs,Zn,Ss,Am,S,mf,uf,gf,Jy,ff,Qy,Zy,ex,Ls,Un,Kn,Cm,Wn,Gn,zm,bf,vf,yf,tx,ix,xf,wf,Sm,rx,sx,ax,gr,Lm,eo,nx,ox,lx,cx,dx,hx,px,Yn=class extends C{constructor(){super(...arguments);m(this,S);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this.mobile="scroll";this.rowActions="hover";this.resizable=!1;this.columnPicker=!1;this._light=!1;this._announce="";this._widths={};this._expanded=new Set;this._picker=!1;this._overflows=!1;m(this,Xn,!1);m(this,Jn,N("cm-dt"));m(this,Jc,new MutationObserver(()=>a(this,S,mf).call(this)));m(this,Qn,typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a(this,S,Un).call(this)));m(this,zs,[]);m(this,Zn,0);m(this,Ss,-1);m(this,Am,e=>{e.target?.closest?.("[data-lines]")&&a(this,S,zm).call(this,e)});m(this,Ls,()=>{r(this,Zn)||!this.stickyHeader||g(this,Zn,requestAnimationFrame(()=>{g(this,Zn,0),a(this,S,Un).call(this)}))});m(this,gr,new we);m(this,eo,e=>{let t=this.renderRoot.querySelector(".tools");t&&!e.composedPath().includes(t)&&a(this,S,Lm).call(this,!1)})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerover",r(this,Am)),Tm(this),a(this,S,mf).call(this),r(this,Jc).observe(this,{childList:!0,subtree:!0}),document.addEventListener("scroll",r(this,Ls),{capture:!0,passive:!0}),window.addEventListener("resize",r(this,Ls),{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,gr).close(),r(this,Jc).disconnect(),r(this,Qn)?.disconnect(),g(this,zs,[]),document.removeEventListener("scroll",r(this,Ls),{capture:!0}),window.removeEventListener("resize",r(this,Ls)),document.removeEventListener("pointerdown",r(this,eo),{capture:!0})}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(s=>s.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((s,l)=>[s,l]).sort(([s,l],[d,p])=>{let u=s[t.key],b=d[t.key],f=u==null||u==="",x=b==null||b==="";return f||x?f===x?l-p:f?1:-1:i*Yy(u,b,t.type,this.locale)||l-p}).map(([s])=>s)}get visibleColumns(){return(this.columns??[]).filter(e=>e.visible!==!1)}updated(e){if(this._picker&&!r(this,gr).active?r(this,gr).open(this.renderRoot.querySelector(".panel"),this.renderRoot.querySelector(".pick"),{align:"end"}):!this._picker&&r(this,gr).active&&r(this,gr).close(),r(this,Xn)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,Xn,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,S,gf).call(this,t.label,this.direction)}if(e.has("columns")){let t=e.get("columns")??[],i={...this._widths},s=!1;for(let l of this.columns??[]){let d=t.find(p=>p.key===l.key);l.width!==void 0&&d?.width!==l.width&&i[l.key]!==void 0&&(delete i[l.key],s=!0)}s&&(this._widths=i)}a(this,S,ex).call(this),a(this,S,Un).call(this)}render(){let e=c`<span class="sr" role="status">${this._announce}</span>`,t=c`<p class="hint" part="scroll-hint" aria-hidden="true">${this.t("scrollHint")}<cm-icon name="chevron-right" size="16"></cm-icon></p>`,i=c`<span class="fade s" aria-hidden="true"></span><span class="fade e" aria-hidden="true"></span>`,s=this.stickyHeader||this.stickyFirstColumn||this._overflows;if(this._light)return c`<div class="frame" part="frame"><div class="wrap"><div class="scroll" part="scroll" tabindex=${this._overflows?"0":h}
2533
2533
  role=${this._overflows?"region":h} aria-label=${this._overflows?this.querySelector("caption")?.textContent?.trim()||h:h}
2534
- @scroll=${()=>a(this,S,jn).call(this)}><slot></slot></div>${i}</div>${t}</div>${e}`;let l=this.visibleColumns,d=a(this,S,bf).call(this,l),p=this.mobile==="priority"?l.filter(v=>v.priority==="low"&&v!==d):[],u=this.sortedRows,b=Math.max(1,l.length),f=!this.loading&&u.length===0,x=this.mobile==="cards"&&!this.loading&&u.length>0;return c`
2534
+ @scroll=${()=>a(this,S,Un).call(this)}><slot></slot></div>${i}</div>${t}</div>${e}`;let l=this.visibleColumns,d=a(this,S,vf).call(this,l),p=this.mobile==="priority"?l.filter(v=>v.priority==="low"&&v!==d):[],u=this.sortedRows,b=Math.max(1,l.length),f=!this.loading&&u.length===0,x=this.mobile==="cards"&&!this.loading&&u.length>0;return c`
2535
2535
  <div class="frame" part="frame" ?data-cards=${x}>
2536
- ${this.columnPicker?a(this,S,ox).call(this):h}
2536
+ ${this.columnPicker?a(this,S,lx).call(this):h}
2537
2537
  <div class="wrap">
2538
2538
  <div class="scroll" part="scroll" tabindex=${s?"0":h}
2539
2539
  role=${s?"region":h}
2540
- aria-label=${s&&this.caption?this.caption:h} @scroll=${()=>a(this,S,jn).call(this)}>
2541
- <table part="table" aria-busy=${this.loading?"true":"false"} @pointerover=${a(this,S,Cm)} @focusin=${a(this,S,ff)}
2542
- @focusout=${a(this,S,ff)}>
2540
+ aria-label=${s&&this.caption?this.caption:h} @scroll=${()=>a(this,S,Un).call(this)}>
2541
+ <table part="table" aria-busy=${this.loading?"true":"false"} @pointerover=${a(this,S,zm)} @focusin=${a(this,S,bf)}
2542
+ @focusout=${a(this,S,bf)}>
2543
2543
  ${this.caption?c`<caption part="caption">${this.caption}</caption>`:h}
2544
- <thead><tr>${l.map(v=>a(this,S,lx).call(this,v,d))}</tr></thead>
2544
+ <thead><tr>${l.map(v=>a(this,S,cx).call(this,v,d))}</tr></thead>
2545
2545
  <tbody>
2546
- ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>c`<tr>${l.map(v=>c`<td class=${a(this,S,Kn).call(this,v,d)} style=${a(this,S,Wn).call(this,v)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):u.map((v,k)=>a(this,S,cx).call(this,v,l,d,p,k))}
2546
+ ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>c`<tr>${l.map(v=>c`<td class=${a(this,S,Wn).call(this,v,d)} style=${a(this,S,Gn).call(this,v)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):u.map((v,k)=>a(this,S,dx).call(this,v,l,d,p,k))}
2547
2547
  ${f?c`<tr class="empty"><td colspan=${b}><slot name="empty">${this.t("empty")}</slot></td></tr>`:h}
2548
2548
  </tbody>
2549
- ${this.totals&&!this.loading&&!f?c`<tfoot><tr part="totals">${l.map(v=>c`<td class=${a(this,S,Kn).call(this,v,d)} style=${a(this,S,Wn).call(this,v)}>${v.type==="actions"?h:a(this,S,Un).call(this,this.totals[v.key])}</td>`)}</tr></tfoot>`:h}
2549
+ ${this.totals&&!this.loading&&!f?c`<tfoot><tr part="totals">${l.map(v=>c`<td class=${a(this,S,Wn).call(this,v,d)} style=${a(this,S,Gn).call(this,v)}>${v.type==="actions"?h:a(this,S,Kn).call(this,this.totals[v.key])}</td>`)}</tr></tfoot>`:h}
2550
2550
  </table>
2551
2551
  </div>
2552
2552
  ${i}
2553
2553
  </div>
2554
2554
  ${t}
2555
- ${x?a(this,S,hx).call(this,u,l,d):h}
2555
+ ${x?a(this,S,px).call(this,u,l,d):h}
2556
2556
  </div>${e}
2557
- `}};Yn=new WeakMap,Xn=new WeakMap,Xc=new WeakMap,Jn=new WeakMap,Cs=new WeakMap,Qn=new WeakMap,zs=new WeakMap,Lm=new WeakMap,S=new WeakSet,pf=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(j0(),a(this,S,Xy).call(this))},mf=function(e){this._announce=this._announce===e?`${e}\xA0`:e},uf=function(e,t){a(this,S,mf).call(this,this.t("sorted",{column:e,direction:this.t(t)}))},Xy=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;if(!t)return;let i=[...t];i.forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),a(this,S,gf).call(this,s),d.addEventListener("click",()=>a(this,S,Jy).call(this,e,s,l))});for(let s of[...e.tBodies,...e.tFoot?[e.tFoot]:[]])for(let l of s.rows)[...l.cells].forEach((d,p)=>{let u=i[p];u&&(d.dataset.label||(d.dataset.label=(u.textContent??"").trim()),u.dataset.priority&&!d.dataset.priority&&(d.dataset.priority=u.dataset.priority),(u.dataset.type==="actions"||u.dataset.type==="controls")&&!d.dataset.type&&(d.dataset.type=u.dataset.type))})},gf=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Jy=function(e,t,i){let s=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),l=t.dataset.key||s,d=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",p=new CustomEvent("cm-sort",{detail:{key:l,direction:d},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(p)||this.sortMode==="manual")return;let u=t.dataset.sort,b=d==="descending"?-1:1;for(let f of e.tBodies){let x=k=>{let L=k.cells[i];return L?(L.dataset.value??L.textContent??"").trim():""},v=[...f.rows].map((k,L)=>[k,x(k),L]).sort(([,k,L],[,P,U])=>k===""||P===""?k===P?L-U:k===""?1:-1:b*Gy(k,P,u,this.locale)||L-U);f.append(...v.map(([k])=>k))}for(let f of e.tHead.rows[0].cells)f.dataset.sort&&(f.setAttribute("aria-sort",f===t?d:"none"),a(this,S,gf).call(this,f));a(this,S,uf).call(this,s,d)},Qy=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),s=this.dispatchEvent(i);g(this,Yn,s),s&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},Zy=function(){let e=[this.renderRoot.querySelector(".scroll"),this.renderRoot.querySelector("table")??this.querySelector(":scope > table")].filter(Boolean);e.length===r(this,Cs).length&&e.every((t,i)=>t===r(this,Cs)[i])||(r(this,Jn)?.disconnect(),e.forEach(t=>r(this,Jn)?.observe(t)),g(this,Cs,e))},Ss=new WeakMap,jn=function(){let e=this.renderRoot?.querySelector(".scroll"),t=this.renderRoot?.querySelector(".frame");if(!e||!t)return;let i=getComputedStyle(e).maxBlockSize!=="none",s=e.scrollWidth>e.clientWidth+1;s!==this._overflows&&(this._overflows=s),e.toggleAttribute("data-open",this.stickyHeader&&!i&&!s);let l=Math.abs(e.scrollLeft);t.toggleAttribute("data-more-start",s&&l>1),t.toggleAttribute("data-more-end",s&&l+e.clientWidth<e.scrollWidth-1);let d=this.renderRoot.querySelector("caption")??this.querySelector(":scope > table > caption"),p=d&&getComputedStyle(d).position!=="absolute"?`${d.offsetHeight}px`:"";e.parentElement.style.getPropertyValue("--_cap")!==p&&e.parentElement.style.setProperty("--_cap",p);let u=0,b=this.renderRoot.querySelector("table")??this.querySelector(":scope > table"),f=b?.tHead;if(this.stickyHeader&&!i&&s&&b&&f){let x=r(this,zs)>0?r(this,zs):0,v=f.getBoundingClientRect().top-x,k=b.getBoundingClientRect().bottom-x,L=0;for(let P=Yy(this);P&&P!==document.documentElement&&P!==document.body;P=Yy(P)){let U=getComputedStyle(P);/(auto|scroll|overlay|hidden|clip)/.test(U.overflowY)&&(L=Math.max(L,P.getBoundingClientRect().top+P.clientTop+(parseFloat(U.paddingTop)||0)))}L+=parseFloat(getComputedStyle(this).getPropertyValue("--cm-data-table-sticky-top"))||0,u=Math.max(0,Math.min(L-v,k-v-f.getBoundingClientRect().height))}for(let x of this.renderRoot.querySelectorAll(".rz")){let v=String(Math.round(x.closest("th").getBoundingClientRect().width));x.getAttribute("aria-valuenow")!==v&&x.setAttribute("aria-valuenow",v)}u!==r(this,zs)&&(g(this,zs,u),u?e.style.setProperty("--_shift",`${u}px`):e.style.removeProperty("--_shift"))},Un=function(e){return e==null?"":e instanceof Date?ue(e,{},this.locale):String(e)},Tm=function(e){return this._widths[e.key]??e.width},Kn=function(e,t){return[U0(e)&&"end",Yc(e)&&"num",(Yc(e)||e.type==="date")&&"nw",e.type==="actions"&&"act",e.priority==="low"&&e!==t&&"low",a(this,S,Tm).call(this,e)!==void 0&&"w"].filter(Boolean).join(" ")},Wn=function(e){let t=a(this,S,Tm).call(this,e);return t===void 0?h:`--_w: ${t}px`},Cm=function(e){let t=e.composedPath()[0]?.closest?.("[data-lines]");if(t&&this.contains(t)){t.scrollWidth>t.clientWidth+1||t.scrollHeight>t.clientHeight+1?t.title=t.textContent?.trim()??"":t.removeAttribute("title");return}let i=e.composedPath()[0]?.closest?.(".t");i&&(i.scrollWidth>i.clientWidth+1||i.scrollHeight>i.clientHeight+1?i.title=i.textContent??"":i.removeAttribute("title"))},ff=function(e){e.type==="focusin"&&a(this,S,Cm).call(this,e);let t=e.composedPath().find(s=>s instanceof HTMLTableRowElement);if(!t)return;let i=e.type==="focusin"||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget);t.toggleAttribute("data-focus",i)},bf=function(e){return e.find(t=>t.primary)??e.find(t=>t.type!=="actions")??e[0]},vf=function(e,t){return t?a(this,S,Un).call(this,e[t.key]):""},ex=function(e,t){let i=t[e.key];return Array.isArray(i)?i:e.actions??[]},tx=function(e,t){let i=(this.rows??[]).indexOf(t);this.dispatchEvent(new CustomEvent("cm-row-action",{detail:{action:e.value??e.label,row:t,index:i},bubbles:!0,composed:!0}))},yf=function(e,t,i){return c`<span class="acts">${a(this,S,ex).call(this,e,t).map(s=>c`<cm-button size="slim" icon=${s.icon??h}
2557
+ `}};Xn=new WeakMap,Jn=new WeakMap,Jc=new WeakMap,Qn=new WeakMap,zs=new WeakMap,Zn=new WeakMap,Ss=new WeakMap,Am=new WeakMap,S=new WeakSet,mf=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(U0(),a(this,S,Jy).call(this))},uf=function(e){this._announce=this._announce===e?`${e}\xA0`:e},gf=function(e,t){a(this,S,uf).call(this,this.t("sorted",{column:e,direction:this.t(t)}))},Jy=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;if(!t)return;let i=[...t];i.forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),a(this,S,ff).call(this,s),d.addEventListener("click",()=>a(this,S,Qy).call(this,e,s,l))});for(let s of[...e.tBodies,...e.tFoot?[e.tFoot]:[]])for(let l of s.rows)[...l.cells].forEach((d,p)=>{let u=i[p];u&&(d.dataset.label||(d.dataset.label=(u.textContent??"").trim()),u.dataset.priority&&!d.dataset.priority&&(d.dataset.priority=u.dataset.priority),(u.dataset.type==="actions"||u.dataset.type==="controls")&&!d.dataset.type&&(d.dataset.type=u.dataset.type))})},ff=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Qy=function(e,t,i){let s=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),l=t.dataset.key||s,d=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",p=new CustomEvent("cm-sort",{detail:{key:l,direction:d},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(p)||this.sortMode==="manual")return;let u=t.dataset.sort,b=d==="descending"?-1:1;for(let f of e.tBodies){let x=k=>{let L=k.cells[i];return L?(L.dataset.value??L.textContent??"").trim():""},v=[...f.rows].map((k,L)=>[k,x(k),L]).sort(([,k,L],[,P,U])=>k===""||P===""?k===P?L-U:k===""?1:-1:b*Yy(k,P,u,this.locale)||L-U);f.append(...v.map(([k])=>k))}for(let f of e.tHead.rows[0].cells)f.dataset.sort&&(f.setAttribute("aria-sort",f===t?d:"none"),a(this,S,ff).call(this,f));a(this,S,gf).call(this,s,d)},Zy=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),s=this.dispatchEvent(i);g(this,Xn,s),s&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},ex=function(){let e=[this.renderRoot.querySelector(".scroll"),this.renderRoot.querySelector("table")??this.querySelector(":scope > table")].filter(Boolean);e.length===r(this,zs).length&&e.every((t,i)=>t===r(this,zs)[i])||(r(this,Qn)?.disconnect(),e.forEach(t=>r(this,Qn)?.observe(t)),g(this,zs,e))},Ls=new WeakMap,Un=function(){let e=this.renderRoot?.querySelector(".scroll"),t=this.renderRoot?.querySelector(".frame");if(!e||!t)return;let i=getComputedStyle(e).maxBlockSize!=="none",s=e.scrollWidth>e.clientWidth+1;s!==this._overflows&&(this._overflows=s),e.toggleAttribute("data-open",this.stickyHeader&&!i&&!s);let l=Math.abs(e.scrollLeft);t.toggleAttribute("data-more-start",s&&l>1),t.toggleAttribute("data-more-end",s&&l+e.clientWidth<e.scrollWidth-1);let d=this.renderRoot.querySelector("caption")??this.querySelector(":scope > table > caption"),p=d&&getComputedStyle(d).position!=="absolute"?`${d.offsetHeight}px`:"";e.parentElement.style.getPropertyValue("--_cap")!==p&&e.parentElement.style.setProperty("--_cap",p);let u=0,b=this.renderRoot.querySelector("table")??this.querySelector(":scope > table"),f=b?.tHead;if(this.stickyHeader&&!i&&s&&b&&f){let x=r(this,Ss)>0?r(this,Ss):0,v=f.getBoundingClientRect().top-x,k=b.getBoundingClientRect().bottom-x,L=0;for(let P=Xy(this);P&&P!==document.documentElement&&P!==document.body;P=Xy(P)){let U=getComputedStyle(P);/(auto|scroll|overlay|hidden|clip)/.test(U.overflowY)&&(L=Math.max(L,P.getBoundingClientRect().top+P.clientTop+(parseFloat(U.paddingTop)||0)))}L+=parseFloat(getComputedStyle(this).getPropertyValue("--cm-data-table-sticky-top"))||0,u=Math.max(0,Math.min(L-v,k-v-f.getBoundingClientRect().height))}for(let x of this.renderRoot.querySelectorAll(".rz")){let v=String(Math.round(x.closest("th").getBoundingClientRect().width));x.getAttribute("aria-valuenow")!==v&&x.setAttribute("aria-valuenow",v)}u!==r(this,Ss)&&(g(this,Ss,u),u?e.style.setProperty("--_shift",`${u}px`):e.style.removeProperty("--_shift"))},Kn=function(e){return e==null?"":e instanceof Date?ue(e,{},this.locale):String(e)},Cm=function(e){return this._widths[e.key]??e.width},Wn=function(e,t){return[K0(e)&&"end",Xc(e)&&"num",(Xc(e)||e.type==="date")&&"nw",e.type==="actions"&&"act",e.priority==="low"&&e!==t&&"low",a(this,S,Cm).call(this,e)!==void 0&&"w"].filter(Boolean).join(" ")},Gn=function(e){let t=a(this,S,Cm).call(this,e);return t===void 0?h:`--_w: ${t}px`},zm=function(e){let t=e.composedPath()[0]?.closest?.("[data-lines]");if(t&&this.contains(t)){t.scrollWidth>t.clientWidth+1||t.scrollHeight>t.clientHeight+1?t.title=t.textContent?.trim()??"":t.removeAttribute("title");return}let i=e.composedPath()[0]?.closest?.(".t");i&&(i.scrollWidth>i.clientWidth+1||i.scrollHeight>i.clientHeight+1?i.title=i.textContent??"":i.removeAttribute("title"))},bf=function(e){e.type==="focusin"&&a(this,S,zm).call(this,e);let t=e.composedPath().find(s=>s instanceof HTMLTableRowElement);if(!t)return;let i=e.type==="focusin"||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget);t.toggleAttribute("data-focus",i)},vf=function(e){return e.find(t=>t.primary)??e.find(t=>t.type!=="actions")??e[0]},yf=function(e,t){return t?a(this,S,Kn).call(this,e[t.key]):""},tx=function(e,t){let i=t[e.key];return Array.isArray(i)?i:e.actions??[]},ix=function(e,t){let i=(this.rows??[]).indexOf(t);this.dispatchEvent(new CustomEvent("cm-row-action",{detail:{action:e.value??e.label,row:t,index:i},bubbles:!0,composed:!0}))},xf=function(e,t,i){return c`<span class="acts">${a(this,S,tx).call(this,e,t).map(s=>c`<cm-button size="slim" icon=${s.icon??h}
2558
2558
  ?icon-only=${!!s.iconOnly} label=${s.iconOnly?this.t("rowAction",{action:s.label,name:i}):h} tone=${s.tone??h}
2559
- @click=${()=>a(this,S,tx).call(this,s,t)}>${s.label}${s.iconOnly||!i?h:c`<span class="sr">, ${i}</span>`}</cm-button>`)}</span>`},xf=function(e,t,i){if(e.type==="actions")return a(this,S,yf).call(this,e,t,i);let s=a(this,S,Un).call(this,t[e.key]);if(!K0(e))return s;let l=Math.trunc(Number(e.lines))||0;return l>1?c`<span class="t lines" style="--_lines: ${l}">${s}</span>`:c`<span class="t">${s}</span>`},zm=function(e,t,i){let s=Math.max(Fy,Math.round(t));this._widths={...this._widths,[e.key]:s},i&&(a(this,S,mf).call(this,this.t("resized",{column:e.label,width:s})),this.dispatchEvent(new CustomEvent("cm-column-resize",{detail:{key:e.key,width:s},bubbles:!0,composed:!0})))},ix=function(e,t){return a(this,S,Tm).call(this,e)??Math.round(t.closest("th").getBoundingClientRect().width)},rx=function(e,t){let i=se(e,this);i!=="ArrowLeft"&&i!=="ArrowRight"||(e.preventDefault(),a(this,S,zm).call(this,t,a(this,S,ix).call(this,t,e.currentTarget)+(i==="ArrowRight"?Vy:-Vy),!0))},sx=function(e,t){if(e.button!==0)return;e.preventDefault();let i=e.currentTarget,s=i.closest("th").getBoundingClientRect().width,l=e.clientX,d=getComputedStyle(this).direction==="rtl";try{i.setPointerCapture(e.pointerId)}catch{}i.setAttribute("data-dragging","");let p=s,u=f=>{p=s+(f.clientX-l)*(d?-1:1),a(this,S,zm).call(this,t,p,!1)},b=()=>{i.removeEventListener("pointermove",u),i.removeEventListener("pointerup",b),i.removeEventListener("pointercancel",b),i.removeAttribute("data-dragging"),a(this,S,zm).call(this,t,p,!0)};i.addEventListener("pointermove",u),i.addEventListener("pointerup",b),i.addEventListener("pointercancel",b)},ur=new WeakMap,Sm=function(e=!this._picker){this._picker=e,e?document.addEventListener("pointerdown",r(this,Zn),{capture:!0}):document.removeEventListener("pointerdown",r(this,Zn),{capture:!0})},Zn=new WeakMap,ax=function(e){e.key!=="Escape"||!this._picker||(e.stopPropagation(),a(this,S,Sm).call(this,!1),this.renderRoot.querySelector(".pick")?.focus())},nx=function(e,t){let i=this.columns.map(s=>s.key===e?{...s,visible:t}:s);this.columns=i,this.dispatchEvent(new CustomEvent("cm-columns-change",{detail:{key:e,visible:t,columns:i},bubbles:!0,composed:!0}))},ox=function(){let e=this.columns??[],t=a(this,S,bf).call(this,this.visibleColumns);return c`<div class="tools" part="tools" @keydown=${a(this,S,ax)}>
2560
- <button type="button" class="pick" part="column-picker" aria-expanded=${this._picker?"true":"false"} aria-controls="${r(this,Xn)}-cols"
2561
- @click=${()=>a(this,S,Sm).call(this)}>${this.t("columns")}<cm-icon name="chevron-down" size="16" aria-hidden="true"></cm-icon></button>
2562
- <fieldset class="panel" id="${r(this,Xn)}-cols" part="column-panel" ?hidden=${!this._picker}>
2559
+ @click=${()=>a(this,S,ix).call(this,s,t)}>${s.label}${s.iconOnly||!i?h:c`<span class="sr">, ${i}</span>`}</cm-button>`)}</span>`},wf=function(e,t,i){if(e.type==="actions")return a(this,S,xf).call(this,e,t,i);let s=a(this,S,Kn).call(this,t[e.key]);if(!W0(e))return s;let l=Math.trunc(Number(e.lines))||0;return l>1?c`<span class="t lines" style="--_lines: ${l}">${s}</span>`:c`<span class="t">${s}</span>`},Sm=function(e,t,i){let s=Math.max(Vy,Math.round(t));this._widths={...this._widths,[e.key]:s},i&&(a(this,S,uf).call(this,this.t("resized",{column:e.label,width:s})),this.dispatchEvent(new CustomEvent("cm-column-resize",{detail:{key:e.key,width:s},bubbles:!0,composed:!0})))},rx=function(e,t){return a(this,S,Cm).call(this,e)??Math.round(t.closest("th").getBoundingClientRect().width)},sx=function(e,t){let i=se(e,this);i!=="ArrowLeft"&&i!=="ArrowRight"||(e.preventDefault(),a(this,S,Sm).call(this,t,a(this,S,rx).call(this,t,e.currentTarget)+(i==="ArrowRight"?jy:-jy),!0))},ax=function(e,t){if(e.button!==0)return;e.preventDefault();let i=e.currentTarget,s=i.closest("th").getBoundingClientRect().width,l=e.clientX,d=getComputedStyle(this).direction==="rtl";try{i.setPointerCapture(e.pointerId)}catch{}i.setAttribute("data-dragging","");let p=s,u=f=>{p=s+(f.clientX-l)*(d?-1:1),a(this,S,Sm).call(this,t,p,!1)},b=()=>{i.removeEventListener("pointermove",u),i.removeEventListener("pointerup",b),i.removeEventListener("pointercancel",b),i.removeAttribute("data-dragging"),a(this,S,Sm).call(this,t,p,!0)};i.addEventListener("pointermove",u),i.addEventListener("pointerup",b),i.addEventListener("pointercancel",b)},gr=new WeakMap,Lm=function(e=!this._picker){this._picker=e,e?document.addEventListener("pointerdown",r(this,eo),{capture:!0}):document.removeEventListener("pointerdown",r(this,eo),{capture:!0})},eo=new WeakMap,nx=function(e){e.key!=="Escape"||!this._picker||(e.stopPropagation(),a(this,S,Lm).call(this,!1),this.renderRoot.querySelector(".pick")?.focus())},ox=function(e,t){let i=this.columns.map(s=>s.key===e?{...s,visible:t}:s);this.columns=i,this.dispatchEvent(new CustomEvent("cm-columns-change",{detail:{key:e,visible:t,columns:i},bubbles:!0,composed:!0}))},lx=function(){let e=this.columns??[],t=a(this,S,vf).call(this,this.visibleColumns);return c`<div class="tools" part="tools" @keydown=${a(this,S,nx)}>
2560
+ <button type="button" class="pick" part="column-picker" aria-expanded=${this._picker?"true":"false"} aria-controls="${r(this,Jn)}-cols"
2561
+ @click=${()=>a(this,S,Lm).call(this)}>${this.t("columns")}<cm-icon name="chevron-down" size="16" aria-hidden="true"></cm-icon></button>
2562
+ <fieldset class="panel" id="${r(this,Jn)}-cols" part="column-panel" ?hidden=${!this._picker}>
2563
2563
  <legend class="sr">${this.t("showColumns")}</legend>
2564
2564
  ${e.map(i=>c`<label class="opt"><input type="checkbox" .checked=${i.visible!==!1} ?disabled=${i===t}
2565
- @change=${s=>a(this,S,nx).call(this,i.key,s.target.checked)} />${i.label}</label>`)}
2565
+ @change=${s=>a(this,S,ox).call(this,i.key,s.target.checked)} />${i.label}</label>`)}
2566
2566
  </fieldset>
2567
- </div>`},lx=function(e,t){let i=this.sort===e.key,s=i?this.direction:"none",d=e.hidden||e.type==="actions"?c`<span class="sr">${e.label}</span>`:c`<span class="t">${e.label}</span>`;return c`<th scope="col" class=${a(this,S,Kn).call(this,e,t)} style=${a(this,S,Wn).call(this,e)} aria-sort=${e.sortable?s:h}><div class="h">${e.sortable?c`<button type="button" class="sort ${i?"on":""}" @click=${()=>a(this,S,Qy).call(this,e)}>${d}<cm-icon
2567
+ </div>`},cx=function(e,t){let i=this.sort===e.key,s=i?this.direction:"none",d=e.hidden||e.type==="actions"?c`<span class="sr">${e.label}</span>`:c`<span class="t">${e.label}</span>`;return c`<th scope="col" class=${a(this,S,Wn).call(this,e,t)} style=${a(this,S,Gn).call(this,e)} aria-sort=${e.sortable?s:h}><div class="h">${e.sortable?c`<button type="button" class="sort ${i?"on":""}" @click=${()=>a(this,S,Zy).call(this,e)}>${d}<cm-icon
2568
2568
  name=${i&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:d}${this.resizable&&e.type!=="actions"?c`<span class="rz" part="resize-handle" role="separator" aria-orientation="vertical" tabindex="0" aria-label=${this.t("resize",{column:e.label})}
2569
- aria-valuemin=${Fy} aria-valuemax="1600"
2570
- @keydown=${p=>a(this,S,rx).call(this,p,e)} @pointerdown=${p=>a(this,S,sx).call(this,p,e)}></span>`:h}</div></th>`},cx=function(e,t,i,s,l){let d=a(this,S,vf).call(this,e,i),p=this._expanded.has(e),u=`${r(this,Xn)}-more-${l}`,b=c`<tr part="row">${t.map(f=>f===i?c`<th scope="row" class=${a(this,S,Kn).call(this,f,i)} style=${a(this,S,Wn).call(this,f)} part="cell">${a(this,S,xf).call(this,f,e,d)}${s.length?c`<button type="button" class="more-btn" aria-expanded=${p?"true":"false"} aria-controls=${u}
2571
- @click=${()=>a(this,S,dx).call(this,e)}>${this.t(p?"viewLess":"viewAll")}</button>`:h}</th>`:c`<td class=${a(this,S,Kn).call(this,f,i)} style=${a(this,S,Wn).call(this,f)} part="cell">${a(this,S,xf).call(this,f,e,d)}</td>`)}</tr>`;return c`${b}${s.length&&p?c`<tr class="more" id=${u} part="row-details"><td colspan=${t.length-s.length}>
2572
- <dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Yc(f)?"num":""}>${a(this,S,Un).call(this,e[f.key])}</dd>`)}</dl></td></tr>`:h}`},dx=function(e){let t=new Set(this._expanded);t.has(e)?t.delete(e):t.add(e),this._expanded=t},hx=function(e,t,i){let s=t.filter(p=>p!==i&&p.type!=="actions"),l=t.filter(p=>p.type==="actions"),d=(p,u=!1)=>{let b=a(this,S,vf).call(this,p,i);return c`<li class="card ${u?"total":""}" part="card">
2569
+ aria-valuemin=${Vy} aria-valuemax="1600"
2570
+ @keydown=${p=>a(this,S,sx).call(this,p,e)} @pointerdown=${p=>a(this,S,ax).call(this,p,e)}></span>`:h}</div></th>`},dx=function(e,t,i,s,l){let d=a(this,S,yf).call(this,e,i),p=this._expanded.has(e),u=`${r(this,Jn)}-more-${l}`,b=c`<tr part="row">${t.map(f=>f===i?c`<th scope="row" class=${a(this,S,Wn).call(this,f,i)} style=${a(this,S,Gn).call(this,f)} part="cell">${a(this,S,wf).call(this,f,e,d)}${s.length?c`<button type="button" class="more-btn" aria-expanded=${p?"true":"false"} aria-controls=${u}
2571
+ @click=${()=>a(this,S,hx).call(this,e)}>${this.t(p?"viewLess":"viewAll")}</button>`:h}</th>`:c`<td class=${a(this,S,Wn).call(this,f,i)} style=${a(this,S,Gn).call(this,f)} part="cell">${a(this,S,wf).call(this,f,e,d)}</td>`)}</tr>`;return c`${b}${s.length&&p?c`<tr class="more" id=${u} part="row-details"><td colspan=${t.length-s.length}>
2572
+ <dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Xc(f)?"num":""}>${a(this,S,Kn).call(this,e[f.key])}</dd>`)}</dl></td></tr>`:h}`},hx=function(e){let t=new Set(this._expanded);t.has(e)?t.delete(e):t.add(e),this._expanded=t},px=function(e,t,i){let s=t.filter(p=>p!==i&&p.type!=="actions"),l=t.filter(p=>p.type==="actions"),d=(p,u=!1)=>{let b=a(this,S,yf).call(this,p,i);return c`<li class="card ${u?"total":""}" part="card">
2573
2573
  <p class="card-title">${b}</p>
2574
- ${s.length?c`<dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Yc(f)?"num":""}>${a(this,S,Un).call(this,p[f.key])}</dd>`)}</dl>`:h}
2575
- ${!u&&l.length?c`<div class="card-actions">${l.map(f=>a(this,S,yf).call(this,f,p,b))}</div>`:h}
2574
+ ${s.length?c`<dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Xc(f)?"num":""}>${a(this,S,Kn).call(this,p[f.key])}</dd>`)}</dl>`:h}
2575
+ ${!u&&l.length?c`<div class="card-actions">${l.map(f=>a(this,S,xf).call(this,f,p,b))}</div>`:h}
2576
2576
  </li>`};return c`${this.caption?c`<p class="cards-caption" aria-hidden="true">${this.caption}</p>`:h}
2577
- <ul class="cards" part="cards" aria-label=${this.caption||h}>${e.map(p=>d(p))}${this.totals?d(this.totals,!0):h}</ul>`},Gn.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},density:{reflect:!0},mobile:{reflect:!0},rowActions:{attribute:"row-actions",reflect:!0},resizable:{type:Boolean,reflect:!0},columnPicker:{type:Boolean,attribute:"column-picker",reflect:!0},_light:{state:!0},_announce:{state:!0},_widths:{state:!0},_expanded:{state:!0},_picker:{state:!0},_overflows:{state:!0}},Gn.styles=[E,Ie,w`
2577
+ <ul class="cards" part="cards" aria-label=${this.caption||h}>${e.map(p=>d(p))}${this.totals?d(this.totals,!0):h}</ul>`},Yn.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},density:{reflect:!0},mobile:{reflect:!0},rowActions:{attribute:"row-actions",reflect:!0},resizable:{type:Boolean,reflect:!0},columnPicker:{type:Boolean,attribute:"column-picker",reflect:!0},_light:{state:!0},_announce:{state:!0},_widths:{state:!0},_expanded:{state:!0},_picker:{state:!0},_overflows:{state:!0}},Yn.styles=[E,Ie,w`
2578
2578
  :host { display: block; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-variant-numeric: tabular-nums; }
2579
2579
  :host([density='compact']) { --cm-table-row-height: 40px; }
2580
2580
  :host([density='comfortable']) { --cm-table-row-height: 48px; }
@@ -2734,7 +2734,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2734
2734
  :host([mobile='priority']) tr.more { display: table-row; }
2735
2735
  }
2736
2736
  @media (forced-colors: active) { button.sort cm-icon { opacity: 1; } .acts { opacity: 1 !important; } }
2737
- `];$("cm-data-table",Gn);var x_=z("resourceItem",{select:"Select {name}"}),w_=z("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),px=w`
2737
+ `];$("cm-data-table",Yn);var k_=z("resourceItem",{select:"Select {name}"}),E_=z("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),mx=w`
2738
2738
  .check { position: relative; display: inline-flex; flex: none; width: 16px; height: 16px; }
2739
2739
  .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
2740
2740
  .check input:disabled { cursor: not-allowed; }
@@ -2746,17 +2746,17 @@ cm-data-table:has(> table) { container-type: inline-size; }
2746
2746
  .dash { width: 50%; height: 2px; background: currentColor; }
2747
2747
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2748
2748
  .check input:disabled + .box { border-color: var(--cm-border-subtle); background: var(--cm-bg-input-filled); }
2749
- `,Dm,ro,mx,ux,to=class extends C{constructor(){super();m(this,ro);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;this.actions="auto";this._hasActions=!1;m(this,Dm,this.attachInternals());r(this,Dm).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return c`
2749
+ `,Rm,so,ux,gx,io=class extends C{constructor(){super();m(this,so);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;this.actions="auto";this._hasActions=!1;m(this,Rm,this.attachInternals());r(this,Rm).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return c`
2750
2750
  ${this.href&&!this.disabled?c`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:h}
2751
- <div class=${this._hasActions?"row has-actions":"row"} part="row" @click=${a(this,ro,ux)}>
2751
+ <div class=${this._hasActions?"row has-actions":"row"} part="row" @click=${a(this,so,gx)}>
2752
2752
  ${this.selectable?c`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
2753
2753
  ?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
2754
2754
  <span class="box" aria-hidden="true">${this.selected?c`<cm-icon name="check" size="12"></cm-icon>`:h}</span></span>`:h}
2755
2755
  <span class="media"><slot name="media"></slot></span>
2756
2756
  <div class="content" part="content"><slot></slot></div>
2757
- <div class="actions" part="actions"><slot name="actions" @slotchange=${a(this,ro,mx)}></slot></div>
2757
+ <div class="actions" part="actions"><slot name="actions" @slotchange=${a(this,so,ux)}></slot></div>
2758
2758
  </div>
2759
- `}};Dm=new WeakMap,ro=new WeakSet,mx=function(e){this._hasActions=e.target.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.textContent?.trim())},ux=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},to.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0},mobile:{reflect:!0},actions:{reflect:!0},_hasActions:{state:!0}},to.styles=[E,px,w`
2759
+ `}};Rm=new WeakMap,so=new WeakSet,ux=function(e){this._hasActions=e.target.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.textContent?.trim())},gx=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},io.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0},mobile:{reflect:!0},actions:{reflect:!0},_hasActions:{state:!0}},io.styles=[E,mx,w`
2760
2760
  :host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-subtle); }
2761
2761
  :host(:last-child) { border-bottom: 0; }
2762
2762
  /* 56px rows (a 40px thumbnail with space-8 above and below), 14px text; compact density (since 1.6): 40px rows,
@@ -2807,18 +2807,18 @@ cm-data-table:has(> table) { container-type: inline-size; }
2807
2807
  :host([columns][mobile='stack']) ::slotted(*) { overflow-wrap: break-word; }
2808
2808
  :host([columns][mobile='stack']) ::slotted(:first-child) { flex: 1 1 100%; }
2809
2809
  }
2810
- `];$("cm-resource-item",to);var Jc,Qc,He,gx,wf,Rm,Hm,eo,Am,Nm,io=class extends C{constructor(){super();m(this,He);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this.mobile="columns";this._count=0;this._rows=0;this._hasHeader=!1;this._hasTable=!1;this._hasActions=!1;m(this,Jc,N("cm-rl"));m(this,Qc,new Set);m(this,Rm,e=>{let t=e.target;this._hasHeader=t.assignedElements().length>0,a(this,He,wf).call(this,t)});m(this,Hm,e=>{this._hasActions=e.target.assignedElements().length>0});m(this,Nm,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,a(this,He,eo).call(this),a(this,He,Am).call(this))})}connectedCallback(){super.connectedCallback(),_m(this)}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),a(this,He,eo).call(this),a(this,He,Am).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,He,eo).call(this),a(this,He,Am).call(this)}clearSelection(){this.selectPage(!1)}updated(e){(e.has("selectable")||e.has("mobile"))&&(a(this,He,eo).call(this),a(this,He,wf).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(k=>!k.disabled).length,s=i>0&&e>=i,l=a(this,He,gx).call(this),d=k=>bh(k,this.locale)==="one"?this.resourceName:l,p=this.total>t,u=h;this.allSelected?u=c`${this.t("allSelected",{count:Math.max(this.total,e),resource:l})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(u=c`${this.t("selected",{count:e,resource:d(e)})}${s&&p?c` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:l})}</button>`:h}`);let b=e>0||this.allSelected,f=this._hasTable,x=!this.hideSelectMenu&&(!f||b),v=c`<slot name="actions" @slotchange=${r(this,Hm)}></slot>`;return c`
2810
+ `];$("cm-resource-item",io);var Qc,Zc,He,fx,$f,Hm,Nm,to,Dm,Pm,ro=class extends C{constructor(){super();m(this,He);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this.mobile="columns";this._count=0;this._rows=0;this._hasHeader=!1;this._hasTable=!1;this._hasActions=!1;m(this,Qc,N("cm-rl"));m(this,Zc,new Set);m(this,Hm,e=>{let t=e.target;this._hasHeader=t.assignedElements().length>0,a(this,He,$f).call(this,t)});m(this,Nm,e=>{this._hasActions=e.target.assignedElements().length>0});m(this,Pm,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,a(this,He,to).call(this),a(this,He,Dm).call(this))})}connectedCallback(){super.connectedCallback(),Tm(this)}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),a(this,He,to).call(this),a(this,He,Dm).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,He,to).call(this),a(this,He,Dm).call(this)}clearSelection(){this.selectPage(!1)}updated(e){(e.has("selectable")||e.has("mobile"))&&(a(this,He,to).call(this),a(this,He,$f).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(k=>!k.disabled).length,s=i>0&&e>=i,l=a(this,He,fx).call(this),d=k=>vh(k,this.locale)==="one"?this.resourceName:l,p=this.total>t,u=h;this.allSelected?u=c`${this.t("allSelected",{count:Math.max(this.total,e),resource:l})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(u=c`${this.t("selected",{count:e,resource:d(e)})}${s&&p?c` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:l})}</button>`:h}`);let b=e>0||this.allSelected,f=this._hasTable,x=!this.hideSelectMenu&&(!f||b),v=c`<slot name="actions" @slotchange=${r(this,Nm)}></slot>`;return c`
2811
2811
  ${this.selectable&&f?c`<div class="top ${this._hasActions?"has":""}" part="top-actions">${v}</div>`:h}
2812
2812
  <div class="head ${this.selectable||this._hasHeader?"on":""} ${f?"over":""}">
2813
- <div class="header ${this._hasHeader?"has":""}"><slot name="header" @slotchange=${r(this,Rm)}></slot></div>
2813
+ <div class="header ${this._hasHeader?"has":""}"><slot name="header" @slotchange=${r(this,Hm)}></slot></div>
2814
2814
  ${this.selectable?c`<div class="toolbar ${f?"over":""} ${b?"busy":""}" part="toolbar">
2815
2815
  <span class="select" part="select">
2816
- <span class="check"><input id="${r(this,Jc)}-all" type="checkbox" .checked=${s} .indeterminate=${e>0&&!s}
2816
+ <span class="check"><input id="${r(this,Qc)}-all" type="checkbox" .checked=${s} .indeterminate=${e>0&&!s}
2817
2817
  ?disabled=${!i} @change=${k=>this.selectPage(k.target.checked)} />
2818
2818
  <span class="box" aria-hidden="true">${e>0&&!s?c`<span class="dash"></span>`:s?c`<cm-icon name="check" size="12"></cm-icon>`:h}</span></span>
2819
2819
  ${this.hideSelectMenu?h:c`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")} ?hidden=${!x}
2820
- .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...p?[{label:this.t("selectAll",{count:this.total,resource:l}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${r(this,Nm)}></cm-action-menu>`}
2821
- <label for="${r(this,Jc)}-all" class=${f||b?"sr":"label"}>${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:d(t)})}</span></label>
2820
+ .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...p?[{label:this.t("selectAll",{count:this.total,resource:l}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${r(this,Pm)}></cm-action-menu>`}
2821
+ <label for="${r(this,Qc)}-all" class=${f||b?"sr":"label"}>${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:d(t)})}</span></label>
2822
2822
  </span>
2823
2823
  <span class="status" part="status" role="status">${u}</span>
2824
2824
  <span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
@@ -2827,12 +2827,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
2827
2827
  </div>
2828
2828
  <div class="body">
2829
2829
  <div class="list" part="list" role="list" aria-label=${this.label||l.replace(/^./,k=>k.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
2830
- <slot @slotchange=${()=>a(this,He,eo).call(this)}></slot>
2830
+ <slot @slotchange=${()=>a(this,He,to).call(this)}></slot>
2831
2831
  </div>
2832
2832
  ${this.loading?c`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:l})}></span>`:h}
2833
2833
  </div>
2834
2834
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
2835
- `}};Jc=new WeakMap,Qc=new WeakMap,He=new WeakSet,gx=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},wf=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(s=>t.add(s));for(let i of r(this,Qc))t.has(i)||(i.removeAttribute("resource-rows"),i.removeAttribute("mobile"));for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain"),this.mobile==="stack"?i.setAttribute("mobile","stack"):i.removeAttribute("mobile");g(this,Qc,t),this._hasTable=t.size>0},Rm=new WeakMap,Hm=new WeakMap,eo=function(){let e=this.items;e.forEach(t=>{t.selectable=this.selectable,t.mobile=this.mobile==="stack"?"stack":void 0}),this._rows=e.length,this._count=e.filter(t=>t.selected).length},Am=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},Nm=new WeakMap,io.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},density:{reflect:!0},mobile:{reflect:!0},_count:{state:!0},_rows:{state:!0},_hasHeader:{state:!0},_hasTable:{state:!0},_hasActions:{state:!0}},io.styles=[E,px,w`
2835
+ `}};Qc=new WeakMap,Zc=new WeakMap,He=new WeakSet,fx=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},$f=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(s=>t.add(s));for(let i of r(this,Zc))t.has(i)||(i.removeAttribute("resource-rows"),i.removeAttribute("mobile"));for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain"),this.mobile==="stack"?i.setAttribute("mobile","stack"):i.removeAttribute("mobile");g(this,Zc,t),this._hasTable=t.size>0},Hm=new WeakMap,Nm=new WeakMap,to=function(){let e=this.items;e.forEach(t=>{t.selectable=this.selectable,t.mobile=this.mobile==="stack"?"stack":void 0}),this._rows=e.length,this._count=e.filter(t=>t.selected).length},Dm=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},Pm=new WeakMap,ro.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},density:{reflect:!0},mobile:{reflect:!0},_count:{state:!0},_rows:{state:!0},_hasHeader:{state:!0},_hasTable:{state:!0},_hasActions:{state:!0}},ro.styles=[E,mx,w`
2836
2836
  :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); --_pad: var(--cm-space-12); --_cm-row-inset: var(--_pad); }
2837
2837
  /* Density (since 1.6): the rows are this element's children, so they inherit these. See density.ts. */
2838
2838
  :host([density='compact']) { --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
@@ -2890,12 +2890,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
2890
2890
  .toolbar .check { width: 20px; height: 20px; }
2891
2891
  .spinner { width: 32px; height: 32px; margin: -16px; border-width: 3px; }
2892
2892
  }
2893
- `];$("cm-resource-list",io);var T_=z("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),C_=z("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),Im,he,$f,kf,fx,bx,gr,vx,yx,xx,Ef,wx,Pt=class Pt extends C{constructor(){super();m(this,he);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;m(this,Im,this.attachInternals());m(this,gr,!1);r(this,Im).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let s=e.items,l=Math.max(0,Math.min(s.length,t??s.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,s[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:s.length+1})),!0):!1}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let s=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
2894
- <div class="row" part="row" @dragover=${a(this,he,xx)} @dragleave=${a(this,he,Ef)} @drop=${a(this,he,wx)}>
2893
+ `];$("cm-resource-list",ro);var S_=z("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),L_=z("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),qm,he,kf,Ef,bx,vx,fr,yx,xx,wx,Mf,$x,It=class It extends C{constructor(){super();m(this,he);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;m(this,qm,this.attachInternals());m(this,fr,!1);r(this,qm).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let s=e.items,l=Math.max(0,Math.min(s.length,t??s.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,s[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:s.length+1})),!0):!1}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let s=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
2894
+ <div class="row" part="row" @dragover=${a(this,he,wx)} @dragleave=${a(this,he,Mf)} @drop=${a(this,he,$x)}>
2895
2895
  ${this.sortable?c`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
2896
2896
  aria-describedby="hint"
2897
- @keydown=${a(this,he,fx)} @dragstart=${a(this,he,bx)} @pointerdown=${a(this,he,vx)}
2898
- @dragend=${()=>{this.classList.remove("dragging"),Pt.dragged=null,Zc(this,null)}}><cm-icon name="drag" size="16"></cm-icon></button>`:h}
2897
+ @keydown=${a(this,he,bx)} @dragstart=${a(this,he,vx)} @pointerdown=${a(this,he,yx)}
2898
+ @dragend=${()=>{this.classList.remove("dragging"),It.dragged=null,ed(this,null)}}><cm-icon name="drag" size="16"></cm-icon></button>`:h}
2899
2899
  ${this.sortable?c`<span class="sr" id="hint">${this.t(this.list?.group?"hintGroup":"hint")}</span>`:h}
2900
2900
  <span class="label" part="label">${this.label}</span>
2901
2901
  <span class="actions" part="actions"><slot name="actions"></slot></span>
@@ -2903,7 +2903,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2903
2903
  <div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
2904
2904
  <slot @slotchange=${e=>{let t=e.target.assignedElements().filter(i=>i.localName==="cm-nested-item");t.forEach(i=>i.sortable=this.sortable),this._hasChildren=t.length>0}}></slot>
2905
2905
  </div>
2906
- `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};Im=new WeakMap,he=new WeakSet,$f=function(){let e=this.list;return e?.group?[...e.getRootNode().querySelectorAll("cm-nested-list")].filter(i=>i===e||i.group===e.group&&i.sortable&&(!i.collapsible||i.open)):[]},kf=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},fx=function(e){let t=this.siblings.indexOf(this),i=e.key==="ArrowUp",s=e.key==="ArrowDown";if(i&&t===0||s&&t===this.siblings.length-1){let d=r(this,he,$f),p=d[d.indexOf(this.list)+(i?-1:1)];if(p){e.preventDefault(),this.moveToList(p,i?p.items.length:0)&&a(this,he,kf).call(this);return}}let l;if(e.key==="ArrowUp")l=t-1;else if(e.key==="ArrowDown")l=t+1;else if(e.key==="Home")l=0;else if(e.key==="End")l=this.siblings.length-1;else return;e.preventDefault(),this.moveTo(l)&&a(this,he,kf).call(this)},bx=function(e){if(e.stopPropagation(),r(this,gr)){e.preventDefault();return}Pt.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},gr=new WeakMap,vx=function(e){if(e.pointerType==="mouse"||!e.isPrimary)return;let t=e.clientY,i=null,s=d=>{if(d.pointerId===e.pointerId){if(!r(this,gr)){if(Math.abs(d.clientY-t)<6)return;g(this,gr,!0),Pt.dragged=this,this.classList.add("dragging")}d.preventDefault(),i=a(this,he,yx).call(this,d.clientX,d.clientY),Zc(this,i)}},l=d=>{if(d.pointerId!==e.pointerId)return;document.removeEventListener("pointermove",s,!0),document.removeEventListener("pointerup",l,!0),document.removeEventListener("pointercancel",l,!0);let p=r(this,gr);g(this,gr,!1),Pt.dragged=null,this.classList.remove("dragging"),Zc(this,null),!(!p||d.type==="pointercancel"||!i)&&(i.list?this.moveToList(i.list,i.index):this.moveTo(i.index))};document.addEventListener("pointermove",s,!0),document.addEventListener("pointerup",l,!0),document.addEventListener("pointercancel",l,!0)},yx=function(e,t){for(let i of r(this,he,$f)){if(i===this.list)continue;let s=i.getBoundingClientRect();if(e>=s.left&&e<=s.right&&t>=s.top&&t<=s.bottom)return{list:i,index:Pm(i.items,this,t)}}return{index:Pm(this.siblings,this,t)}},xx=function(e){let t=Pt.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),s=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",s),this.classList.toggle("drop-before",!s)},Ef=function(){this.classList.remove("drop-before","drop-after")},wx=function(e){let t=Pt.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");a(this,he,Ef).call(this);let s=this.siblings,l=s.indexOf(t),d=s.indexOf(this)+(i?1:0);d>l&&(d-=1),t.moveTo(d)},Pt.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},Pt.styles=[E,w`
2906
+ `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};qm=new WeakMap,he=new WeakSet,kf=function(){let e=this.list;return e?.group?[...e.getRootNode().querySelectorAll("cm-nested-list")].filter(i=>i===e||i.group===e.group&&i.sortable&&(!i.collapsible||i.open)):[]},Ef=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},bx=function(e){let t=this.siblings.indexOf(this),i=e.key==="ArrowUp",s=e.key==="ArrowDown";if(i&&t===0||s&&t===this.siblings.length-1){let d=r(this,he,kf),p=d[d.indexOf(this.list)+(i?-1:1)];if(p){e.preventDefault(),this.moveToList(p,i?p.items.length:0)&&a(this,he,Ef).call(this);return}}let l;if(e.key==="ArrowUp")l=t-1;else if(e.key==="ArrowDown")l=t+1;else if(e.key==="Home")l=0;else if(e.key==="End")l=this.siblings.length-1;else return;e.preventDefault(),this.moveTo(l)&&a(this,he,Ef).call(this)},vx=function(e){if(e.stopPropagation(),r(this,fr)){e.preventDefault();return}It.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},fr=new WeakMap,yx=function(e){if(e.pointerType==="mouse"||!e.isPrimary)return;let t=e.clientY,i=null,s=d=>{if(d.pointerId===e.pointerId){if(!r(this,fr)){if(Math.abs(d.clientY-t)<6)return;g(this,fr,!0),It.dragged=this,this.classList.add("dragging")}d.preventDefault(),i=a(this,he,xx).call(this,d.clientX,d.clientY),ed(this,i)}},l=d=>{if(d.pointerId!==e.pointerId)return;document.removeEventListener("pointermove",s,!0),document.removeEventListener("pointerup",l,!0),document.removeEventListener("pointercancel",l,!0);let p=r(this,fr);g(this,fr,!1),It.dragged=null,this.classList.remove("dragging"),ed(this,null),!(!p||d.type==="pointercancel"||!i)&&(i.list?this.moveToList(i.list,i.index):this.moveTo(i.index))};document.addEventListener("pointermove",s,!0),document.addEventListener("pointerup",l,!0),document.addEventListener("pointercancel",l,!0)},xx=function(e,t){for(let i of r(this,he,kf)){if(i===this.list)continue;let s=i.getBoundingClientRect();if(e>=s.left&&e<=s.right&&t>=s.top&&t<=s.bottom)return{list:i,index:Im(i.items,this,t)}}return{index:Im(this.siblings,this,t)}},wx=function(e){let t=It.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),s=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",s),this.classList.toggle("drop-before",!s)},Mf=function(){this.classList.remove("drop-before","drop-after")},$x=function(e){let t=It.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");a(this,he,Mf).call(this);let s=this.siblings,l=s.indexOf(t),d=s.indexOf(this)+(i?1:0);d>l&&(d-=1),t.moveTo(d)},It.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},It.styles=[E,w`
2907
2907
  :host { display: block; }
2908
2908
  .row {
2909
2909
  display: flex; align-items: center; gap: var(--cm-space-12); min-height: 48px; padding: 0 var(--cm-space-16);
@@ -2930,20 +2930,20 @@ cm-data-table:has(> table) { container-type: inline-size; }
2930
2930
  .actions { gap: var(--cm-space-8); }
2931
2931
  .children { margin-inline-start: var(--cm-space-20); }
2932
2932
  }
2933
- `],Pt.dragged=null;var ao=Pt;$("cm-nested-item",ao);function Pm(o,n,e){return o.filter(t=>{if(t===n)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function Zc(o,n){if((o.list??o).getRootNode().querySelectorAll("cm-nested-item.drop-before, cm-nested-item.drop-after, cm-nested-list.drop-target").forEach(i=>i.classList.remove("drop-before","drop-after","drop-target")),!n)return;let t=(n.list?n.list.items:o.siblings).filter(i=>i!==o);t.length?n.index<t.length?t[n.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):n.list?.classList.add("drop-target")}var Ls,st,$x,Mf,_f,kx,Ex,so=class extends C{constructor(){super(...arguments);m(this,st);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;m(this,Ls,N("cm-nl"))}get items(){return[...this.children].filter(e=>e.localName==="cm-nested-item")}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}willUpdate(){this.hasUpdated||(this._empty=!this.items.length)}updated(e){(e.has("sortable")||e.has("group"))&&a(this,st,Mf).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
2933
+ `],It.dragged=null;var no=It;$("cm-nested-item",no);function Im(o,n,e){return o.filter(t=>{if(t===n)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function ed(o,n){if((o.list??o).getRootNode().querySelectorAll("cm-nested-item.drop-before, cm-nested-item.drop-after, cm-nested-list.drop-target").forEach(i=>i.classList.remove("drop-before","drop-after","drop-target")),!n)return;let t=(n.list?n.list.items:o.siblings).filter(i=>i!==o);t.length?n.index<t.length?t[n.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):n.list?.classList.add("drop-target")}var As,st,kx,_f,Tf,Ex,Mx,ao=class extends C{constructor(){super(...arguments);m(this,st);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;m(this,As,N("cm-nl"))}get items(){return[...this.children].filter(e=>e.localName==="cm-nested-item")}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}willUpdate(){this.hasUpdated||(this._empty=!this.items.length)}updated(e){(e.has("sortable")||e.has("group"))&&a(this,st,_f).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
2934
2934
  <div class="bar" part="bar">
2935
- <div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,Ls)}-h">${this.heading}</div>
2935
+ <div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,As)}-h">${this.heading}</div>
2936
2936
  <span class="actions"><slot name="actions"></slot></span>
2937
- ${this.collapsible?c`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${r(this,Ls)}-rows"
2938
- aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${a(this,st,$x)}>
2937
+ ${this.collapsible?c`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${r(this,As)}-rows"
2938
+ aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${a(this,st,kx)}>
2939
2939
  <cm-icon name=${t?"chevron-up":"chevron-down"} size="16"></cm-icon></button>`:h}
2940
2940
  </div>
2941
- <div class="rows ${this.group&&this._empty?"empty":""}" id="${r(this,Ls)}-rows" role="list" aria-labelledby="${r(this,Ls)}-h" ?hidden=${!t}
2942
- @dragover=${a(this,st,kx)} @drop=${a(this,st,Ex)}>
2943
- <slot @slotchange=${()=>{a(this,st,Mf).call(this),this._empty=!this.items.length}}></slot>
2941
+ <div class="rows ${this.group&&this._empty?"empty":""}" id="${r(this,As)}-rows" role="list" aria-labelledby="${r(this,As)}-h" ?hidden=${!t}
2942
+ @dragover=${a(this,st,Ex)} @drop=${a(this,st,Mx)}>
2943
+ <slot @slotchange=${()=>{a(this,st,_f).call(this),this._empty=!this.items.length}}></slot>
2944
2944
  </div>
2945
2945
  <span class="sr" role="status">${this._msg}</span>
2946
- `}};Ls=new WeakMap,st=new WeakSet,$x=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Mf=function(){this.items.forEach(t=>{t.sortable=this.sortable,t.requestUpdate()})},_f=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},kx=function(e){let t=ao.dragged;a(this,st,_f).call(this,t)&&(e.preventDefault(),Zc(t,{list:this,index:Pm(this.items,t,e.clientY)}))},Ex=function(e){let t=ao.dragged;if(!a(this,st,_f).call(this,t))return;e.preventDefault();let i=Pm(this.items,t,e.clientY);Zc(t,null),t.moveToList(this,i)},so.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},group:{reflect:!0},_msg:{state:!0},_empty:{state:!0}},so.styles=[E,w`
2946
+ `}};As=new WeakMap,st=new WeakSet,kx=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},_f=function(){this.items.forEach(t=>{t.sortable=this.sortable,t.requestUpdate()})},Tf=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},Ex=function(e){let t=no.dragged;a(this,st,Tf).call(this,t)&&(e.preventDefault(),ed(t,{list:this,index:Im(this.items,t,e.clientY)}))},Mx=function(e){let t=no.dragged;if(!a(this,st,Tf).call(this,t))return;e.preventDefault();let i=Im(this.items,t,e.clientY);ed(t,null),t.moveToList(this,i)},ao.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},group:{reflect:!0},_msg:{state:!0},_empty:{state:!0}},ao.styles=[E,w`
2947
2947
  :host { display: block; }
2948
2948
  .bar {
2949
2949
  display: flex; align-items: center; gap: var(--cm-space-12); min-height: 64px; padding: 0 var(--cm-space-20);
@@ -2967,9 +2967,9 @@ cm-data-table:has(> table) { container-type: inline-size; }
2967
2967
  .title { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); }
2968
2968
  .rows { margin-inline-start: var(--cm-space-8); }
2969
2969
  }
2970
- `];$("cm-nested-list",so);var Mx=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},_x=pa(class extends Pi{constructor(o){if(super(o),o.type!==At.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],s=[],l=0;for(let d of o)i[l]=t?t(d,l):l,s[l]=e(d,l),l++;return{values:s,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=Zb(o),{values:s,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,s;let d=this.ut??=[],p=[],u,b,f=0,x=i.length-1,v=0,k=s.length-1;for(;f<=x&&v<=k;)if(i[f]===null)f++;else if(i[x]===null)x--;else if(d[f]===l[v])p[v]=Ii(i[f],s[v]),f++,v++;else if(d[x]===l[k])p[k]=Ii(i[x],s[k]),x--,k--;else if(d[f]===l[k])p[k]=Ii(i[f],s[k]),ma(o,p[k+1],i[f]),f++,k--;else if(d[x]===l[v])p[v]=Ii(i[x],s[v]),ma(o,i[f],i[x]),x--,v++;else if(u===void 0&&(u=Mx(l,v,k),b=Mx(d,f,x)),u.has(d[f]))if(u.has(d[x])){let L=b.get(l[v]),P=L!==void 0?i[L]:null;if(P===null){let U=ma(o,i[f]);Ii(U,s[v]),p[v]=U}else p[v]=Ii(P,s[v]),ma(o,i[f],P),i[L]=null;v++}else Rh(i[x]),x--;else Rh(i[f]),f++;for(;v<=k;){let L=ma(o,p[k+1]);Ii(L,s[v]),p[v++]=L}for(;f<=x;){let L=i[f++];L!==null&&Rh(L)}return this.ut=l,Dh(o,p),Pe}});function Tx(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),s=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return s(1);case"ArrowLeft":return s(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var ye,mt,ut,Ds=class{constructor(n){m(this,ye);m(this,mt,null);m(this,ut,null);g(this,ye,n)}get active(){return r(this,mt)!==null}get from(){return r(this,mt)&&{...r(this,mt)}}get target(){return r(this,ut)&&{...r(this,ut)}}groupCount(){return r(this,ye).groupCount()}slotCount(n){return n>=0&&n<r(this,ye).groupCount()?r(this,ye).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,mt,{...n}),g(this,ut,{...n}),r(this,ye).onTarget?.(this.target),r(this,ye).announce(r(this,ye).messages.pickedUp(this.target))}moveTo(n){if(!r(this,ut))return;let e=Math.max(0,Math.min(n.group,r(this,ye).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,ut,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,ye).onTarget?.(this.target),r(this,ye).announce(r(this,ye).messages.over(this.target)))}drop(){if(!r(this,mt)||!r(this,ut))return;let n=r(this,mt),e=r(this,ut);g(this,mt,g(this,ut,null)),r(this,ye).onTarget?.(null),r(this,ye).onDrop(n,e)}cancel(n=!1){if(!r(this,mt))return;let e=r(this,mt),t=n?"":r(this,ye).messages.cancelled(e);g(this,mt,g(this,ut,null)),r(this,ye).onTarget?.(null),r(this,ye).onCancel?.(e),t&&r(this,ye).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(r(this,ye).navigate??Tx)(e,r(this,ut),this);return t?(this.moveTo(t),!0):!1}};ye=new WeakMap,mt=new WeakMap,ut=new WeakMap;var ed,As,Rs=class{constructor(n=document,e="assertive"){m(this,ed);m(this,As);let t=n.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return r(this,As)??this.element.textContent??""}announce(n){clearTimeout(r(this,ed)),this.element.textContent===n?(this.element.textContent="",g(this,As,n),g(this,ed,setTimeout(()=>{this.element.textContent=n,g(this,As,void 0)},50))):(g(this,As,void 0),this.element.textContent=n)}};ed=new WeakMap,As=new WeakMap;var U_=z("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),K_=z("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),W_=z("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."}),G0="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",td,Fm,Cx,Hs=class extends C{constructor(){super(...arguments);m(this,Fm);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";m(this,td,N("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return c`<div class="card" part="card">
2970
+ `];$("cm-nested-list",ao);var _x=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},Tx=ga(class extends qi{constructor(o){if(super(o),o.type!==Dt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],s=[],l=0;for(let d of o)i[l]=t?t(d,l):l,s[l]=e(d,l),l++;return{values:s,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=ev(o),{values:s,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,s;let d=this.ut??=[],p=[],u,b,f=0,x=i.length-1,v=0,k=s.length-1;for(;f<=x&&v<=k;)if(i[f]===null)f++;else if(i[x]===null)x--;else if(d[f]===l[v])p[v]=Oi(i[f],s[v]),f++,v++;else if(d[x]===l[k])p[k]=Oi(i[x],s[k]),x--,k--;else if(d[f]===l[k])p[k]=Oi(i[f],s[k]),fa(o,p[k+1],i[f]),f++,k--;else if(d[x]===l[v])p[v]=Oi(i[x],s[v]),fa(o,i[f],i[x]),x--,v++;else if(u===void 0&&(u=_x(l,v,k),b=_x(d,f,x)),u.has(d[f]))if(u.has(d[x])){let L=b.get(l[v]),P=L!==void 0?i[L]:null;if(P===null){let U=fa(o,i[f]);Oi(U,s[v]),p[v]=U}else p[v]=Oi(P,s[v]),fa(o,i[f],P),i[L]=null;v++}else Fh(i[x]),x--;else Fh(i[f]),f++;for(;v<=k;){let L=fa(o,p[k+1]);Oi(L,s[v]),p[v++]=L}for(;f<=x;){let L=i[f++];L!==null&&Fh(L)}return this.ut=l,Bh(o,p),Pe}});function Cx(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),s=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return s(1);case"ArrowLeft":return s(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var ye,mt,ut,Rs=class{constructor(n){m(this,ye);m(this,mt,null);m(this,ut,null);g(this,ye,n)}get active(){return r(this,mt)!==null}get from(){return r(this,mt)&&{...r(this,mt)}}get target(){return r(this,ut)&&{...r(this,ut)}}groupCount(){return r(this,ye).groupCount()}slotCount(n){return n>=0&&n<r(this,ye).groupCount()?r(this,ye).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,mt,{...n}),g(this,ut,{...n}),r(this,ye).onTarget?.(this.target),r(this,ye).announce(r(this,ye).messages.pickedUp(this.target))}moveTo(n){if(!r(this,ut))return;let e=Math.max(0,Math.min(n.group,r(this,ye).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,ut,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,ye).onTarget?.(this.target),r(this,ye).announce(r(this,ye).messages.over(this.target)))}drop(){if(!r(this,mt)||!r(this,ut))return;let n=r(this,mt),e=r(this,ut);g(this,mt,g(this,ut,null)),r(this,ye).onTarget?.(null),r(this,ye).onDrop(n,e)}cancel(n=!1){if(!r(this,mt))return;let e=r(this,mt),t=n?"":r(this,ye).messages.cancelled(e);g(this,mt,g(this,ut,null)),r(this,ye).onTarget?.(null),r(this,ye).onCancel?.(e),t&&r(this,ye).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(r(this,ye).navigate??Cx)(e,r(this,ut),this);return t?(this.moveTo(t),!0):!1}};ye=new WeakMap,mt=new WeakMap,ut=new WeakMap;var td,Ds,Hs=class{constructor(n=document,e="assertive"){m(this,td);m(this,Ds);let t=n.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return r(this,Ds)??this.element.textContent??""}announce(n){clearTimeout(r(this,td)),this.element.textContent===n?(this.element.textContent="",g(this,Ds,n),g(this,td,setTimeout(()=>{this.element.textContent=n,g(this,Ds,void 0)},50))):(g(this,Ds,void 0),this.element.textContent=n)}};td=new WeakMap,Ds=new WeakMap;var G_=z("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),Y_=z("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),X_=z("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."}),Y0="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",id,Vm,zx,Ns=class extends C{constructor(){super(...arguments);m(this,Vm);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";m(this,id,N("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return c`<div class="card" part="card">
2971
2971
  ${this.locked?h:c`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
2972
- aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,td)}-help"></div>`}
2972
+ aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,id)}-help"></div>`}
2973
2973
  <div class="content">
2974
2974
  <div class="head">
2975
2975
  <div class="title" part="title"><slot name="heading" @slotchange=${()=>this.requestUpdate()}>${this.href?c`<a href=${this.href} tabindex="-1">${this.heading}</a>`:this.heading}</slot></div>
@@ -2977,11 +2977,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
2977
2977
  <slot name="actions"></slot>
2978
2978
  </div>
2979
2979
  <div class="lines"><slot></slot></div>
2980
- <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>a(this,Fm,Cx).call(this,i,"_badges")}></slot></div>
2980
+ <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>a(this,Vm,zx).call(this,i,"_badges")}></slot></div>
2981
2981
  </div>
2982
2982
  ${t?c`<cm-spinner class="spin" size="small" accessible-label=${this.t("saving")} aria-hidden="true"></cm-spinner>`:h}
2983
- <span id="${r(this,td)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
2984
- </div>`}};td=new WeakMap,Fm=new WeakSet,Cx=function(e,t){this[t]=e.target.assignedElements({flatten:!0}).length>0},Hs.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Hs.properties={value:{reflect:!0},label:{},heading:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0},_badges:{state:!0},_slottedTitle:{state:!0}},Hs.styles=[E,w`
2983
+ <span id="${r(this,id)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
2984
+ </div>`}};id=new WeakMap,Vm=new WeakSet,zx=function(e,t){this[t]=e.target.assignedElements({flatten:!0}).length>0},Ns.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Ns.properties={value:{reflect:!0},label:{},heading:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0},_badges:{state:!0},_slottedTitle:{state:!0}},Ns.styles=[E,w`
2985
2985
  :host { display: block; position: relative; -webkit-touch-callout: none; font-size: 14px; line-height: 20px; }
2986
2986
  .card {
2987
2987
  position: relative; display: block; padding: var(--cm-space-12) var(--cm-space-12); background: var(--cm-bg-surface);
@@ -3006,22 +3006,22 @@ cm-data-table:has(> table) { container-type: inline-size; }
3006
3006
  :host([moving]) .content { opacity: 0.5; }
3007
3007
  :host([ghost]) .card { cursor: grabbing; box-shadow: var(--cm-shadow-lg); border-color: var(--cm-border-subtle); }
3008
3008
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
3009
- `];$("cm-board-card",Hs);var lo,id,co,ho,br,qm,zx,Ns=class extends C{constructor(){super(...arguments);m(this,br);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;m(this,lo,!1);this._cards=[];this._drop=null;m(this,id,new MutationObserver(()=>a(this,br,qm).call(this)));m(this,co,N("cm-col"));m(this,ho,!1)}get collapsed(){return r(this,lo)}connectedCallback(){super.connectedCallback(),a(this,br,qm).call(this),r(this,id).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,id).disconnect()}get cards(){return[...this.children].filter(e=>e.localName==="cm-board-card"&&!e.hasAttribute("slot"))}get key(){return this.value||this.heading}get count(){return typeof this.total=="number"&&!Number.isNaN(this.total)?this.total:this._cards.length}get scrollElement(){return this.renderRoot?.querySelector(".scroll")??null}_sync(){return a(this,br,qm).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,lo,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",r(this,lo)),g(this,ho,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let s=this._cards[Number(i.dataset.i)];s?i.assign(s):i.assign()});let t=i=>[...this.children].filter(s=>s.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),r(this,ho)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,ho,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,s=t?e.filter(v=>v!==t.card):e,l=t?e.indexOf(t.card):-1,d=!!t&&!this.collapsed&&!(l>=0&&t.index===l),p=[];e.forEach((v,k)=>{d&&v!==t.card&&s.indexOf(v)===t.index&&p.push({key:"drop"}),p.push({key:v,card:v,i:k})}),d&&t.index>=s.length&&p.push({key:"drop"});let u=this.hasMore||i>e.length,b=this.loading,f=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),x=this.t("count",{count:i});return c`<section aria-labelledby="${r(this,co)}-h" class=${t&&this.collapsed?"over":""}>
3009
+ `];$("cm-board-card",Ns);var co,rd,ho,po,vr,Om,Sx,Ps=class extends C{constructor(){super(...arguments);m(this,vr);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;m(this,co,!1);this._cards=[];this._drop=null;m(this,rd,new MutationObserver(()=>a(this,vr,Om).call(this)));m(this,ho,N("cm-col"));m(this,po,!1)}get collapsed(){return r(this,co)}connectedCallback(){super.connectedCallback(),a(this,vr,Om).call(this),r(this,rd).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,rd).disconnect()}get cards(){return[...this.children].filter(e=>e.localName==="cm-board-card"&&!e.hasAttribute("slot"))}get key(){return this.value||this.heading}get count(){return typeof this.total=="number"&&!Number.isNaN(this.total)?this.total:this._cards.length}get scrollElement(){return this.renderRoot?.querySelector(".scroll")??null}_sync(){return a(this,vr,Om).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,co,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",r(this,co)),g(this,po,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let s=this._cards[Number(i.dataset.i)];s?i.assign(s):i.assign()});let t=i=>[...this.children].filter(s=>s.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),r(this,po)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,po,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,s=t?e.filter(v=>v!==t.card):e,l=t?e.indexOf(t.card):-1,d=!!t&&!this.collapsed&&!(l>=0&&t.index===l),p=[];e.forEach((v,k)=>{d&&v!==t.card&&s.indexOf(v)===t.index&&p.push({key:"drop"}),p.push({key:v,card:v,i:k})}),d&&t.index>=s.length&&p.push({key:"drop"});let u=this.hasMore||i>e.length,b=this.loading,f=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),x=this.t("count",{count:i});return c`<section aria-labelledby="${r(this,ho)}-h" class=${t&&this.collapsed?"over":""}>
3010
3010
  <header part="header">
3011
- <div class="title" id="${r(this,co)}-h" role="heading" aria-level=${f}>${this.heading}<span class="sr">, ${x}</span></div>
3011
+ <div class="title" id="${r(this,ho)}-h" role="heading" aria-level=${f}>${this.heading}<span class="sr">, ${x}</span></div>
3012
3012
  <span class="count" part="count" aria-hidden="true">${this.formatNumber(i)}</span>
3013
3013
  <span class="actions"><slot class="actions"></slot></span>
3014
3014
  </header>
3015
3015
  <div class="scroll">
3016
- <ul part="list" role="list" aria-labelledby="${r(this,co)}-h" aria-busy=${b?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
3017
- ${_x(p,v=>v.key,v=>v.card?c`<li><slot data-i=${v.i}></slot></li>`:c`<li class="drop" aria-hidden="true"><div style="min-height:${Math.max(40,t.height)}px">${t.card.name}</div></li>`)}
3016
+ <ul part="list" role="list" aria-labelledby="${r(this,ho)}-h" aria-busy=${b?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
3017
+ ${Tx(p,v=>v.key,v=>v.card?c`<li><slot data-i=${v.i}></slot></li>`:c`<li class="drop" aria-hidden="true"><div style="min-height:${Math.max(40,t.height)}px">${t.card.name}</div></li>`)}
3018
3018
  </ul>
3019
3019
  ${b&&!e.length&&!this.collapsed?c`<div class="loading" aria-hidden="true"><cm-skeleton variant="block"></cm-skeleton><cm-skeleton variant="block"></cm-skeleton></div>`:h}
3020
3020
  <div class="empty" ?hidden=${e.length>0||b||u||this.collapsed||d}><slot class="empty">${this.t("empty")}</slot></div>
3021
- ${u&&!this.collapsed?c`<div class="more"><cm-button part="more" size="medium" ?loading=${b} @click=${a(this,br,zx)}>${this.t("loadMore")}</cm-button></div>`:h}
3021
+ ${u&&!this.collapsed?c`<div class="more"><cm-button part="more" size="medium" ?loading=${b} @click=${a(this,vr,Sx)}>${this.t("loadMore")}</cm-button></div>`:h}
3022
3022
  </div>
3023
3023
  <span class="sr" role="status">${b?this.t("loading",{column:this.heading}):""}</span>
3024
- </section>`}};lo=new WeakMap,id=new WeakMap,co=new WeakMap,ho=new WeakMap,br=new WeakSet,qm=function(){this._cards=this.cards},zx=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{detail:{column:this,value:this.key},bubbles:!0,composed:!0}))},Ns.shadowRootOptions={...A.shadowRootOptions,slotAssignment:"manual"},Ns.properties={value:{reflect:!0},heading:{},total:{type:Number},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},_cards:{state:!0},_drop:{state:!0}},Ns.styles=[E,w`
3024
+ </section>`}};co=new WeakMap,rd=new WeakMap,ho=new WeakMap,po=new WeakMap,vr=new WeakSet,Om=function(){this._cards=this.cards},Sx=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{detail:{column:this,value:this.key},bubbles:!0,composed:!0}))},Ps.shadowRootOptions={...A.shadowRootOptions,slotAssignment:"manual"},Ps.properties={value:{reflect:!0},heading:{},total:{type:Number},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},_cards:{state:!0},_drop:{state:!0}},Ps.styles=[E,w`
3025
3025
  :host {
3026
3026
  display: flex; flex-direction: column; flex: none; min-height: 0; max-height: 100%;
3027
3027
  inline-size: var(--cm-board-column-width, 272px);
@@ -3058,9 +3058,9 @@ cm-data-table:has(> table) { container-type: inline-size; }
3058
3058
  :host([collapsed]) .scroll { padding: 0; overflow: hidden; }
3059
3059
  :host([collapsed]) .actions { display: none; }
3060
3060
  :host([collapsed]) section.over { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; }
3061
- `];$("cm-board-column",Ns);var Xe,Oe,ke,Ps,ce,I,Tf,no,Sx,Cf,Lx,Ax,Dx,Rx,rd,Hx,sd,zf,Sf,Lf,Om,Nx,ad,nd,od,ld,cd,dd,hd,Af,Df,Bm,Px,fr,oo=class extends C{constructor(){super();m(this,I);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;m(this,Xe,new Rs);m(this,Oe);m(this,ke,null);m(this,Ps,new WeakMap);m(this,ce,null);m(this,rd,e=>{if(r(this,ce)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=se(e,this);if(r(this,Oe).active){r(this,Oe).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=a(this,I,Rx).call(this,e.composedPath());if(!(!i||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===" ")e.preventDefault(),this.pickUp(i);else if(e.key==="Enter")i.open()&&e.preventDefault();else if(t.startsWith("Arrow")){let s=a(this,I,Hx).call(this,i,t);s&&(e.preventDefault(),s.focusHandle())}}});m(this,sd,e=>{if(!r(this,Oe).active||!r(this,ke))return;let t=e.relatedTarget;t&&(t===r(this,ke).card||r(this,ke).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{r(this,Oe).active&&r(this,ke)&&!r(this,ke).card.matches(":focus-within")&&r(this,Oe).cancel()})});m(this,ad,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});m(this,nd,e=>{if(r(this,ce)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(d=>d.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(d=>d instanceof Element&&d!==i&&d.matches?.(G0)))return;let s=a(this,I,no).call(this,i);if(!s)return;r(this,Oe).active&&r(this,Oe).cancel();let l=i.getBoundingClientRect();g(this,ce,{card:i,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,dx:e.clientX-l.left,dy:e.clientY-l.top,width:l.width,height:l.height,from:s.column,fromIndex:s.index}),e.pointerType!=="mouse"&&(r(this,ce).timer=setTimeout(()=>{r(this,ce)&&!r(this,ce).started&&a(this,I,Af).call(this)},300)),window.addEventListener("pointermove",r(this,cd),!0),window.addEventListener("pointerup",r(this,dd),!0),window.addEventListener("pointercancel",r(this,hd),!0),window.addEventListener("touchmove",r(this,od),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,ld),!0)});m(this,od,e=>{r(this,ce)?.started&&e.cancelable&&e.preventDefault()});m(this,ld,e=>{r(this,ce)&&e.preventDefault()});m(this,cd,e=>{let t=r(this,ce);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,I,Af).call(this):a(this,I,fr).call(this,!1));return}e.preventDefault(),a(this,I,Df).call(this),a(this,I,Bm).call(this)}});m(this,dd,e=>{let t=r(this,ce);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,I,fr).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,I,fr).call(this,!0)});m(this,hd,e=>{r(this,ce)&&e.pointerId===r(this,ce).pointerId&&a(this,I,fr).call(this,!1)});g(this,Oe,new Ds({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!r(this,ke)?0:t.cards.filter(i=>i!==r(this,ke).card).length+1},onTarget:e=>a(this,I,Lx).call(this,e),onDrop:(e,t)=>a(this,I,Dx).call(this,e,t),onCancel:()=>a(this,I,Cf).call(this),messages:{pickedUp:e=>a(this,I,Tf).call(this,"pickedUp",e),over:e=>a(this,I,Tf).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:r(this,ke)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>r(this,Xe).announce(e)}))}get columns(){return[...this.children].filter(e=>e.localName==="cm-board-column")}column(e){return this.columns.find(t=>t.key===e)}card(e){for(let t of this.columns){let i=t.cards.find(s=>s.key===e);if(i)return i}}get heldCard(){return r(this,ke)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,rd)),this.addEventListener("focusout",r(this,sd)),this.addEventListener("pointerdown",r(this,nd)),this.addEventListener("dragstart",r(this,ad))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,rd)),this.removeEventListener("focusout",r(this,sd)),this.removeEventListener("pointerdown",r(this,nd)),this.removeEventListener("dragstart",r(this,ad)),r(this,Oe).cancel(!0),a(this,I,fr).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(r(this,Xe).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return r(this,Xe).text}announce(e){r(this,Xe).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=a(this,I,no).call(this,t);return i?(a(this,I,fr).call(this,!1),r(this,Oe).cancel(!0),g(this,ke,{card:t,column:i.column,index:i.index}),t.moving=!0,a(this,I,Sx).call(this,t),r(this,Oe).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=r(this,ce);e?.started&&(a(this,I,fr).call(this,!1),r(this,Xe).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),r(this,Oe).cancel()}moveCard(e,t,i){let s=typeof e=="string"?this.card(e):e,l=typeof t=="string"?this.column(t):t;if(!s||!l)return!1;let d=a(this,I,no).call(this,s);if(!d)return!1;let p=l.cards.filter(b=>b!==s).length,u=Math.max(0,Math.min(i??p,p));return a(this,I,Om).call(this,s,d.column,d.index,l,u,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Ps).get(t);if(this.controlled||!i||(r(this,Ps).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let s=t.matches(":focus-within");return a(this,I,Sf).call(this,t,i.from,i.fromIndex),i.totals&&a(this,I,Lf).call(this,i.to,i.from),a(this,I,zf).call(this,i.to,i.from,s?t:null),r(this,Xe).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return c`<div class="board" role="group" aria-label=${this.label}>
3061
+ `];$("cm-board-column",Ps);var Xe,Oe,ke,Is,ce,I,Cf,oo,Lx,zf,Ax,Dx,Rx,Hx,sd,Nx,ad,Sf,Lf,Af,Bm,Px,nd,od,ld,cd,dd,hd,pd,Df,Rf,Fm,Ix,br,lo=class extends C{constructor(){super();m(this,I);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;m(this,Xe,new Hs);m(this,Oe);m(this,ke,null);m(this,Is,new WeakMap);m(this,ce,null);m(this,sd,e=>{if(r(this,ce)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=se(e,this);if(r(this,Oe).active){r(this,Oe).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=a(this,I,Hx).call(this,e.composedPath());if(!(!i||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===" ")e.preventDefault(),this.pickUp(i);else if(e.key==="Enter")i.open()&&e.preventDefault();else if(t.startsWith("Arrow")){let s=a(this,I,Nx).call(this,i,t);s&&(e.preventDefault(),s.focusHandle())}}});m(this,ad,e=>{if(!r(this,Oe).active||!r(this,ke))return;let t=e.relatedTarget;t&&(t===r(this,ke).card||r(this,ke).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{r(this,Oe).active&&r(this,ke)&&!r(this,ke).card.matches(":focus-within")&&r(this,Oe).cancel()})});m(this,nd,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});m(this,od,e=>{if(r(this,ce)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(d=>d.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(d=>d instanceof Element&&d!==i&&d.matches?.(Y0)))return;let s=a(this,I,oo).call(this,i);if(!s)return;r(this,Oe).active&&r(this,Oe).cancel();let l=i.getBoundingClientRect();g(this,ce,{card:i,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,dx:e.clientX-l.left,dy:e.clientY-l.top,width:l.width,height:l.height,from:s.column,fromIndex:s.index}),e.pointerType!=="mouse"&&(r(this,ce).timer=setTimeout(()=>{r(this,ce)&&!r(this,ce).started&&a(this,I,Df).call(this)},300)),window.addEventListener("pointermove",r(this,dd),!0),window.addEventListener("pointerup",r(this,hd),!0),window.addEventListener("pointercancel",r(this,pd),!0),window.addEventListener("touchmove",r(this,ld),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,cd),!0)});m(this,ld,e=>{r(this,ce)?.started&&e.cancelable&&e.preventDefault()});m(this,cd,e=>{r(this,ce)&&e.preventDefault()});m(this,dd,e=>{let t=r(this,ce);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,I,Df).call(this):a(this,I,br).call(this,!1));return}e.preventDefault(),a(this,I,Rf).call(this),a(this,I,Fm).call(this)}});m(this,hd,e=>{let t=r(this,ce);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,I,br).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,I,br).call(this,!0)});m(this,pd,e=>{r(this,ce)&&e.pointerId===r(this,ce).pointerId&&a(this,I,br).call(this,!1)});g(this,Oe,new Rs({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!r(this,ke)?0:t.cards.filter(i=>i!==r(this,ke).card).length+1},onTarget:e=>a(this,I,Ax).call(this,e),onDrop:(e,t)=>a(this,I,Rx).call(this,e,t),onCancel:()=>a(this,I,zf).call(this),messages:{pickedUp:e=>a(this,I,Cf).call(this,"pickedUp",e),over:e=>a(this,I,Cf).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:r(this,ke)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>r(this,Xe).announce(e)}))}get columns(){return[...this.children].filter(e=>e.localName==="cm-board-column")}column(e){return this.columns.find(t=>t.key===e)}card(e){for(let t of this.columns){let i=t.cards.find(s=>s.key===e);if(i)return i}}get heldCard(){return r(this,ke)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,sd)),this.addEventListener("focusout",r(this,ad)),this.addEventListener("pointerdown",r(this,od)),this.addEventListener("dragstart",r(this,nd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,sd)),this.removeEventListener("focusout",r(this,ad)),this.removeEventListener("pointerdown",r(this,od)),this.removeEventListener("dragstart",r(this,nd)),r(this,Oe).cancel(!0),a(this,I,br).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(r(this,Xe).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return r(this,Xe).text}announce(e){r(this,Xe).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=a(this,I,oo).call(this,t);return i?(a(this,I,br).call(this,!1),r(this,Oe).cancel(!0),g(this,ke,{card:t,column:i.column,index:i.index}),t.moving=!0,a(this,I,Lx).call(this,t),r(this,Oe).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=r(this,ce);e?.started&&(a(this,I,br).call(this,!1),r(this,Xe).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),r(this,Oe).cancel()}moveCard(e,t,i){let s=typeof e=="string"?this.card(e):e,l=typeof t=="string"?this.column(t):t;if(!s||!l)return!1;let d=a(this,I,oo).call(this,s);if(!d)return!1;let p=l.cards.filter(b=>b!==s).length,u=Math.max(0,Math.min(i??p,p));return a(this,I,Bm).call(this,s,d.column,d.index,l,u,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Is).get(t);if(this.controlled||!i||(r(this,Is).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let s=t.matches(":focus-within");return a(this,I,Lf).call(this,t,i.from,i.fromIndex),i.totals&&a(this,I,Af).call(this,i.to,i.from),a(this,I,Sf).call(this,i.to,i.from,s?t:null),r(this,Xe).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return c`<div class="board" role="group" aria-label=${this.label}>
3062
3062
  <div class="columns" part="columns"><slot @slotchange=${()=>this.requestUpdate()}></slot></div>
3063
- </div>`}};Xe=new WeakMap,Oe=new WeakMap,ke=new WeakMap,Ps=new WeakMap,ce=new WeakMap,I=new WeakSet,Tf=function(e,t){let i=this.columns[t.group];return this.t(e,{card:r(this,ke)?.card.name??"",column:i?.heading??"",position:t.index+1,count:r(this,Oe).slotCount(t.group)})},no=function(e){let t=this.columns,i=t.findIndex(s=>s.contains(e)&&e.parentElement===s);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},Sx=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{r(this,ke)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},Cf=function(){r(this,ke)&&(r(this,ke).card.moving=!1),g(this,ke,null)},Lx=function(e){let t=r(this,ke);if(this.columns.forEach((i,s)=>{i._drop=t&&e&&s===e.group?{card:t.card,index:e.index,height:t.card.getBoundingClientRect().height}:null}),e){let i=this.columns[e.group];i?.updateComplete.then(()=>{let s=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);a(this,I,Ax).call(this,i,s)})}},Ax=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let l=i.getBoundingClientRect(),d=e.getBoundingClientRect();d.left<l.left?i.scrollLeft-=l.left-d.left+8:d.right>l.right&&(i.scrollLeft+=d.right-l.right+8)}let s=e.scrollElement;if(s){let l=s.getBoundingClientRect(),d=t.getBoundingClientRect();d.top<l.top?s.scrollTop-=l.top-d.top+8:d.bottom>l.bottom&&(s.scrollTop+=d.bottom-l.bottom+8)}},Dx=function(e,t){let i=r(this,ke);if(a(this,I,Cf).call(this),!i)return;let s=this.columns[t.group];a(this,I,Om).call(this,i.card,i.column,e.index,s,t.index,"keyboard")},Rx=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(s=>s.localName==="cm-board-card");return i&&a(this,I,no).call(this,i)?i:null},rd=new WeakMap,Hx=function(e,t){let i=a(this,I,no).call(this,e);if(!i)return null;let s=i.column.cards;if(t==="ArrowDown")return s[i.index+1]??null;if(t==="ArrowUp")return s[i.index-1]??null;let l=t==="ArrowRight"?1:-1,d=this.columns;for(let p=i.group+l;p>=0&&p<d.length;p+=l){let u=d[p].cards;if(u.length)return u[Math.min(i.index,u.length-1)]}return null},sd=new WeakMap,zf=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},Sf=function(e,t,i){let s=t.cards.filter(d=>d!==e),l=s[i];l?l.before(e):s.length?s[s.length-1].after(e):t.append(e)},Lf=function(e,t){e!==t&&(typeof e.total=="number"&&(e.total=Math.max(0,e.total-1)),typeof t.total=="number"&&(t.total=t.total+1))},Om=function(e,t,i,s,l,d){let p=e.name;if(t===s&&i===l)return d!=="api"&&r(this,Xe).announce(this.t("sameSpot",{card:p})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let u=[],b={value:e.key,card:e,from:t.key,to:s.key,fromColumn:t,toColumn:s,fromIndex:i,toIndex:l,source:d,waitUntil:v=>{u.push(Promise.resolve(v))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:b,bubbles:!0,composed:!0,cancelable:!0})))return r(this,Xe).announce(this.t("refused",{card:p,column:s.heading})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let x=s.cards.filter(v=>v!==e).length+1;if(this.controlled)d==="keyboard"&&a(this,I,Nx).call(this,e.key,s);else{let v=d==="keyboard"||e.matches(":focus-within");a(this,I,Sf).call(this,e,s,l);let k=t!==s;k&&a(this,I,Lf).call(this,t,s),r(this,Ps).set(e,{card:e,from:t,fromIndex:i,to:s,toIndex:l,totals:k}),a(this,I,zf).call(this,t,s,v?e:null)}return r(this,Xe).announce(this.t("moved",{card:p,column:s.heading,position:l+1,count:x})),u.length&&(e.pending=!0,Promise.all(u).then(()=>{e.pending=!1,this.controlled||r(this,Ps).delete(e)},()=>{e.pending=!1,this.controlled?r(this,Xe).announce(this.t("reverted",{card:p,column:t.heading})):this.revert(e)})),!0},Nx=function(e,t){let i=()=>t.isConnected?t.cards.find(d=>d.key===e):void 0,s=()=>{let d=i(),p=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!d||!(p||this.contains(document.activeElement))?!1:(t._sync().then(()=>d.updateComplete).then(()=>{d.isConnected&&d.focusHandle({preventScroll:!0})}),!0)},l=new MutationObserver(()=>{s()&&l.disconnect()});l.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>l.disconnect(),1e3)},ad=new WeakMap,nd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakMap,dd=new WeakMap,hd=new WeakMap,Af=function(){let e=r(this,ce);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges();let t=e.card.cloneNode(!0);t.removeAttribute("id"),t.removeAttribute("moving"),t.setAttribute("ghost",""),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""),Object.assign(t.style,{position:"fixed",zIndex:"2147483000",left:"0",top:"0",width:`${e.width}px`,margin:"0",pointerEvents:"none",willChange:"transform"}),(this.ownerDocument.body??this.ownerDocument.documentElement).appendChild(t),e.ghost=t,e.card.moving=!0,this.dragging=!0,e.to=e.from,e.toIndex=e.fromIndex,r(this,Xe).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),a(this,I,Df).call(this),a(this,I,Bm).call(this);let i=()=>{r(this,ce)?.started&&(a(this,I,Px).call(this),r(this,ce).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},Df=function(){let e=r(this,ce);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},Bm=function(){let e=r(this,ce);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],s=1/0;for(let u of t){let b=u.getBoundingClientRect(),f=e.x<b.left?b.left-e.x:e.x>b.right?e.x-b.right:0;f<s&&(i=u,s=f)}let l=i.cards.filter(u=>u!==e.card),d=l.length;if(i.collapsed)d=0;else for(let u=0;u<l.length;u++){let b=l[u].getBoundingClientRect();if(e.y<b.top+b.height/2){d=u;break}}if(i===e.to&&d===e.toIndex)return;let p=i!==e.to;e.to=i,e.toIndex=d,t.forEach(u=>{u._drop=u===i?{card:e.card,index:d,height:e.height}:null}),p&&r(this,Xe).announce(this.t("over",{column:i.heading,position:d+1,count:l.length+1}))},Px=function(){let e=r(this,ce);if(!e)return;let t=48,i=16,s=x=>x<t?Math.ceil((t-Math.max(x,0))/t*i):0,l=!1,d=this.renderRoot.querySelector(".columns");if(d){let x=d.getBoundingClientRect(),v=s(e.x-x.left),k=s(x.right-e.x),L=d.scrollLeft;v?d.scrollLeft-=v:k&&(d.scrollLeft+=k),l||=d.scrollLeft!==L}let p=e.to?.scrollElement;if(p&&p.scrollHeight>p.clientHeight){let x=p.getBoundingClientRect();if(e.x>=x.left&&e.x<=x.right){let v=s(e.y-x.top),k=s(x.bottom-e.y),L=p.scrollTop;v?p.scrollTop-=v:k&&(p.scrollTop+=k),l||=p.scrollTop!==L}}let u=window.innerHeight,b=s(e.y),f=s(u-e.y);if(b||f){let x=window.scrollY;window.scrollBy(0,b?-b:f),l||=window.scrollY!==x}l&&a(this,I,Bm).call(this)},fr=function(e){let t=r(this,ce);t&&(g(this,ce,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,cd),!0),window.removeEventListener("pointerup",r(this,dd),!0),window.removeEventListener("pointercancel",r(this,hd),!0),window.removeEventListener("touchmove",r(this,od),!0),window.removeEventListener("contextmenu",r(this,ld),!0),t.ghost?.remove(),t.started&&(t.card.moving=!1,this.dragging=!1,this.columns.forEach(i=>{i._drop=null}),e&&t.to&&t.toIndex!==void 0&&a(this,I,Om).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},oo.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},oo.styles=[E,w`
3063
+ </div>`}};Xe=new WeakMap,Oe=new WeakMap,ke=new WeakMap,Is=new WeakMap,ce=new WeakMap,I=new WeakSet,Cf=function(e,t){let i=this.columns[t.group];return this.t(e,{card:r(this,ke)?.card.name??"",column:i?.heading??"",position:t.index+1,count:r(this,Oe).slotCount(t.group)})},oo=function(e){let t=this.columns,i=t.findIndex(s=>s.contains(e)&&e.parentElement===s);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},Lx=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{r(this,ke)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},zf=function(){r(this,ke)&&(r(this,ke).card.moving=!1),g(this,ke,null)},Ax=function(e){let t=r(this,ke);if(this.columns.forEach((i,s)=>{i._drop=t&&e&&s===e.group?{card:t.card,index:e.index,height:t.card.getBoundingClientRect().height}:null}),e){let i=this.columns[e.group];i?.updateComplete.then(()=>{let s=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);a(this,I,Dx).call(this,i,s)})}},Dx=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let l=i.getBoundingClientRect(),d=e.getBoundingClientRect();d.left<l.left?i.scrollLeft-=l.left-d.left+8:d.right>l.right&&(i.scrollLeft+=d.right-l.right+8)}let s=e.scrollElement;if(s){let l=s.getBoundingClientRect(),d=t.getBoundingClientRect();d.top<l.top?s.scrollTop-=l.top-d.top+8:d.bottom>l.bottom&&(s.scrollTop+=d.bottom-l.bottom+8)}},Rx=function(e,t){let i=r(this,ke);if(a(this,I,zf).call(this),!i)return;let s=this.columns[t.group];a(this,I,Bm).call(this,i.card,i.column,e.index,s,t.index,"keyboard")},Hx=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(s=>s.localName==="cm-board-card");return i&&a(this,I,oo).call(this,i)?i:null},sd=new WeakMap,Nx=function(e,t){let i=a(this,I,oo).call(this,e);if(!i)return null;let s=i.column.cards;if(t==="ArrowDown")return s[i.index+1]??null;if(t==="ArrowUp")return s[i.index-1]??null;let l=t==="ArrowRight"?1:-1,d=this.columns;for(let p=i.group+l;p>=0&&p<d.length;p+=l){let u=d[p].cards;if(u.length)return u[Math.min(i.index,u.length-1)]}return null},ad=new WeakMap,Sf=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},Lf=function(e,t,i){let s=t.cards.filter(d=>d!==e),l=s[i];l?l.before(e):s.length?s[s.length-1].after(e):t.append(e)},Af=function(e,t){e!==t&&(typeof e.total=="number"&&(e.total=Math.max(0,e.total-1)),typeof t.total=="number"&&(t.total=t.total+1))},Bm=function(e,t,i,s,l,d){let p=e.name;if(t===s&&i===l)return d!=="api"&&r(this,Xe).announce(this.t("sameSpot",{card:p})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let u=[],b={value:e.key,card:e,from:t.key,to:s.key,fromColumn:t,toColumn:s,fromIndex:i,toIndex:l,source:d,waitUntil:v=>{u.push(Promise.resolve(v))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:b,bubbles:!0,composed:!0,cancelable:!0})))return r(this,Xe).announce(this.t("refused",{card:p,column:s.heading})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let x=s.cards.filter(v=>v!==e).length+1;if(this.controlled)d==="keyboard"&&a(this,I,Px).call(this,e.key,s);else{let v=d==="keyboard"||e.matches(":focus-within");a(this,I,Lf).call(this,e,s,l);let k=t!==s;k&&a(this,I,Af).call(this,t,s),r(this,Is).set(e,{card:e,from:t,fromIndex:i,to:s,toIndex:l,totals:k}),a(this,I,Sf).call(this,t,s,v?e:null)}return r(this,Xe).announce(this.t("moved",{card:p,column:s.heading,position:l+1,count:x})),u.length&&(e.pending=!0,Promise.all(u).then(()=>{e.pending=!1,this.controlled||r(this,Is).delete(e)},()=>{e.pending=!1,this.controlled?r(this,Xe).announce(this.t("reverted",{card:p,column:t.heading})):this.revert(e)})),!0},Px=function(e,t){let i=()=>t.isConnected?t.cards.find(d=>d.key===e):void 0,s=()=>{let d=i(),p=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!d||!(p||this.contains(document.activeElement))?!1:(t._sync().then(()=>d.updateComplete).then(()=>{d.isConnected&&d.focusHandle({preventScroll:!0})}),!0)},l=new MutationObserver(()=>{s()&&l.disconnect()});l.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>l.disconnect(),1e3)},nd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakMap,dd=new WeakMap,hd=new WeakMap,pd=new WeakMap,Df=function(){let e=r(this,ce);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges();let t=e.card.cloneNode(!0);t.removeAttribute("id"),t.removeAttribute("moving"),t.setAttribute("ghost",""),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""),Object.assign(t.style,{position:"fixed",zIndex:"2147483000",left:"0",top:"0",width:`${e.width}px`,margin:"0",pointerEvents:"none",willChange:"transform"}),(this.ownerDocument.body??this.ownerDocument.documentElement).appendChild(t),e.ghost=t,e.card.moving=!0,this.dragging=!0,e.to=e.from,e.toIndex=e.fromIndex,r(this,Xe).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),a(this,I,Rf).call(this),a(this,I,Fm).call(this);let i=()=>{r(this,ce)?.started&&(a(this,I,Ix).call(this),r(this,ce).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},Rf=function(){let e=r(this,ce);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},Fm=function(){let e=r(this,ce);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],s=1/0;for(let u of t){let b=u.getBoundingClientRect(),f=e.x<b.left?b.left-e.x:e.x>b.right?e.x-b.right:0;f<s&&(i=u,s=f)}let l=i.cards.filter(u=>u!==e.card),d=l.length;if(i.collapsed)d=0;else for(let u=0;u<l.length;u++){let b=l[u].getBoundingClientRect();if(e.y<b.top+b.height/2){d=u;break}}if(i===e.to&&d===e.toIndex)return;let p=i!==e.to;e.to=i,e.toIndex=d,t.forEach(u=>{u._drop=u===i?{card:e.card,index:d,height:e.height}:null}),p&&r(this,Xe).announce(this.t("over",{column:i.heading,position:d+1,count:l.length+1}))},Ix=function(){let e=r(this,ce);if(!e)return;let t=48,i=16,s=x=>x<t?Math.ceil((t-Math.max(x,0))/t*i):0,l=!1,d=this.renderRoot.querySelector(".columns");if(d){let x=d.getBoundingClientRect(),v=s(e.x-x.left),k=s(x.right-e.x),L=d.scrollLeft;v?d.scrollLeft-=v:k&&(d.scrollLeft+=k),l||=d.scrollLeft!==L}let p=e.to?.scrollElement;if(p&&p.scrollHeight>p.clientHeight){let x=p.getBoundingClientRect();if(e.x>=x.left&&e.x<=x.right){let v=s(e.y-x.top),k=s(x.bottom-e.y),L=p.scrollTop;v?p.scrollTop-=v:k&&(p.scrollTop+=k),l||=p.scrollTop!==L}}let u=window.innerHeight,b=s(e.y),f=s(u-e.y);if(b||f){let x=window.scrollY;window.scrollBy(0,b?-b:f),l||=window.scrollY!==x}l&&a(this,I,Fm).call(this)},br=function(e){let t=r(this,ce);t&&(g(this,ce,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,dd),!0),window.removeEventListener("pointerup",r(this,hd),!0),window.removeEventListener("pointercancel",r(this,pd),!0),window.removeEventListener("touchmove",r(this,ld),!0),window.removeEventListener("contextmenu",r(this,cd),!0),t.ghost?.remove(),t.started&&(t.card.moving=!1,this.dragging=!1,this.columns.forEach(i=>{i._drop=null}),e&&t.to&&t.toIndex!==void 0&&a(this,I,Bm).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},lo.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},lo.styles=[E,w`
3064
3064
  :host { position: relative; display: block; container-type: inline-size; container-name: cm-board; min-width: 0; }
3065
3065
  .board { height: 100%; }
3066
3066
  .columns {
@@ -3074,60 +3074,60 @@ cm-data-table:has(> table) { container-type: inline-size; }
3074
3074
  ::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
3075
3075
  ::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
3076
3076
  }
3077
- `];$("cm-board",oo);var tT=z("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),uo=class extends A{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};uo.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},uo.styles=w`:host { display: none !important; }`;$("cm-calendar-event",uo);var Ym=o=>String(o).padStart(2,"0"),Ix=o=>`${B(o)}T${Ym(o.getHours())}:${Ym(o.getMinutes())}`,Vm=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),qx=["month","week","day"],Y0=600,Ox=new Map,Bx=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=Ox.get(e);return t||(t=new Intl.DateTimeFormat(o,n),Ox.set(e,t)),t},Rf=o=>o.replace(/[  ]/g," ").trim(),fo,Je,Qe,Ne,ae,ne,qs,Qt,ft,xd,xr,bo,vo,yo,xo,wd,y,Be,vr,pd,jm,Jt,Hf,md,It,Nf,Fx,qt,po,Vx,jx,gt,ud,gd,Um,Ux,Kx,Wx,Is,Pf,fd,Gx,bd,Yx,Xx,Jx,Qx,$d,kd,Zx,ew,Ed,vd,tw,If,qf,Of,iw,rw,Bf,Ff,Vf,Md,jf,sw,_d,Td,Cd,zd,Sd,Ld,Uf,Km,aw,yr,yd,nw,Kf,ow,Wm,Wf,mo,Gm,lw,cw,dw,hw,pw,go=class extends C{constructor(){super();m(this,y);this.view="month";this.date="";this.today="";this.step=15;m(this,fo,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;m(this,Je,N("cm-cal"));m(this,Qe,new Rs);m(this,Ne);m(this,ae,null);m(this,ne,null);m(this,qs,new WeakMap);m(this,Qt,"");m(this,ft,null);m(this,xd,"");m(this,xr,!0);m(this,bo,0);m(this,vo,!1);m(this,yo);m(this,xo,0);m(this,wd,new MutationObserver(()=>this.requestUpdate()));m(this,$d,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Qt,t.dataset.k);for(let i of a(this,y,bd).call(this))i.tabIndex=i===t?0:-1}});m(this,kd,e=>{let t=e.relatedTarget;if(this._more&&!r(this,ae)){let i=this.renderRoot.querySelector(".pop"),s=e.composedPath()[0];i&&i.contains(s)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,Ne).active||!r(this,ae)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,Ne).active||!r(this,ae))return;this.renderRoot.activeElement?.dataset.ev!==r(this,ae).ev.key&&r(this,Ne).cancel()}))});m(this,Ed,e=>{if(r(this,ne)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=se(e,this);if(r(this,Ne).active){r(this,Ne).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let s=i.closest(".pop");if(s&&e.key==="Escape"){e.preventDefault(),a(this,y,Wm).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,bo,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(s&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...s.querySelectorAll(".chip")],p=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];p&&(e.preventDefault(),p.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),a(this,y,ew).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,y,Zx).call(this,i,t);l?(e.preventDefault(),a(this,y,Qx).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});m(this,Md,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});m(this,_d,e=>{if(r(this,ne)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(p=>p.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),s=i&&a(this,y,po).call(this,i);if(!s||i.locked||i.pending)return;let l=a(this,y,qf).call(this,s,t.dataset.day??s.days[0]);if(!l)return;r(this,Ne).active&&r(this,Ne).cancel();let d=0;if(l.mode==="time"){let p=a(this,y,jf).call(this,e.clientX,e.clientY);p&&t.classList.contains("time")&&(d=Math.max(0,Math.min(s.dur,p.min-s.min)))}g(this,ne,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,ne).timer=setTimeout(()=>{r(this,ne)&&!r(this,ne).started&&a(this,y,Uf).call(this)},300)),window.addEventListener("pointermove",r(this,zd),!0),window.addEventListener("pointerup",r(this,Sd),!0),window.addEventListener("pointercancel",r(this,Ld),!0),window.addEventListener("touchmove",r(this,Td),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,Cd),!0)});m(this,Td,e=>{r(this,ne)?.started&&e.cancelable&&e.preventDefault()});m(this,Cd,e=>{r(this,ne)&&e.preventDefault()});m(this,zd,e=>{let t=r(this,ne);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,y,Uf).call(this):a(this,y,yr).call(this,!1));return}e.preventDefault(),a(this,y,Km).call(this)}});m(this,Sd,e=>{let t=r(this,ne);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,y,yr).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,y,yr).call(this,!0)});m(this,Ld,e=>{r(this,ne)&&e.pointerId===r(this,ne).pointerId&&a(this,y,yr).call(this,!1)});g(this,Ne,new Ds({groupCount:()=>a(this,y,qt).call(this).length,slotCount:()=>r(this,ae)?r(this,ae).mode==="day"?1:a(this,y,vd).call(this,r(this,ae).ev.dur):0,navigate:(e,t)=>a(this,y,tw).call(this,e,t),onTarget:e=>a(this,y,iw).call(this,e),onDrop:(e,t)=>a(this,y,rw).call(this,e,t),onCancel:()=>a(this,y,Of).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,ae)?.ev.name??"",place:a(this,y,Is).call(this,r(this,ae),e)}),over:e=>this.t("over",{place:a(this,y,Is).call(this,r(this,ae),e)}),cancelled:e=>this.t("cancelled",{event:r(this,ae)?.ev.name??"",place:a(this,y,Is).call(this,r(this,ae),e)})},announce:e=>r(this,Qe).announce(e)}))}get locale(){return r(this,fo)}set locale(e){let t=r(this,fo);g(this,fo,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=a(this,y,qt).call(this);return{view:r(this,y,Be),start:B(e[0]),end:B(e[e.length-1])}}get heldEvent(){return r(this,ae)?.ev.el??null}get announcement(){return r(this,Qe).text}announce(e){r(this,Qe).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,Ed)),this.addEventListener("focusin",r(this,$d)),this.addEventListener("focusout",r(this,kd)),this.addEventListener("pointerdown",r(this,_d)),this.addEventListener("dragstart",r(this,Md)),r(this,wd).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,yo,new ResizeObserver(()=>{cancelAnimationFrame(r(this,xo)),g(this,xo,requestAnimationFrame(()=>a(this,y,Pf).call(this)))})),r(this,yo).observe(this)),a(this,y,Pf).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,Ed)),this.removeEventListener("focusin",r(this,$d)),this.removeEventListener("focusout",r(this,kd)),this.removeEventListener("pointerdown",r(this,_d)),this.removeEventListener("dragstart",r(this,Md)),r(this,wd).disconnect(),r(this,yo)?.disconnect(),cancelAnimationFrame(r(this,xo)),r(this,Ne).cancel(!0),a(this,y,yr).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,xr,!0),e.get("view")!==void 0&&(this._more="",r(this,Ne).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Qe).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,xr,!0),a(this,y,Jx).call(this),r(this,ft)){let l=a(this,y,Yx).call(this,r(this,ft).key);l?(g(this,ft,null),l.focus({preventScroll:!1})):Date.now()>r(this,ft).until&&g(this,ft,null)}r(this,vo)&&(g(this,vo,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,xr)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,xr,!1)}t||g(this,xr,!0),r(this,ae)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,s=`${i.view}|${i.start}|${i.end}`;s!==r(this,xd)&&(g(this,xd,s),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=B(a(this,y,fd).call(this,r(this,y,It),-1))}next(){this.date=B(a(this,y,fd).call(this,r(this,y,It),1))}goToToday(){this.date=r(this,y,md)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let s=a(this,y,po).call(this,i);if(!s)return!1;let l=a(this,y,qt).call(this).map(B),d=t&&s.days.includes(t)&&l.includes(t)?t:s.days.find(b=>l.includes(b));if(!d)return!1;let p=a(this,y,qf).call(this,s,d);if(!p)return!1;a(this,y,yr).call(this,!1),r(this,Ne).cancel(!0),this._more="",g(this,ae,p),i.moving=!0;let u=`ev:${s.key}:${d}`;return g(this,Qt,u),g(this,ft,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,Ne).pickUp(p.from),!0}cancelMove(){let e=r(this,ne);e?.started&&(a(this,y,yr).call(this,!1),r(this,Qe).announce(this.t("cancelled",{event:e.ev.name,place:a(this,y,Is).call(this,e,e.from)}))),r(this,Ne).cancel()}moveEvent(e,t,i){let s=typeof e=="string"?this.event(e):e,l=s&&a(this,y,po).call(this,s);if(!l)return!1;let d=l.allDay?R(xt(t).date||t):Ut(t);if(!d)return!1;let p=i?l.allDay?R(xt(i).date||i):Ut(i):null;return(!p||p<d)&&(p=l.allDay?te(d,Vm(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,y,Vf).call(this,l,d,p,"api",!1,B(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,qs).get(t);if(this.controlled||!i)return!1;r(this,qs).delete(t);let s=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=a(this,y,po).call(this,t);return l&&s&&g(this,ft,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Qe).announce(this.t("reverted",{event:t.name,place:l?a(this,y,Um).call(this,l):i.start})),!0}render(){let e=a(this,y,qt).call(this),t=a(this,y,jx).call(this,a(this,y,Vx).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
3078
- ${a(this,y,lw).call(this,e)}
3079
- ${r(this,y,Be)==="month"?a(this,y,dw).call(this,e,t):a(this,y,pw).call(this,e,t)}
3077
+ `];$("cm-board",lo);var sT=z("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),go=class extends A{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};go.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},go.styles=w`:host { display: none !important; }`;$("cm-calendar-event",go);var Xm=o=>String(o).padStart(2,"0"),qx=o=>`${B(o)}T${Xm(o.getHours())}:${Xm(o.getMinutes())}`,jm=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),Ox=["month","week","day"],X0=600,Bx=new Map,Fx=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=Bx.get(e);return t||(t=new Intl.DateTimeFormat(o,n),Bx.set(e,t)),t},Hf=o=>o.replace(/[  ]/g," ").trim(),bo,Je,Qe,Ne,ae,ne,Os,Zt,ft,wd,wr,vo,yo,xo,wo,$d,y,Be,yr,md,Um,Qt,Nf,ud,qt,Pf,Vx,Ot,mo,jx,Ux,gt,gd,fd,Km,Kx,Wx,Gx,qs,If,bd,Yx,vd,Xx,Jx,Qx,Zx,kd,Ed,ew,tw,Md,yd,iw,qf,Of,Bf,rw,sw,Ff,Vf,jf,_d,Uf,aw,Td,Cd,zd,Sd,Ld,Ad,Kf,Wm,nw,xr,xd,ow,Wf,lw,Gm,Gf,uo,Ym,cw,dw,hw,pw,mw,fo=class extends C{constructor(){super();m(this,y);this.view="month";this.date="";this.today="";this.step=15;m(this,bo,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;m(this,Je,N("cm-cal"));m(this,Qe,new Hs);m(this,Ne);m(this,ae,null);m(this,ne,null);m(this,Os,new WeakMap);m(this,Zt,"");m(this,ft,null);m(this,wd,"");m(this,wr,!0);m(this,vo,0);m(this,yo,!1);m(this,xo);m(this,wo,0);m(this,$d,new MutationObserver(()=>this.requestUpdate()));m(this,kd,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Zt,t.dataset.k);for(let i of a(this,y,vd).call(this))i.tabIndex=i===t?0:-1}});m(this,Ed,e=>{let t=e.relatedTarget;if(this._more&&!r(this,ae)){let i=this.renderRoot.querySelector(".pop"),s=e.composedPath()[0];i&&i.contains(s)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,Ne).active||!r(this,ae)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,Ne).active||!r(this,ae))return;this.renderRoot.activeElement?.dataset.ev!==r(this,ae).ev.key&&r(this,Ne).cancel()}))});m(this,Md,e=>{if(r(this,ne)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=se(e,this);if(r(this,Ne).active){r(this,Ne).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let s=i.closest(".pop");if(s&&e.key==="Escape"){e.preventDefault(),a(this,y,Gm).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,vo,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(s&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...s.querySelectorAll(".chip")],p=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];p&&(e.preventDefault(),p.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),a(this,y,tw).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,y,ew).call(this,i,t);l?(e.preventDefault(),a(this,y,Zx).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});m(this,_d,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});m(this,Td,e=>{if(r(this,ne)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(p=>p.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),s=i&&a(this,y,mo).call(this,i);if(!s||i.locked||i.pending)return;let l=a(this,y,Of).call(this,s,t.dataset.day??s.days[0]);if(!l)return;r(this,Ne).active&&r(this,Ne).cancel();let d=0;if(l.mode==="time"){let p=a(this,y,Uf).call(this,e.clientX,e.clientY);p&&t.classList.contains("time")&&(d=Math.max(0,Math.min(s.dur,p.min-s.min)))}g(this,ne,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,ne).timer=setTimeout(()=>{r(this,ne)&&!r(this,ne).started&&a(this,y,Kf).call(this)},300)),window.addEventListener("pointermove",r(this,Sd),!0),window.addEventListener("pointerup",r(this,Ld),!0),window.addEventListener("pointercancel",r(this,Ad),!0),window.addEventListener("touchmove",r(this,Cd),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,zd),!0)});m(this,Cd,e=>{r(this,ne)?.started&&e.cancelable&&e.preventDefault()});m(this,zd,e=>{r(this,ne)&&e.preventDefault()});m(this,Sd,e=>{let t=r(this,ne);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?a(this,y,Kf).call(this):a(this,y,xr).call(this,!1));return}e.preventDefault(),a(this,y,Wm).call(this)}});m(this,Ld,e=>{let t=r(this,ne);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,y,xr).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,y,xr).call(this,!0)});m(this,Ad,e=>{r(this,ne)&&e.pointerId===r(this,ne).pointerId&&a(this,y,xr).call(this,!1)});g(this,Ne,new Rs({groupCount:()=>a(this,y,Ot).call(this).length,slotCount:()=>r(this,ae)?r(this,ae).mode==="day"?1:a(this,y,yd).call(this,r(this,ae).ev.dur):0,navigate:(e,t)=>a(this,y,iw).call(this,e,t),onTarget:e=>a(this,y,rw).call(this,e),onDrop:(e,t)=>a(this,y,sw).call(this,e,t),onCancel:()=>a(this,y,Bf).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,ae)?.ev.name??"",place:a(this,y,qs).call(this,r(this,ae),e)}),over:e=>this.t("over",{place:a(this,y,qs).call(this,r(this,ae),e)}),cancelled:e=>this.t("cancelled",{event:r(this,ae)?.ev.name??"",place:a(this,y,qs).call(this,r(this,ae),e)})},announce:e=>r(this,Qe).announce(e)}))}get locale(){return r(this,bo)}set locale(e){let t=r(this,bo);g(this,bo,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=a(this,y,Ot).call(this);return{view:r(this,y,Be),start:B(e[0]),end:B(e[e.length-1])}}get heldEvent(){return r(this,ae)?.ev.el??null}get announcement(){return r(this,Qe).text}announce(e){r(this,Qe).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,Md)),this.addEventListener("focusin",r(this,kd)),this.addEventListener("focusout",r(this,Ed)),this.addEventListener("pointerdown",r(this,Td)),this.addEventListener("dragstart",r(this,_d)),r(this,$d).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,xo,new ResizeObserver(()=>{cancelAnimationFrame(r(this,wo)),g(this,wo,requestAnimationFrame(()=>a(this,y,If).call(this)))})),r(this,xo).observe(this)),a(this,y,If).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,Md)),this.removeEventListener("focusin",r(this,kd)),this.removeEventListener("focusout",r(this,Ed)),this.removeEventListener("pointerdown",r(this,Td)),this.removeEventListener("dragstart",r(this,_d)),r(this,$d).disconnect(),r(this,xo)?.disconnect(),cancelAnimationFrame(r(this,wo)),r(this,Ne).cancel(!0),a(this,y,xr).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,wr,!0),e.get("view")!==void 0&&(this._more="",r(this,Ne).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Qe).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,wr,!0),a(this,y,Qx).call(this),r(this,ft)){let l=a(this,y,Xx).call(this,r(this,ft).key);l?(g(this,ft,null),l.focus({preventScroll:!1})):Date.now()>r(this,ft).until&&g(this,ft,null)}r(this,yo)&&(g(this,yo,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,wr)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,wr,!1)}t||g(this,wr,!0),r(this,ae)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,s=`${i.view}|${i.start}|${i.end}`;s!==r(this,wd)&&(g(this,wd,s),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=B(a(this,y,bd).call(this,r(this,y,qt),-1))}next(){this.date=B(a(this,y,bd).call(this,r(this,y,qt),1))}goToToday(){this.date=r(this,y,ud)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let s=a(this,y,mo).call(this,i);if(!s)return!1;let l=a(this,y,Ot).call(this).map(B),d=t&&s.days.includes(t)&&l.includes(t)?t:s.days.find(b=>l.includes(b));if(!d)return!1;let p=a(this,y,Of).call(this,s,d);if(!p)return!1;a(this,y,xr).call(this,!1),r(this,Ne).cancel(!0),this._more="",g(this,ae,p),i.moving=!0;let u=`ev:${s.key}:${d}`;return g(this,Zt,u),g(this,ft,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,Ne).pickUp(p.from),!0}cancelMove(){let e=r(this,ne);e?.started&&(a(this,y,xr).call(this,!1),r(this,Qe).announce(this.t("cancelled",{event:e.ev.name,place:a(this,y,qs).call(this,e,e.from)}))),r(this,Ne).cancel()}moveEvent(e,t,i){let s=typeof e=="string"?this.event(e):e,l=s&&a(this,y,mo).call(this,s);if(!l)return!1;let d=l.allDay?R(xt(t).date||t):Kt(t);if(!d)return!1;let p=i?l.allDay?R(xt(i).date||i):Kt(i):null;return(!p||p<d)&&(p=l.allDay?te(d,jm(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,y,jf).call(this,l,d,p,"api",!1,B(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Os).get(t);if(this.controlled||!i)return!1;r(this,Os).delete(t);let s=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=a(this,y,mo).call(this,t);return l&&s&&g(this,ft,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Qe).announce(this.t("reverted",{event:t.name,place:l?a(this,y,Km).call(this,l):i.start})),!0}render(){let e=a(this,y,Ot).call(this),t=a(this,y,Ux).call(this,a(this,y,jx).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
3078
+ ${a(this,y,cw).call(this,e)}
3079
+ ${r(this,y,Be)==="month"?a(this,y,hw).call(this,e,t):a(this,y,mw).call(this,e,t)}
3080
3080
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
3081
3081
  <span id="${r(this,Je)}-gh" hidden>${this.t("gridHelp")}</span>
3082
3082
  <span id="${r(this,Je)}-mv" hidden>${this.t("openHint")} ${this.t("instructions")}</span>
3083
3083
  <span id="${r(this,Je)}-op" hidden>${this.t("openHint")}</span>
3084
- </div>`}};fo=new WeakMap,Je=new WeakMap,Qe=new WeakMap,Ne=new WeakMap,ae=new WeakMap,ne=new WeakMap,qs=new WeakMap,Qt=new WeakMap,ft=new WeakMap,xd=new WeakMap,xr=new WeakMap,bo=new WeakMap,vo=new WeakMap,yo=new WeakMap,xo=new WeakMap,wd=new WeakMap,y=new WeakSet,Be=function(){return qx.includes(this.view)?this.view:"month"},vr=function(){return Yi(this,this.locale)},pd=function(){return Ia(r(this,y,vr))},jm=function(){return Ha(r(this,y,vr),this.hourCycle)},Jt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},Hf=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Pa(r(this,y,vr)):(Math.trunc(e)%7+7)%7},md=function(){return R(this.today)?this.today:eg()},It=function(){return R(this.date)??R(r(this,y,md))},Nf=function(){return r(this,y,Be)==="month"&&this._narrow},Fx=function(){return r(this,y,Be)!=="month"},qt=function(){let e=r(this,y,It),t=r(this,y,Hf);if(r(this,y,Be)==="day")return[e];if(r(this,y,Be)==="week"){if(this._narrow)return[e,te(e,1),te(e,2)];let d=te(e,-((e.getDay()-t+7)%7));return Array.from({length:7},(p,u)=>te(d,u))}let i=Se(e),s=te(i,-((i.getDay()-t+7)%7)),l=Math.ceil((Vm(s,Zr(e))+1)/7)*7;return Array.from({length:l},(d,p)=>te(s,p))},po=function(e){let t=e.name,i=e.heading||(e.textContent??"").replace(/\s+/g," ").trim()||t,s=!!R(e.start),l=e.allDay||s;if(l){let b=R(xt(e.start).date||e.start);if(!b)return null;let f=R(xt(e.end).date||e.end)??b;f<b&&(f=b);let x=Math.min(Vm(b,f),366);return{el:e,key:e.key,name:t,text:i,allDay:l,start:b,end:f,min:0,dur:1440,days:Array.from({length:x+1},(v,k)=>B(te(b,k)))}}let d=Ut(e.start);if(!d)return null;let p=Ut(e.end);(!p||p<=d)&&(p=new Date(d.getTime()+30*6e4));let u=Math.max(1,Math.round((p.getTime()-d.getTime())/6e4));return{el:e,key:e.key,name:t,text:i,allDay:l,start:d,end:p,min:d.getHours()*60+d.getMinutes(),dur:u,days:[B(d)]}},Vx=function(){return this.events.map(e=>a(this,y,po).call(this,e)).filter(e=>!!e)},jx=function(e){let t=new Map;for(let i of e)for(let s of i.days)(t.get(s)??t.set(s,[]).get(s)).push(i);for(let i of t.values())i.sort((s,l)=>(s.allDay===l.allDay?0:s.allDay?-1:1)||s.start.getTime()-l.start.getTime()||s.name.localeCompare(l.name));return t},gt=function(e){return ue(e,{weekday:"long",day:"numeric",month:"long"},r(this,y,vr))},ud=function(e){return r(this,y,jm).format((e%1440+1440)%1440)},gd=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},s=Bx(r(this,y,vr),{hour:"numeric",minute:"2-digit",...i});try{if(B(e)===B(t)&&s.formatRangeToParts){let p=s.formatRangeToParts(e,t),u=p.findIndex(f=>f.source==="endRange"),b=-1;if(p.forEach((f,x)=>{f.source==="startRange"&&(b=x)}),b>=0&&u>b){let f=x=>Rf(x.map(v=>v.value).join(""));return this.t("timeRange",{start:f(p.slice(0,b+1)),end:f(p.slice(u))})}}}catch{}let l=B(e)===B(t),d=p=>l?a(this,y,ud).call(this,p.getHours()*60+p.getMinutes()):r(this,y,jm).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},Um=function(e){return e.allDay?B(e.start)===B(e.end)?this.t("allDayOn",{date:a(this,y,gt).call(this,e.start)}):this.t("allDayRange",{start:a(this,y,gt).call(this,e.start),end:a(this,y,gt).call(this,e.end)}):B(e.start)!==B(e.end)&&!(e.end.getHours()===0&&e.end.getMinutes()===0&&Vm(e.start,e.end)===1)?a(this,y,gd).call(this,e.start,e.end):this.t("timed",{date:a(this,y,gt).call(this,e.start),time:a(this,y,gd).call(this,e.start,e.end)})},Ux=function(e){let t={title:e.name,when:a(this,y,Um).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},Kx=function(e){let t=r(this,y,vr);if(r(this,y,Be)==="month")return r(this,y,pd).monthYear(r(this,y,It));if(e.length===1)return ue(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=Bx(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return Rf(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},Wx=function(e){return r(this,y,jm).hour12?Rf(ue(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},r(this,y,vr))):a(this,y,ud).call(this,e*60)},Is=function(e,t){let{start:i,end:s}=a(this,y,If).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,y,gt).call(this,i),time:a(this,y,gd).call(this,i,s)}):a(this,y,gt).call(this,te(R(e.origin),t.group-e.from.group))},Pf=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<Y0;t!==this._narrow&&(this._narrow=t)},fd=function(e,t){return r(this,y,Be)==="month"?be(e,t):r(this,y,Be)==="week"?te(e,t*(this._narrow?3:7)):te(e,t)},Gx=function(e){this.view!==e&&(this.view=e)},bd=function(){return[...this.renderRoot.querySelectorAll(".item")]},Yx=function(e){let t=[...this.renderRoot.querySelectorAll("[data-k]")],i=t.find(s=>s.dataset.k===e&&s.classList.contains("item"))??t.find(s=>s.dataset.k===e);if(i)return i;if(e.startsWith("ev:")&&!this.controlled){let s=e.slice(e.lastIndexOf(":")+1);return t.find(l=>l.dataset.k===`more:${s}`)??null}return null},Xx=function(){let e=B(r(this,y,It));if(r(this,y,Nf))return`day:${e}`;if(r(this,y,Be)==="month")return this.readonly?`cell:${e}`:`add:${e}`;let t=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));return`slot:${e}:${t}`},Jx=function(){let e=a(this,y,bd).call(this);if(!e.length)return;let t=e.find(i=>i.dataset.k===r(this,Qt))??e.find(i=>i.dataset.k===a(this,y,Xx).call(this))??e.find(i=>i.dataset.day===B(r(this,y,It)))??e[0];for(let i of e)i.tabIndex=i===t?0:-1},Qx=function(e){g(this,Qt,e.dataset.k??"");for(let t of a(this,y,bd).call(this))t.tabIndex=t===e?0:-1;e.focus()},$d=new WeakMap,kd=new WeakMap,Zx=function(e,t){let i=new Map;for(let v of a(this,y,bd).call(this)){let k=Number(v.dataset.i);(i.get(k)??i.set(k,[]).get(k)).push(v)}let s=Number(e.dataset.i),l=i.get(s)??[e],d=Math.max(0,l.indexOf(e)),p=a(this,y,qt).call(this).length,u=r(this,y,Be)==="month",b=e.dataset.row,f=(v,k)=>{let L=v>=0&&v<p?i.get(v):void 0;return(L?.length?k(L):void 0)??null},x=v=>u?v[Math.min(d,v.length-1)]:v.find(k=>k.dataset.row===b)??v[0];switch(t){case"ArrowRight":return f(s+1,x);case"ArrowLeft":return f(s-1,x);case"ArrowDown":return l[d+1]??(u?f(s+7,v=>v[0]):null);case"ArrowUp":return d>0?l[d-1]:u?f(s-7,v=>v[v.length-1]):null;case"Home":return u?f(s-s%7,v=>v[0]):f(0,x);case"End":return u?f(Math.min(p-1,s-s%7+6),v=>v[0]):f(p-1,x);default:return null}},ew=function(e,t){let i=e.dataset.day??B(r(this,y,It)),s=a(this,y,fd).call(this,R(i)??r(this,y,It),t),l=B(s),d=(e.dataset.k??"").split(":")[0],p;r(this,y,Nf)?p=`day:${l}`:r(this,y,Be)==="month"?p=this.readonly?`cell:${l}`:`add:${l}`:d==="adadd"||e.dataset.row==="a"?p=`adadd:${l}`:p=`slot:${l}:${e.dataset.row??this.dayStart}`,this.date=B(a(this,y,fd).call(this,r(this,y,It),t)),g(this,Qt,p),g(this,ft,{key:p,until:Date.now()+1e3})},Ed=new WeakMap,vd=function(e){return Math.floor((1440-Math.min(e,1440))/r(this,y,Jt))+1},tw=function(e,t){let i=r(this,ae);if(!i)return null;let s=a(this,y,qt).call(this).length,l=b=>Math.max(0,Math.min(s-1,b));if(i.mode==="day"){let b=r(this,y,Be)==="month";switch(e){case"ArrowRight":return{group:l(t.group+1),index:0};case"ArrowLeft":return{group:l(t.group-1),index:0};case"ArrowDown":return b?{group:t.group+7<s?t.group+7:t.group,index:0}:{...t};case"ArrowUp":return b?{group:t.group-7>=0?t.group-7:t.group,index:0}:{...t};case"Home":return{group:b?t.group-t.group%7:0,index:0};case"End":return{group:b?l(t.group-t.group%7+6):s-1,index:0};default:return null}}let d=a(this,y,vd).call(this,i.ev.dur)-1,p=Math.max(1,Math.round(60/r(this,y,Jt))),u=b=>Math.max(0,Math.min(d,b));switch(e){case"ArrowRight":return{group:l(t.group+1),index:t.index};case"ArrowLeft":return{group:l(t.group-1),index:t.index};case"ArrowDown":return{group:t.group,index:u(t.index+1)};case"ArrowUp":return{group:t.group,index:u(t.index-1)};case"PageDown":return{group:t.group,index:u(t.index+p)};case"PageUp":return{group:t.group,index:u(t.index-p)};case"Home":return{group:t.group,index:0};case"End":return{group:t.group,index:d};default:return null}},If=function(e,t){let{ev:i}=e;if(e.mode==="time"){let d=a(this,y,qt).call(this)[t.group]??R(e.origin),p=new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,t.index*r(this,y,Jt));return{start:p,end:new Date(p.getTime()+i.dur*6e4)}}let s=t.group-e.from.group,l=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()+s,d.getHours(),d.getMinutes());return{start:l(i.start),end:l(i.end)}},qf=function(e,t){let s=a(this,y,qt).call(this).map(B).indexOf(t);if(s<0)return null;let l=r(this,y,Fx)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/r(this,y,Jt)),a(this,y,vd).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:s,index:d}}},Of=function(){r(this,ae)&&(r(this,ae).ev.el.moving=!1),g(this,ae,null),this._target=null},iw=function(e){let t=r(this,ae);if(!t||!e){this._target=null;return}let i=B(a(this,y,qt).call(this)[e.group]??R(t.origin)),s=e.group===t.from.group&&e.index===t.from.index;this._target=s?null:{iso:i,min:t.mode==="time"?e.index*r(this,y,Jt):void 0}},rw=function(e,t){let i=r(this,ae);a(this,y,Of).call(this),i&&(g(this,bo,performance.now()+400),a(this,y,Bf).call(this,i,e,t,"keyboard"))},Bf=function(e,t,i,s){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,y,If).call(this,e,i),u=B(te(R(e.origin),i.group-t.group));a(this,y,Vf).call(this,e.ev,d,p,s,l,e.mode==="time"?B(d):u)},Ff=function(e,t,i){return e?{start:B(t),end:B(i)}:{start:Ix(t),end:Ix(i)}},Vf=function(e,t,i,s,l,d){let p=e.el,u=e.name,b=a(this,y,Ff).call(this,e.allDay,e.start,e.end),f=a(this,y,Ff).call(this,e.allDay,t,i),x=q=>{s==="keyboard"&&g(this,ft,{key:q,until:Date.now()+1e3})};if(l||b.start===f.start&&b.end===f.end)return s!=="api"&&r(this,Qe).announce(this.t("sameSpot",{event:u})),this.requestUpdate(),!1;let v={...e,start:t,end:i},k=e.allDay?a(this,y,gt).call(this,t):this.t("timed",{date:a(this,y,gt).call(this,t),time:a(this,y,gd).call(this,t,i)}),L=[],P={value:e.key,event:p,from:b,to:f,allDay:e.allDay,source:s,waitUntil:q=>{L.push(Promise.resolve(q))}};return this.dispatchEvent(new CustomEvent("cm-move",{detail:P,bubbles:!0,composed:!0,cancelable:!0}))?(this.controlled||(r(this,qs).set(p,b),p.start=f.start,p.end=f.end),x(`ev:${e.key}:${d}`),this.requestUpdate(),r(this,Qe).announce(this.t("moved",{event:u,place:v.allDay?a(this,y,gt).call(this,t):k})),L.length&&(p.pending=!0,Promise.all(L).then(()=>{p.pending=!1,this.controlled||r(this,qs).delete(p)},()=>{p.pending=!1,this.controlled?r(this,Qe).announce(this.t("reverted",{event:u,place:a(this,y,Um).call(this,e)})):this.revert(p)})),!0):(r(this,Qe).announce(this.t("refused",{event:u,place:k})),this.requestUpdate(),!1)},Md=new WeakMap,jf=function(e,t){let i=[...this.renderRoot.querySelectorAll('.tcell[data-row="0"]')];if(!i.length)return null;let s=0,l=1/0;i.forEach((p,u)=>{let b=p.getBoundingClientRect(),f=e<b.left?b.left-e:e>b.right?e-b.right:0;f<l&&(l=f,s=Number(p.dataset.i??u))});let d=i[0].getBoundingClientRect();return{group:s,min:(t-d.top)/d.height*60}},sw=function(e,t){let i=[...this.renderRoot.querySelectorAll("[data-drop]")];if(!i.length)return null;let s=null,l=1/0;for(let d of i){let p=d.getBoundingClientRect(),u=e<p.left?p.left-e:e>p.right?e-p.right:0,b=t<p.top?p.top-t:t>p.bottom?t-p.bottom:0,f=Math.hypot(u,b);f<l&&(l=f,s=d)}return s?Number(s.dataset.i):null},_d=new WeakMap,Td=new WeakMap,Cd=new WeakMap,zd=new WeakMap,Sd=new WeakMap,Ld=new WeakMap,Uf=function(){let e=r(this,ne);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges(),this._more="",e.ev.el.moving=!0,this.dragging=!0,r(this,Qe).announce(this.t("pickedUp",{event:e.ev.name,place:a(this,y,Is).call(this,e,e.from)})),a(this,y,Km).call(this);let t=()=>{r(this,ne)?.started&&(a(this,y,aw).call(this),r(this,ne).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},Km=function(){let e=r(this,ne);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,y,jf).call(this,e.x,e.y);if(l){let d=a(this,y,vd).call(this,e.ev.dur)-1;t={group:l.group,index:Math.max(0,Math.min(d,Math.round((l.min-e.grab)/r(this,y,Jt))))}}}else{let l=a(this,y,sw).call(this,e.x,e.y);l!==null&&(t={group:l,index:0})}if(!t||t.group===e.to.group&&t.index===e.to.index&&this._target)return;let i=t.group!==e.to.group;e.to=t;let s=t.group===e.from.group&&t.index===e.from.index;this._target=s?null:{iso:B(a(this,y,qt).call(this)[t.group]),min:e.mode==="time"?t.index*r(this,y,Jt):void 0},i&&r(this,Qe).announce(this.t("over",{place:a(this,y,Is).call(this,e,t)}))},aw=function(){let e=r(this,ne),t=this.renderRoot.querySelector(".tg");if(!e||!t||e.mode!=="time")return;let i=40,s=14,l=x=>x<i?Math.ceil((i-Math.max(x,0))/i*s):0,d=t.getBoundingClientRect();if(e.x<d.left||e.x>d.right)return;let p=t.querySelector(".tg-top")?.getBoundingClientRect().bottom??d.top,u=l(e.y-p),b=l(d.bottom-e.y),f=t.scrollTop;u?t.scrollTop-=u:b&&(t.scrollTop+=b),t.scrollTop!==f&&a(this,y,Km).call(this)},yr=function(e){let t=r(this,ne);t&&(g(this,ne,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,zd),!0),window.removeEventListener("pointerup",r(this,Sd),!0),window.removeEventListener("pointercancel",r(this,Ld),!0),window.removeEventListener("touchmove",r(this,Td),!0),window.removeEventListener("contextmenu",r(this,Cd),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,y,Bf).call(this,t,t.from,t.to,"pointer")))},yd=function(e,t){this.readonly||this.dispatchEvent(new CustomEvent("cm-add",{detail:{start:e,allDay:t,view:r(this,y,Be)},bubbles:!0,composed:!0}))},nw=function(e,t,i){let s=i*60;if(e.detail>0){let p=e.currentTarget.getBoundingClientRect(),u=Math.floor((e.clientY-p.top)/p.height*60/r(this,y,Jt))*r(this,y,Jt);s+=Math.max(0,Math.min(59,u))}let l=Math.floor(s/60),d=s%60;a(this,y,yd).call(this,`${t}T${Ym(l)}:${Ym(d)}`,!1)},Kf=function(e,t){if(performance.now()<r(this,bo)||r(this,Ne).active){e.preventDefault();return}this.dispatchEvent(new CustomEvent("cm-open",{detail:{value:t.key,event:t.el},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},ow=function(e){this._more=e,g(this,vo,!0)},Wm=function(e){let t=this._more;this._more="",e&&t&&(g(this,Qt,`more:${t}`),g(this,ft,{key:`more:${t}`,until:Date.now()+1e3}))},Wf=function(){return r(this,ae)?.ev??(r(this,ne)?.started?r(this,ne).ev:null)},mo=function(e,t,i,s,l,d={}){let p=e.el,u=p.pending,b=a(this,y,Ux).call(this,e),f=!this.readonly&&!p.locked&&!u,x=["attention","information","success","critical"].includes(p.tone)?p.tone:"neutral",v=`chip ${s} tone-${x}${l?" item":""}${p.moving?" moving":""}${u?" pending":""}${p.locked?" locked":""}`,k=p.icon?c`<cm-icon name=${p.icon} size="14"></cm-icon>`:h,L=e.allDay?h:c`<span class="tm">${a(this,y,ud).call(this,e.min)}</span>`,P=p.kind&&(s!=="month"||!p.icon)?c`<span class="k">${p.kind}</span>`:h,U=u?c`<span class="spin" aria-hidden="true"></span>`:h,q=s==="time"?c`<span class="lead">${k}${L}${U}</span><span class="h">${e.text}</span>${P}`:c`${k}${L}<span class="h">${e.text}</span>${P}${U}`,O=u?`${b}, ${this.t("saving")}`:b,ve=f?`${r(this,Je)}-mv`:`${r(this,Je)}-op`,G=`ev:${e.key}:${t}`,K=f?this.t("roleDescription"):h;return p.href?c`<a class=${v} href=${p.href} style=${d.style??h} data-k=${G} data-ev=${e.key} data-day=${t} data-i=${i}
3084
+ </div>`}};bo=new WeakMap,Je=new WeakMap,Qe=new WeakMap,Ne=new WeakMap,ae=new WeakMap,ne=new WeakMap,Os=new WeakMap,Zt=new WeakMap,ft=new WeakMap,wd=new WeakMap,wr=new WeakMap,vo=new WeakMap,yo=new WeakMap,xo=new WeakMap,wo=new WeakMap,$d=new WeakMap,y=new WeakSet,Be=function(){return Ox.includes(this.view)?this.view:"month"},yr=function(){return Xi(this,this.locale)},md=function(){return qa(r(this,y,yr))},Um=function(){return Na(r(this,y,yr),this.hourCycle)},Qt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},Nf=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ia(r(this,y,yr)):(Math.trunc(e)%7+7)%7},ud=function(){return R(this.today)?this.today:tg()},qt=function(){return R(this.date)??R(r(this,y,ud))},Pf=function(){return r(this,y,Be)==="month"&&this._narrow},Vx=function(){return r(this,y,Be)!=="month"},Ot=function(){let e=r(this,y,qt),t=r(this,y,Nf);if(r(this,y,Be)==="day")return[e];if(r(this,y,Be)==="week"){if(this._narrow)return[e,te(e,1),te(e,2)];let d=te(e,-((e.getDay()-t+7)%7));return Array.from({length:7},(p,u)=>te(d,u))}let i=Se(e),s=te(i,-((i.getDay()-t+7)%7)),l=Math.ceil((jm(s,es(e))+1)/7)*7;return Array.from({length:l},(d,p)=>te(s,p))},mo=function(e){let t=e.name,i=e.heading||(e.textContent??"").replace(/\s+/g," ").trim()||t,s=!!R(e.start),l=e.allDay||s;if(l){let b=R(xt(e.start).date||e.start);if(!b)return null;let f=R(xt(e.end).date||e.end)??b;f<b&&(f=b);let x=Math.min(jm(b,f),366);return{el:e,key:e.key,name:t,text:i,allDay:l,start:b,end:f,min:0,dur:1440,days:Array.from({length:x+1},(v,k)=>B(te(b,k)))}}let d=Kt(e.start);if(!d)return null;let p=Kt(e.end);(!p||p<=d)&&(p=new Date(d.getTime()+30*6e4));let u=Math.max(1,Math.round((p.getTime()-d.getTime())/6e4));return{el:e,key:e.key,name:t,text:i,allDay:l,start:d,end:p,min:d.getHours()*60+d.getMinutes(),dur:u,days:[B(d)]}},jx=function(){return this.events.map(e=>a(this,y,mo).call(this,e)).filter(e=>!!e)},Ux=function(e){let t=new Map;for(let i of e)for(let s of i.days)(t.get(s)??t.set(s,[]).get(s)).push(i);for(let i of t.values())i.sort((s,l)=>(s.allDay===l.allDay?0:s.allDay?-1:1)||s.start.getTime()-l.start.getTime()||s.name.localeCompare(l.name));return t},gt=function(e){return ue(e,{weekday:"long",day:"numeric",month:"long"},r(this,y,yr))},gd=function(e){return r(this,y,Um).format((e%1440+1440)%1440)},fd=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},s=Fx(r(this,y,yr),{hour:"numeric",minute:"2-digit",...i});try{if(B(e)===B(t)&&s.formatRangeToParts){let p=s.formatRangeToParts(e,t),u=p.findIndex(f=>f.source==="endRange"),b=-1;if(p.forEach((f,x)=>{f.source==="startRange"&&(b=x)}),b>=0&&u>b){let f=x=>Hf(x.map(v=>v.value).join(""));return this.t("timeRange",{start:f(p.slice(0,b+1)),end:f(p.slice(u))})}}}catch{}let l=B(e)===B(t),d=p=>l?a(this,y,gd).call(this,p.getHours()*60+p.getMinutes()):r(this,y,Um).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},Km=function(e){return e.allDay?B(e.start)===B(e.end)?this.t("allDayOn",{date:a(this,y,gt).call(this,e.start)}):this.t("allDayRange",{start:a(this,y,gt).call(this,e.start),end:a(this,y,gt).call(this,e.end)}):B(e.start)!==B(e.end)&&!(e.end.getHours()===0&&e.end.getMinutes()===0&&jm(e.start,e.end)===1)?a(this,y,fd).call(this,e.start,e.end):this.t("timed",{date:a(this,y,gt).call(this,e.start),time:a(this,y,fd).call(this,e.start,e.end)})},Kx=function(e){let t={title:e.name,when:a(this,y,Km).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},Wx=function(e){let t=r(this,y,yr);if(r(this,y,Be)==="month")return r(this,y,md).monthYear(r(this,y,qt));if(e.length===1)return ue(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=Fx(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return Hf(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},Gx=function(e){return r(this,y,Um).hour12?Hf(ue(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},r(this,y,yr))):a(this,y,gd).call(this,e*60)},qs=function(e,t){let{start:i,end:s}=a(this,y,qf).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,y,gt).call(this,i),time:a(this,y,fd).call(this,i,s)}):a(this,y,gt).call(this,te(R(e.origin),t.group-e.from.group))},If=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<X0;t!==this._narrow&&(this._narrow=t)},bd=function(e,t){return r(this,y,Be)==="month"?be(e,t):r(this,y,Be)==="week"?te(e,t*(this._narrow?3:7)):te(e,t)},Yx=function(e){this.view!==e&&(this.view=e)},vd=function(){return[...this.renderRoot.querySelectorAll(".item")]},Xx=function(e){let t=[...this.renderRoot.querySelectorAll("[data-k]")],i=t.find(s=>s.dataset.k===e&&s.classList.contains("item"))??t.find(s=>s.dataset.k===e);if(i)return i;if(e.startsWith("ev:")&&!this.controlled){let s=e.slice(e.lastIndexOf(":")+1);return t.find(l=>l.dataset.k===`more:${s}`)??null}return null},Jx=function(){let e=B(r(this,y,qt));if(r(this,y,Pf))return`day:${e}`;if(r(this,y,Be)==="month")return this.readonly?`cell:${e}`:`add:${e}`;let t=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));return`slot:${e}:${t}`},Qx=function(){let e=a(this,y,vd).call(this);if(!e.length)return;let t=e.find(i=>i.dataset.k===r(this,Zt))??e.find(i=>i.dataset.k===a(this,y,Jx).call(this))??e.find(i=>i.dataset.day===B(r(this,y,qt)))??e[0];for(let i of e)i.tabIndex=i===t?0:-1},Zx=function(e){g(this,Zt,e.dataset.k??"");for(let t of a(this,y,vd).call(this))t.tabIndex=t===e?0:-1;e.focus()},kd=new WeakMap,Ed=new WeakMap,ew=function(e,t){let i=new Map;for(let v of a(this,y,vd).call(this)){let k=Number(v.dataset.i);(i.get(k)??i.set(k,[]).get(k)).push(v)}let s=Number(e.dataset.i),l=i.get(s)??[e],d=Math.max(0,l.indexOf(e)),p=a(this,y,Ot).call(this).length,u=r(this,y,Be)==="month",b=e.dataset.row,f=(v,k)=>{let L=v>=0&&v<p?i.get(v):void 0;return(L?.length?k(L):void 0)??null},x=v=>u?v[Math.min(d,v.length-1)]:v.find(k=>k.dataset.row===b)??v[0];switch(t){case"ArrowRight":return f(s+1,x);case"ArrowLeft":return f(s-1,x);case"ArrowDown":return l[d+1]??(u?f(s+7,v=>v[0]):null);case"ArrowUp":return d>0?l[d-1]:u?f(s-7,v=>v[v.length-1]):null;case"Home":return u?f(s-s%7,v=>v[0]):f(0,x);case"End":return u?f(Math.min(p-1,s-s%7+6),v=>v[0]):f(p-1,x);default:return null}},tw=function(e,t){let i=e.dataset.day??B(r(this,y,qt)),s=a(this,y,bd).call(this,R(i)??r(this,y,qt),t),l=B(s),d=(e.dataset.k??"").split(":")[0],p;r(this,y,Pf)?p=`day:${l}`:r(this,y,Be)==="month"?p=this.readonly?`cell:${l}`:`add:${l}`:d==="adadd"||e.dataset.row==="a"?p=`adadd:${l}`:p=`slot:${l}:${e.dataset.row??this.dayStart}`,this.date=B(a(this,y,bd).call(this,r(this,y,qt),t)),g(this,Zt,p),g(this,ft,{key:p,until:Date.now()+1e3})},Md=new WeakMap,yd=function(e){return Math.floor((1440-Math.min(e,1440))/r(this,y,Qt))+1},iw=function(e,t){let i=r(this,ae);if(!i)return null;let s=a(this,y,Ot).call(this).length,l=b=>Math.max(0,Math.min(s-1,b));if(i.mode==="day"){let b=r(this,y,Be)==="month";switch(e){case"ArrowRight":return{group:l(t.group+1),index:0};case"ArrowLeft":return{group:l(t.group-1),index:0};case"ArrowDown":return b?{group:t.group+7<s?t.group+7:t.group,index:0}:{...t};case"ArrowUp":return b?{group:t.group-7>=0?t.group-7:t.group,index:0}:{...t};case"Home":return{group:b?t.group-t.group%7:0,index:0};case"End":return{group:b?l(t.group-t.group%7+6):s-1,index:0};default:return null}}let d=a(this,y,yd).call(this,i.ev.dur)-1,p=Math.max(1,Math.round(60/r(this,y,Qt))),u=b=>Math.max(0,Math.min(d,b));switch(e){case"ArrowRight":return{group:l(t.group+1),index:t.index};case"ArrowLeft":return{group:l(t.group-1),index:t.index};case"ArrowDown":return{group:t.group,index:u(t.index+1)};case"ArrowUp":return{group:t.group,index:u(t.index-1)};case"PageDown":return{group:t.group,index:u(t.index+p)};case"PageUp":return{group:t.group,index:u(t.index-p)};case"Home":return{group:t.group,index:0};case"End":return{group:t.group,index:d};default:return null}},qf=function(e,t){let{ev:i}=e;if(e.mode==="time"){let d=a(this,y,Ot).call(this)[t.group]??R(e.origin),p=new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,t.index*r(this,y,Qt));return{start:p,end:new Date(p.getTime()+i.dur*6e4)}}let s=t.group-e.from.group,l=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()+s,d.getHours(),d.getMinutes());return{start:l(i.start),end:l(i.end)}},Of=function(e,t){let s=a(this,y,Ot).call(this).map(B).indexOf(t);if(s<0)return null;let l=r(this,y,Vx)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/r(this,y,Qt)),a(this,y,yd).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:s,index:d}}},Bf=function(){r(this,ae)&&(r(this,ae).ev.el.moving=!1),g(this,ae,null),this._target=null},rw=function(e){let t=r(this,ae);if(!t||!e){this._target=null;return}let i=B(a(this,y,Ot).call(this)[e.group]??R(t.origin)),s=e.group===t.from.group&&e.index===t.from.index;this._target=s?null:{iso:i,min:t.mode==="time"?e.index*r(this,y,Qt):void 0}},sw=function(e,t){let i=r(this,ae);a(this,y,Bf).call(this),i&&(g(this,vo,performance.now()+400),a(this,y,Ff).call(this,i,e,t,"keyboard"))},Ff=function(e,t,i,s){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,y,qf).call(this,e,i),u=B(te(R(e.origin),i.group-t.group));a(this,y,jf).call(this,e.ev,d,p,s,l,e.mode==="time"?B(d):u)},Vf=function(e,t,i){return e?{start:B(t),end:B(i)}:{start:qx(t),end:qx(i)}},jf=function(e,t,i,s,l,d){let p=e.el,u=e.name,b=a(this,y,Vf).call(this,e.allDay,e.start,e.end),f=a(this,y,Vf).call(this,e.allDay,t,i),x=q=>{s==="keyboard"&&g(this,ft,{key:q,until:Date.now()+1e3})};if(l||b.start===f.start&&b.end===f.end)return s!=="api"&&r(this,Qe).announce(this.t("sameSpot",{event:u})),this.requestUpdate(),!1;let v={...e,start:t,end:i},k=e.allDay?a(this,y,gt).call(this,t):this.t("timed",{date:a(this,y,gt).call(this,t),time:a(this,y,fd).call(this,t,i)}),L=[],P={value:e.key,event:p,from:b,to:f,allDay:e.allDay,source:s,waitUntil:q=>{L.push(Promise.resolve(q))}};return this.dispatchEvent(new CustomEvent("cm-move",{detail:P,bubbles:!0,composed:!0,cancelable:!0}))?(this.controlled||(r(this,Os).set(p,b),p.start=f.start,p.end=f.end),x(`ev:${e.key}:${d}`),this.requestUpdate(),r(this,Qe).announce(this.t("moved",{event:u,place:v.allDay?a(this,y,gt).call(this,t):k})),L.length&&(p.pending=!0,Promise.all(L).then(()=>{p.pending=!1,this.controlled||r(this,Os).delete(p)},()=>{p.pending=!1,this.controlled?r(this,Qe).announce(this.t("reverted",{event:u,place:a(this,y,Km).call(this,e)})):this.revert(p)})),!0):(r(this,Qe).announce(this.t("refused",{event:u,place:k})),this.requestUpdate(),!1)},_d=new WeakMap,Uf=function(e,t){let i=[...this.renderRoot.querySelectorAll('.tcell[data-row="0"]')];if(!i.length)return null;let s=0,l=1/0;i.forEach((p,u)=>{let b=p.getBoundingClientRect(),f=e<b.left?b.left-e:e>b.right?e-b.right:0;f<l&&(l=f,s=Number(p.dataset.i??u))});let d=i[0].getBoundingClientRect();return{group:s,min:(t-d.top)/d.height*60}},aw=function(e,t){let i=[...this.renderRoot.querySelectorAll("[data-drop]")];if(!i.length)return null;let s=null,l=1/0;for(let d of i){let p=d.getBoundingClientRect(),u=e<p.left?p.left-e:e>p.right?e-p.right:0,b=t<p.top?p.top-t:t>p.bottom?t-p.bottom:0,f=Math.hypot(u,b);f<l&&(l=f,s=d)}return s?Number(s.dataset.i):null},Td=new WeakMap,Cd=new WeakMap,zd=new WeakMap,Sd=new WeakMap,Ld=new WeakMap,Ad=new WeakMap,Kf=function(){let e=r(this,ne);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges(),this._more="",e.ev.el.moving=!0,this.dragging=!0,r(this,Qe).announce(this.t("pickedUp",{event:e.ev.name,place:a(this,y,qs).call(this,e,e.from)})),a(this,y,Wm).call(this);let t=()=>{r(this,ne)?.started&&(a(this,y,nw).call(this),r(this,ne).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},Wm=function(){let e=r(this,ne);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,y,Uf).call(this,e.x,e.y);if(l){let d=a(this,y,yd).call(this,e.ev.dur)-1;t={group:l.group,index:Math.max(0,Math.min(d,Math.round((l.min-e.grab)/r(this,y,Qt))))}}}else{let l=a(this,y,aw).call(this,e.x,e.y);l!==null&&(t={group:l,index:0})}if(!t||t.group===e.to.group&&t.index===e.to.index&&this._target)return;let i=t.group!==e.to.group;e.to=t;let s=t.group===e.from.group&&t.index===e.from.index;this._target=s?null:{iso:B(a(this,y,Ot).call(this)[t.group]),min:e.mode==="time"?t.index*r(this,y,Qt):void 0},i&&r(this,Qe).announce(this.t("over",{place:a(this,y,qs).call(this,e,t)}))},nw=function(){let e=r(this,ne),t=this.renderRoot.querySelector(".tg");if(!e||!t||e.mode!=="time")return;let i=40,s=14,l=x=>x<i?Math.ceil((i-Math.max(x,0))/i*s):0,d=t.getBoundingClientRect();if(e.x<d.left||e.x>d.right)return;let p=t.querySelector(".tg-top")?.getBoundingClientRect().bottom??d.top,u=l(e.y-p),b=l(d.bottom-e.y),f=t.scrollTop;u?t.scrollTop-=u:b&&(t.scrollTop+=b),t.scrollTop!==f&&a(this,y,Wm).call(this)},xr=function(e){let t=r(this,ne);t&&(g(this,ne,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,Sd),!0),window.removeEventListener("pointerup",r(this,Ld),!0),window.removeEventListener("pointercancel",r(this,Ad),!0),window.removeEventListener("touchmove",r(this,Cd),!0),window.removeEventListener("contextmenu",r(this,zd),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,y,Ff).call(this,t,t.from,t.to,"pointer")))},xd=function(e,t){this.readonly||this.dispatchEvent(new CustomEvent("cm-add",{detail:{start:e,allDay:t,view:r(this,y,Be)},bubbles:!0,composed:!0}))},ow=function(e,t,i){let s=i*60;if(e.detail>0){let p=e.currentTarget.getBoundingClientRect(),u=Math.floor((e.clientY-p.top)/p.height*60/r(this,y,Qt))*r(this,y,Qt);s+=Math.max(0,Math.min(59,u))}let l=Math.floor(s/60),d=s%60;a(this,y,xd).call(this,`${t}T${Xm(l)}:${Xm(d)}`,!1)},Wf=function(e,t){if(performance.now()<r(this,vo)||r(this,Ne).active){e.preventDefault();return}this.dispatchEvent(new CustomEvent("cm-open",{detail:{value:t.key,event:t.el},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},lw=function(e){this._more=e,g(this,yo,!0)},Gm=function(e){let t=this._more;this._more="",e&&t&&(g(this,Zt,`more:${t}`),g(this,ft,{key:`more:${t}`,until:Date.now()+1e3}))},Gf=function(){return r(this,ae)?.ev??(r(this,ne)?.started?r(this,ne).ev:null)},uo=function(e,t,i,s,l,d={}){let p=e.el,u=p.pending,b=a(this,y,Kx).call(this,e),f=!this.readonly&&!p.locked&&!u,x=["attention","information","success","critical"].includes(p.tone)?p.tone:"neutral",v=`chip ${s} tone-${x}${l?" item":""}${p.moving?" moving":""}${u?" pending":""}${p.locked?" locked":""}`,k=p.icon?c`<cm-icon name=${p.icon} size="14"></cm-icon>`:h,L=e.allDay?h:c`<span class="tm">${a(this,y,gd).call(this,e.min)}</span>`,P=p.kind&&(s!=="month"||!p.icon)?c`<span class="k">${p.kind}</span>`:h,U=u?c`<span class="spin" aria-hidden="true"></span>`:h,q=s==="time"?c`<span class="lead">${k}${L}${U}</span><span class="h">${e.text}</span>${P}`:c`${k}${L}<span class="h">${e.text}</span>${P}${U}`,O=u?`${b}, ${this.t("saving")}`:b,ve=f?`${r(this,Je)}-mv`:`${r(this,Je)}-op`,G=`ev:${e.key}:${t}`,K=f?this.t("roleDescription"):h;return p.href?c`<a class=${v} href=${p.href} style=${d.style??h} data-k=${G} data-ev=${e.key} data-day=${t} data-i=${i}
3085
3085
  data-row=${d.row??h} aria-label=${O} aria-describedby=${ve} aria-roledescription=${K}
3086
- @click=${Z=>a(this,y,Kf).call(this,Z,e)}>${q}</a>`:c`<button type="button" class=${v} style=${d.style??h} data-k=${G} data-ev=${e.key} data-day=${t} data-i=${i}
3086
+ @click=${Z=>a(this,y,Wf).call(this,Z,e)}>${q}</a>`:c`<button type="button" class=${v} style=${d.style??h} data-k=${G} data-ev=${e.key} data-day=${t} data-i=${i}
3087
3087
  data-row=${d.row??h} aria-label=${O} aria-describedby=${ve} aria-roledescription=${K}
3088
- @click=${Z=>a(this,y,Kf).call(this,Z,e)}>${q}</button>`},Gm=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.text}</div>`},lw=function(e){let t=r(this,y,Be),i=t==="week"&&this._narrow,s=t==="month"?this.t("previousMonth"):i?this.t("previousDays",{count:3}):t==="week"?this.t("previousWeek"):this.t("previousDay"),l=t==="month"?this.t("nextMonth"):i?this.t("nextDays",{count:3}):t==="week"?this.t("nextWeek"):this.t("nextDay"),d=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2));return c`<div class="head" part="header">
3088
+ @click=${Z=>a(this,y,Wf).call(this,Z,e)}>${q}</button>`},Ym=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.text}</div>`},cw=function(e){let t=r(this,y,Be),i=t==="week"&&this._narrow,s=t==="month"?this.t("previousMonth"):i?this.t("previousDays",{count:3}):t==="week"?this.t("previousWeek"):this.t("previousDay"),l=t==="month"?this.t("nextMonth"):i?this.t("nextDays",{count:3}):t==="week"?this.t("nextWeek"):this.t("nextDay"),d=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2));return c`<div class="head" part="header">
3089
3089
  <div class="nav">
3090
3090
  <button type="button" class="hb icon prev" aria-label=${s} @click=${()=>this.previous()}><cm-icon name="chevron-left" size="18"></cm-icon></button>
3091
3091
  <button type="button" class="hb today" @click=${()=>this.goToToday()}>${this.t("today")}</button>
3092
3092
  <button type="button" class="hb icon next" aria-label=${l} @click=${()=>this.next()}><cm-icon name="chevron-right" size="18"></cm-icon></button>
3093
3093
  </div>
3094
- <div class="title" part="title" id="${r(this,Je)}-t" role="heading" aria-level=${d} aria-live="polite">${a(this,y,Kx).call(this,e)}${this.loading?c`<cm-spinner size="small" aria-hidden="true"></cm-spinner>`:h}</div>
3094
+ <div class="title" part="title" id="${r(this,Je)}-t" role="heading" aria-level=${d} aria-live="polite">${a(this,y,Wx).call(this,e)}${this.loading?c`<cm-spinner size="small" aria-hidden="true"></cm-spinner>`:h}</div>
3095
3095
  <div class="views" role="group" aria-label=${this.t("views")}>
3096
- ${qx.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,y,Gx).call(this,p)}>${this.t(p)}</button>`)}
3096
+ ${Ox.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,y,Yx).call(this,p)}>${this.t(p)}</button>`)}
3097
3097
  </div>
3098
- </div>`},cw=function(e){let t=r(this,y,pd),i=Array.from({length:7},(s,l)=>(l+r(this,y,Hf))%7);return c`<thead><tr>${i.map(s=>c`<th scope="col" abbr=${t.weekdaysLong[s]}><span aria-hidden="true">${e?t.weekdaysShort[s].slice(0,2):t.weekdaysShort[s]}</span><span class="vh">${t.weekdaysLong[s]}</span></th>`)}</tr></thead>`},dw=function(e,t){let i=r(this,y,It),s=r(this,y,md),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,y,Wf).call(this),p=this._target,u=Array.from({length:e.length/7},(q,O)=>e.slice(O*7,O*7+7)),b=this._narrow,f=(q,O,ve)=>{let G=B(q),K=t.get(G)??[],Z=a(this,y,gt).call(this,q),zt=`${q.getMonth()!==i.getMonth()?"other":""} ${G===s?"today":""} ${p?.iso===G?"over":""}`,Er=c`<span class="num" aria-hidden="true">${r(this,y,pd).day(q)}</span>`;if(b){let Ve=K.slice(0,3).map(Js=>["attention","information","success","critical"].includes(Js.el.tone)?Js.el.tone:"neutral");return c`<td class=${zt} data-drop data-i=${O} aria-selected=${G===B(i)?"true":"false"} aria-current=${G===s?"date":h}>
3098
+ </div>`},dw=function(e){let t=r(this,y,md),i=Array.from({length:7},(s,l)=>(l+r(this,y,Nf))%7);return c`<thead><tr>${i.map(s=>c`<th scope="col" abbr=${t.weekdaysLong[s]}><span aria-hidden="true">${e?t.weekdaysShort[s].slice(0,2):t.weekdaysShort[s]}</span><span class="vh">${t.weekdaysLong[s]}</span></th>`)}</tr></thead>`},hw=function(e,t){let i=r(this,y,qt),s=r(this,y,ud),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,y,Gf).call(this),p=this._target,u=Array.from({length:e.length/7},(q,O)=>e.slice(O*7,O*7+7)),b=this._narrow,f=(q,O,ve)=>{let G=B(q),K=t.get(G)??[],Z=a(this,y,gt).call(this,q),zt=`${q.getMonth()!==i.getMonth()?"other":""} ${G===s?"today":""} ${p?.iso===G?"over":""}`,Mr=c`<span class="num" aria-hidden="true">${r(this,y,md).day(q)}</span>`;if(b){let Ve=K.slice(0,3).map(Qs=>["attention","information","success","critical"].includes(Qs.el.tone)?Qs.el.tone:"neutral");return c`<td class=${zt} data-drop data-i=${O} aria-selected=${G===B(i)?"true":"false"} aria-current=${G===s?"date":h}>
3099
3099
  <button type="button" class="dayb item" data-k="day:${G}" data-i=${O} data-day=${G} aria-label=${this.t("dayEvents",{date:Z,count:K.length})}
3100
- @click=${()=>{this.date=G,g(this,Qt,`day:${G}`)}}>${Er}<span class="dots">${Ve.map(Js=>c`<span class="dot tone-${Js}"></span>`)}</span></button>
3101
- </td>`}let X=K,St=0;if(K.length>l){X=K.slice(0,l-1);let Ve=d&&K.find(Js=>Js.key===d.key);Ve&&!X.includes(Ve)&&(X=[...K.slice(0,l-2),Ve]),St=K.length-X.length}let me=this.readonly;return c`<td class="${zt}${me?" item":""}" data-drop data-i=${O} data-day=${G} data-k=${me?`cell:${G}`:h}
3100
+ @click=${()=>{this.date=G,g(this,Zt,`day:${G}`)}}>${Mr}<span class="dots">${Ve.map(Qs=>c`<span class="dot tone-${Qs}"></span>`)}</span></button>
3101
+ </td>`}let X=K,St=0;if(K.length>l){X=K.slice(0,l-1);let Ve=d&&K.find(Qs=>Qs.key===d.key);Ve&&!X.includes(Ve)&&(X=[...K.slice(0,l-2),Ve]),St=K.length-X.length}let me=this.readonly;return c`<td class="${zt}${me?" item":""}" data-drop data-i=${O} data-day=${G} data-k=${me?`cell:${G}`:h}
3102
3102
  aria-label=${me?this.t("dayEvents",{date:Z,count:K.length}):h} aria-current=${G===s?"date":h}>
3103
- <div class="dh">${Er}<span class="vh">${Z}</span>
3103
+ <div class="dh">${Mr}<span class="vh">${Z}</span>
3104
3104
  ${me?h:c`<button type="button" class="add item" data-k="add:${G}" data-i=${O} data-day=${G} aria-label=${this.t("addOn",{date:Z})}
3105
- @click=${()=>a(this,y,yd).call(this,G,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3105
+ @click=${()=>a(this,y,xd).call(this,G,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3106
3106
  </div>
3107
3107
  ${X.length||p?.iso===G&&d?c`<ul class="evs">
3108
- ${X.map(Ve=>c`<li>${a(this,y,mo).call(this,Ve,G,O,"month",!0)}</li>`)}
3109
- ${p?.iso===G&&d?c`<li aria-hidden="true">${a(this,y,Gm).call(this,d)}</li>`:h}
3108
+ ${X.map(Ve=>c`<li>${a(this,y,uo).call(this,Ve,G,O,"month",!0)}</li>`)}
3109
+ ${p?.iso===G&&d?c`<li aria-hidden="true">${a(this,y,Ym).call(this,d)}</li>`:h}
3110
3110
  </ul>`:h}
3111
3111
  ${St?c`<button type="button" class="more item" data-k="more:${G}" data-i=${O} data-day=${G} aria-haspopup="dialog"
3112
3112
  aria-expanded=${this._more===G?"true":"false"} aria-label=${this.t("moreLabel",{count:St,date:Z})}
3113
- @click=${()=>this._more===G?a(this,y,Wm).call(this,!1):a(this,y,ow).call(this,G)}>${this.t("more",{count:St})}</button>`:h}
3113
+ @click=${()=>this._more===G?a(this,y,Gm).call(this,!1):a(this,y,lw).call(this,G)}>${this.t("more",{count:St})}</button>`:h}
3114
3114
  ${this._more===G?c`<div class="pop ${ve>=4?"end":""}" role="dialog" aria-label=${Z}>
3115
- <div class="pop-h"><span>${Z}</span><button type="button" class="xb" aria-label=${this.t("close")} @click=${()=>a(this,y,Wm).call(this,!0)}><cm-icon name="close" size="16"></cm-icon></button></div>
3116
- <ul>${K.map(Ve=>c`<li>${a(this,y,mo).call(this,Ve,G,O,"list",!1)}</li>`)}</ul>
3115
+ <div class="pop-h"><span>${Z}</span><button type="button" class="xb" aria-label=${this.t("close")} @click=${()=>a(this,y,Gm).call(this,!0)}><cm-icon name="close" size="16"></cm-icon></button></div>
3116
+ <ul>${K.map(Ve=>c`<li>${a(this,y,uo).call(this,Ve,G,O,"list",!1)}</li>`)}</ul>
3117
3117
  </div>`:h}
3118
3118
  </td>`},x=c`<table class="month ${b?"compact":""}" part="grid" role="grid" aria-labelledby="${r(this,Je)}-t" aria-describedby="${r(this,Je)}-gh"
3119
3119
  aria-busy=${this.loading?"true":"false"}>
3120
- ${a(this,y,cw).call(this,b)}
3120
+ ${a(this,y,dw).call(this,b)}
3121
3121
  <tbody>${u.map((q,O)=>c`<tr>${q.map((ve,G)=>f(ve,O*7+G,G))}</tr>`)}</tbody>
3122
3122
  </table>`;if(!b)return x;let v=B(i),k=t.get(v)??[],L=e.findIndex(q=>B(q)===v),P=a(this,y,gt).call(this,i),U=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2)+1);return c`${x}
3123
3123
  <section class="agenda" part="agenda" aria-labelledby="${r(this,Je)}-ag">
3124
3124
  <div class="ag-h">
3125
3125
  <div class="ag-t" id="${r(this,Je)}-ag" role="heading" aria-level=${U}>${P}</div>
3126
- ${this.readonly?h:c`<button type="button" class="hb ag-add" aria-label=${this.t("addOn",{date:P})} @click=${()=>a(this,y,yd).call(this,v,!0)}>
3126
+ ${this.readonly?h:c`<button type="button" class="hb ag-add" aria-label=${this.t("addOn",{date:P})} @click=${()=>a(this,y,xd).call(this,v,!0)}>
3127
3127
  <cm-icon name="plus" size="16"></cm-icon>${this.t("add")}</button>`}
3128
3128
  </div>
3129
- ${k.length?c`<ul class="ag-list">${k.map(q=>c`<li>${a(this,y,mo).call(this,q,v,L,"list",!1)}</li>`)}</ul>`:c`<p class="empty">${this.t("noEvents")}</p>`}
3130
- </section>`},hw=function(e){let t=new Map,i=e.filter(u=>!u.allDay).sort((u,b)=>u.min-b.min||b.dur-u.dur),s=[],l=[],d=-1,p=()=>{for(let u of s)t.get(u).lanes=l.length;s=[],l=[]};for(let u of i){let b=Math.min(1440,u.min+Math.max(u.dur,20));u.min>=d&&(p(),d=-1);let f=l.findIndex(x=>x<=u.min);f<0?(f=l.length,l.push(b)):l[f]=b,t.set(u,{lane:f,lanes:1}),s.push(u),d=Math.max(d,b)}return p(),t},pw=function(e,t){let i=r(this,y,md),s=r(this,y,pd),l=a(this,y,Wf).call(this),d=this._target,p=this.readonly,u=e.map(f=>{let x=B(f),v=t.get(x)??[];return{d:f,iso:x,text:a(this,y,gt).call(this,f),allDay:v.filter(k=>k.allDay),timed:v.filter(k=>!k.allDay),lanes:a(this,y,hw).call(this,v)}}),b=Array.from({length:24},(f,x)=>x);return c`<div class="tg" part="grid" role="grid" aria-labelledby="${r(this,Je)}-t" aria-describedby="${r(this,Je)}-gh" aria-busy=${this.loading?"true":"false"}
3129
+ ${k.length?c`<ul class="ag-list">${k.map(q=>c`<li>${a(this,y,uo).call(this,q,v,L,"list",!1)}</li>`)}</ul>`:c`<p class="empty">${this.t("noEvents")}</p>`}
3130
+ </section>`},pw=function(e){let t=new Map,i=e.filter(u=>!u.allDay).sort((u,b)=>u.min-b.min||b.dur-u.dur),s=[],l=[],d=-1,p=()=>{for(let u of s)t.get(u).lanes=l.length;s=[],l=[]};for(let u of i){let b=Math.min(1440,u.min+Math.max(u.dur,20));u.min>=d&&(p(),d=-1);let f=l.findIndex(x=>x<=u.min);f<0?(f=l.length,l.push(b)):l[f]=b,t.set(u,{lane:f,lanes:1}),s.push(u),d=Math.max(d,b)}return p(),t},mw=function(e,t){let i=r(this,y,ud),s=r(this,y,md),l=a(this,y,Gf).call(this),d=this._target,p=this.readonly,u=e.map(f=>{let x=B(f),v=t.get(x)??[];return{d:f,iso:x,text:a(this,y,gt).call(this,f),allDay:v.filter(k=>k.allDay),timed:v.filter(k=>!k.allDay),lanes:a(this,y,pw).call(this,v)}}),b=Array.from({length:24},(f,x)=>x);return c`<div class="tg" part="grid" role="grid" aria-labelledby="${r(this,Je)}-t" aria-describedby="${r(this,Je)}-gh" aria-busy=${this.loading?"true":"false"}
3131
3131
  style="--cols:${e.length}">
3132
3132
  <div class="tg-top" role="rowgroup">
3133
3133
  <div class="row" role="row">
@@ -3140,24 +3140,24 @@ cm-data-table:has(> table) { container-type: inline-size; }
3140
3140
  <div class="axis" role="rowheader">${this.t("allDay")}</div>
3141
3141
  ${u.map((f,x)=>c`<div class="adcell ${d?.iso===f.iso&&l?.allDay?"over":""}" role="gridcell" data-drop data-i=${x}>
3142
3142
  ${p?h:c`<button type="button" class="add item" data-k="adadd:${f.iso}" data-i=${x} data-day=${f.iso} data-row="a"
3143
- aria-label=${this.t("addAllDay",{date:f.text})} @click=${()=>a(this,y,yd).call(this,f.iso,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3144
- ${f.allDay.map(v=>a(this,y,mo).call(this,v,f.iso,x,"allday",!0,{row:"a"}))}
3145
- ${d?.iso===f.iso&&l?.allDay?a(this,y,Gm).call(this,l):h}
3143
+ aria-label=${this.t("addAllDay",{date:f.text})} @click=${()=>a(this,y,xd).call(this,f.iso,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3144
+ ${f.allDay.map(v=>a(this,y,uo).call(this,v,f.iso,x,"allday",!0,{row:"a"}))}
3145
+ ${d?.iso===f.iso&&l?.allDay?a(this,y,Ym).call(this,l):h}
3146
3146
  </div>`)}
3147
3147
  </div>
3148
3148
  </div>
3149
3149
  <div class="tg-body" role="rowgroup">
3150
3150
  ${b.map(f=>c`<div class="row hr" role="row">
3151
- <div class="axis" role="rowheader"><span>${a(this,y,Wx).call(this,f)}</span></div>
3151
+ <div class="axis" role="rowheader"><span>${a(this,y,Gx).call(this,f)}</span></div>
3152
3152
  ${u.map((x,v)=>{let k=x.timed.filter(P=>Math.floor(P.min/60)===f),L=l&&!l.allDay&&d?.iso===x.iso&&d.min!==void 0&&Math.floor(d.min/60)===f;return c`<div class="tcell" role="gridcell" data-i=${v} data-row=${f} data-day=${x.iso}>
3153
3153
  ${p?h:c`<button type="button" class="slot item" data-k="slot:${x.iso}:${f}" data-i=${v} data-row=${f} data-day=${x.iso}
3154
- aria-label=${this.t("addAt",{time:a(this,y,ud).call(this,f*60),date:x.text})} @click=${P=>a(this,y,nw).call(this,P,x.iso,f)}></button>`}
3155
- ${k.map(P=>{let U=x.lanes.get(P)??{lane:0,lanes:1},q=Math.min(P.dur,1440-P.min)/60;return a(this,y,mo).call(this,P,x.iso,v,"time",!0,{row:String(f),style:`--top:${(P.min-f*60)/60};--len:${q};--lane:${U.lane};--lanes:${U.lanes}`})})}
3156
- ${L?a(this,y,Gm).call(this,l,"time",`--top:${(d.min-f*60)/60};--len:${Math.min(l.dur,1440-d.min)/60}`):h}
3154
+ aria-label=${this.t("addAt",{time:a(this,y,gd).call(this,f*60),date:x.text})} @click=${P=>a(this,y,ow).call(this,P,x.iso,f)}></button>`}
3155
+ ${k.map(P=>{let U=x.lanes.get(P)??{lane:0,lanes:1},q=Math.min(P.dur,1440-P.min)/60;return a(this,y,uo).call(this,P,x.iso,v,"time",!0,{row:String(f),style:`--top:${(P.min-f*60)/60};--len:${q};--lane:${U.lane};--lanes:${U.lanes}`})})}
3156
+ ${L?a(this,y,Ym).call(this,l,"time",`--top:${(d.min-f*60)/60};--len:${Math.min(l.dur,1440-d.min)/60}`):h}
3157
3157
  </div>`})}
3158
3158
  </div>`)}
3159
3159
  </div>
3160
- </div>`},go.properties={view:{reflect:!0},date:{reflect:!0},today:{},label:{string:"label"},step:{type:Number},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},hourCycle:{attribute:"hour-cycle"},dayStart:{type:Number,attribute:"day-start"},maxEvents:{type:Number,attribute:"max-events"},headingLevel:{type:Number,attribute:"heading-level"},loading:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0},_narrow:{state:!0},_more:{state:!0},_target:{state:!0}},go.styles=[E,w`
3160
+ </div>`},fo.properties={view:{reflect:!0},date:{reflect:!0},today:{},label:{string:"label"},step:{type:Number},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},hourCycle:{attribute:"hour-cycle"},dayStart:{type:Number,attribute:"day-start"},maxEvents:{type:Number,attribute:"max-events"},headingLevel:{type:Number,attribute:"heading-level"},loading:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0},_narrow:{state:!0},_more:{state:!0},_target:{state:!0}},fo.styles=[E,w`
3161
3161
  :host { display: block; position: relative; min-width: 0; font-size: 14px; line-height: 20px; }
3162
3162
  :host([dragging]) { cursor: grabbing; user-select: none; -webkit-user-select: none; }
3163
3163
  .cal { display: flex; flex-direction: column; gap: var(--cm-space-12); min-width: 0; }
@@ -3318,12 +3318,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
3318
3318
  .chip.time > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3319
3319
  .chip.time .lead { display: flex; align-items: center; gap: 4px; min-width: 0; }
3320
3320
  .ph.time { position: absolute; z-index: 3; inset-inline: 0 2px; inset-block-start: calc(var(--top) * var(--h)); height: calc(var(--len) * var(--h)); align-items: flex-start; }
3321
- `];$("cm-calendar",go);var oT=z("reportTile",{pinned:", pinned"}),Os=class extends C{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
3321
+ `];$("cm-calendar",fo);var dT=z("reportTile",{pinned:", pinned"}),Bs=class extends C{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
3322
3322
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="40"></cm-icon></slot></span>
3323
3323
  <span class="label">${this.label}</span>
3324
3324
  ${this.pinned?c`<span class="pin" part="pin"><cm-icon name="pin" size="16"></cm-icon>
3325
3325
  <span class="sr">${this.t("pinned")}</span></span>`:h}
3326
- `;return this.href?c`<a class="tile" part="tile" href=${this.href}>${e}</a>`:c`<button class="tile" part="tile" type="button">${e}</button>`}};Os.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Os.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Os.styles=[E,w`
3326
+ `;return this.href?c`<a class="tile" part="tile" href=${this.href}>${e}</a>`:c`<button class="tile" part="tile" type="button">${e}</button>`}};Bs.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Bs.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0},Bs.styles=[E,w`
3327
3327
  :host { display: block; }
3328
3328
  .tile {
3329
3329
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-12);
@@ -3342,10 +3342,10 @@ cm-data-table:has(> table) { container-type: inline-size; }
3342
3342
  .icon cm-icon::part(svg) { width: 32px; height: 32px; }
3343
3343
  ::slotted([slot='icon']) { width: 32px; height: 32px; }
3344
3344
  }
3345
- `];$("cm-report-tile",Os);var wo=class extends A{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return c`
3345
+ `];$("cm-report-tile",Bs);var $o=class extends A{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return c`
3346
3346
  ${this.heading?c`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:h}
3347
3347
  <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":h}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
3348
- `}};wo.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},wo.styles=[E,w`
3348
+ `}};$o.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},$o.styles=[E,w`
3349
3349
  :host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
3350
3350
  .title { margin: 0 0 var(--cm-space-16); font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
3351
3351
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-12); }
@@ -3355,7 +3355,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3355
3355
  .title { margin-bottom: var(--cm-space-8); }
3356
3356
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-8); }
3357
3357
  }
3358
- `];$("cm-report-tiles",wo);var pT=z("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),mw=/^\s*-?\d+(\.\d+)?\s*$/,$o=class extends C{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:mw.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),s=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
3358
+ `];$("cm-report-tiles",$o);var gT=z("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),uw=/^\s*-?\d+(\.\d+)?\s*$/,ko=class extends C{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:uw.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),s=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
3359
3359
  <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${s}</span>
3360
3360
  </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?c`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),s=i!==h||e,l=c`
3361
3361
  <span class="label" id="label" part="label">${this.label}</span>
@@ -3364,7 +3364,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3364
3364
  ${i}
3365
3365
  <span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
3366
3366
  </span>
3367
- `,d=c`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,p=this.loading?"true":h;return this.href?c`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${s?"foot":h} aria-busy=${p}>${l}</a>${d}`:c`<div class="tile" part="tile" aria-busy=${p}>${l}</div>${d}`}};$o.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&mw.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},$o.styles=[E,w`
3367
+ `,d=c`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,p=this.loading?"true":h;return this.href?c`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${s?"foot":h} aria-busy=${p}>${l}</a>${d}`:c`<div class="tile" part="tile" aria-busy=${p}>${l}</div>${d}`}};ko.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&uw.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},ko.styles=[E,w`
3368
3368
  :host { display: block; align-self: stretch; min-inline-size: 0; }
3369
3369
  .tile {
3370
3370
  display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
@@ -3400,29 +3400,29 @@ cm-data-table:has(> table) { container-type: inline-size; }
3400
3400
  .value { font-size: var(--cm-type-heading-lg-resp-size); }
3401
3401
  }
3402
3402
  @media (forced-colors: active) { .change { color: CanvasText; } }
3403
- `];$("cm-metric",$o);var ko=class extends A{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return uw(this)}};ko.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},ko.styles=w`:host { display: none !important; }`;$("cm-nav-item",ko);function uw(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Si(o);return t.length&&(e.items=t),e}var Si=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(uw),Gf=o=>o.value||o.href||o.label,Xm=o=>!!o.current||!!o.items?.some(Xm),wr=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},$r=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:Gf(n),href:n.href??""}}));var wT=z("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Ad,Dd,Zm,Y,Yf,Jm,Xf,gw,fw,Jf,Qf,bw,Zf,eb,Qm,tb,vw,Eo=class extends C{constructor(){super(...arguments);m(this,Y);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;m(this,Ad,new Set);m(this,Dd);m(this,Zm,N("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,Y,Yf).call(this),g(this,Dd,wr(this,()=>a(this,Y,Yf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Dd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,Y,Jm).call(this,e,t);r(this,Ad).has(i)||!e.items?.length||(r(this,Ad).add(i),(e.expanded||Xm(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let s=a(this,Y,Jm).call(this,i,e),l=t??!this._open.has(s);if(l===this._open.has(s))return;let d=new Set(this._open);l?d.add(s):d.delete(s),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
3404
- <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${a(this,Y,fw)}>
3403
+ `];$("cm-metric",ko);var Eo=class extends A{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return gw(this)}};Eo.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},Eo.styles=w`:host { display: none !important; }`;$("cm-nav-item",Eo);function gw(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Li(o);return t.length&&(e.items=t),e}var Li=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(gw),Yf=o=>o.value||o.href||o.label,Jm=o=>!!o.current||!!o.items?.some(Jm),$r=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},kr=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:Yf(n),href:n.href??""}}));var ET=z("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Dd,Rd,eu,Y,Xf,Qm,Jf,fw,bw,Qf,Zf,vw,eb,tb,Zm,ib,yw,Mo=class extends C{constructor(){super(...arguments);m(this,Y);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;m(this,Dd,new Set);m(this,Rd);m(this,eu,N("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,Y,Xf).call(this),g(this,Rd,$r(this,()=>a(this,Y,Xf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Rd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,Y,Qm).call(this,e,t);r(this,Dd).has(i)||!e.items?.length||(r(this,Dd).add(i),(e.expanded||Jm(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let s=a(this,Y,Qm).call(this,i,e),l=t??!this._open.has(s);if(l===this._open.has(s))return;let d=new Set(this._open);l?d.add(s):d.delete(s),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
3404
+ <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${a(this,Y,bw)}>
3405
3405
  <slot name="header"></slot>
3406
3406
  <ul part="list">
3407
- ${this.navItems.map((t,i)=>{if(!t.items?.length)return c`<li>${a(this,Y,tb).call(this,t,"",{index:i})}</li>`;let s=!e&&this._open.has(a(this,Y,Jm).call(this,t,i)),l=`${r(this,Zm)}-${i}`;return c`<li>
3408
- ${a(this,Y,Qm).call(this,t,c`<button type="button" class="item parent ${Xm(t)?"has-current":""}" part="item" data-index=${i}
3409
- aria-expanded=${s?"true":"false"} aria-controls=${l} @click=${()=>e?a(this,Y,bw).call(this,i):this.toggle(i)}>
3410
- ${a(this,Y,Zf).call(this,t)}${a(this,Y,eb).call(this,t)}
3407
+ ${this.navItems.map((t,i)=>{if(!t.items?.length)return c`<li>${a(this,Y,ib).call(this,t,"",{index:i})}</li>`;let s=!e&&this._open.has(a(this,Y,Qm).call(this,t,i)),l=`${r(this,eu)}-${i}`;return c`<li>
3408
+ ${a(this,Y,Zm).call(this,t,c`<button type="button" class="item parent ${Jm(t)?"has-current":""}" part="item" data-index=${i}
3409
+ aria-expanded=${s?"true":"false"} aria-controls=${l} @click=${()=>e?a(this,Y,vw).call(this,i):this.toggle(i)}>
3410
+ ${a(this,Y,eb).call(this,t)}${a(this,Y,tb).call(this,t)}
3411
3411
  ${e?h:c`<cm-icon class="chev" name="chevron-down" size="16"></cm-icon>`}
3412
3412
  </button>`)}
3413
3413
  <ul class="sub" id=${l} ?hidden=${!s} aria-label=${t.label}>
3414
- ${a(this,Y,Jf).call(this,t.items).map(([d,p])=>c`<li>${a(this,Y,tb).call(this,{...d,icon:void 0},p?"deep":"",{parent:i})}</li>`)}
3414
+ ${a(this,Y,Qf).call(this,t.items).map(([d,p])=>c`<li>${a(this,Y,ib).call(this,{...d,icon:void 0},p?"deep":"",{parent:i})}</li>`)}
3415
3415
  </ul>
3416
3416
  </li>`})}
3417
3417
  </ul>
3418
- ${a(this,Y,vw).call(this)}
3418
+ ${a(this,Y,yw).call(this)}
3419
3419
  <slot name="footer"></slot>
3420
3420
  <slot hidden></slot>
3421
3421
  </nav>
3422
- `}};Ad=new WeakMap,Dd=new WeakMap,Zm=new WeakMap,Y=new WeakSet,Yf=function(){this._slotted=Si(this)},Jm=function(e,t){return`${t}:${Gf(e)}`},Xf=function(e,t){$r(this,t)||e.preventDefault()},gw=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},fw=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=a(this,Y,gw).call(this),s=i.indexOf(t),l=Number(t.dataset.index),d=se(e,this),p;if(e.key==="ArrowDown")p=i[(s+1)%i.length];else if(e.key==="ArrowUp")p=i[(s-1+i.length)%i.length];else if(e.key==="Home")p=i[0];else if(e.key==="End")p=i[i.length-1];else{if(this.collapsed&&(d==="ArrowRight"||d==="ArrowLeft"))return;if(d==="ArrowRight"&&t.classList.contains("parent")){this.toggle(l,!0),e.preventDefault();return}else if(d==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(l,!1):t.dataset.parent&&(p=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!p){e.preventDefault();return}}else return}e.preventDefault(),p?.focus()},Jf=function(e,t=0){return e.flatMap(i=>[[i,t],...a(this,Y,Jf).call(this,i.items??[],t+1)])},Qf=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},bw=function(e){a(this,Y,Qf).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},Zf=function(e){return e.icon?c`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?c`<span class="initial" aria-hidden="true">${([...e.label.trim()][0]??"").toLocaleUpperCase(this.locale)}</span>`:h},eb=function(e){if(!this.collapsed)return c`<span class="label">${e.label}</span>${e.badge?c`<span class="badge">${e.badge}</span>`:h}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return c`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?c`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:h}</span>`:h}`},Qm=function(e,t){return this.collapsed?c`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},tb=function(e,t,i={}){let s=c`${a(this,Y,Zf).call(this,e)}${a(this,Y,eb).call(this,e)}`;return a(this,Y,Qm).call(this,e,e.href?c`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":h}
3423
- data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Xf).call(this,l,e)}>${s}</a>`:c`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":h}
3424
- data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Xf).call(this,l,e)}>${s}</button>`)},vw=function(){if(!this.collapsible)return h;let e=this.t(this.collapsed?"expand":"collapse"),t=c`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?c`<span class="sr">${e}</span>`:c`<span class="label">${e}</span>`}`;return c`<div class="toggle-row">${a(this,Y,Qm).call(this,{label:e},c`<button type="button" class="item toggle" part="collapse-button"
3425
- @click=${()=>a(this,Y,Qf).call(this,!this.collapsed)}>${t}</button>`)}</div>`},Eo.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},Eo.styles=[E,w`
3422
+ `}};Dd=new WeakMap,Rd=new WeakMap,eu=new WeakMap,Y=new WeakSet,Xf=function(){this._slotted=Li(this)},Qm=function(e,t){return`${t}:${Yf(e)}`},Jf=function(e,t){kr(this,t)||e.preventDefault()},fw=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},bw=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=a(this,Y,fw).call(this),s=i.indexOf(t),l=Number(t.dataset.index),d=se(e,this),p;if(e.key==="ArrowDown")p=i[(s+1)%i.length];else if(e.key==="ArrowUp")p=i[(s-1+i.length)%i.length];else if(e.key==="Home")p=i[0];else if(e.key==="End")p=i[i.length-1];else{if(this.collapsed&&(d==="ArrowRight"||d==="ArrowLeft"))return;if(d==="ArrowRight"&&t.classList.contains("parent")){this.toggle(l,!0),e.preventDefault();return}else if(d==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(l,!1):t.dataset.parent&&(p=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!p){e.preventDefault();return}}else return}e.preventDefault(),p?.focus()},Qf=function(e,t=0){return e.flatMap(i=>[[i,t],...a(this,Y,Qf).call(this,i.items??[],t+1)])},Zf=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},vw=function(e){a(this,Y,Zf).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},eb=function(e){return e.icon?c`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?c`<span class="initial" aria-hidden="true">${([...e.label.trim()][0]??"").toLocaleUpperCase(this.locale)}</span>`:h},tb=function(e){if(!this.collapsed)return c`<span class="label">${e.label}</span>${e.badge?c`<span class="badge">${e.badge}</span>`:h}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return c`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?c`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:h}</span>`:h}`},Zm=function(e,t){return this.collapsed?c`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},ib=function(e,t,i={}){let s=c`${a(this,Y,eb).call(this,e)}${a(this,Y,tb).call(this,e)}`;return a(this,Y,Zm).call(this,e,e.href?c`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":h}
3423
+ data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Jf).call(this,l,e)}>${s}</a>`:c`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":h}
3424
+ data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Jf).call(this,l,e)}>${s}</button>`)},yw=function(){if(!this.collapsible)return h;let e=this.t(this.collapsed?"expand":"collapse"),t=c`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?c`<span class="sr">${e}</span>`:c`<span class="label">${e}</span>`}`;return c`<div class="toggle-row">${a(this,Y,Zm).call(this,{label:e},c`<button type="button" class="item toggle" part="collapse-button"
3425
+ @click=${()=>a(this,Y,Zf).call(this,!this.collapsed)}>${t}</button>`)}</div>`},Mo.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},Mo.styles=[E,w`
3426
3426
  :host { display: block; width: var(--cm-side-navigation-width, 220px); }
3427
3427
  nav {
3428
3428
  background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: var(--cm-radius-lg);
@@ -3467,7 +3467,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3467
3467
  background: var(--cm-count-bg); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
3468
3468
  }
3469
3469
  .dot.count { inset-block-start: 2px; height: 16px; padding: 0 var(--cm-space-4); font-size: var(--cm-font-size-12); font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; color: var(--cm-count-text); }
3470
- `];$("cm-side-navigation",Eo);function yw(o){let n=o.trim().split(/[\s._@-]+/).filter(Boolean);if(!n.length)return"";let e=[...n[0]][0]??"",t=n.length>1&&!/[.@]/.test(o)?[...n[n.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var Mo=class extends A{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=yw(this.name),t=this.decorative||!this.name?h:this.name,i=this.decorative||!this.name?"true":h,s,l="avatar";return this.src&&!this._failed?s=c`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?s=c`<span aria-hidden="true">${e}</span>`:(l+=" icon",s=c`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),c`<span class=${l} part="avatar" role=${t===h?h:"img"} aria-label=${t} aria-hidden=${i}>${s}</span>`}};Mo.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},Mo.styles=[E,w`
3470
+ `];$("cm-side-navigation",Mo);function xw(o){let n=o.trim().split(/[\s._@-]+/).filter(Boolean);if(!n.length)return"";let e=[...n[0]][0]??"",t=n.length>1&&!/[.@]/.test(o)?[...n[n.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var _o=class extends A{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=xw(this.name),t=this.decorative||!this.name?h:this.name,i=this.decorative||!this.name?"true":h,s,l="avatar";return this.src&&!this._failed?s=c`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?s=c`<span aria-hidden="true">${e}</span>`:(l+=" icon",s=c`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),c`<span class=${l} part="avatar" role=${t===h?h:"img"} aria-label=${t} aria-hidden=${i}>${s}</span>`}};_o.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},_o.styles=[E,w`
3471
3471
  :host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
3472
3472
  :host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
3473
3473
  :host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
@@ -3480,22 +3480,22 @@ cm-data-table:has(> table) { container-type: inline-size; }
3480
3480
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
3481
3481
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
3482
3482
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
3483
- `];$("cm-avatar",Mo);var LT=z("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),Co,Li,zo,Fe,Rd,ib,_o,To=class extends C{constructor(){super();m(this,Fe);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;m(this,Co);m(this,Li,!1);m(this,zo,null);this.addEventListener("cm-select",e=>{let t=a(this,Fe,Rd).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,Fe,Rd).call(this)?.focus();return}this._searchOpen||(g(this,zo,Ju()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,Co,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,Co).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Co)?.disconnect(),r(this,Li)&&(Gi(),g(this,Li,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,Li)||(tc(),g(this,Li,!0)),a(this,Fe,Rd).call(this)?.focus(),a(this,Fe,_o).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,Li)&&(Gi(),g(this,Li,!1));let i=r(this,zo)??this.renderRoot.querySelector(".search-btn");g(this,zo,null),i?.isConnected&&i.focus(),a(this,Fe,_o).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
3483
+ `];$("cm-avatar",_o);var RT=z("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),zo,Ai,So,Fe,Hd,rb,To,Co=class extends C{constructor(){super();m(this,Fe);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;m(this,zo);m(this,Ai,!1);m(this,So,null);this.addEventListener("cm-select",e=>{let t=a(this,Fe,Hd).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,Fe,Hd).call(this)?.focus();return}this._searchOpen||(g(this,So,Qu()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,zo,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,zo).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,zo)?.disconnect(),r(this,Ai)&&(Yi(),g(this,Ai,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,Ai)||(ic(),g(this,Ai,!0)),a(this,Fe,Hd).call(this)?.focus(),a(this,Fe,To).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,Ai)&&(Yi(),g(this,Ai,!1));let i=r(this,So)??this.renderRoot.querySelector(".search-btn");g(this,So,null),i?.isConnected&&i.focus(),a(this,Fe,To).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
3484
3484
  <header part="bar" role="banner" aria-label=${this.label||h}>
3485
3485
  <div class="logo"><slot name="logo"></slot></div>
3486
3486
  ${this.store?c`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
3487
- @click=${()=>a(this,Fe,_o).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="16"></cm-icon></button>`:h}
3488
- ${this._narrow?h:c`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${a(this,Fe,ib)}></slot></div>`}
3487
+ @click=${()=>a(this,Fe,To).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="16"></cm-icon></button>`:h}
3488
+ ${this._narrow?h:c`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${a(this,Fe,rb)}></slot></div>`}
3489
3489
  <span class="grow"></span>
3490
3490
  <div class="end">
3491
3491
  ${this._narrow&&this._hasSearch?c`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
3492
3492
  aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:h}
3493
3493
  <div class="actions"><slot name="actions"></slot></div>
3494
3494
  ${this.balance?c`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
3495
- @click=${()=>a(this,Fe,_o).call(this,"cm-wallet")}>${this.balance}</button>`:h}
3495
+ @click=${()=>a(this,Fe,To).call(this,"cm-wallet")}>${this.balance}</button>`:h}
3496
3496
  <slot name="end"></slot>
3497
3497
  ${this.userName?c`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
3498
- @click=${()=>a(this,Fe,_o).call(this,"cm-account")}><span class="name">${this.userName}</span>
3498
+ @click=${()=>a(this,Fe,To).call(this,"cm-account")}><span class="name">${this.userName}</span>
3499
3499
  <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:h}
3500
3500
  <slot name="account"></slot>
3501
3501
  </div>
@@ -3504,11 +3504,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
3504
3504
  @keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
3505
3505
  @cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
3506
3506
  <div class="layer-bar">
3507
- <div class="layer-search"><slot name="search" @slotchange=${a(this,Fe,ib)}></slot></div>
3507
+ <div class="layer-search"><slot name="search" @slotchange=${a(this,Fe,rb)}></slot></div>
3508
3508
  <button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
3509
3509
  </div>
3510
3510
  </dialog>`:h}
3511
- `}};Co=new WeakMap,Li=new WeakMap,zo=new WeakMap,Fe=new WeakSet,Rd=function(){return this.querySelector(':scope > [slot="search"]')},ib=function(){this._hasSearch=!!a(this,Fe,Rd).call(this)},_o=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},To.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},To.styles=[E,w`
3511
+ `}};zo=new WeakMap,Ai=new WeakMap,So=new WeakMap,Fe=new WeakSet,Hd=function(){return this.querySelector(':scope > [slot="search"]')},rb=function(){this._hasSearch=!!a(this,Fe,Hd).call(this)},To=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Co.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},Co.styles=[E,w`
3512
3512
  :host {
3513
3513
  display: block; background: var(--cm-bg-surface); container-type: inline-size;
3514
3514
  --_h: var(--cm-control-height-md); --_touch: var(--cm-control-height-touch);
@@ -3585,11 +3585,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
3585
3585
  @media (pointer: coarse) {
3586
3586
  @container (max-width: 640px) { .user { min-width: var(--_touch); } }
3587
3587
  }
3588
- `];$("cm-header-bar",To);var IT=z("bottomNavigation",{label:"Main"}),Hd,Bs,rb,xw,So=class extends C{constructor(){super(...arguments);m(this,Bs);this.items=[];this.fixed=!1;this.menuItem="";this.menuOpen=!1;this._slotted=[];m(this,Hd)}connectedCallback(){super.connectedCallback(),a(this,Bs,rb).call(this),g(this,Hd,wr(this,()=>a(this,Bs,rb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Hd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3589
- <ul>${this.navItems.slice(0,5).map(e=>c`<li>${a(this,Bs,xw).call(this,e)}</li>`)}</ul>
3588
+ `];$("cm-header-bar",Co);var BT=z("bottomNavigation",{label:"Main"}),Nd,Fs,sb,ww,Lo=class extends C{constructor(){super(...arguments);m(this,Fs);this.items=[];this.fixed=!1;this.menuItem="";this.menuOpen=!1;this._slotted=[];m(this,Nd)}connectedCallback(){super.connectedCallback(),a(this,Fs,sb).call(this),g(this,Nd,$r(this,()=>a(this,Fs,sb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Nd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3589
+ <ul>${this.navItems.slice(0,5).map(e=>c`<li>${a(this,Fs,ww).call(this,e)}</li>`)}</ul>
3590
3590
  <slot hidden></slot>
3591
- </nav>`}};Hd=new WeakMap,Bs=new WeakSet,rb=function(){this._slotted=Si(this)},xw=function(e){let t=!!this.menuItem&&e.value===this.menuItem,i=this.menuOpen&&this.menuItem?t:!!e.current,s=`item ${e.primary?"primary":""} ${i?"on":""}`,l=c`<span class="icon">${e.icon?c`<cm-icon name=${e.icon} size=${e.primary?16:20}></cm-icon>`:h}</span><span class="label">${e.label}</span>`,d=p=>{$r(this,e)||p.preventDefault()};return e.href?c`<a class=${s} part="item" href=${e.href} aria-current=${e.current?"page":h} @click=${d}>${l}</a>`:c`<button type="button" class=${s} part="item" aria-current=${e.current?"page":h}
3592
- aria-expanded=${t?String(this.menuOpen):h} @click=${d}>${l}</button>`},So.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},menuItem:{attribute:"menu-item"},menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},_slotted:{state:!0}},So.styles=[E,w`
3591
+ </nav>`}};Nd=new WeakMap,Fs=new WeakSet,sb=function(){this._slotted=Li(this)},ww=function(e){let t=!!this.menuItem&&e.value===this.menuItem,i=this.menuOpen&&this.menuItem?t:!!e.current,s=`item ${e.primary?"primary":""} ${i?"on":""}`,l=c`<span class="icon">${e.icon?c`<cm-icon name=${e.icon} size=${e.primary?16:20}></cm-icon>`:h}</span><span class="label">${e.label}</span>`,d=p=>{kr(this,e)||p.preventDefault()};return e.href?c`<a class=${s} part="item" href=${e.href} aria-current=${e.current?"page":h} @click=${d}>${l}</a>`:c`<button type="button" class=${s} part="item" aria-current=${e.current?"page":h}
3592
+ aria-expanded=${t?String(this.menuOpen):h} @click=${d}>${l}</button>`},Lo.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},menuItem:{attribute:"menu-item"},menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},_slotted:{state:!0}},Lo.styles=[E,w`
3593
3593
  :host { display: block; }
3594
3594
  :host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
3595
3595
  nav {
@@ -3614,32 +3614,32 @@ cm-data-table:has(> table) { container-type: inline-size; }
3614
3614
  .primary .icon { width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
3615
3615
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
3616
3616
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3617
- `];$("cm-bottom-navigation",So);var UT=z("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Nd,Fs,Ze,sb,ww,ab,nb,$w,Lo=class extends C{constructor(){super(...arguments);m(this,Ze);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;m(this,Nd);m(this,Fs,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,Ze,sb).call(this),g(this,Nd,wr(this,()=>a(this,Ze,sb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Nd)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Fs)}-sub"
3617
+ `];$("cm-bottom-navigation",Lo);var GT=z("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Pd,Vs,Ze,ab,$w,nb,ob,kw,Ao=class extends C{constructor(){super(...arguments);m(this,Ze);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;m(this,Pd);m(this,Vs,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,Ze,ab).call(this),g(this,Pd,$r(this,()=>a(this,Ze,ab).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Pd)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Vs)}-sub"
3618
3618
  @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
3619
3619
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="16"></cm-icon>
3620
3620
  ${t.label}</button>
3621
- <ul class="card" aria-label=${t.label}>${t.items.map(i=>c`<li>${a(this,Ze,nb).call(this,i,0,0,!0)}</li>`)}</ul>
3621
+ <ul class="card" aria-label=${t.label}>${t.items.map(i=>c`<li>${a(this,Ze,ob).call(this,i,0,0,!0)}</li>`)}</ul>
3622
3622
  <slot hidden></slot>
3623
3623
  </nav>`:c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3624
- ${a(this,Ze,$w).call(this)}
3625
- ${e.map((i,s)=>{let l=`${r(this,Fs)}-s${s}`;return c`<section aria-labelledby=${i.label?l:h}>
3624
+ ${a(this,Ze,kw).call(this)}
3625
+ ${e.map((i,s)=>{let l=`${r(this,Vs)}-s${s}`;return c`<section aria-labelledby=${i.label?l:h}>
3626
3626
  ${i.label?c`<h2 class="heading" id=${l}>${i.label}</h2>`:h}
3627
- <ul class="card">${(i.items??[]).map((d,p)=>c`<li>${a(this,Ze,nb).call(this,d,s,p)}</li>`)}</ul>
3627
+ <ul class="card">${(i.items??[]).map((d,p)=>c`<li>${a(this,Ze,ob).call(this,d,s,p)}</li>`)}</ul>
3628
3628
  </section>`})}
3629
3629
  <slot hidden></slot>
3630
- </nav>`}};Nd=new WeakMap,Fs=new WeakMap,Ze=new WeakSet,sb=function(){this._slotted=Si(this)},ww=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},ab=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},nb=function(e,t,i,s=!1){let l=b=>{$r(this,e)||b.preventDefault()};if(e.primary&&!s)return c`<button type="button" class="row action" part="row" @click=${l}>${e.label}</button>`;let d=e.icon&&!s?c`<cm-icon class="icon" name=${e.icon} size="20"></cm-icon>`:h,p=e.badge?c`<span class="badge">${e.badge}</span>`:h;if(e.items?.length&&!s)return c`<button type="button" class="row" part="row" data-row="${t}-${i}"
3631
- @click=${()=>a(this,Ze,ww).call(this,t,i)}>${d}<span class="text"><span class="label">${e.label}</span>${p}</span><cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let u=c`${d}<span class="text"><span class="label">${e.label}</span>${p}</span>${e.href&&!s?c`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:h}`;return e.href?c`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":h} @click=${l}>${u}</a>`:c`<button type="button" class="row" part="row" aria-current=${e.current?"page":h} @click=${l}>${u}</button>`},$w=function(){if(!this.store&&!this.userName)return h;let e=this.userName.trim().charAt(0).toUpperCase();return c`<section aria-labelledby="${r(this,Fs)}-profile">
3632
- <h2 class="heading" id="${r(this,Fs)}-profile">${this.t("profile")}</h2>
3630
+ </nav>`}};Pd=new WeakMap,Vs=new WeakMap,Ze=new WeakSet,ab=function(){this._slotted=Li(this)},$w=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},nb=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},ob=function(e,t,i,s=!1){let l=b=>{kr(this,e)||b.preventDefault()};if(e.primary&&!s)return c`<button type="button" class="row action" part="row" @click=${l}>${e.label}</button>`;let d=e.icon&&!s?c`<cm-icon class="icon" name=${e.icon} size="20"></cm-icon>`:h,p=e.badge?c`<span class="badge">${e.badge}</span>`:h;if(e.items?.length&&!s)return c`<button type="button" class="row" part="row" data-row="${t}-${i}"
3631
+ @click=${()=>a(this,Ze,$w).call(this,t,i)}>${d}<span class="text"><span class="label">${e.label}</span>${p}</span><cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let u=c`${d}<span class="text"><span class="label">${e.label}</span>${p}</span>${e.href&&!s?c`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:h}`;return e.href?c`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":h} @click=${l}>${u}</a>`:c`<button type="button" class="row" part="row" aria-current=${e.current?"page":h} @click=${l}>${u}</button>`},kw=function(){if(!this.store&&!this.userName)return h;let e=this.userName.trim().charAt(0).toUpperCase();return c`<section aria-labelledby="${r(this,Vs)}-profile">
3632
+ <h2 class="heading" id="${r(this,Vs)}-profile">${this.t("profile")}</h2>
3633
3633
  <ul class="card">
3634
- ${this.store?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ab).call(this,"cm-store-switch")}>
3634
+ ${this.store?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,nb).call(this,"cm-store-switch")}>
3635
3635
  <span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
3636
3636
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
3637
- ${this.userName?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ab).call(this,"cm-account")}>
3637
+ ${this.userName?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,nb).call(this,"cm-account")}>
3638
3638
  <span class="avatar">${this.avatarSrc?c`<img src=${this.avatarSrc} alt="">`:c`<span aria-hidden="true">${e}</span>`}</span>
3639
3639
  <span class="stack"><span>${this.userName}</span>${this.userEmail?c`<span class="email">${this.userEmail}</span>`:h}</span>
3640
3640
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
3641
3641
  </ul>
3642
- </section>`},Lo.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},Lo.styles=[E,w`
3642
+ </section>`},Ao.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},Ao.styles=[E,w`
3643
3643
  :host { display: block; background: var(--cm-bg-page); }
3644
3644
  nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
3645
3645
  .heading {
@@ -3685,12 +3685,12 @@ ${t.label}</button>
3685
3685
  }
3686
3686
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
3687
3687
  .sub .row { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
3688
- `];$("cm-mobile-menu",Lo);var JT=z("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),eu,kw,Ao=class extends C{constructor(){super(...arguments);m(this,eu);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
3688
+ `];$("cm-mobile-menu",Ao);var eC=z("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),tu,Ew,Do=class extends C{constructor(){super(...arguments);m(this,tu);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
3689
3689
  <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h}</slot></span>
3690
3690
  <span class="text"><slot></slot></span>
3691
- ${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${a(this,eu,kw)}><cm-icon name="close" size="16"></cm-icon>
3691
+ ${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${a(this,tu,Ew)}><cm-icon name="close" size="16"></cm-icon>
3692
3692
  </button>`:h}
3693
- </div>`}};eu=new WeakSet,kw=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},Ao.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},Ao.styles=[E,w`
3693
+ </div>`}};tu=new WeakSet,Ew=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},Do.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},Do.styles=[E,w`
3694
3694
  :host { display: block; }
3695
3695
  .bar {
3696
3696
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--cm-space-8); min-height: 48px;
@@ -3712,11 +3712,11 @@ ${t.label}</button>
3712
3712
  @media (max-width: 640px) {
3713
3713
  .bar { min-height: 44px; justify-content: flex-start; text-align: start; }
3714
3714
  }
3715
- `];$("cm-flash-offer-bar",Ao);var sC=z("linkTabs",{label:"Sections"}),Id,Ro,qd,Ct,Ew,Pd,ob,Do=class extends C{constructor(){super(...arguments);m(this,Ct);this.items=[];this._slotted=[];this._more="";m(this,Id);m(this,Ro,new ResizeObserver(()=>a(this,Ct,Pd).call(this)));m(this,qd,"")}connectedCallback(){super.connectedCallback(),a(this,Ct,ob).call(this),g(this,Id,wr(this,()=>a(this,Ct,ob).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Id)?.disconnect(),r(this,Ro).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector("ul");r(this,Ro).observe(e),e.addEventListener("scroll",()=>a(this,Ct,Pd).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,Ct,Pd).call(this))}updated(){for(let e of this.renderRoot.querySelectorAll("li"))r(this,Ro).observe(e);a(this,Ct,Ew).call(this),a(this,Ct,Pd).call(this)}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3715
+ `];$("cm-flash-offer-bar",Do);var oC=z("linkTabs",{label:"Sections"}),qd,Ho,Od,Ct,Mw,Id,lb,Ro=class extends C{constructor(){super(...arguments);m(this,Ct);this.items=[];this._slotted=[];this._more="";m(this,qd);m(this,Ho,new ResizeObserver(()=>a(this,Ct,Id).call(this)));m(this,Od,"")}connectedCallback(){super.connectedCallback(),a(this,Ct,lb).call(this),g(this,qd,$r(this,()=>a(this,Ct,lb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,qd)?.disconnect(),r(this,Ho).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector("ul");r(this,Ho).observe(e),e.addEventListener("scroll",()=>a(this,Ct,Id).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,Ct,Id).call(this))}updated(){for(let e of this.renderRoot.querySelectorAll("li"))r(this,Ho).observe(e);a(this,Ct,Mw).call(this),a(this,Ct,Id).call(this)}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3716
3716
  <ul part="tabs" class=${this._more?`more-${this._more}`:""}>${this.tabs.map(e=>c`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":h}
3717
- @click=${t=>{$r(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
3717
+ @click=${t=>{kr(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
3718
3718
  <slot hidden></slot>
3719
- </nav>`}};Id=new WeakMap,Ro=new WeakMap,qd=new WeakMap,Ct=new WeakSet,Ew=function(){let e=this.renderRoot.querySelector("ul"),t=this.renderRoot.querySelector('a[aria-current="page"]'),i=t?.getAttribute("href")??"";if(!e||!t||i===r(this,qd)||e.scrollWidth<=e.clientWidth)return;g(this,qd,i);let s=e.getBoundingClientRect(),l=t.getBoundingClientRect(),d=32;l.right>s.right-d?e.scrollLeft+=l.right-s.right+d:l.left<s.left+d&&(e.scrollLeft-=s.left+d-l.left)},Pd=function(){let e=this.renderRoot.querySelector("ul");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},ob=function(){this._slotted=Si(this)},Do.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0},_more:{state:!0}},Do.styles=[E,w`
3719
+ </nav>`}};qd=new WeakMap,Ho=new WeakMap,Od=new WeakMap,Ct=new WeakSet,Mw=function(){let e=this.renderRoot.querySelector("ul"),t=this.renderRoot.querySelector('a[aria-current="page"]'),i=t?.getAttribute("href")??"";if(!e||!t||i===r(this,Od)||e.scrollWidth<=e.clientWidth)return;g(this,Od,i);let s=e.getBoundingClientRect(),l=t.getBoundingClientRect(),d=32;l.right>s.right-d?e.scrollLeft+=l.right-s.right+d:l.left<s.left+d&&(e.scrollLeft-=s.left+d-l.left)},Id=function(){let e=this.renderRoot.querySelector("ul");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},lb=function(){this._slotted=Li(this)},Ro.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0},_more:{state:!0}},Ro.styles=[E,w`
3720
3720
  :host { display: block; }
3721
3721
  ul {
3722
3722
  display: flex; gap: var(--cm-space-24); margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto;
@@ -3742,7 +3742,7 @@ ${t.label}</button>
3742
3742
  :host(:dir(rtl)) ul.more-start { mask-image: linear-gradient(to right, #000 calc(100% - var(--cm-space-32)), transparent); }
3743
3743
  @media (max-width: 640px) { ul { gap: var(--cm-space-16); } }
3744
3744
 
3745
- `];$("cm-link-tabs",Do);var dC=z("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),Ho=class extends C{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",s=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
3745
+ `];$("cm-link-tabs",Ro);var mC=z("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),No=class extends C{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",s=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
3746
3746
  <div class="logo" part="logo"><slot name="logo"></slot></div>
3747
3747
  <div class="status"><slot name="status"></slot></div>
3748
3748
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
@@ -3754,7 +3754,7 @@ ${t.label}</button>
3754
3754
  ${this.offer?c`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:h}
3755
3755
  <div class="actions"><slot name="actions"></slot>${this.href?c`<a class="details" part="details" href=${this.href}
3756
3756
  aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:h}</div>
3757
- </article>`}};Ho.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},Ho.styles=[E,w`
3757
+ </article>`}};No.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},No.styles=[E,w`
3758
3758
  :host { display: block; container-type: inline-size; }
3759
3759
  article {
3760
3760
  position: relative; display: flex; flex-direction: column; gap: var(--cm-space-8); height: 100%; padding: var(--cm-space-20);
@@ -3791,21 +3791,21 @@ ${t.label}</button>
3791
3791
  .actions { gap: var(--cm-space-8); }
3792
3792
  .details { margin-inline-start: auto; }
3793
3793
  }
3794
- `];$("cm-app-card",Ho);var tu,Mw,No=class extends le{constructor(){super(...arguments);m(this,tu);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3794
+ `];$("cm-app-card",No);var iu,_w,Po=class extends le{constructor(){super(...arguments);m(this,iu);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3795
3795
  ${this.renderHeader()}
3796
3796
  <div class="body" part="body"><slot></slot></div>
3797
- <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${a(this,tu,Mw)}></slot></footer>
3798
- </div>`)}};tu=new WeakSet,Mw=function(e){this._hasFooter=e.target.assignedElements().length>0},No.properties={...le.properties,size:{reflect:!0},_hasFooter:{state:!0}},No.styles=[...le.overlayStyles,w`
3797
+ <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${a(this,iu,_w)}></slot></footer>
3798
+ </div>`)}};iu=new WeakSet,_w=function(e){this._hasFooter=e.target.assignedElements().length>0},Po.properties={...le.properties,size:{reflect:!0},_hasFooter:{state:!0}},Po.styles=[...le.overlayStyles,w`
3799
3799
  dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
3800
3800
  :host([size='small']) dialog { --cm-modal-width: 400px; }
3801
3801
  :host([size='large']) dialog { --cm-modal-width: 900px; }
3802
3802
  .panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-lg); box-shadow: var(--cm-shadow-lg); }
3803
3803
 
3804
- `];$("cm-modal",No);var iu,_w,Zt=class extends le{constructor(){super(...arguments);m(this,iu);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return c`<slot></slot>`}renderFooter(){return c`<slot name="footer" @slotchange=${a(this,iu,_w)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3804
+ `];$("cm-modal",Po);var ru,Tw,ei=class extends le{constructor(){super(...arguments);m(this,ru);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return c`<slot></slot>`}renderFooter(){return c`<slot name="footer" @slotchange=${a(this,ru,Tw)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3805
3805
  ${this.renderHeader()}
3806
3806
  <div class="body" part="body">${this.renderBody()}</div>
3807
3807
  <footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
3808
- </div>`)}};iu=new WeakSet,_w=function(e){this._hasFooter=e.target.assignedElements().length>0},Zt.properties={...le.properties,size:{reflect:!0},_hasFooter:{state:!0}},Zt.styles=[...le.overlayStyles,w`
3808
+ </div>`)}};ru=new WeakSet,Tw=function(e){this._hasFooter=e.target.assignedElements().length>0},ei.properties={...le.properties,size:{reflect:!0},_hasFooter:{state:!0}},ei.styles=[...le.overlayStyles,w`
3809
3809
  dialog {
3810
3810
  position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
3811
3811
  }
@@ -3823,23 +3823,23 @@ ${t.label}</button>
3823
3823
  .panel { border-radius: var(--cm-radius-lg); }
3824
3824
 
3825
3825
  }
3826
- `];$("cm-side-panel",Zt);var _C=z("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),Io,ru,Po=class extends Zt{constructor(){super(...arguments);this.search=!1;this.query="";m(this,Io,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});m(this,ru,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(s,l)=>{if(l==="")return;let d=e[s];e[s]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[s,l]of new FormData(i))typeof l=="string"&&t(s,l);return e}return this.querySelectorAll("[name]").forEach(s=>{let l=s.getAttribute("name");"checked"in s&&(s.type==="checkbox"||s.type==="radio"||s.localName.match(/^cm-(checkbox|radio|toggle)$/))?s.checked&&t(l,s.value||"on"):typeof s.value=="string"&&t(l,s.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
3826
+ `];$("cm-side-panel",ei);var zC=z("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),qo,su,Io=class extends ei{constructor(){super(...arguments);this.search=!1;this.query="";m(this,qo,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});m(this,su,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(s,l)=>{if(l==="")return;let d=e[s];e[s]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[s,l]of new FormData(i))typeof l=="string"&&t(s,l);return e}return this.querySelectorAll("[name]").forEach(s=>{let l=s.getAttribute("name");"checked"in s&&(s.type==="checkbox"||s.type==="radio"||s.localName.match(/^cm-(checkbox|radio|toggle)$/))?s.checked&&t(l,s.value||"on"):typeof s.value=="string"&&t(l,s.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
3827
3827
  placeholder=${this.searchPlaceholder}
3828
3828
  @input=${e=>{this.query=e.target.value}}
3829
- @cm-search=${e=>{e.stopPropagation(),r(this,Io).call(this)}}></cm-search>`:h}
3830
- <slot @submit=${e=>{e.preventDefault(),r(this,Io).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${r(this,ru)}>${this.resetLabel}</cm-button>
3831
- <cm-button part="apply" variant="primary" @click=${r(this,Io)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};Io=new WeakMap,ru=new WeakMap,Po.properties={...Zt.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},Po.styles=[...Zt.styles,w`
3829
+ @cm-search=${e=>{e.stopPropagation(),r(this,qo).call(this)}}></cm-search>`:h}
3830
+ <slot @submit=${e=>{e.preventDefault(),r(this,qo).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${r(this,su)}>${this.resetLabel}</cm-button>
3831
+ <cm-button part="apply" variant="primary" @click=${r(this,qo)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};qo=new WeakMap,su=new WeakMap,Io.properties={...ei.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},Io.styles=[...ei.styles,w`
3832
3832
  .search { display: block; margin-bottom: var(--cm-space-20); }
3833
3833
  .foot { justify-content: center; }
3834
3834
  ::slotted(form) { display: grid; gap: var(--cm-space-12); }
3835
- `];$("cm-filter-panel",Po);var DC=z("accountMenu",{trigger:"Account: {name}"}),qo=class extends Ft{constructor(){super();this.name="";this.avatarSrc="";this.meta="";this.profileHref="";this.orgName="";this.orgMeta="";this.orgHref="";this.plan="";this.align="end"}triggerTemplate(e,t){return c`<button type="button" class="trigger account" part="trigger" aria-haspopup="menu" aria-expanded=${String(this.open)}
3835
+ `];$("cm-filter-panel",Io);var NC=z("accountMenu",{trigger:"Account: {name}"}),Oo=class extends Vt{constructor(){super();this.name="";this.avatarSrc="";this.meta="";this.profileHref="";this.orgName="";this.orgMeta="";this.orgHref="";this.plan="";this.align="end"}triggerTemplate(e,t){return c`<button type="button" class="trigger account" part="trigger" aria-haspopup="menu" aria-expanded=${String(this.open)}
3836
3836
  aria-label=${this.t("trigger",{name:this.name})} ?disabled=${this.disabled} @click=${e} @keydown=${t}>
3837
3837
  <cm-avatar name=${this.name} src=${this.avatarSrc||h} decorative></cm-avatar></button>`}headTemplate(){let e=(t,i,s,l,d)=>{let p=c`${s}<span class="who"><strong>${l}</strong>${d?c`<span>${d}</span>`:h}</span>${t?c`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:h}`;return t?c`<a class="row" part=${i} href=${t}>${p}</a>`:c`<div class="row" part=${i}>${p}</div>`};return c`<div class="acct">
3838
3838
  ${e(this.profileHref,"profile",c`<span class="ring"><cm-avatar name=${this.name} src=${this.avatarSrc||h} decorative></cm-avatar></span>`,this.name,this.meta)}
3839
3839
  ${this.orgName?c`<div class="split"></div>
3840
3840
  ${e(this.orgHref,"org",c`<span class="logo"><slot name="org-logo"><cm-icon name="store" size="20"></cm-icon></slot></span>`,this.orgName,this.orgMeta)}
3841
3841
  ${this.plan?c`<div class="plan"><cm-icon name="check-circle" size="16"></cm-icon>${this.plan}</div>`:h}`:h}
3842
- </div>`}};qo.properties={...Ft.properties,name:{},avatarSrc:{attribute:"avatar-src"},meta:{},profileHref:{attribute:"profile-href"},orgName:{attribute:"org-name"},orgMeta:{attribute:"org-meta"},orgHref:{attribute:"org-href"},plan:{}},qo.styles=[...Ft.styles,w`
3842
+ </div>`}};Oo.properties={...Vt.properties,name:{},avatarSrc:{attribute:"avatar-src"},meta:{},profileHref:{attribute:"profile-href"},orgName:{attribute:"org-name"},orgMeta:{attribute:"org-meta"},orgHref:{attribute:"org-href"},plan:{}},Oo.styles=[...Vt.styles,w`
3843
3843
  /* The avatar button: 36px round with a ring (40 and a 44px hit area on touch screens). */
3844
3844
  .trigger.account {
3845
3845
  position: relative; width: var(--cm-control-height-md, 36px); height: var(--cm-control-height-md, 36px); min-height: 0; padding: 2px;
@@ -3872,8 +3872,8 @@ ${t.label}</button>
3872
3872
  .plan cm-icon { color: var(--cm-text-success); }
3873
3873
  .split { height: 0; margin: var(--cm-space-4) var(--cm-space-12); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
3874
3874
  :host(:dir(rtl)) .chev { transform: scaleX(-1); }
3875
- `];$("cm-account-menu",qo);var IC=z("sparkline",{summary:"{label}: {total} in all, peak {peak}, latest {latest}",summaryAt:"{label}: {total} in all, peak {peak} on {when}, latest {latest}",empty:"{label}: no data"}),X0=o=>{if(!o)return[];let n=o.trim(),e=[];if(n.startsWith("["))try{e=JSON.parse(n)}catch{e=[]}else e=n.split(",");return e.map(t=>{let i=Number(t);return Number.isFinite(i)?i:0})},J0=o=>{if(!o)return[];let n=o.trim();if(n.startsWith("["))try{return JSON.parse(n).map(String)}catch{return[]}return n.split(",").map(e=>e.trim())},Oo=class extends C{constructor(){super(...arguments);this.values=[];this.labels=[];this.label="";this.type="bars";this.tone="neutral"}get summary(){let e=this.values??[],t=this.label||"";if(!e.length)return this.t("empty",{label:t});let i=e.reduce((u,b)=>u+b,0),s=Math.max(...e),l=e.indexOf(s),d={label:t,total:this.formatNumber(i),peak:this.formatNumber(s),latest:this.formatNumber(e[e.length-1])},p=this.labels?.[l];return p?this.t("summaryAt",{...d,when:p}):this.t("summary",d)}render(){let e=this.values??[],t=e.length,i=100,s=32,l=2,d=Math.max(1,...e.map(f=>Math.max(0,f))),p=f=>s-Math.max(0,f)/d*(s-l),u=f=>this.labels?.[f]?`${this.labels[f]}: ${this.formatNumber(e[f])}`:"",b=h;if(t&&this.type==="line"){let f=t>1?i/(t-1):0,x=e.map((k,L)=>`${(t>1?L*f:i/2).toFixed(2)},${p(k).toFixed(2)}`).join(" "),v=x.split(" ").pop().split(",");b=ii`<polyline class="line" points=${x}></polyline><line class="dot" x1=${v[0]} y1=${v[1]} x2=${v[0]} y2=${v[1]}></line>`}else if(t){let f=i/t,x=t>1?Math.min(f*.25,2):0,v=f-x;b=e.map((k,L)=>{let P=Math.max(k>0?1.5:0,s-p(k)),U=u(L);return ii`<rect class=${L===t-1?"bar last":"bar"} x=${(L*f+x/2).toFixed(2)} y=${(s-P).toFixed(2)} width=${v.toFixed(2)} height=${P.toFixed(2)} rx="0.6">${U?ii`<title>${U}</title>`:h}</rect>`})}return c`<svg part="chart" role="img" aria-label=${this.summary} viewBox="0 0 ${i} ${s}" preserveAspectRatio="none">
3876
- <line class="base" x1="0" y1=${s} x2=${i} y2=${s}></line>${b}</svg>`}};Oo.properties={values:{converter:{fromAttribute:X0}},labels:{converter:{fromAttribute:J0}},label:{},type:{reflect:!0},tone:{reflect:!0}},Oo.styles=[E,w`
3875
+ `];$("cm-account-menu",Oo);var BC=z("sparkline",{summary:"{label}: {total} in all, peak {peak}, latest {latest}",summaryAt:"{label}: {total} in all, peak {peak} on {when}, latest {latest}",empty:"{label}: no data"}),J0=o=>{if(!o)return[];let n=o.trim(),e=[];if(n.startsWith("["))try{e=JSON.parse(n)}catch{e=[]}else e=n.split(",");return e.map(t=>{let i=Number(t);return Number.isFinite(i)?i:0})},Q0=o=>{if(!o)return[];let n=o.trim();if(n.startsWith("["))try{return JSON.parse(n).map(String)}catch{return[]}return n.split(",").map(e=>e.trim())},Bo=class extends C{constructor(){super(...arguments);this.values=[];this.labels=[];this.label="";this.type="bars";this.tone="neutral"}get summary(){let e=this.values??[],t=this.label||"";if(!e.length)return this.t("empty",{label:t});let i=e.reduce((u,b)=>u+b,0),s=Math.max(...e),l=e.indexOf(s),d={label:t,total:this.formatNumber(i),peak:this.formatNumber(s),latest:this.formatNumber(e[e.length-1])},p=this.labels?.[l];return p?this.t("summaryAt",{...d,when:p}):this.t("summary",d)}render(){let e=this.values??[],t=e.length,i=100,s=32,l=2,d=Math.max(1,...e.map(f=>Math.max(0,f))),p=f=>s-Math.max(0,f)/d*(s-l),u=f=>this.labels?.[f]?`${this.labels[f]}: ${this.formatNumber(e[f])}`:"",b=h;if(t&&this.type==="line"){let f=t>1?i/(t-1):0,x=e.map((k,L)=>`${(t>1?L*f:i/2).toFixed(2)},${p(k).toFixed(2)}`).join(" "),v=x.split(" ").pop().split(",");b=ri`<polyline class="line" points=${x}></polyline><line class="dot" x1=${v[0]} y1=${v[1]} x2=${v[0]} y2=${v[1]}></line>`}else if(t){let f=i/t,x=t>1?Math.min(f*.25,2):0,v=f-x;b=e.map((k,L)=>{let P=Math.max(k>0?1.5:0,s-p(k)),U=u(L);return ri`<rect class=${L===t-1?"bar last":"bar"} x=${(L*f+x/2).toFixed(2)} y=${(s-P).toFixed(2)} width=${v.toFixed(2)} height=${P.toFixed(2)} rx="0.6">${U?ri`<title>${U}</title>`:h}</rect>`})}return c`<svg part="chart" role="img" aria-label=${this.summary} viewBox="0 0 ${i} ${s}" preserveAspectRatio="none">
3876
+ <line class="base" x1="0" y1=${s} x2=${i} y2=${s}></line>${b}</svg>`}};Bo.properties={values:{converter:{fromAttribute:J0}},labels:{converter:{fromAttribute:Q0}},label:{},type:{reflect:!0},tone:{reflect:!0}},Bo.styles=[E,w`
3877
3877
  :host { display: block; width: 100%; max-width: var(--cm-sparkline-width, none); height: var(--cm-sparkline-height, 32px); color: var(--cm-icon-default); }
3878
3878
  :host([tone='information']) { color: var(--cm-text-information); }
3879
3879
  :host([tone='success']) { color: var(--cm-text-success); }
@@ -3886,17 +3886,17 @@ ${t.label}</button>
3886
3886
  .line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
3887
3887
  .dot { stroke: var(--cm-text-default); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
3888
3888
  :host([tone='information']) .dot, :host([tone='success']) .dot { stroke: currentColor; }
3889
- `];$("cm-sparkline",Oo);var Od,Vs,lb,Tw,Bo=class extends le{constructor(){super(...arguments);m(this,Vs);this.heading="";this.items=[];this._slotted=[];m(this,Od)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=kl(this),g(this,Od,kh(this,()=>{this._slotted=kl(this)}))}disconnectedCallback(){super.disconnectedCallback(),r(this,Od)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider&&!i.heading),t=e.some(i=>i.icon);return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3889
+ `];$("cm-sparkline",Bo);var Bd,js,cb,Cw,Fo=class extends le{constructor(){super(...arguments);m(this,js);this.heading="";this.items=[];this._slotted=[];m(this,Bd)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=El(this),g(this,Bd,Eh(this,()=>{this._slotted=El(this)}))}disconnectedCallback(){super.disconnectedCallback(),r(this,Bd)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider&&!i.heading),t=e.some(i=>i.icon);return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3890
3890
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
3891
3891
  <cm-icon name="close" size="16"></cm-icon></button>
3892
3892
  ${this.heading?c`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:h}
3893
3893
  <div class="content">
3894
- ${e.length?c`<ul class=${t?"icons":""} part="list">${e.map(i=>c`<li>${a(this,Vs,Tw).call(this,i)}</li>`)}</ul>`:h}
3894
+ ${e.length?c`<ul class=${t?"icons":""} part="list">${e.map(i=>c`<li>${a(this,js,Cw).call(this,i)}</li>`)}</ul>`:h}
3895
3895
  <slot ?hidden=${this._slotted.length>0}></slot>
3896
3896
  </div>
3897
- </div>`)}};Od=new WeakMap,Vs=new WeakSet,lb=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},Tw=function(e){let t=`row${e.critical?" critical":""}`,i=c`${e.icon?c`<cm-icon class="lead" name=${e.icon} size="16"></cm-icon>
3898
- `:h}<span class="label">${e.label}</span>${e.icon?c`<cm-icon name="chevron-right" size="16"></cm-icon>`:h}`;return e.href&&!e.disabled?c`<a class=${t} part="row" href=${e.href} @click=${s=>a(this,Vs,lb).call(this,s,e)}>${i}</a>`:c`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":h}
3899
- @click=${s=>a(this,Vs,lb).call(this,s,e)}>${i}</button>`},Bo.properties={...le.properties,items:{type:Array},_slotted:{state:!0}},Bo.styles=[...le.overlayStyles,w`
3897
+ </div>`)}};Bd=new WeakMap,js=new WeakSet,cb=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},Cw=function(e){let t=`row${e.critical?" critical":""}`,i=c`${e.icon?c`<cm-icon class="lead" name=${e.icon} size="16"></cm-icon>
3898
+ `:h}<span class="label">${e.label}</span>${e.icon?c`<cm-icon name="chevron-right" size="16"></cm-icon>`:h}`;return e.href&&!e.disabled?c`<a class=${t} part="row" href=${e.href} @click=${s=>a(this,js,cb).call(this,s,e)}>${i}</a>`:c`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":h}
3899
+ @click=${s=>a(this,js,cb).call(this,s,e)}>${i}</button>`},Fo.properties={...le.properties,items:{type:Array},_slotted:{state:!0}},Fo.styles=[...le.overlayStyles,w`
3900
3900
  dialog {
3901
3901
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: var(--cm-space-24);
3902
3902
  }
@@ -3930,17 +3930,17 @@ ${t.label}</button>
3930
3930
  }
3931
3931
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
3932
3932
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
3933
- `];$("cm-bottom-sheet",Bo);var XC=z("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),Q0={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},Fo=class extends A{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};Fo.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},Fo.styles=w`:host { display: none; }`;$("cm-notification-item",Fo);var jo,at,cb,db,Cw,zw,Sw,Vo=class extends le{constructor(){super(...arguments);m(this,at);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;m(this,jo)}connectedCallback(){super.connectedCallback(),a(this,at,cb).call(this),g(this,jo,new MutationObserver(()=>a(this,at,cb).call(this))),r(this,jo).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,jo)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(s=>s.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${a(this,at,zw)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
3934
- <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?c`<ul class="list" part="list">${e.map(s=>c`<li>${a(this,at,Cw).call(this,s)}</li>`)}</ul>`:c`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3933
+ `];$("cm-bottom-sheet",Fo);var ZC=z("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),Z0={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},Vo=class extends A{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};Vo.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},Vo.styles=w`:host { display: none; }`;$("cm-notification-item",Vo);var Uo,at,db,hb,zw,Sw,Lw,jo=class extends le{constructor(){super(...arguments);m(this,at);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;m(this,Uo)}connectedCallback(){super.connectedCallback(),a(this,at,db).call(this),g(this,Uo,new MutationObserver(()=>a(this,at,db).call(this))),r(this,Uo).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Uo)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(s=>s.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${a(this,at,Sw)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
3934
+ <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?c`<ul class="list" part="list">${e.map(s=>c`<li>${a(this,at,zw).call(this,s)}</li>`)}</ul>`:c`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3935
3935
  ${this.renderHeader(t)}
3936
3936
  ${i}
3937
3937
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
3938
3938
  ${this.moreHref?c`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:h}
3939
- <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${a(this,at,Sw)}></slot></div>
3939
+ <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${a(this,at,Lw)}></slot></div>
3940
3940
  <slot hidden></slot>
3941
- </div>`)}};jo=new WeakMap,at=new WeakSet,cb=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},db=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},Cw=function(e){let t=e.tone??"information",i=e.description?c`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,s=c`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||Q0[t]||"bell"} size="14"></cm-icon></span>
3941
+ </div>`)}};Uo=new WeakMap,at=new WeakSet,db=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},hb=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},zw=function(e){let t=e.tone??"information",i=e.description?c`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,s=c`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||Z0[t]||"bell"} size="14"></cm-icon></span>
3942
3942
  <span class="label">${e.unread?c`<span class="vh">${this.t("unread")}</span>`:h}${i}</span>
3943
- ${e.time?c`<time>${e.time}</time>`:h}`,l=`row${e.unread?" unread":""}`;return e.href?c`<a class=${l} part="row" href=${e.href} @click=${d=>a(this,at,db).call(this,d,e)}>${s}</a>`:c`<button type="button" class=${l} part="row" @click=${d=>a(this,at,db).call(this,d,e)}>${s}</button>`},zw=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},Sw=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},Vo.properties={...le.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},Vo.styles=[...le.overlayStyles,w`
3943
+ ${e.time?c`<time>${e.time}</time>`:h}`,l=`row${e.unread?" unread":""}`;return e.href?c`<a class=${l} part="row" href=${e.href} @click=${d=>a(this,at,hb).call(this,d,e)}>${s}</a>`:c`<button type="button" class=${l} part="row" @click=${d=>a(this,at,hb).call(this,d,e)}>${s}</button>`},Sw=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},Lw=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},jo.properties={...le.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},jo.styles=[...le.overlayStyles,w`
3944
3944
  dialog {
3945
3945
  position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
3946
3946
  width: min(380px, calc(100vw - 32px));
@@ -3990,15 +3990,15 @@ ${t.label}</button>
3990
3990
  @media (max-width: 599px) {
3991
3991
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
3992
3992
  }
3993
- `];$("cm-notification-panel",Vo);var iz=z("toastRegion",{label:"Notifications"}),rz=z("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),Lw=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},hb=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},Z0=2e3,Aw=1e4,Dw=150,Bd,Ot,Ai,Fd,Go,Yo,js,kr,Us,Te,su,Rw,Uo,pb,Vd,jd,Ud,Kd,Hw,Ko=class extends C{constructor(){super(...arguments);m(this,Te);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;m(this,Bd);m(this,Ot);m(this,Ai,0);m(this,Fd,0);m(this,Go,!1);m(this,Yo,!1);m(this,js);m(this,kr);m(this,Us);m(this,Vd,()=>{g(this,Go,!0),a(this,Te,pb).call(this)});m(this,jd,()=>{g(this,Go,!1),a(this,Te,Uo).call(this)});m(this,Ud,()=>{g(this,Yo,!0),a(this,Te,pb).call(this)});m(this,Kd,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Yo,!1),a(this,Te,Uo).call(this))})}get closed(){if(!r(this,js)){if(!this.open&&r(this,Us))return Promise.resolve(r(this,Us));g(this,js,new Promise(e=>{g(this,kr,e)}))}return r(this,js)}get effectiveDuration(){let e=this.duration??(this.actionLabel?Aw:5e3);return Math.min(Aw,Math.max(Z0,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,Bd,setTimeout(()=>{this._primed=!0},Dw)),this.addEventListener("pointerenter",r(this,Vd)),this.addEventListener("pointerleave",r(this,jd)),this.addEventListener("focusin",r(this,Ud)),this.addEventListener("focusout",r(this,Kd))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,kr)&&queueMicrotask(()=>{!this.isConnected&&this.open&&a(this,Te,su).call(this,"removed")}),clearTimeout(r(this,Ot)),clearTimeout(r(this,Bd)),this.removeEventListener("pointerenter",r(this,Vd)),this.removeEventListener("pointerleave",r(this,jd)),this.removeEventListener("focusin",r(this,Ud)),this.removeEventListener("focusout",r(this,Kd))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Us,void 0):r(this,kr)&&a(this,Te,su).call(this,"close")),(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,Ot)),this.open&&(this._inRegion||this._primed)&&(g(this,Ai,this.effectiveDuration),a(this,Te,Uo).call(this)))}show(){this.open?(g(this,Ai,this.effectiveDuration),a(this,Te,Uo).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(r(this,Ot)),this.open=!1,a(this,Te,su).call(this,e),!0):(e==="timeout"&&(g(this,Ai,this.effectiveDuration),a(this,Te,Uo).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
3993
+ `];$("cm-notification-panel",jo);var az=z("toastRegion",{label:"Notifications"}),nz=z("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),Aw=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},pb=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},e1=2e3,Dw=1e4,Rw=150,Fd,Bt,Di,Vd,Yo,Xo,Us,Er,Ks,Te,au,Hw,Ko,mb,jd,Ud,Kd,Wd,Nw,Wo=class extends C{constructor(){super(...arguments);m(this,Te);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;m(this,Fd);m(this,Bt);m(this,Di,0);m(this,Vd,0);m(this,Yo,!1);m(this,Xo,!1);m(this,Us);m(this,Er);m(this,Ks);m(this,jd,()=>{g(this,Yo,!0),a(this,Te,mb).call(this)});m(this,Ud,()=>{g(this,Yo,!1),a(this,Te,Ko).call(this)});m(this,Kd,()=>{g(this,Xo,!0),a(this,Te,mb).call(this)});m(this,Wd,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Xo,!1),a(this,Te,Ko).call(this))})}get closed(){if(!r(this,Us)){if(!this.open&&r(this,Ks))return Promise.resolve(r(this,Ks));g(this,Us,new Promise(e=>{g(this,Er,e)}))}return r(this,Us)}get effectiveDuration(){let e=this.duration??(this.actionLabel?Dw:5e3);return Math.min(Dw,Math.max(e1,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,Fd,setTimeout(()=>{this._primed=!0},Rw)),this.addEventListener("pointerenter",r(this,jd)),this.addEventListener("pointerleave",r(this,Ud)),this.addEventListener("focusin",r(this,Kd)),this.addEventListener("focusout",r(this,Wd))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,Er)&&queueMicrotask(()=>{!this.isConnected&&this.open&&a(this,Te,au).call(this,"removed")}),clearTimeout(r(this,Bt)),clearTimeout(r(this,Fd)),this.removeEventListener("pointerenter",r(this,jd)),this.removeEventListener("pointerleave",r(this,Ud)),this.removeEventListener("focusin",r(this,Kd)),this.removeEventListener("focusout",r(this,Wd))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Ks,void 0):r(this,Er)&&a(this,Te,au).call(this,"close")),(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,Bt)),this.open&&(this._inRegion||this._primed)&&(g(this,Di,this.effectiveDuration),a(this,Te,Ko).call(this)))}show(){this.open?(g(this,Di,this.effectiveDuration),a(this,Te,Ko).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(r(this,Bt)),this.open=!1,a(this,Te,au).call(this,e),!0):(e==="timeout"&&(g(this,Di,this.effectiveDuration),a(this,Te,Ko).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
3994
3994
  ${this.tone==="critical"?c`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:h}
3995
3995
  <div class="message" part="message">${this.message}<slot></slot></div>
3996
- ${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${a(this,Te,Hw)}>${this.actionLabel}</button>`:h}
3996
+ ${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${a(this,Te,Nw)}>${this.actionLabel}</button>`:h}
3997
3997
  <button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
3998
3998
  <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
3999
3999
  </button>
4000
4000
  ${this.actionLabel&&this._inRegion&&this.t("shortcut")?c`<span class="hint">${this.t("shortcut")}</span>`:h}
4001
- </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};Bd=new WeakMap,Ot=new WeakMap,Ai=new WeakMap,Fd=new WeakMap,Go=new WeakMap,Yo=new WeakMap,js=new WeakMap,kr=new WeakMap,Us=new WeakMap,Te=new WeakSet,su=function(e){g(this,Us,e);let t=r(this,kr);g(this,js,g(this,kr,void 0)),t?.(e)},Rw=function(){return r(this,Go)||r(this,Yo)},Uo=function(){clearTimeout(r(this,Ot)),!(!this.open||r(this,Te,Rw))&&(g(this,Fd,Date.now()),g(this,Ot,setTimeout(()=>this.dismiss("timeout"),r(this,Ai))))},pb=function(){r(this,Ot)!==void 0&&(clearTimeout(r(this,Ot)),g(this,Ot,void 0),g(this,Ai,Math.max(1e3,r(this,Ai)-(Date.now()-r(this,Fd)))))},Vd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Kd=new WeakMap,Hw=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Ko.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Ko.styles=[E,w`
4001
+ </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};Fd=new WeakMap,Bt=new WeakMap,Di=new WeakMap,Vd=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,Us=new WeakMap,Er=new WeakMap,Ks=new WeakMap,Te=new WeakSet,au=function(e){g(this,Ks,e);let t=r(this,Er);g(this,Us,g(this,Er,void 0)),t?.(e)},Hw=function(){return r(this,Yo)||r(this,Xo)},Ko=function(){clearTimeout(r(this,Bt)),!(!this.open||r(this,Te,Hw))&&(g(this,Vd,Date.now()),g(this,Bt,setTimeout(()=>this.dismiss("timeout"),r(this,Di))))},mb=function(){r(this,Bt)!==void 0&&(clearTimeout(r(this,Bt)),g(this,Bt,void 0),g(this,Di,Math.max(1e3,r(this,Di)-(Date.now()-r(this,Vd)))))},jd=new WeakMap,Ud=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Nw=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Wo.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Wo.styles=[E,w`
4002
4002
  :host { display: block; pointer-events: auto; }
4003
4003
  :host(:not([open])) { display: none; }
4004
4004
  .toast {
@@ -4030,13 +4030,13 @@ ${t.label}</button>
4030
4030
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
4031
4031
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
4032
4032
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
4033
- `];$("cm-toast",Ko);var Ks,Wd,Gd,Yd,Xd,Jd,Xo,au,Wo=class extends C{constructor(){super(...arguments);m(this,Xo);this.max=3;m(this,Ks,null);m(this,Wd,!1);m(this,Gd,e=>{let t=e.target;queueMicrotask(()=>{if(t.localName!=="cm-toast"||t.open)return;let i=t.matches(":focus-within");t.remove(),i&&a(this,Xo,au).call(this)})});m(this,Yd,e=>{let t=e.relatedTarget;t&&!hb(this,t)&&g(this,Ks,t)});m(this,Xd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;let t=e.composedPath().find(i=>i.localName==="cm-toast");t&&t.parentElement===this&&(e.preventDefault(),t.dismiss("close"))});m(this,Jd,e=>{if(e.key!=="F6"||e.altKey||e.ctrlKey||e.metaKey||e.defaultPrevented)return;(this.matches(":focus-within")?a(this,Xo,au).call(this):this.focusToast())&&e.preventDefault()})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),g(this,Wd,!0)),this.addEventListener("cm-dismiss",r(this,Gd)),this.addEventListener("focusin",r(this,Yd)),this.addEventListener("keydown",r(this,Xd)),document.addEventListener("keydown",r(this,Jd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,Gd)),this.removeEventListener("focusin",r(this,Yd)),this.removeEventListener("keydown",r(this,Xd)),document.removeEventListener("keydown",r(this,Jd))}updated(){r(this,Wd)&&this.setAttribute("aria-label",this.t("label"))}focusToast(){let e=[...this.querySelectorAll(":scope > cm-toast[open]")].reverse(),t=e.find(l=>l.actionLabel)??e[0],i=t?.shadowRoot?.querySelector(".action")??t?.shadowRoot?.querySelector(".close");if(!i)return!1;let s=Lw();return s&&!hb(this,s)&&g(this,Ks,s),i.focus(),!0}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")],i=t.slice(0,Math.max(0,t.length-Math.max(1,this.max))),s=i.some(l=>l.matches(":focus-within"));return i.forEach(l=>l.remove()),s&&a(this,Xo,au).call(this),e}render(){return c`<slot></slot>`}};Ks=new WeakMap,Wd=new WeakMap,Gd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Jd=new WeakMap,Xo=new WeakSet,au=function(){let e=r(this,Ks);return g(this,Ks,null),e?.isConnected?(e.focus(),hb(e,Lw())||e.shadowRoot?.querySelector("button, a[href], input, select, textarea, [tabindex]")?.focus(),!0):!1},Wo.properties={max:{type:Number}},Wo.styles=[E,w`
4033
+ `];$("cm-toast",Wo);var Ws,Gd,Yd,Xd,Jd,Qd,Jo,nu,Go=class extends C{constructor(){super(...arguments);m(this,Jo);this.max=3;m(this,Ws,null);m(this,Gd,!1);m(this,Yd,e=>{let t=e.target;queueMicrotask(()=>{if(t.localName!=="cm-toast"||t.open)return;let i=t.matches(":focus-within");t.remove(),i&&a(this,Jo,nu).call(this)})});m(this,Xd,e=>{let t=e.relatedTarget;t&&!pb(this,t)&&g(this,Ws,t)});m(this,Jd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;let t=e.composedPath().find(i=>i.localName==="cm-toast");t&&t.parentElement===this&&(e.preventDefault(),t.dismiss("close"))});m(this,Qd,e=>{if(e.key!=="F6"||e.altKey||e.ctrlKey||e.metaKey||e.defaultPrevented)return;(this.matches(":focus-within")?a(this,Jo,nu).call(this):this.focusToast())&&e.preventDefault()})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),g(this,Gd,!0)),this.addEventListener("cm-dismiss",r(this,Yd)),this.addEventListener("focusin",r(this,Xd)),this.addEventListener("keydown",r(this,Jd)),document.addEventListener("keydown",r(this,Qd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,Yd)),this.removeEventListener("focusin",r(this,Xd)),this.removeEventListener("keydown",r(this,Jd)),document.removeEventListener("keydown",r(this,Qd))}updated(){r(this,Gd)&&this.setAttribute("aria-label",this.t("label"))}focusToast(){let e=[...this.querySelectorAll(":scope > cm-toast[open]")].reverse(),t=e.find(l=>l.actionLabel)??e[0],i=t?.shadowRoot?.querySelector(".action")??t?.shadowRoot?.querySelector(".close");if(!i)return!1;let s=Aw();return s&&!pb(this,s)&&g(this,Ws,s),i.focus(),!0}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")],i=t.slice(0,Math.max(0,t.length-Math.max(1,this.max))),s=i.some(l=>l.matches(":focus-within"));return i.forEach(l=>l.remove()),s&&a(this,Jo,nu).call(this),e}render(){return c`<slot></slot>`}};Ws=new WeakMap,Gd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Jd=new WeakMap,Qd=new WeakMap,Jo=new WeakSet,nu=function(){let e=r(this,Ws);return g(this,Ws,null),e?.isConnected?(e.focus(),pb(e,Aw())||e.shadowRoot?.querySelector("button, a[href], input, select, textarea, [tabindex]")?.focus(),!0):!1},Go.properties={max:{type:Number}},Go.styles=[E,w`
4034
4034
  :host {
4035
4035
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
4036
4036
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-8);
4037
4037
  padding-inline: var(--cm-space-12); pointer-events: none;
4038
4038
  }
4039
- `];$("cm-toast-region",Wo);function Nw(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let s=document.createElement("cm-toast");if(s.message=String(o),n.tone&&(s.tone=n.tone),n.duration!==void 0&&(s.duration=n.duration),n.action){s.actionLabel=n.action.label;let l=n.action.onAction;s.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(s),Dw),s}return t.add(s)}async function e$(o,n,e){await o();let{message:t,undoLabel:i,...s}=e,l=i??vh("toast","undo",void 0,s.root??document.body),d=await Nw(t,{...s,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var cz=z("progressBar",{inProgress:"In progress"}),nu,Jo=class extends C{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";m(this,nu,N("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${r(this,nu)}-label`;return c`
4039
+ `];$("cm-toast-region",Go);function Pw(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let s=document.createElement("cm-toast");if(s.message=String(o),n.tone&&(s.tone=n.tone),n.duration!==void 0&&(s.duration=n.duration),n.action){s.actionLabel=n.action.label;let l=n.action.onAction;s.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(s),Rw),s}return t.add(s)}async function t1(o,n,e){await o();let{message:t,undoLabel:i,...s}=e,l=i??yh("toast","undo",void 0,s.root??document.body),d=await Pw(t,{...s,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var pz=z("progressBar",{inProgress:"In progress"}),ou,Qo=class extends C{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";m(this,ou,N("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${r(this,ou)}-label`;return c`
4040
4040
  <div class="head ${this.labelHidden?"vh":""}">
4041
4041
  <span id=${t} part="label">${this.label}</span>
4042
4042
  ${this.showValue&&e!==null?c`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:h}
@@ -4046,7 +4046,7 @@ ${t.label}</button>
4046
4046
  aria-valuenow=${e===null?h:Math.round(e)}
4047
4047
  aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
4048
4048
  <div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
4049
- </div>`}};nu=new WeakMap,Jo.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Jo.styles=[E,w`
4049
+ </div>`}};ou=new WeakMap,Qo.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Qo.styles=[E,w`
4050
4050
  :host { display: block; }
4051
4051
  .head { display: flex; justify-content: space-between; gap: var(--cm-space-8); margin-block-end: var(--cm-space-8); font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
4052
4052
  .value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
@@ -4064,7 +4064,7 @@ ${t.label}</button>
4064
4064
  .fill { transition: none; }
4065
4065
  .indeterminate .fill { animation-duration: 4s; }
4066
4066
  }
4067
- `];$("cm-progress-bar",Jo);var Qo=class extends A{constructor(){super(...arguments);this.tone="neutral"}render(){return c`<span part="badge"><slot></slot></span>`}};Qo.properties={tone:{reflect:!0}},Qo.styles=[E,w`
4067
+ `];$("cm-progress-bar",Qo);var Zo=class extends A{constructor(){super(...arguments);this.tone="neutral"}render(){return c`<span part="badge"><slot></slot></span>`}};Zo.properties={tone:{reflect:!0}},Zo.styles=[E,w`
4068
4068
  :host { display: inline-flex; vertical-align: middle; }
4069
4069
  span {
4070
4070
  display: inline-flex; align-items: center; box-sizing: border-box; height: 24px; padding: 0 var(--cm-space-8); white-space: nowrap;
@@ -4081,12 +4081,12 @@ ${t.label}</button>
4081
4081
  :host([tone='success']) span { background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)), var(--cm-bg-surface); color: var(--cm-text-success); }
4082
4082
  :host([tone='critical']) span { background: linear-gradient(var(--cm-bg-critical), var(--cm-bg-critical)), var(--cm-bg-surface); color: var(--cm-text-critical); }
4083
4083
  :host([tone='attention']) span { background: linear-gradient(var(--cm-bg-attention), var(--cm-bg-attention)), var(--cm-bg-surface); color: var(--cm-text-attention); }
4084
- `];$("cm-badge",Qo);var el,tl,Bt,Pw,Iw,Qd,qw,ou,mb,Zo=class extends A{constructor(){super(...arguments);m(this,Bt);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;this.variant="standard";this.href="";this.target="";this.selected=!1;this.label="";m(this,el,!1);m(this,tl,!1);m(this,Qd,!1);m(this,ou,()=>{this.href||this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))})}willUpdate(){this.selected&&g(this,Qd,!0)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=r(this,Bt,qw),i=t?a(this,Bt,mb).call(this,this.heading):this.heading,s=this.heading?c`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${i}</span><span class="adornment" ?hidden=${!r(this,el)}><slot name="title-adornment" @slotchange=${a(this,Bt,Pw)}></slot></span></div>`:h;return c`<section part="card" aria-label=${!t&&this.heading||h}>${t&&!this.heading?a(this,Bt,mb).call(this,h):h}
4084
+ `];$("cm-badge",Zo);var tl,il,Ft,Iw,qw,Zd,Ow,lu,ub,el=class extends A{constructor(){super(...arguments);m(this,Ft);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;this.variant="standard";this.href="";this.target="";this.selected=!1;this.label="";m(this,tl,!1);m(this,il,!1);m(this,Zd,!1);m(this,lu,()=>{this.href||this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))})}willUpdate(){this.selected&&g(this,Zd,!0)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=r(this,Ft,Ow),i=t?a(this,Ft,ub).call(this,this.heading):this.heading,s=this.heading?c`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${i}</span><span class="adornment" ?hidden=${!r(this,tl)}><slot name="title-adornment" @slotchange=${a(this,Ft,Iw)}></slot></span></div>`:h;return c`<section part="card" aria-label=${!t&&this.heading||h}>${t&&!this.heading?a(this,Ft,ub).call(this,h):h}
4085
4085
  ${this.heading||this.description?c`<header><div class="main">${this.heading?c`<span class="strut" aria-hidden="true">${this.heading}</span>`:h}${s}${this.description?c`<p class="desc">${this.description}</p>`:h}</div>
4086
- <div class="actions"><slot name="actions"></slot></div></header>`:c`<div class="bare" ?hidden=${!r(this,tl)}><div class="actions"><slot name="actions" @slotchange=${a(this,Bt,Iw)}></slot></div></div>`}
4086
+ <div class="actions"><slot name="actions"></slot></div></header>`:c`<div class="bare" ?hidden=${!r(this,il)}><div class="actions"><slot name="actions" @slotchange=${a(this,Ft,qw)}></slot></div></div>`}
4087
4087
  <slot></slot>
4088
- </section>`}};el=new WeakMap,tl=new WeakMap,Bt=new WeakSet,Pw=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==r(this,el)&&(g(this,el,t),this.requestUpdate())},Iw=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==r(this,tl)&&(g(this,tl,t),this.requestUpdate())},Qd=new WeakMap,qw=function(){return String(this.variant||"").split(/\s+/).includes("interactive")},ou=new WeakMap,mb=function(e){let t=e===h?"hit cover":"hit",i=e===h?this.label||h:h;return this.href?c`<a class=${t} part="control" href=${this.href} target=${this.target||h} rel=${this.target==="_blank"?"noopener noreferrer":h}
4089
- aria-current=${this.selected?"true":h} aria-label=${i}>${e}</a>`:c`<button class=${t} part="control" type="button" aria-pressed=${this.selected?"true":r(this,Qd)?"false":h} aria-label=${i} @click=${r(this,ou)}>${e}</button>`},Zo.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},variant:{reflect:!0},href:{},target:{},selected:{type:Boolean,reflect:!0},label:{}},Zo.styles=[E,w`
4088
+ </section>`}};tl=new WeakMap,il=new WeakMap,Ft=new WeakSet,Iw=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==r(this,tl)&&(g(this,tl,t),this.requestUpdate())},qw=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==r(this,il)&&(g(this,il,t),this.requestUpdate())},Zd=new WeakMap,Ow=function(){return String(this.variant||"").split(/\s+/).includes("interactive")},lu=new WeakMap,ub=function(e){let t=e===h?"hit cover":"hit",i=e===h?this.label||h:h;return this.href?c`<a class=${t} part="control" href=${this.href} target=${this.target||h} rel=${this.target==="_blank"?"noopener noreferrer":h}
4089
+ aria-current=${this.selected?"true":h} aria-label=${i}>${e}</a>`:c`<button class=${t} part="control" type="button" aria-pressed=${this.selected?"true":r(this,Zd)?"false":h} aria-label=${i} @click=${r(this,lu)}>${e}</button>`},el.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},variant:{reflect:!0},href:{},target:{},selected:{type:Boolean,reflect:!0},label:{}},el.styles=[E,w`
4090
4090
  /* Owner standard (1.6): 24px padding and a 16px gap under the header; compact 16px and 12px; 16px on phones. */
4091
4091
  :host { display: block; --_pad: var(--cm-space-24); --_gap: var(--cm-space-16); }
4092
4092
  :host([variant~='compact']) { --_pad: var(--cm-space-16); --_gap: var(--cm-space-12); }
@@ -4141,8 +4141,8 @@ ${t.label}</button>
4141
4141
  .bare { display: flex; justify-content: flex-end; margin-bottom: var(--_gap); }
4142
4142
  .bare[hidden] { display: none; }
4143
4143
  :host([flush]) .bare { padding: var(--_pad) var(--_pad) 0; margin-bottom: var(--cm-space-8); }
4144
- `];$("cm-card",Zo);var t$=["0","4","8","12","16","20","24","32","40","48","64"],i$={10:"8",15:"16",22:"24",30:"32"};function il(o,n){let e=(t,i)=>`:host([${o}='${t}']) { ${n}: ${i==="0"?"0px":`var(--cm-space-${i})`}; }`;return ah([...t$.map(t=>e(t,t)),...Object.entries(i$).map(([t,i])=>e(t,i))].join(`
4145
- `))}var rl=class extends A{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return c`<slot></slot>`}};rl.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},rl.styles=[E,w`
4144
+ `];$("cm-card",el);var i1=["0","4","8","12","16","20","24","32","40","48","64"],r1={10:"8",15:"16",22:"24",30:"32"};function rl(o,n){let e=(t,i)=>`:host([${o}='${t}']) { ${n}: ${i==="0"?"0px":`var(--cm-space-${i})`}; }`;return nh([...i1.map(t=>e(t,t)),...Object.entries(r1).map(([t,i])=>e(t,i))].join(`
4145
+ `))}var sl=class extends A{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return c`<slot></slot>`}};sl.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},sl.styles=[E,w`
4146
4146
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
4147
4147
  :host([direction='inline']) { flex-direction: row; align-items: center; }
4148
4148
  :host([wrap]) { flex-wrap: wrap; }
@@ -4155,13 +4155,13 @@ ${t.label}</button>
4155
4155
  :host([justify='center']) { justify-content: center; }
4156
4156
  :host([justify='end']) { justify-content: flex-end; }
4157
4157
  :host([justify='space-between']) { justify-content: space-between; }
4158
- `,il("gap","gap")];$("cm-stack",rl);Zs("cm-stack");var Ow="important",r$=" !"+Ow,Bw=pa(class extends Pi{constructor(o){if(super(o),o.type!==At.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((n,e)=>{let t=o[e];return t==null?n:n+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(o,[n]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let t of this.ft)n[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in n){let i=n[t];if(i!=null){this.ft.add(t);let s=typeof i=="string"&&i.endsWith(r$);t.includes("-")||s?e.setProperty(t,s?i.slice(0,-11):i,s?Ow:""):e[t]=i}}return Pe}});var sl=class extends A{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return c`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${Bw({gridTemplateColumns:i})}><slot></slot></div>`}};sl.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},sl.styles=[E,w`
4158
+ `,rl("gap","gap")];$("cm-stack",sl);ea("cm-stack");var Bw="important",s1=" !"+Bw,Fw=ga(class extends qi{constructor(o){if(super(o),o.type!==Dt.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((n,e)=>{let t=o[e];return t==null?n:n+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(o,[n]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let t of this.ft)n[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in n){let i=n[t];if(i!=null){this.ft.add(t);let s=typeof i=="string"&&i.endsWith(s1);t.includes("-")||s?e.setProperty(t,s?i.slice(0,-11):i,s?Bw:""):e[t]=i}}return Pe}});var al=class extends A{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return c`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${Fw({gridTemplateColumns:i})}><slot></slot></div>`}};al.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},al.styles=[E,w`
4159
4159
  :host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
4160
4160
  .grid { display: grid; gap: var(--_gap); align-items: start; }
4161
4161
  @container cm-grid (max-width: 640px) {
4162
4162
  .grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
4163
4163
  }
4164
- `,il("gap","--_gap")];$("cm-grid",sl);var du,Ws,Gs,eh,xe,lu,ub,Zd,cu,gb,al=class extends A{constructor(){super(...arguments);m(this,xe);this.gap="24";this.variant="default";this.asidePosition="above";this.stickyAside=!1;m(this,du,this.attachInternals());m(this,Ws);m(this,Gs,[]);m(this,eh,()=>a(this,xe,cu).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,xe,ub).call(this)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&a(this,xe,Zd).call(this)}updated(e){(e.has("stickyAside")||e.has("variant"))&&a(this,xe,Zd).call(this)}get asideSticks(){let e=a(this,xe,lu).call(this)[0];return!!e&&getComputedStyle(e).position==="sticky"}render(){return c`<div class="layout" part="layout"><slot @slotchange=${()=>{this.stickyAside&&a(this,xe,Zd).call(this)}}></slot></div>`}};du=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,eh=new WeakMap,xe=new WeakSet,lu=function(){return[...this.children].filter(e=>e.getAttribute("variant")==="aside")},ub=function(){r(this,Ws)?.disconnect(),g(this,Ws,void 0),g(this,Gs,[]),window.removeEventListener("resize",r(this,eh)),a(this,xe,gb).call(this,!1)},Zd=function(){a(this,xe,ub).call(this),!(!this.stickyAside||this.variant!=="record"||!this.isConnected)&&(g(this,Ws,new ResizeObserver(()=>a(this,xe,cu).call(this))),g(this,Gs,[this,...a(this,xe,lu).call(this)]),r(this,Gs).forEach(e=>r(this,Ws).observe(e)),window.addEventListener("resize",r(this,eh)),a(this,xe,cu).call(this))},cu=function(){let e=a(this,xe,lu).call(this);if(e.some(i=>!r(this,Gs).includes(i))){a(this,xe,Zd).call(this);return}let t=e.length>0&&e.every(i=>{let s=parseFloat(getComputedStyle(i).insetBlockStart)||0;return i.getBoundingClientRect().height+s<=window.innerHeight});a(this,xe,gb).call(this,t)},gb=function(e){let t=r(this,du).states;if(t)try{e?t.add("aside-fits"):t.delete("aside-fits")}catch{}},al.properties={gap:{reflect:!0},variant:{reflect:!0},asidePosition:{attribute:"aside-position",reflect:!0},stickyAside:{type:Boolean,attribute:"sticky-aside",reflect:!0}},al.styles=[E,w`
4164
+ `,rl("gap","--_gap")];$("cm-grid",al);var hu,Gs,Ys,th,xe,cu,gb,eh,du,fb,nl=class extends A{constructor(){super(...arguments);m(this,xe);this.gap="24";this.variant="default";this.asidePosition="above";this.stickyAside=!1;m(this,hu,this.attachInternals());m(this,Gs);m(this,Ys,[]);m(this,th,()=>a(this,xe,du).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,xe,gb).call(this)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&a(this,xe,eh).call(this)}updated(e){(e.has("stickyAside")||e.has("variant"))&&a(this,xe,eh).call(this)}get asideSticks(){let e=a(this,xe,cu).call(this)[0];return!!e&&getComputedStyle(e).position==="sticky"}render(){return c`<div class="layout" part="layout"><slot @slotchange=${()=>{this.stickyAside&&a(this,xe,eh).call(this)}}></slot></div>`}};hu=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,th=new WeakMap,xe=new WeakSet,cu=function(){return[...this.children].filter(e=>e.getAttribute("variant")==="aside")},gb=function(){r(this,Gs)?.disconnect(),g(this,Gs,void 0),g(this,Ys,[]),window.removeEventListener("resize",r(this,th)),a(this,xe,fb).call(this,!1)},eh=function(){a(this,xe,gb).call(this),!(!this.stickyAside||this.variant!=="record"||!this.isConnected)&&(g(this,Gs,new ResizeObserver(()=>a(this,xe,du).call(this))),g(this,Ys,[this,...a(this,xe,cu).call(this)]),r(this,Ys).forEach(e=>r(this,Gs).observe(e)),window.addEventListener("resize",r(this,th)),a(this,xe,du).call(this))},du=function(){let e=a(this,xe,cu).call(this);if(e.some(i=>!r(this,Ys).includes(i))){a(this,xe,eh).call(this);return}let t=e.length>0&&e.every(i=>{let s=parseFloat(getComputedStyle(i).insetBlockStart)||0;return i.getBoundingClientRect().height+s<=window.innerHeight});a(this,xe,fb).call(this,t)},fb=function(e){let t=r(this,hu).states;if(t)try{e?t.add("aside-fits"):t.delete("aside-fits")}catch{}},nl.properties={gap:{reflect:!0},variant:{reflect:!0},asidePosition:{attribute:"aside-position",reflect:!0},stickyAside:{type:Boolean,attribute:"sticky-aside",reflect:!0}},nl.styles=[E,w`
4165
4165
  :host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-24); }
4166
4166
  .layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
4167
4167
  @container cm-layout (max-width: 767px) {
@@ -4205,9 +4205,9 @@ ${t.label}</button>
4205
4205
  /* Read back by #measure(); only takes effect once the aside is sticky. --_header: cm-app-frame's header height. */
4206
4206
  inset-block-start: var(--cm-layout-sticky-top, calc(var(--_header, 0px) + var(--cm-space-24)));
4207
4207
  }
4208
- `,il("gap","--_gap")];var nl=class extends A{constructor(){super(...arguments);this.variant="full"}render(){return c`<slot></slot>`}};nl.properties={variant:{reflect:!0}},nl.styles=[E,w`
4208
+ `,rl("gap","--_gap")];var ol=class extends A{constructor(){super(...arguments);this.variant="full"}render(){return c`<slot></slot>`}};ol.properties={variant:{reflect:!0}},ol.styles=[E,w`
4209
4209
  :host { display: flex; flex-direction: column; gap: var(--_cm-section-gap, var(--cm-space-24)); min-inline-size: 0; }
4210
- `];$("cm-layout",al);$("cm-layout-section",nl);var fb=1024,s$=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o},Xs,ll,Di,pe,bb,vb,yb,xb,Ys,Fw,th,ih,ol=class extends A{constructor(){super(...arguments);m(this,pe);this.menuOpen=!1;this.menuItem="";this.panel=!1;this._wide=!1;m(this,Xs);m(this,ll,null);m(this,Di,!1);m(this,th,e=>{if(!this.menuItem)return;let t=a(this,pe,Fw).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?a(this,pe,Ys).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&a(this,pe,Ys).call(this,!1,!1)});m(this,ih,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),a(this,pe,Ys).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",r(this,th)),this.addEventListener("keydown",r(this,ih));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=fb),this.hasUpdated&&a(this,pe,yb).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",r(this,th)),this.removeEventListener("keydown",r(this,ih)),r(this,Xs)?.disconnect(),g(this,Xs,void 0),r(this,Di)&&(Gi(),g(this,Di,!1))}get wide(){return this._wide}firstUpdated(){let e=0;g(this,Xs,new ResizeObserver(()=>{a(this,pe,bb).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=fb!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=fb}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>r(this,Xs).observe(t))}updated(e){e.has("_wide")&&a(this,pe,bb).call(this),(e.has("menuOpen")||e.has("menuItem"))&&a(this,pe,xb).call(this),a(this,pe,yb).call(this)}openMenu(){a(this,pe,Ys).call(this,!0)}closeMenu(){a(this,pe,Ys).call(this,!1)}toggleMenu(){a(this,pe,Ys).call(this,!this.menuOpen)}render(){let e=this._wide,t=a(this,pe,vb).call(this);return c`<div class="frame ${e?"wide":""}" part="frame">
4210
+ `];$("cm-layout",nl);$("cm-layout-section",ol);var bb=1024,a1=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o},Js,cl,Ri,pe,vb,yb,xb,wb,Xs,Vw,ih,rh,ll=class extends A{constructor(){super(...arguments);m(this,pe);this.menuOpen=!1;this.menuItem="";this.panel=!1;this._wide=!1;m(this,Js);m(this,cl,null);m(this,Ri,!1);m(this,ih,e=>{if(!this.menuItem)return;let t=a(this,pe,Vw).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?a(this,pe,Xs).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&a(this,pe,Xs).call(this,!1,!1)});m(this,rh,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),a(this,pe,Xs).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",r(this,ih)),this.addEventListener("keydown",r(this,rh));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=bb),this.hasUpdated&&a(this,pe,xb).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",r(this,ih)),this.removeEventListener("keydown",r(this,rh)),r(this,Js)?.disconnect(),g(this,Js,void 0),r(this,Ri)&&(Yi(),g(this,Ri,!1))}get wide(){return this._wide}firstUpdated(){let e=0;g(this,Js,new ResizeObserver(()=>{a(this,pe,vb).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=bb!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=bb}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>r(this,Js).observe(t))}updated(e){e.has("_wide")&&a(this,pe,vb).call(this),(e.has("menuOpen")||e.has("menuItem"))&&a(this,pe,wb).call(this),a(this,pe,xb).call(this)}openMenu(){a(this,pe,Xs).call(this,!0)}closeMenu(){a(this,pe,Xs).call(this,!1)}toggleMenu(){a(this,pe,Xs).call(this,!this.menuOpen)}render(){let e=this._wide,t=a(this,pe,yb).call(this);return c`<div class="frame ${e?"wide":""}" part="frame">
4211
4211
  <div class="probe"></div>
4212
4212
  <div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
4213
4213
  <div class="body">
@@ -4215,8 +4215,8 @@ ${t.label}</button>
4215
4215
  <main part="main" ?inert=${t}><slot></slot></main>
4216
4216
  </div>
4217
4217
  <div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
4218
- <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation" @slotchange=${()=>a(this,pe,xb).call(this)}></slot></div>
4219
- </div>`}};Xs=new WeakMap,ll=new WeakMap,Di=new WeakMap,pe=new WeakSet,bb=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},vb=function(){return this.menuOpen&&!this._wide&&!!this.querySelector(':scope > [slot="mobile-menu"]')},yb=function(){let e=this.isConnected&&a(this,pe,vb).call(this);e&&!r(this,Di)?(tc(),g(this,Di,!0)):!e&&r(this,Di)&&(Gi(),g(this,Di,!1))},xb=function(){if(!this.menuItem)return;let e=this.querySelector(':scope > [slot="bottom-navigation"]');e&&(e.menuItem=this.menuItem,e.menuOpen=this.menuOpen)},Ys=function(e,t=!0){e!==this.menuOpen&&(e&&g(this,ll,s$()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(r(this,ll)?.focus(),g(this,ll,null))}))},Fw=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},th=new WeakMap,ih=new WeakMap,ol.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},panel:{type:Boolean,reflect:!0},_wide:{state:!0}},ol.styles=[E,w`
4218
+ <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation" @slotchange=${()=>a(this,pe,wb).call(this)}></slot></div>
4219
+ </div>`}};Js=new WeakMap,cl=new WeakMap,Ri=new WeakMap,pe=new WeakSet,vb=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},yb=function(){return this.menuOpen&&!this._wide&&!!this.querySelector(':scope > [slot="mobile-menu"]')},xb=function(){let e=this.isConnected&&a(this,pe,yb).call(this);e&&!r(this,Ri)?(ic(),g(this,Ri,!0)):!e&&r(this,Ri)&&(Yi(),g(this,Ri,!1))},wb=function(){if(!this.menuItem)return;let e=this.querySelector(':scope > [slot="bottom-navigation"]');e&&(e.menuItem=this.menuItem,e.menuOpen=this.menuOpen)},Xs=function(e,t=!0){e!==this.menuOpen&&(e&&g(this,cl,a1()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(r(this,cl)?.focus(),g(this,cl,null))}))},Vw=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},ih=new WeakMap,rh=new WeakMap,ll.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},panel:{type:Boolean,reflect:!0},_wide:{state:!0}},ll.styles=[E,w`
4220
4220
  :host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
4221
4221
  .header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
4222
4222
  .body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
@@ -4249,7 +4249,7 @@ ${t.label}</button>
4249
4249
  .menu::-webkit-scrollbar { display: none; }
4250
4250
  .probe { block-size: 0; }
4251
4251
  [hidden] { display: none !important; }
4252
- `];$("cm-app-frame",ol);var cl=class extends A{constructor(){super(...arguments);this.width="";this.fullWidth=!1;this.narrow=!1}render(){return c`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};cl.properties={width:{reflect:!0},fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},cl.styles=[E,w`
4252
+ `];$("cm-app-frame",ll);var dl=class extends A{constructor(){super(...arguments);this.width="";this.fullWidth=!1;this.narrow=!1}render(){return c`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};dl.properties={width:{reflect:!0},fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},dl.styles=[E,w`
4253
4253
  :host { display: block; container: cm-page / inline-size; background: var(--cm-page-background, var(--cm-bg-page)); min-block-size: 100%; }
4254
4254
  .content {
4255
4255
  box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
@@ -4261,16 +4261,16 @@ ${t.label}</button>
4261
4261
  :host([width='detail']) .content { max-inline-size: 1040px; }
4262
4262
  :host([width='wide']) .content { max-inline-size: 1600px; }
4263
4263
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-16); } }
4264
- `];$("cm-page",cl);var hl,Vw,jw,dl=class extends C{constructor(){super(...arguments);m(this,hl);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?ii`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:ii`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return c`<div class="banner" part="banner" role=${e}>
4264
+ `];$("cm-page",dl);var pl,jw,Uw,hl=class extends C{constructor(){super(...arguments);m(this,pl);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?ri`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:ri`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return c`<div class="banner" part="banner" role=${e}>
4265
4265
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
4266
4266
  <div class="body">
4267
4267
  ${this.heading?c`<p class="title">${this.heading}</p>`:h}
4268
4268
  <div><slot></slot></div>
4269
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${a(this,hl,Vw)}></slot></div>
4269
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${a(this,pl,jw)}></slot></div>
4270
4270
  </div>
4271
- ${this.dismissible?c`<button class="close" aria-label=${this.t("dismiss")} @click=${a(this,hl,jw)}>
4271
+ ${this.dismissible?c`<button class="close" aria-label=${this.t("dismiss")} @click=${a(this,pl,Uw)}>
4272
4272
  <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>`:h}
4273
- </div>`}};hl=new WeakSet,Vw=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},jw=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},dl.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},dl.styles=[E,w`
4273
+ </div>`}};pl=new WeakSet,jw=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},Uw=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},hl.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},hl.styles=[E,w`
4274
4274
  :host { display: block; }
4275
4275
  .banner {
4276
4276
  display: flex; gap: var(--cm-space-12); align-items: flex-start;
@@ -4294,10 +4294,10 @@ ${t.label}</button>
4294
4294
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
4295
4295
  }
4296
4296
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
4297
- `];$("cm-banner",dl);var rS=z("thumbnail",{noImage:"{alt} (no image)"}),pl=class extends C{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
4297
+ `];$("cm-banner",hl);var nS=z("thumbnail",{noImage:"{alt} (no image)"}),ml=class extends C{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
4298
4298
  @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return c`<span class="box" part="thumbnail" role=${this.alt?"img":h}
4299
4299
  aria-label=${this.alt?this.t("noImage",{alt:this.alt}):h} aria-hidden=${this.alt?h:"true"}>
4300
- <cm-icon name="box" size=${e}></cm-icon></span>`}};pl.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},pl.styles=[E,w`
4300
+ <cm-icon name="box" size=${e}></cm-icon></span>`}};ml.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},ml.styles=[E,w`
4301
4301
  :host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
4302
4302
  :host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
4303
4303
  :host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
@@ -4307,7 +4307,7 @@ ${t.label}</button>
4307
4307
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
4308
4308
  }
4309
4309
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
4310
- `];$("cm-thumbnail",pl);export{Rs as Announcer,En as CmAccordion,qo as CmAccountMenu,xn as CmActionBar,Ft as CmActionMenu,Ho as CmAppCard,ol as CmAppFrame,Mo as CmAvatar,Qo as CmBadge,dl as CmBanner,oo as CmBoard,Hs as CmBoardCard,Ns as CmBoardColumn,So as CmBottomNavigation,Bo as CmBottomSheet,Sr as CmButton,ha as CmButtonGroup,go as CmCalendar,uo as CmCalendarEvent,Zo as CmCard,Bi as CmCheckbox,or as CmColorField,pn as CmColorPicker,Wi as CmCombobox,Ra as CmCommandPalette,Cn as CmComment,zn as CmCommentBox,Gn as CmDataTable,Qi as CmDatePicker,tr as CmDateRangePicker,Mn as CmEmptyState,ar as CmFileUpload,Po as CmFilterPanel,Ao as CmFlashOfferBar,Qr as CmGlobalSearch,sl as CmGrid,To as CmHeaderBar,ea as CmIcon,kn as CmInfoItem,$n as CmInfoPanel,al as CmLayout,nl as CmLayoutSection,Do as CmLinkTabs,C as CmLocalizedElement,ta as CmMenuItem,$o as CmMetric,Lo as CmMobileMenu,No as CmModal,ko as CmNavItem,ao as CmNestedItem,so as CmNestedList,Fo as CmNotificationItem,Vo as CmNotificationPanel,Gt as CmOptionGroup,cl as CmPage,yn as CmPageHeader,qn as CmPagination,Jo as CmProgressBar,Br as CmRadio,Fr as CmRadioGroup,Os as CmReportTile,wo as CmReportTiles,to as CmResourceItem,io as CmResourceList,wn as CmSaveBar,Ki as CmSearch,vn as CmSegmentedControl,Ui as CmSelect,Eo as CmSideNavigation,Zt as CmSidePanel,lr as CmSignatureField,_n as CmSkeleton,Tn as CmSkeletonDisplay,Pn as CmSmartTip,In as CmSmartTips,Oo as CmSparkline,aa as CmSpinner,rl as CmStack,Bn as CmStatusTabs,Vn as CmTableHeader,Gr as CmTag,Oi as CmTextField,pl as CmThumbnail,sr as CmTimePicker,Ms as CmTimeline,Hn as CmTimelineItem,Ko as CmToast,Wo as CmToastRegion,Fi as CmToggle,Sn as CmTooltip,Kv as DEFAULT_PALETTE,dn as MAX_RECENT,Ds as MoveModel,wv as commandMatches,n0 as configure,z as defineStrings,Vb as directionalIcons,hs as formatColor,ue as formatDate,cs as formatGradient,Bb as formatMessage,_u as formatNumber,s0 as getDefaultStrings,Mc as hslToRgb,rm as hsvToRgb,T0 as httpColorSource,yw as initials,Jl as isApplePlatform,kg as isColorValue,Tx as listNavigation,Eg as localColorSource,wl as localeFor,Wu as matchesShortcut,ds as normalizeHex,qe as parseColor,Ht as parseGradient,bh as pluralCategory,sm as pushRecent,o0 as resetStrings,Op as resolvePreset,Ec as rgbToHsl,im as rgbToHsv,_c as sameColor,a0 as setStrings,pp as shortcutKeys,Nw as showToast,vh as translate,e$ as undoable};
4310
+ `];$("cm-thumbnail",ml);export{Hs as Announcer,Mn as CmAccordion,Oo as CmAccountMenu,wn as CmActionBar,Vt as CmActionMenu,No as CmAppCard,ll as CmAppFrame,_o as CmAvatar,Zo as CmBadge,hl as CmBanner,lo as CmBoard,Ns as CmBoardCard,Ps as CmBoardColumn,Lo as CmBottomNavigation,Fo as CmBottomSheet,Lr as CmButton,ua as CmButtonGroup,fo as CmCalendar,go as CmCalendarEvent,el as CmCard,Vi as CmCheckbox,lr as CmColorField,mn as CmColorPicker,Gi as CmCombobox,Ha as CmCommandPalette,zn as CmComment,Sn as CmCommentBox,Yn as CmDataTable,Zi as CmDatePicker,ir as CmDateRangePicker,_n as CmEmptyState,nr as CmFileUpload,Io as CmFilterPanel,Do as CmFlashOfferBar,Zr as CmGlobalSearch,al as CmGrid,Co as CmHeaderBar,ta as CmIcon,En as CmInfoItem,kn as CmInfoPanel,nl as CmLayout,ol as CmLayoutSection,Ro as CmLinkTabs,C as CmLocalizedElement,ia as CmMenuItem,ko as CmMetric,Ao as CmMobileMenu,Po as CmModal,Eo as CmNavItem,no as CmNestedItem,ao as CmNestedList,Vo as CmNotificationItem,jo as CmNotificationPanel,Yt as CmOptionGroup,dl as CmPage,xn as CmPageHeader,On as CmPagination,Qo as CmProgressBar,Fr as CmRadio,Vr as CmRadioGroup,Bs as CmReportTile,$o as CmReportTiles,io as CmResourceItem,ro as CmResourceList,$n as CmSaveBar,Wi as CmSearch,yn as CmSegmentedControl,Ki as CmSelect,Mo as CmSideNavigation,ei as CmSidePanel,cr as CmSignatureField,Tn as CmSkeleton,Cn as CmSkeletonDisplay,In as CmSmartTip,qn as CmSmartTips,Bo as CmSparkline,la as CmSpinner,sl as CmStack,Fn as CmStatusTabs,jn as CmTableHeader,Yr as CmTag,Fi as CmTextField,ml as CmThumbnail,ar as CmTimePicker,_s as CmTimeline,Nn as CmTimelineItem,Wo as CmToast,Go as CmToastRegion,ji as CmToggle,Ln as CmTooltip,Wv as DEFAULT_PALETTE,hn as MAX_RECENT,Rs as MoveModel,$v as commandMatches,o0 as configure,z as defineStrings,jb as directionalIcons,ps as formatColor,ue as formatDate,ds as formatGradient,Fb as formatMessage,Tu as formatNumber,a0 as getDefaultStrings,_c as hslToRgb,sm as hsvToRgb,C0 as httpColorSource,xw as initials,Ql as isApplePlatform,Eg as isColorValue,Cx as listNavigation,Mg as localColorSource,$l as localeFor,Gu as matchesShortcut,hs as normalizeHex,qe as parseColor,Nt as parseGradient,vh as pluralCategory,am as pushRecent,l0 as resetStrings,Bp as resolvePreset,Mc as rgbToHsl,rm as rgbToHsv,Tc as sameColor,n0 as setStrings,mp as shortcutKeys,Pw as showToast,yh as translate,t1 as undoable};
4311
4311
  /*! Bundled license information:
4312
4312
 
4313
4313
  @lit/reactive-element/css-tag.js: