@commmerce/ui 1.21.2 → 1.21.4

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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(o,n,e)=>(cu(o,n,"read from private field"),e?e.call(o):n.get(o)),m=(o,n,e)=>n.has(o)?vb("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(cu(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(cu(o,n,"access private method"),e);var ih=globalThis,rh=ih.ShadowRoot&&(ih.ShadyCSS===void 0||ih.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,du=Symbol(),yb=new WeakMap,pl=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==du)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(rh&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=yb.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&yb.set(e,n))}return n}toString(){return this.cssText}},sh=o=>new pl(typeof o=="string"?o:o+"",void 0,du),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 pl(e,o,du)},xb=(o,n)=>{if(rh)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=ih.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},hu=rh?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return sh(e)})(o):o;var{is:Fw,defineProperty:Vw,getOwnPropertyDescriptor:jw,getOwnPropertyNames:Uw,getOwnPropertySymbols:Kw,getPrototypeOf:Ww}=Object,ah=globalThis,wb=ah.trustedTypes,Gw=wb?wb.emptyScript:"",Yw=ah.reactiveElementPolyfillSupport,ml=(o,n)=>o,pu={toAttribute(o,n){switch(n){case Boolean:o=o?Gw: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}},kb=(o,n)=>!Fw(o,n),$b={attribute:!0,type:String,converter:pu,reflect:!1,useDefault:!1,hasChanged:kb};Symbol.metadata??=Symbol("metadata"),ah.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=$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&&Vw(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:s}=jw(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(ml("elementProperties")))return;let n=Ww(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(ml("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ml("properties"))){let e=this.properties,t=[...Uw(e),...Kw(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(hu(i))}else n!==void 0&&e.push(hu(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 xb(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:pu).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:pu;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??kb)(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[ml("elementProperties")]=new Map,ei[ml("finalized")]=new Map,Yw?.({ReactiveElement:ei}),(ah.reactiveElementVersions??=[]).push("2.1.2");var uu=globalThis,Eb=o=>o,nh=uu.trustedTypes,Mb=nh?nh.createPolicy("lit-html",{createHTML:o=>o}):void 0,gu="$lit$",ti=`lit$${Math.random().toFixed(9).slice(2)}$`,fu="?"+ti,Xw=`<${fu}>`,Tr=document,gl=()=>Tr.createComment(""),fl=o=>o===null||typeof o!="object"&&typeof o!="function",bu=Array.isArray,Lb=o=>bu(o)||typeof o?.[Symbol.iterator]=="function",mu=`[
2
- \f\r]`,ul=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_b=/-->/g,Tb=/>/g,Mr=RegExp(`>|${mu}(?:([^\\s"'>=/]+)(${mu}*=${mu}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Cb=/'/g,zb=/"/g,Ab=/^(?:script|style|textarea|title)$/i,vu=o=>(n,...e)=>({_$litType$:o,strings:n,values:e}),c=vu(1),ii=vu(2),o$=vu(3),Pe=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Sb=new WeakMap,_r=Tr.createTreeWalker(Tr,129);function Db(o,n){if(!bu(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Mb!==void 0?Mb.createHTML(n):n}var Rb=(o,n)=>{let e=o.length-1,t=[],i,s=n===2?"<svg>":n===3?"<math>":"",l=ul;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===ul?b[1]==="!--"?l=_b:b[1]!==void 0?l=Tb:b[2]!==void 0?(Ab.test(b[2])&&(i=RegExp("</"+b[2],"g")),l=Mr):b[3]!==void 0&&(l=Mr):l===Mr?b[0]===">"?(l=i??ul,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]==='"'?zb:Cb):l===zb||l===Cb?l=Mr:l===_b||l===Tb?l=ul:(l=Mr,i=void 0);let v=l===Mr&&o[d+1].startsWith("/>")?" ":"";s+=l===ul?p+Xw:f>=0?(t.push(u),p.slice(0,f)+gu+p.slice(f)+ti+v):p+ti+(f===-2?d:v)}return[Db(o,s+(o[e]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),t]},bl=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]=Rb(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(gu)){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]==="."?lh:k[1]==="?"?ch:k[1]==="@"?dh:zr}),i.removeAttribute(f)}else f.startsWith(ti)&&(p.push({type:6,index:s}),i.removeAttribute(f));if(Ab.test(i.tagName)){let f=i.textContent.split(ti),x=f.length-1;if(x>0){i.textContent=nh?nh.emptyScript:"";for(let v=0;v<x;v++)i.append(f[v],gl()),_r.nextNode(),p.push({type:2,index:++s});i.append(f[x],gl())}}}else if(i.nodeType===8)if(i.data===fu)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=fl(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 oh=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 hh(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),fl(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):Lb(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&&fl(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=bl.createElement(Db(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let s=new oh(i,this),l=s.u(this.options);s.p(e),this.T(l),this._$AH=s}}_$AC(n){let e=Sb.get(n.strings);return e===void 0&&Sb.set(n.strings,e=new bl(n)),e}k(n){bu(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(gl()),this.O(gl()),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=Eb(n).nextSibling;Eb(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=!fl(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||=!fl(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??"")}},lh=class extends zr{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===h?void 0:n}},ch=class extends zr{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==h)}},dh=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)}},hh=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)}},Hb={M:gu,P:ti,A:fu,C:1,L:Rb,R:oh,D:Lb,V:Cr,I:Qs,H:zr,N:ch,U:dh,B:lh,F:hh},Jw=uu.litHtmlPolyfillSupport;Jw?.(bl,Qs),(uu.litHtmlVersions??=[]).push("3.3.3");var Nb=(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(gl(),s),s,void 0,e??{})}return i._$AI(o),i};var yu=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=Nb(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,yu.litElementHydrateSupport?.({LitElement:A});var Qw=yu.litElementPolyfillSupport;Qw?.({LitElement:A});(yu.litElementVersions??=[]).push("4.2.2");var E=w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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
- `,w$=w`
15
+ `,E$=w`
16
16
  outline: 2px solid var(--cm-border-strong);
17
17
  outline-offset: 2px;
18
- `,Zw=0,N=o=>`${o}-${++Zw}`;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 e0={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},ph={common:{...e0}},vl={},yl={},mh;function z(o,n){return ph[o]={...ph[o],...n},n}function t0(){return Object.fromEntries(Object.entries(ph).map(([o,n])=>[o,{...n}]))}function uh(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function i0(o,n){uh(n?yl[n.toLowerCase()]??={}:vl,o),bh()}function r0(o={}){"locale"in o&&(mh=o.locale||void 0),o.strings&&uh(vl,o.strings);for(let[n,e]of Object.entries(o.translations??{}))uh(yl[n.toLowerCase()]??={},e);bh()}function s0(){mh=void 0;for(let o of Object.keys(vl))delete vl[o];for(let o of Object.keys(yl))delete yl[o];bh()}function xl(o){if(mh)return mh;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 Pb=new Map;function $u(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,s=Pb.get(i);if(!s){try{s=t(n)}catch{s=t(void 0)}Pb.set(i,s)}return s}function ku(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 gh(o,n){return $u("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function Ib(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[gh(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"?ku(l,{},e):String(l)})}function a0(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=yl[d]?.[s]?.[n];if(p!==void 0)return p}let l=vl[s]?.[n]??ph[s]?.[n];if(l!==void 0)return l}}function fh(o,n,e,t,i){let s=xl(t);return Ib(a0(o,n,s,i),e,s)}var wu=new Set,xu;function bh(){for(let o of wu)o.requestUpdate()}function n0(){xu||typeof MutationObserver>"u"||typeof document>"u"||(xu=new MutationObserver(bh),xu.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var o0=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 o0(this.localName)}t(n,e){return fh(this.stringsNamespace,n,e,this,this.strings)}get locale(){return xl(this)}formatNumber(n,e){return ku(n,e,this.locale)}connectedCallback(){super.connectedCallback(),wu.add(this),n0()}disconnectedCallback(){super.disconnectedCallback(),wu.delete(this)}};C.properties={strings:{type:Object}};var vh={"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"},qb=["more","drag"],M$=Object.keys(vh);var Ob=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],Zs=class extends A{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=vh[this.name]??vh.more,t=qb.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
+ `,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"
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"?Ob.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};Zs.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},Zs.styles=w`
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`
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",Zs);var Bb=99,R$=z("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),yh,xh,wl,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,yh,this.attachInternals());m(this,xh,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,yh).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});m(this,wl,!1);this.addEventListener("click",r(this,xh),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,wl)&&(g(this,wl,!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>Bb?this.t("countOverflow",{max:Bb}):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",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}
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>`}};yh=new WeakMap,xh=new WeakMap,wl=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>`}};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`
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,16 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 ea=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}}};ea.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}},ea.styles=w`:host { display: none; }`;$("cm-menu-item",ea);function $l(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 wh(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",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`
118
118
  :where([popover]) { margin: 0; padding: 0; border: 0; color: inherit; background: none; overflow: visible; }
119
- `,kl=8,Lt,ta,ia,ra,Lr,we=class{constructor(){m(this,Lt,null);m(this,ta,null);m(this,ia,{});m(this,ra,"");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,ra,n.style.maxHeight),g(this,Lt,n),g(this,ta,e),g(this,ia,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,ta);if(!n||!e)return;let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=r(this,ia).gap??4,d=r(this,ia).align??"start";n.style.maxHeight=r(this,ra),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-kl&&(k=f?x:v);let L=Math.max(0,Math.min(kl,t.left)),P=Math.min(i,Math.max(i-kl,t.right))-u;k=Math.max(L,Math.min(k,P));let U=s-t.bottom-l-kl,q=t.top-l-kl,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,ta,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,ra)}}};Lt=new WeakMap,ta=new WeakMap,ia=new WeakMap,ra=new WeakMap,Lr=new WeakMap;var sa=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
+ `,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">
120
120
  ${this.custom?h:c`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
121
121
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
122
122
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
123
123
  </svg>`}
124
124
  <slot @slotchange=${this.onSlotChange}></slot>
125
125
  <span class="vh">${this.accessibleLabel||this.t("loading")}</span>
126
- </span>`}};sa.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},sa.styles=[E,w`
126
+ </span>`}};aa.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},aa.styles=[E,w`
127
127
  :host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
128
128
  .spinner { display: inline-flex; align-items: center; --cm-spinner-duration: 0.8s; --cm-spinner-play-state: running; }
129
129
  ::slotted(*) { display: block; block-size: 20px; inline-size: auto; }
@@ -141,18 +141,18 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
141
141
  svg { animation-duration: 2.4s; }
142
142
  .spinner { --cm-spinner-play-state: paused; }
143
143
  }
144
- `];$("cm-spinner",sa);var Q$=z("actionMenu",{label:"Actions"}),El,Ar,Dr,Ml,J,$h,_l,kh,Eh,Mh,_h,Fb,na,oa,la,aa,Th,Vb,Eu,jb,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,El);m(this,Ar,N("cm-menu"));m(this,Dr,"");m(this,Ml,0);m(this,_l,e=>{this.open&&!e.composedPath().includes(this)&&a(this,J,Mh).call(this,!1)});m(this,na,new we);m(this,oa,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,la,()=>{this.disabled||(this.open?this.hide():this.show())});m(this,Th,e=>{let t=a(this,J,Eh).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,J,aa).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,J,aa).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,J,aa).call(this,t[0]);break;case"End":e.preventDefault(),a(this,J,aa).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,Ml)<600?r(this,Dr):"")+e.key.toLowerCase()),g(this,Ml,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,aa).call(this,u)}}})}connectedCallback(){super.connectedCallback(),a(this,J,$h).call(this),g(this,El,wh(this,()=>a(this,J,$h).call(this))),document.addEventListener("pointerdown",r(this,_l),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,El)?.disconnect(),document.removeEventListener("pointerdown",r(this,_l),!0),r(this,na).close()}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,J,Eh).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,J,Mh).call(this,!0),this.updateComplete.then(()=>a(this,J,_h).call(this))}hide(e=!1){a(this,J,Mh).call(this,!1),e&&a(this,J,kh).call(this)?.focus()}updated(e){if(e.has("open")&&this.open&&a(this,J,Fb).call(this),e.has("open")&&!this.open&&r(this,na).close(),this._custom){let t=a(this,J,kh).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,Eh).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,J,_h).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,la)} @keydown=${r(this,oa)} @slotchange=${()=>a(this,J,$h).call(this)}></slot>`:this.triggerTemplate(r(this,la),r(this,oa))??c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
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
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,la)} @keydown=${r(this,oa)}>${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}
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}
147
147
  <div class="pop" part="menu" popover="manual" ?hidden=${!this.open}>
148
148
  ${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,Th)}>
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,jb).call(this,e)}
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)}
151
151
  </div>
152
152
  </div>
153
- <slot hidden></slot>`}};El=new WeakMap,Ar=new WeakMap,Dr=new WeakMap,Ml=new WeakMap,J=new WeakSet,$h=function(){this._slotted=$l(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},_l=new WeakMap,kh=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},Eh=function(){return this.loading?[]:this.menuItems.map((e,t)=>!e.divider&&!e.heading&&!e.disabled?t:-1).filter(e=>e>=0)},Mh=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})))},_h=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Fb=function(){let e=this.renderRoot.querySelector(".pop");if(!e||r(this,na).open(e,a(this,J,kh).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")},na=new WeakMap,oa=new WeakMap,la=new WeakMap,aa=function(e){this._active=e,this.updateComplete.then(()=>a(this,J,_h).call(this))},Th=new WeakMap,Vb=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)},Eu=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,Vb).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}
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
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>`},jb=function(e){let t=[];for(let i=0;i<e.length;i++){let s=e[i];if(!s.heading){t.push(a(this,J,Eu).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,Eu).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`
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`
156
156
  :host { display: inline-block; position: relative; vertical-align: middle; }
157
157
  .trigger {
158
158
  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 +215,12 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
215
215
  }
216
216
  .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
217
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
218
- `];$("cm-action-menu",Ft);var s1=z("buttonGroup",{more:"More"}),Ri="data-cm-overflow",l0=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],Hi,Rr,ri,Vt,Ni,Hr,Q,ca,Ub,Tl,Mu,Ch,zh,Kb,Sh,_u,Tu,Cu,da=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,Sh,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,_u).call(this)))})}get overflowing(){return[...r(this,Hi)]}connectedCallback(){super.connectedCallback(),g(this,Rr,new MutationObserver(e=>a(this,Q,Ub).call(this,e))),r(this,Rr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:l0}),typeof ResizeObserver<"u"&&(g(this,ri,new ResizeObserver(()=>a(this,Q,ca).call(this))),r(this,ri).observe(this),g(this,Ni,new Set([this]))),document.fonts?.ready.then(()=>a(this,Q,ca).call(this)),a(this,Q,ca).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,Mu).call(this,a(this,Q,Tl).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&a(this,Q,ca).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,Vt)),g(this,Vt,0),a(this,Q,zh).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
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}>
219
219
  <slot></slot>
220
220
  <cm-action-menu class="more ${this._size}${e?" icon":""}" part="more" hidden align="end"
221
221
  .items=${this._items} label=${this.moreLabel} ?icon-only=${e} icon=${this.moreIcon||"more"}
222
- @cm-select=${r(this,Sh)}></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,ca=function(){r(this,Vt)||!this.isConnected||g(this,Vt,requestAnimationFrame(()=>{g(this,Vt,0);let e=a(this,Q,Tl).call(this).map(t=>t.updateComplete).filter(Boolean);e.length?Promise.all(e).then(()=>a(this,Q,zh).call(this)):a(this,Q,zh).call(this)}))},Ub=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,ca).call(this)},Tl=function(){return Array.from(this.children).filter(e=>e.localName==="cm-button"&&(!e.hidden||e.hasAttribute(Ri)))},Mu=function(e){for(let t of e)t.hasAttribute(Ri)&&(t.removeAttribute(Ri),t.hidden=!1)},Ch=function(){return this.renderRoot.querySelector(".more")},zh=function(){let e=this.renderRoot.querySelector(".row"),t=a(this,Q,Ch).call(this);if(!e||!t||!this.isConnected)return;let i=a(this,Q,Tl).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,Mu).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,Cu).call(this):s&&s!==t&&d.has(s)&&a(this,Q,Tu).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,Kb).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,_u).call(this))},Kb=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}},Sh=new WeakMap,_u=function(){if(!r(this,Hr))return;g(this,Hr,!1);let e=document.activeElement,t=a(this,Q,Ch).call(this);(!e||e===document.body||e===document.documentElement||e===this&&(!t||t.hidden||this.shadowRoot.activeElement!==t))&&(t&&!t.hidden?a(this,Q,Tu).call(this):a(this,Q,Cu).call(this))},Tu=function(){a(this,Q,Ch).call(this)?.shadowRoot?.querySelector('[part="trigger"]')?.focus()},Cu=function(){let e=a(this,Q,Tl).call(this).filter(i=>!i.hidden&&!i.hasAttribute("disabled")),t=e[e.length-1];(t?.shadowRoot?.querySelector('[part="control"]')??t)?.focus()},da.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}},da.styles=[E,w`
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`
224
224
  :host { display: block; min-inline-size: 0; }
225
225
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-8); min-inline-size: 0; }
226
226
  :host([align='end']) .row { justify-content: flex-end; }
@@ -244,7 +244,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
244
244
  .more::part(trigger), .more.slim::part(trigger) { min-height: var(--cm-control-height-lg, 40px); }
245
245
  .more.icon::part(trigger), .more.icon.slim::part(trigger) { width: var(--cm-control-height-lg, 40px); }
246
246
  }
247
- `];$("cm-button-group",da);var At={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ha=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:c0}=Hb,Wb=o=>o;var Yb=o=>o.strings===void 0,Gb=()=>document.createComment(""),pa=(o,n,e)=>{let t=o._$AA.parentNode,i=n===void 0?o._$AB:n._$AA;if(e===void 0){let s=t.insertBefore(Gb(),i),l=t.insertBefore(Gb(),i);e=new c0(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=Wb(p).nextSibling;Wb(t).insertBefore(p,i),p=u}}}return e},Ii=(o,n,e=o)=>(o._$AI(n,e),o),d0={},Lh=(o,n=d0)=>o._$AH=n,Xb=o=>o._$AH,Ah=o=>{o._$AR(),o._$AA.remove()};var ee=ha(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(!Yb(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 Lh(o),n}});var bt=w`
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`
248
248
  :host {
249
249
  --_cm-field-h: var(--cm-control-height-lg, 40px);
250
250
  --_cm-field-font: var(--cm-font-size-14, 14px);
@@ -268,7 +268,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
268
268
  .error { color: var(--cm-text-critical); }
269
269
  :host([size='small']) .field { gap: var(--cm-space-4); }
270
270
  :host([size='small']) .label { font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); }
271
- `,ma=w`
271
+ `,ua=w`
272
272
  [role='listbox'] {
273
273
  max-height: 264px; overflow-y: auto; margin: 0; padding: var(--cm-space-4); list-style: none;
274
274
  }
@@ -280,25 +280,25 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
280
280
  [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
281
  :host([size='small']) [role='option'] { min-height: var(--cm-control-height-sm, 32px); }
282
282
  @media (pointer: coarse) { [role='option'], :host([size='small']) [role='option'] { min-height: var(--cm-control-height-touch, 44px); } }
283
- `;var Dh=!1,zu=!1,Jb=!1,Qb=()=>{Dh||(Dh=!0,setTimeout(()=>{Dh=!1,zu=!1}))};function h0(){Jb||typeof document>"u"||(Jb=!0,document.addEventListener("click",Qb,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&Qb()},!0))}var et,Nr,ua,ga,qi,Cl,Pr,zl,Su,Sl,Rh,Hh,re=class{constructor(n,e,t){m(this,zl);m(this,et);m(this,Nr);m(this,ua);m(this,ga,!1);m(this,qi,!1);m(this,Cl,"");m(this,Pr,!1);m(this,Sl,()=>{g(this,ga,!0)});m(this,Rh,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,ga)||r(this,qi))return;let t=r(this,Nr).validity;t.valid||t.valueMissing||(g(this,qi,!0),r(this,et).requestUpdate())})});m(this,Hh,n=>{if(!(!Dh&&!r(this,Pr))){if(n.preventDefault(),g(this,qi,!0),r(this,et).requestUpdate(),r(this,Pr)){r(this,ua).call(this);return}zu||(zu=!0,r(this,ua).call(this))}});g(this,et,n),g(this,Nr,e),g(this,ua,t??(()=>n.focus())),h0(),n.addEventListener("invalid",r(this,Hh)),n.addEventListener("input",r(this,Sl),!0),n.addEventListener("change",r(this,Sl),!0),n.addEventListener("focusout",r(this,Rh))}get message(){return a(this,zl,Su).call(this)}sync(){let n=a(this,zl,Su).call(this);r(this,et).toggleAttribute("data-cm-invalid",!!n),n!==r(this,Cl)&&(g(this,Cl,n),queueMicrotask(()=>r(this,et).requestUpdate()))}reset(){g(this,ga,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,ua=new WeakMap,ga=new WeakMap,qi=new WeakMap,Cl=new WeakMap,Pr=new WeakMap,zl=new WeakSet,Su=function(){return r(this,et).error?r(this,et).error:r(this,qi)?r(this,Nr).validity.valid?"":r(this,Nr).validationMessage:""},Sl=new WeakMap,Rh=new WeakMap,Hh=new WeakMap;var T1=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,Al,oe,Zb,Ll,Nh,ev,Lu,Au,Du,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,Al,"")}connectedCallback(){super.connectedCallback(),g(this,Al,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,Ll).call(this),r(this,ge).checkValidity()}reportValidity(){return a(this,oe,Ll).call(this),r(this,Ir).report(()=>r(this,ge).reportValidity())}formResetCallback(){this.value=r(this,Al),this.error="",r(this,Ir).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,ge).setFormValue(this.value),a(this,oe,Ll).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}
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}
284
284
  .value=${ee(this.value)} placeholder=${this.placeholder||h}
285
285
  inputmode=${this.inputMode||h}
286
286
  minlength=${s} maxlength=${l}
287
287
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
288
288
  aria-invalid=${i.invalid} aria-describedby=${t}
289
- @input=${a(this,oe,Lu)} @change=${a(this,oe,Du)} @blur=${a(this,oe,Au)}></textarea>`:c`<input class="input" part="input" id=${i.id} type=${this.type}
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}
290
290
  .value=${ee(this.value)} placeholder=${this.placeholder||h}
291
291
  autocomplete=${this.autocomplete??h} inputmode=${this.inputMode||h}
292
292
  min=${this.min||h} max=${this.max||h} step=${this.step||h}
293
293
  pattern=${this.pattern||h} minlength=${s} maxlength=${l}
294
294
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
295
295
  aria-invalid=${i.invalid} aria-describedby=${t}
296
- @input=${a(this,oe,Lu)} @change=${a(this,oe,Du)} @blur=${a(this,oe,Au)} />`;return c`<div class="field">
296
+ @input=${a(this,oe,Ru)} @change=${a(this,oe,Nu)} @blur=${a(this,oe,Hu)} />`;return c`<div class="field">
297
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}
298
298
  ${d}
299
299
  ${e?c`<p class="error" id="${r(this,si)}-err" role="alert">${e}</p>`:h}
300
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,Al=new WeakMap,oe=new WeakSet,Zb=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},Ll=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,Zb).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,Nh).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,Nh).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,ev).call(this,e)),e??void 0):r(this,ge).setValidity({}),r(this,Ir).sync()},Nh=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)},ev=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,Nh).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)}},Lu=function(e){this.value=e.target.value},Au=function(){a(this,oe,Ll).call(this)},Du=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`
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`
302
302
  :host { display: block; }
303
303
  .input {
304
304
  width: 100%; height: var(--_cm-field-h); padding: 0 var(--_cm-field-pad);
@@ -314,13 +314,13 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
314
314
  .input:read-only, .input:disabled { background: var(--cm-bg-input-filled); }
315
315
  .input:disabled { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
316
316
  :host([error]:not([error=''])) .input, :host([data-cm-invalid]) .input { border-color: var(--cm-border-critical); }
317
- `];$("cm-text-field",Oi);var R1=z("checkbox",{required:"Please tick this box."}),vt,qr,ai,Dl,Ph,tv,Bi=class extends C{constructor(){super(...arguments);m(this,Ph);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,Dl,!1)}connectedCallback(){super.connectedCallback(),g(this,Dl,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,Dl),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)}>
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
318
  <input type="checkbox" id=${r(this,ai)} .checked=${this.checked} .indeterminate=${this.indeterminate}
319
319
  ?disabled=${this.disabled} ?required=${this.required} aria-invalid=${t?"true":h}
320
- aria-describedby=${i||h} @change=${a(this,Ph,tv)} />
320
+ aria-describedby=${i||h} @change=${a(this,qh,sv)} />
321
321
  <span class="box" part="box">${e}</span>
322
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,Dl=new WeakMap,Ph=new WeakSet,tv=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`
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`
324
324
  :host { display: inline-flex; flex-direction: column; }
325
325
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; }
326
326
  /* The 16px box (18px on touch screens, owner standard 1.6) sits centred on the label's first line (20px); the
@@ -346,12 +346,12 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
346
346
  /* 1.14: the field's own message, under the label text (past the box and its gap). */
347
347
  .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
348
  :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 Rl,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,Rl,N("cm-radio"))}render(){let e=this.description?`${r(this,Rl)}-d`:null;return c`<div class="radio" part="radio" role="radio" id=${r(this,Rl)}
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)}
350
350
  aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":h}
351
351
  aria-describedby=${e??h} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
352
352
  <span class="dot" part="dot"></span>
353
353
  <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>`}};Rl=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`
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`
355
355
  :host { display: inline-flex; }
356
356
  .radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; outline: none; }
357
357
  .dot {
@@ -373,16 +373,16 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
373
373
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
374
374
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-subtle); }
375
375
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
376
- `];$("cm-radio",Br);var B1=z("radioGroup",{required:"Please select one of these options."}),nt,Vr,ni,Hl,Nl,Pl,fa,fe,Ru,qh,Or,Hu,ba,Nu,Oh,Bh,Ih,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,Hl,"");m(this,Nl,!0);m(this,Pl,!1);m(this,fa,!1);m(this,qh,()=>{a(this,fe,Ru).call(this),r(this,ba).call(this)});m(this,ba,()=>{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,Hu).call(this)[0];for(let s of e)s._tabbable=s===i&&!this.disabled});m(this,Oh,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,fe,Nu).call(this,t,!0)});m(this,Bh,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,fe,Hu).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,Nu).call(this,d,!0)});this.addEventListener("keydown",r(this,Bh)),this.addEventListener("click",r(this,Oh))}connectedCallback(){super.connectedCallback(),a(this,fe,Ru).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,Hl),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,Pl)&&!r(this,fa)&&g(this,Nl,!1),g(this,Pl,!0),r(this,ba).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,Ih).call(this)?`${r(this,ni)}-l`:h} aria-label=${a(this,fe,Ih).call(this)?h:this.getAttribute("aria-label")??h}
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}
378
378
  aria-describedby=${t||h}
379
379
  aria-required=${this.required?"true":h} aria-invalid=${e?"true":h}
380
380
  aria-disabled=${this.disabled?"true":h}>
381
- <span class="label" id="${r(this,ni)}-l" part="label" ?hidden=${!a(this,fe,Ih).call(this)}>${this.label}<slot name="label"></slot>${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>
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
382
  ${this.helpText?c`<p class="help" id="${r(this,ni)}-help">${this.helpText}</p>`:h}
383
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,qh)}></slot></div>
385
- </div>`}};nt=new WeakMap,Vr=new WeakMap,ni=new WeakMap,Hl=new WeakMap,Nl=new WeakMap,Pl=new WeakMap,fa=new WeakMap,fe=new WeakSet,Ru=function(){r(this,Nl)&&(this.value||(g(this,fa,!0),this.value=a(this,fe,Or).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,fa,!1))),g(this,Hl,this.value))},qh=new WeakMap,Or=function(){return[...this.querySelectorAll("cm-radio")]},Hu=function(){return a(this,fe,Or).call(this).filter(e=>!e.disabled&&!this.disabled)},ba=new WeakMap,Nu=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,ba).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Oh=new WeakMap,Bh=new WeakMap,Ih=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`
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`
386
386
  :host { display: block; }
387
387
  .group { display: flex; flex-direction: column; gap: var(--cm-space-8); }
388
388
  .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 +391,13 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
391
391
  .error { color: var(--cm-text-critical); }
392
392
  .options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-12); padding-top: var(--cm-space-4); }
393
393
  :host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-24); }
394
- `];$("cm-radio-group",Fr);var va,jr,Il,Fh,iv,Fi=class extends A{constructor(){super(...arguments);m(this,Fh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;m(this,va,this.attachInternals());m(this,jr,N("cm-tg"));m(this,Il,!1)}connectedCallback(){super.connectedCallback(),g(this,Il,this.checked)}get form(){return r(this,va).form}checkValidity(){return r(this,va).checkValidity()}formResetCallback(){this.checked=r(this,Il)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){r(this,va).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return c`<label for=${r(this,jr)}>
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
395
  <input type="checkbox" role="switch" id=${r(this,jr)} .checked=${this.checked} ?disabled=${this.disabled}
396
396
  aria-label=${e?h:this.getAttribute("aria-label")??h}
397
- aria-describedby=${this.description?`${r(this,jr)}-d`:h} @change=${a(this,Fh,iv)} />
397
+ aria-describedby=${this.description?`${r(this,jr)}-d`:h} @change=${a(this,jh,av)} />
398
398
  <span class="track" part="track"><span class="thumb" part="thumb"></span></span>
399
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>`}};va=new WeakMap,jr=new WeakMap,Il=new WeakMap,Fh=new WeakSet,iv=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`
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`
401
401
  :host { display: inline-flex; }
402
402
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-8); padding-block: 2px; cursor: pointer; }
403
403
  /* A 36 x 20 track with a 16px thumb; the invisible input is a 24px-tall target. */
@@ -425,7 +425,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
425
425
  :host([disabled]) .track { opacity: .5; }
426
426
  :host([disabled]) .label { color: var(--cm-text-secondary); }
427
427
  @media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
428
- `];$("cm-toggle",Fi);var ya=w`
428
+ `];$("cm-toggle",Fi);var xa=w`
429
429
  .pop {
430
430
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-4)); inset-inline: 0;
431
431
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
@@ -437,7 +437,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
437
437
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
438
438
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
439
439
  }
440
- `;function Vh(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`
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
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
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
443
  .gh {
@@ -446,7 +446,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
446
446
  }
447
447
  .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
448
448
  .gopts { list-style: none; margin: 0; padding: 0; }
449
- `;function xa(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 jh(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 Uh=w`
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
450
  [role='listbox'] { padding-block: var(--cm-space-4); }
451
451
  [role='listbox'][hidden] { display: none; }
452
452
  [role='option'] {
@@ -465,12 +465,12 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
465
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
466
  color: var(--cm-text-tertiary); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-xs);
467
467
  }
468
- `;function Kh(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 Wh(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 Gh(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"}
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
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 Yh(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var rk=z("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),ot,Kr,Ce,$a,Dt,ka,Ol,W,Pu,Wr,Iu,ql,wa,Ur,ji,Xh,Jh,Bl,Qh,rv,Zh,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,$a,"");m(this,Dt,"");m(this,ka,0);m(this,Ol,new MutationObserver(()=>a(this,W,Pu).call(this)));m(this,Wr,new we);m(this,Jh,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,W,ql).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,W,ql).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,Xh).call(this,t);a(this,W,ql).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,wa).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,ka)<500){let i=a(this,W,Xh).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,Xh).call(this,t);i>=0&&(this._active=i)}}});m(this,Bl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,W,wa).call(this)});m(this,Qh,()=>{this.disabled||(this.open?a(this,W,wa).call(this):a(this,W,ql).call(this))});m(this,Zh,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,W,Pu).call(this),r(this,Ol).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,Bl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Wr).close(),r(this,Ol).disconnect(),document.removeEventListener("pointerdown",r(this,Bl),!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,$a),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?xa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):xa(this._slotted)}firstUpdated(){r(this,$a)||g(this,$a,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
+ 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":""}
471
471
  aria-selected=${p.value===this.value?"true":"false"} aria-disabled=${p.disabled?"true":h}
472
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,Zh)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
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}
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,Qh)} @keydown=${r(this,Jh)} @blur=${()=>a(this,W,wa).call(this)}>
483
- <span class="text ${t?"":"placeholder"}" id="${r(this,Ce)}-v">${t?a(this,W,rv).call(this,t):this.placeholder}</span>
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>
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
- ${jh(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
+ ${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>
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,$a=new WeakMap,Dt=new WeakMap,ka=new WeakMap,Ol=new WeakMap,W=new WeakSet,Pu=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,$a,this.value))},Wr=new WeakMap,Iu=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},ql=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,Iu).call(this)[0]??-1)},wa=function(){this.open=!1},Ur=function(e){let t=this.items[e];!t||t.disabled||(a(this,W,wa).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,Iu).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))]},Xh=function(e){let t=Date.now();g(this,Dt,t-r(this,ka)>500?e:r(this,Dt)+e),g(this,ka,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},Jh=new WeakMap,Bl=new WeakMap,Qh=new WeakMap,rv=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},Zh=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,ma,Vi,w`
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`
497
497
  :host { display: block; position: relative; }
498
498
  .label { cursor: default; }
499
499
  .wrap { position: relative; }
@@ -526,16 +526,16 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 hk=z("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Ma,ep,Fl,je,Ea,sv,av,qu,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,Ma,this.attachInternals());m(this,ep,N("cm-search"));m(this,Fl,"")}connectedCallback(){super.connectedCallback(),g(this,Fl,this.value)}get form(){return r(this,Ma).form}checkValidity(){return r(this,Ma).checkValidity()}formResetCallback(){this.value=r(this,Fl)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,Ma).setFormValue(this.value)}render(){return c`<div class="box" part="box">
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">
530
530
  <cm-icon class="icon" name="search" size="16"></cm-icon>
531
- <input id=${r(this,ep)} part="input" type="search" enterkeyhint="search" autocomplete="off"
531
+ <input id=${r(this,ip)} 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,sv)} @change=${()=>a(this,je,Ea).call(this,"change")} @keydown=${a(this,je,av)} />
534
- ${this.value&&!this.disabled?c`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${a(this,je,qu)}><cm-icon name="close" size="16"></cm-icon></button>`:h}
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}
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,Ea).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>`}};Ma=new WeakMap,ep=new WeakMap,Fl=new WeakMap,je=new WeakSet,Ea=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},sv=function(e){this.value=e.target.value},av=function(e){e.key==="Enter"?a(this,je,Ea).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),a(this,je,qu).call(this))},qu=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),a(this,je,Ea).call(this,"input"),a(this,je,Ea).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,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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 bk=z("tag",{remove:"Remove {label}"}),tp,nv,Gr=class extends C{constructor(){super(...arguments);m(this,tp);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,tp,nv)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};tp=new WeakSet,nv=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",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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 Ck=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,Kl,Ca,Wl,Gl,Yl,H,Ou,ov,Vl,ip,jl,li,_a,Ta,oi,lv,Ul,Bu,Fu,Yr,rp,sp,Xr,cv,ap,np,op,dv,hv,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,Kl,null);m(this,Ca,new Map);m(this,Wl,new Map);m(this,Gl,new MutationObserver(()=>a(this,H,Ou).call(this)));m(this,Yl);m(this,li,new we);m(this,rp,()=>{this._focusIn=!0});m(this,sp,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});m(this,ap,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,H,Ta).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});m(this,np,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,H,Ul).call(this,1):(a(this,H,Ta).call(this),e.altKey||a(this,H,Ul).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,H,Ul).call(this,-1):(a(this,H,Ta).call(this),a(this,H,Ul).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,H,Bu).call(this,this._active)):r(this,H,ip)&&(e.preventDefault(),a(this,H,Fu).call(this,r(this,H,ip)));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,_a).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,op,()=>{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,Vl).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,H,Ou).call(this),r(this,Gl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,Yl,Vh(this,()=>this.open,()=>a(this,H,oi).call(this))),this.addEventListener("focusin",r(this,rp)),this.addEventListener("focusout",r(this,sp))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,li).close(),r(this,Gl).disconnect(),(e=r(this,Yl))==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,Kl)??{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?xa(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):xa(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,Kl,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,Ca).set(t.value,t.label),t.group&&r(this,Wl).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,Vl).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=a(this,H,jl).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,_a).call(this))}focus(e){this.renderRoot.querySelector("input")?.focus(e)}render(){let e=a(this,H,jl).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",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":""}
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,Bu).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,dv).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
+ @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">
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
598
  <div class="box" part="box" @click=${u=>{u.target.closest("cm-tag[removable]")||a(this,H,Yr).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,hv).call(this):h}
600
+ ${this.multiple?a(this,H,uv).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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,ap)} @keydown=${r(this,np)} @blur=${r(this,op)}
609
- @click=${()=>{this.open||a(this,H,Ta).call(this)}} @change=${u=>u.stopPropagation()} />
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()} />
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,Ta).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,oi).call(this):(a(this,H,Ca).call(this),a(this,H,Yr).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
- ${jh(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
+ ${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>
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,Kl=new WeakMap,Ca=new WeakMap,Wl=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,H=new WeakSet,Ou=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])}},ov=function(e){return this.items.find(t=>t.value===e)?.label??r(this,Ca).get(e)??e},Vl=function(e){let t=a(this,H,ov).call(this,e);if(!this.showGroup)return t;let i=this.items.find(s=>s.value===e)?.group??r(this,Wl).get(e);return i?this.t("grouped",{group:i,label:t}):t},ip=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},jl=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,H,ip);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},li=new WeakMap,_a=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ta=function(){this.disabled||(this.open=!0)},oi=function(){this.open=!1,this._active=-1},lv=function(e=a(this,H,jl).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},Ul=function(e){let t=a(this,H,lv).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]},Bu=function(e){let t=a(this,H,jl).call(this)[e];if(!(!t||t.disabled)){if(t.create){a(this,H,Fu).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,_a).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,_a).call(this))}},Fu=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,Ca).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,_a).call(this))},Yr=function(){this.renderRoot.querySelector("input")?.focus()},rp=new WeakMap,sp=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)},cv=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)}},ap=new WeakMap,np=new WeakMap,op=new WeakMap,dv=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)}`},hv=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,Vl).call(this,i)})}
629
- @keydown=${l=>a(this,H,cv).call(this,l,s)}
630
- @cm-remove=${()=>{this.removeValue(i),a(this,H,Yr).call(this)}}>${a(this,H,Vl).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,ya,ma,Vi,w`
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`
631
631
  :host { display: block; position: relative; }
632
632
  .wrap { position: relative; }
633
633
  .box {
@@ -668,7 +668,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 Xl(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var p0={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function lp(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:p0[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 Vu(o,n=Xl()){let e=lp(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function ju(o,n,e=Xl()){let t=lp(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 cp(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var m0={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},u0={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},g0={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"},f0=o=>g0[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function dp(o,n=Xl()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=lp(t,n);if(!i)return[o.trim()];let s=n?m0:u0,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(s[d]);e.push(f0(i.key))}return e}function pv(o,n=Xl()){if(/\s/.test(o.trim()))return"";let e=lp(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 qk=z("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),yt,Ql,ie,hp,Jl,ci,za,Uu,pp,mv,mp,Zl,Ku,uv,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,Ql);m(this,ci,new we);m(this,pp,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,ie,Uu).call(this)});m(this,mp,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,ie,mv).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,ie,Jl)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,yt)}-o${this._active}`)?.click());break;case"Escape":r(this,ie,Jl)?(e.preventDefault(),e.stopPropagation(),a(this,ie,za).call(this)):this.value&&(e.preventDefault(),a(this,ie,Ku).call(this,!1));break;case"Tab":a(this,ie,za).call(this);break;default:}});m(this,Zl,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||cp(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,Ql,Vh(this,()=>this.open,()=>a(this,ie,za).call(this))),document.addEventListener("keydown",r(this,Zl))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ci).close(),(e=r(this,Ql))==null||e.call(this),document.removeEventListener("keydown",r(this,Zl))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,ie,hp).call(this).length&&(this._active=-1)}updated(e){let t=r(this,ie,Jl);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,hp).call(this),t=r(this,ie,Jl),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 Gh({id:`${r(this,yt)}-o${x}`,active:x===this._active,href:u.href,cls:f,onHover:()=>this._active=x,onChoose:v=>a(this,ie,uv).call(this,v,u)},b)};return c`<div class="wrap">
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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,pp)} @keydown=${r(this,mp)}
680
+ @input=${r(this,up)} @keydown=${r(this,gp)}
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,Ku).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,Yu).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
- ${Kh(`${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},Wh(x)))}
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)))}
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,Ql=new WeakMap,ie=new WeakSet,hp=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}]:[]])},Jl=function(){return this.open&&!!this.value.trim()},ci=new WeakMap,za=function(){this.open=!1,this._active=-1},Uu=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},pp=new WeakMap,mv=function(e){this._active=Yh(this._active,e,a(this,ie,hp).call(this).length)},mp=new WeakMap,Zl=new WeakMap,Ku=function(e=!0){this.value="",a(this,ie,za).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,ie,Uu).call(this)},uv=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,za).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,ya,Vi,Uh,w`
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`
696
696
  :host { display: block; position: relative; }
697
697
  .wrap { position: relative; }
698
698
  .box {
@@ -722,15 +722,15 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 Wu=0,gv="",fv="";function ec(){if(Wu++===0){let o=document.documentElement;gv=o.style.overflow,fv=o.style.scrollbarGutter,window.innerWidth-o.clientWidth>0&&(o.style.scrollbarGutter="stable"),o.style.overflow="hidden"}}function Gi(){if(Wu>0&&--Wu===0){let o=document.documentElement;o.style.overflow=gv,o.style.scrollbarGutter=fv}}function Gu(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var Sa,di,La,Aa,up,gp,fp,bp,vp,yp,le=class extends C{constructor(){super(...arguments);m(this,Aa);this.open=!1;this.label="";this.uid=N("cm-ovl");m(this,Sa,null);m(this,di,!1);m(this,La,!1);m(this,gp,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});m(this,fp,e=>{e.preventDefault(),this.requestClose("escape")});m(this,bp,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,Aa,up).call(this))});m(this,vp,e=>{g(this,La,e.target===e.currentTarget)});m(this,yp,e=>{if(e.target===e.currentTarget&&r(this,La)){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,La,!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,Aa,up).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,Sa,Gu()),!this.isConnected)return;t.showModal(),r(this,di)||(ec(),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,Aa,up).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",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">
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,gp)} @cancel=${r(this,fp)} @close=${r(this,bp)}
733
- @pointerdown=${r(this,vp)} @click=${r(this,yp)}>${e}</dialog>`}};Sa=new WeakMap,di=new WeakMap,La=new WeakMap,Aa=new WeakSet,up=function(){r(this,di)&&(Gi(),g(this,di,!1));let e=r(this,Sa);g(this,Sa,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},gp=new WeakMap,fp=new WeakMap,bp=new WeakMap,vp=new WeakMap,yp=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,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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
762
762
 
763
763
  }
764
764
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
765
- `];var eE=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"}),bv=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function vv(o,n){let e=bv(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=bv([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var ic,De,Yu,Xu,tc,xp,wp,yv,xv,Da=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,ic,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!ju(e,this.shortcut)||!this.open&&!Vu(this.shortcut)&&cp(e)||this.open&&!Vu(this.shortcut)||(e.preventDefault(),this.toggle())});m(this,xp,e=>{this.value=e.target.value,this._active=a(this,De,tc).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});m(this,wp,e=>{let t=a(this,De,tc).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Yh(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,ic))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,ic))}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,tc).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,Xu).call(this):[],t=a(this,De,tc).call(this,e),i=r(this,De,Yu),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 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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,xp)} @keydown=${r(this,wp)} />
774
- <kbd class="esc" aria-hidden="true">${dp("escape")[0]}</kbd>
773
+ @input=${r(this,$p)} @keydown=${r(this,kp)} />
774
+ <kbd class="esc" aria-hidden="true">${pp("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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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
- ${Kh(`${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 Gh({id:`${d}-o${x}`,active:x===this._active,href:f.href,cls:v?"":"all",keyshortcuts:v?.shortcut?pv(v.shortcut):void 0,onHover:()=>this._active=x,onChoose:k=>a(this,De,yv).call(this,k,f)},v?Wh(v,a(this,De,xv).call(this,v.shortcut)):c`<span class="text">${f.group.seeAllLabel||this.seeAllLabel}</span>`)})}
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>`)})}
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>`)}};ic=new WeakMap,De=new WeakSet,Yu=function(){return this.value.trim()},Xu=function(){let e=r(this,De,Yu),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=>vv(l,e)):s.items);return t},tc=function(e=a(this,De,Xu).call(this)){return e.flatMap(t=>t.rows)},xp=new WeakMap,wp=new WeakMap,yv=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)},xv=function(e){return e?c`<span class="keys" aria-hidden="true">${dp(e).map(t=>c`<kbd>${t}</kbd>`)}</span>`:h},Da.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}},Da.styles=[...le.overlayStyles,ya,Vi,Uh,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Da);var b0=/^(\d{4})-(\d{2})-(\d{2})$/;function R(o){let n=b0.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())}`,Ju=()=>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 v0=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function Ee(o){let n=v0.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 kv=()=>{let o=new Date;return`${B(o)}T${jt(o.getHours())}:${jt(o.getMinutes())}`},wv=new Map;function Ra(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=wv.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 wv.set(t,v),v}var $p=(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 Ha={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},rc=o=>Array.isArray(o)?o:typeof o=="string"?Ha.fromAttribute(o):[];function Yi(o,n){let e=[n,xl(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function Na(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 Pa(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 kp=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function Ia(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 Ep(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 sc(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=Ju(),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",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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 Mp=w`
844
+ </table>`}var Tp=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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 _p(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 qa=w`
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`
879
879
  ${bt}
880
880
  :host { display: block; position: relative; }
881
881
  .wrap { position: relative; }
@@ -907,69 +907,69 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 uE=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."}}),Va,$e,rs,wt,ja,gi,Zi,tt,lt,Ua,Ka,M,ac,Xi,Wa,Tp,ts,Oa,pi,Ji,mi,ui,Cp,Qu,zp,Ba,is,Sp,Zu,Ev,Lp,Mv,_v,fi,Ga,eg,Fa,nc,oc,tg,Tv,Ap,ig,rg,Dp,Rp,Hp,Np,Pp,lc,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,Va,"");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,ja,null);m(this,gi,!1);m(this,Zi,!1);m(this,tt,"");m(this,lt,"");m(this,Ua,!1);m(this,Ka,"");m(this,Wa,!1);m(this,fi,new we);m(this,Ga,!1);m(this,Ap,e=>{e.key==="Enter"?a(this,M,tg).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,M,Tv).call(this,e.key==="ArrowUp"?1:-1))});m(this,Dp,()=>{this.disabled||(this.open?this.open=!1:(a(this,M,oc).call(this),this.show()))});m(this,Rp,e=>{e.key==="Enter"?a(this,M,oc).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,M,oc).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});m(this,Hp,e=>{let t=Ep(se(e,this),e,this._focus,r(this,M,Qu));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,ig).call(this,this._focus))});m(this,Np,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,M,rg).call(this);return}_p(e,e.currentTarget)});m(this,Pp,e=>{this._focus=Kt(be(this._focus,e),r(this,M,mi),r(this,M,ui))});m(this,lc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Va)}set locale(e){let t=r(this,Va);g(this,Va,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,ja)===null&&g(this,ja,this.value),document.addEventListener("pointerdown",r(this,lc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,fi).close(),document.removeEventListener("pointerdown",r(this,lc),!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,Lp).call(this),r(this,$e).checkValidity()}reportValidity(){return a(this,M,Lp).call(this),r(this,rs).report(()=>r(this,$e).reportValidity())}formResetCallback(){r(this,rs).reset(),this._dateError=this._timeError="",this.value=r(this,ja)??"",this.time&&(a(this,M,Zu).call(this,this.value),g(this,M,a(this,M,is).call(this,r(this,lt)),Xi)),this._text=a(this,M,Ba).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,Ev).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:rc(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Wa)?(a(this,M,Zu).call(this,this.value),r(this,Ua)||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,Ba).call(this,r(this,M,pi)):e.has("locale")&&R(r(this,M,pi))&&(this._text=a(this,M,Ba).call(this,r(this,M,pi))),e.has("value")&&!r(this,Ga)&&(this._dateError=this._timeError=""),g(this,Ga,!1),g(this,gi,!1),g(this,Ua,!1),g(this,Wa,!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,Lp).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 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">
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,zp)}
915
+ .value=${ee(this._text)} placeholder=${this.placeholder||r(this,M,Lp)}
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,oc).call(this)} @keydown=${r(this,Rp)} />
920
+ @change=${()=>a(this,M,lc).call(this)} @keydown=${r(this,Np)} />
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,Dp)}><cm-icon name="calendar" size="16"></cm-icon></button>
924
+ @click=${r(this,Hp)}><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,ac))} placeholder=${r(this,M,Sp)}
928
+ .value=${ee(r(this,M,nc))} placeholder=${r(this,M,Ap)}
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
932
  @input=${x=>{x.stopPropagation(),g(this,M,x.target.value,Xi)}}
933
- @change=${()=>a(this,M,tg).call(this)} @keydown=${r(this,Ap)} />
933
+ @change=${()=>a(this,M,sg).call(this)} @keydown=${r(this,Rp)} />
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,Np)}>
937
- ${this.open?c`<div class="cal">${sc({id:r(this,wt),fmt:e,firstDay:r(this,M,Qu),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,ig).call(this,x),onKey:r(this,Hp),onMonth:r(this,Pp),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:h}
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}
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>`}};Va=new WeakMap,$e=new WeakMap,rs=new WeakMap,wt=new WeakMap,ja=new WeakMap,gi=new WeakMap,Zi=new WeakMap,tt=new WeakMap,lt=new WeakMap,Ua=new WeakMap,Ka=new WeakMap,M=new WeakSet,ac=function(){return r(this,Ka)},Xi=function(e){e!==r(this,Ka)&&(g(this,Ka,e),this.requestUpdate())},Wa=new WeakMap,Tp=function(){return Yi(this,this.locale)},ts=function(){return Pa(r(this,M,Tp))},Oa=function(){return Ra(r(this,M,Tp),this.hourCycle)},pi=function(){return this.time?r(this,tt):this.value},Ji=function(e){return this.time&&e.trim().toLowerCase()==="now"?kv():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)},Cp=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Qu=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Na(r(this,M,Tp)):(Math.trunc(e)%7+7)%7},zp=function(){return kp(r(this,M,ts),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Ba=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,Oa).format(t)},Sp=function(){return $p(r(this,M,Oa),{h:this.t("patternHour"),m:this.t("patternMinute")})},Zu=function(e){let{date:t,time:i}=xt(e);g(this,tt,t),g(this,lt,t?i:"")},Ev=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)},Lp=function(){a(this,M,Mv).call(this),r(this,rs).sync()},Mv=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,zp)}),e):this.time?a(this,M,_v).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({})},_v=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,ac).trim()&&l===null)return s({badInput:!0},"badTime",{pattern:r(this,M,Sp)},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,Oa).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,Cp))return s({stepMismatch:!0},"stepMismatch",{count:r(this,M,Cp)},i);if(this.isUnavailable(r(this,tt)))return s({customError:!0},"unavailable");r(this,$e).setValidity({})},fi=new WeakMap,Ga=new WeakMap,eg=function(e){e!==this.value&&(g(this,Ga,!0),this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Fa=function(e,t){g(this,tt,e),g(this,lt,t);let i=e&&t?`${e}T${t}`:"";g(this,Wa,!0),this.requestUpdate(),a(this,M,eg).call(this,i)},nc=function(e){this.time?a(this,M,Fa).call(this,e,r(this,lt)):a(this,M,eg).call(this,e)},oc=function(){let e=this._text.trim();if(this._dateError="",!e){a(this,M,nc).call(this,"");return}let t=Ia(e,r(this,M,ts));t?(a(this,M,nc).call(this,t),this._text=a(this,M,Ba).call(this,t)):(g(this,gi,!0),a(this,M,nc).call(this,""),this._dateError=this.t("badInput",{pattern:r(this,M,zp)}))},tg=function(){let e=r(this,M,ac).trim(),t=e?es(e,r(this,M,Oa)):"";if(g(this,gi,!0),t===null){g(this,Ua,!0),a(this,M,Fa).call(this,r(this,tt),""),this._timeError=this.t("badTime",{pattern:r(this,M,Sp)});return}this._timeError="",a(this,M,Fa).call(this,r(this,tt),t),g(this,M,a(this,M,is).call(this,t),Xi)},Tv=function(e){let t=r(this,M,Cp),i=es(r(this,M,ac),r(this,M,Oa));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,Fa).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,Fa).call(this,r(this,tt),d),g(this,M,a(this,M,is).call(this,d),Xi)},Ap=new WeakMap,ig=function(e){let t=B(e);this.isUnavailable(t)||(this.open=!1,a(this,M,nc).call(this,t),this._text=a(this,M,Ba).call(this,t),this._dateError="",this.time&&!r(this,lt)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,M,rg).call(this))},rg=function(){this.renderRoot.querySelector(".trigger")?.focus()},Dp=new WeakMap,Rp=new WeakMap,Hp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,lc=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:Ha},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,qa,Mp,w`.pop { min-width: 0; }`];$("cm-date-picker",Qi);var EE=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"}),sg=(o,n)=>te(o,-((o.getDay()-n+7)%7)),Cv={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[te(o,-1),te(o,-1)]],"this-week":["This week",(o,n)=>[sg(o,n),o]],"last-week":["Last week",(o,n)=>[te(sg(o,n),-7),te(sg(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)]]},y0=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function Ip(o,n=new Date,e,t=0){if(typeof o=="object"&&o)return o;let i=Cv[o];if(!i||!Object.prototype.hasOwnProperty.call(Cv,o))return null;let s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[l,d]=i[1](s,t);return{label:e?.(y0(o))||i[0],start:B(l),end:B(d)}}var x0=["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"],Za,Me,as,Le,en,tn,Ke,rn,Wt,ir,_,ss,cc,qp,bi,er,Ya,dc,Xa,ag,Op,hc,We,pc,Rt,vi,zv,mc,Ja,Bp,ng,og,lg,cg,Fp,dg,Qa,fc,Vp,bc,vc,yc,uc,gc,Sv,Lv,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,Za,"");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,en,null);m(this,tn,!1);m(this,Ke,!1);m(this,rn,!1);m(this,Wt,!1);m(this,ir,!1);m(this,We,"start");m(this,vi,new we);m(this,fc,()=>{this.disabled||(this.open?this.open=!1:(r(this,_,ss)||(a(this,_,Ja).call(this,"start"),a(this,_,Ja).call(this,"end")),this.show()))});m(this,Vp,e=>t=>{t.key==="Enter"?a(this,_,Ja).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,_,Ja).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});m(this,bc,e=>{let t=Ep(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,_,Xa).call(this,this._focus),g(this,Wt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,_,Bp).call(this,this._focus))});m(this,vc,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,_,Qa).call(this);return}_p(e,e.currentTarget)});m(this,yc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Za)}set locale(e){let t=r(this,Za);g(this,Za,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,en)||g(this,en,[this.start,this.end,this.preset]),document.addEventListener("pointerdown",r(this,yc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,vi).close(),document.removeEventListener("pointerdown",r(this,yc),!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,en)??["","",""],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,_,dc)===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,_,dc))),this._focus=Kt(R(this.start)??t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),a(this,_,Xa).call(this,this._focus),g(this,We,"start"),g(this,Wt,!0),g(this,ir,!0),a(this,_,Ya).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:rc(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){if(e.has("preset")&&!r(this,tn)&&this.preset){let t=Ip(this.preset,new Date,void 0,r(this,_,er));t&&(this.start=t.start,this.end=t.end)}g(this,tn,!1),r(this,rn)||(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,rn,!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,_,pc)}),d):this._endText.trim()&&!t?r(this,Me).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,_,pc)}),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,_,Op):[],[b,f,x]=r(this,_,cc)?[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,_,dc),U=K=>sc({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,_,uc).call(this,Z),note:Z=>{let zt=a(this,_,uc).call(this,Z);return zt==="start"?this.t("startNote"):zt==="end"?this.t("endNote"):""},onPick:Z=>a(this,_,Bp).call(this,Z),onKey:r(this,bc),onMonth:Z=>{this._view=be(this._view,Z),this._focus=Kt(be(this._focus,Z),R(this.min),R(this.max)),a(this,_,Xa).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,_,pc)}
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)}
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
947
  @input=${zt=>{zt.stopPropagation();let Er=zt.target.value;K==="start"?this._startText=Er:this._endText=Er}}
948
- @change=${()=>a(this,_,Ja).call(this,K)} @keydown=${r(this,Vp).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}>
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}>
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,_,Lv).call(this,p,s,l):c`<div class="wrap">
950
+ ${r(this,_,ss)?a(this,_,Rv).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,fc)}><cm-icon name="calendar" size="16"></cm-icon></button>
956
+ @click=${r(this,bc)}><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,vc)}>
959
+ ?hidden=${!this.open} @keydown=${r(this,yc)}>
960
960
  ${this.open?c`<div class="body">
961
- ${u.length||r(this,_,hc)?c`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(K=>c`<li>
961
+ ${u.length||r(this,_,pc)?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,_,ng).call(this,K)}>${K.label}</button></li>`)}${r(this,_,hc)?c`<li>
963
+ @click=${()=>a(this,_,cg).call(this,K)}>${K.label}</button></li>`)}${r(this,_,pc)?c`<li>
964
964
  <button type="button" class="preset" data-preset="custom" aria-pressed=${L?"true":"false"}
965
- @click=${()=>a(this,_,og).call(this)}>${this.t("custom")}</button></li>`:h}</ul>`:h}
965
+ @click=${()=>a(this,_,dg).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,_,cc)&&!r(this,_,ss)?c`<div class="foot" part="footer">
969
+ ${r(this,_,dc)&&!r(this,_,ss)?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,_,dg).call(this)}>${this.t("cancel")}</button>
972
- <button type="button" class="act primary" ?disabled=${!q||!O} @click=${()=>a(this,_,lg).call(this)}>${this.t("apply")}</button>
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>
973
973
  </div>`:h}
974
974
  </div>
975
975
  </div>`:h}
@@ -977,47 +977,47 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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>`}};Za=new WeakMap,Me=new WeakMap,as=new WeakMap,Le=new WeakMap,en=new WeakMap,tn=new WeakMap,Ke=new WeakMap,rn=new WeakMap,Wt=new WeakMap,ir=new WeakMap,_=new WeakSet,ss=function(){return this.variant==="report"},cc=function(){return this.confirm||r(this,_,ss)},qp=function(){return Yi(this,this.locale)},bi=function(){return Pa(r(this,_,qp))},er=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Na(r(this,_,qp)):(Math.trunc(e)%7+7)%7},Ya=function(){this._dStartText=a(this,_,Rt).call(this,this._draftStart),this._dEndText=a(this,_,Rt).call(this,this._draftEnd)},dc=function(){return Number(this.months)!==2||typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches?1:2},Xa=function(e){let t=r(this,_,dc),i=Se(e);i<this._view?this._view=i:i>=be(this._view,t)&&(this._view=be(i,1-t))},ag=function(){let e=rc(this.presets);return e.length||!r(this,_,ss)?e:x0},Op=function(){return r(this,_,ag).flatMap(e=>{let t=Ip(e,new Date,i=>this.t(i),r(this,_,er));return t?[{...t,key:typeof e=="string"?e:""}]:[]})},hc=function(){return r(this,_,ag).includes("custom")},We=new WeakMap,pc=function(){return kp(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,zv=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},mc=function(e,t,i){let s=i??r(this,_,Op).find(l=>l.key&&l.start===e&&l.end===t)?.key??"";s!==this.preset&&(g(this,tn,!0),this.preset=s),!(e===this.start&&t===this.end)&&(this.start=e,this.end=t,a(this,_,zv).call(this))},Ja=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?Ia(t,r(this,_,bi)):"";t&&!i&&g(this,rn,!0);let s=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,_,mc).call(this,...s),i&&(e==="start"?this._startText=a(this,_,Rt).call(this,i):this._endText=a(this,_,Rt).call(this,i))},Bp=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,_,Ya).call(this);return}if(this._draftEnd=t,a(this,_,Ya).call(this),g(this,We,"start"),r(this,_,cc)){this._focus=e,g(this,Wt,!0);return}this.open=!1,a(this,_,mc).call(this,this._draftStart,t,""),a(this,_,Qa).call(this)}},ng=function(e){if(r(this,_,cc)){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,_,Xa).call(this,R(e.start)),a(this,_,Xa).call(this,t),g(this,ir,!0),a(this,_,Ya).call(this);return}this.open=!1,a(this,_,mc).call(this,e.start,e.end,e.key),a(this,_,Qa).call(this)},og=function(){g(this,Ke,!0),this._draftPreset="",g(this,We,"start"),g(this,Wt,!0),this.requestUpdate()},lg=function(){!this._draftStart||!this._draftEnd||(this.open=!1,a(this,_,mc).call(this,this._draftStart,this._draftEnd,r(this,Ke)?"":this._draftPreset||void 0),a(this,_,Qa).call(this))},cg=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim(),i=t?Ia(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,_,Ya).call(this)},Fp=function(e){let t=(e==="start"?this._dStartText:this._dEndText).trim();if(!t)return!1;let i=Ia(t,r(this,_,bi));return!i||this.isUnavailable(i)},dg=function(){this.open=!1,a(this,_,Qa).call(this)},Qa=function(){this.renderRoot.querySelector(".trigger")?.focus()},fc=new WeakMap,Vp=new WeakMap,bc=new WeakMap,vc=new WeakMap,yc=new WeakMap,uc=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":""},gc=function(e,t,i){let s=R(e),l=R(t);if(!s)return"";let d=new Intl.DateTimeFormat(r(this,_,qp),{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," ")},Sv=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},Lv=function(e,t,i){let s=r(this,_,bi),l=R(this.start),d=R(this.end),p=this.open?r(this,_,Op):[],[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"?Ip(this.preset,new Date,X=>this.t(X),r(this,_,er))?.label??"":l&&d&&r(this,_,hc)?this.t("custom"):"",U=l&&d?a(this,_,gc).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,_,Fp).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,_,pc)}
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)}
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,_,cg).call(this,X)}}
985
- @keydown=${me=>{me.key==="Enter"&&(me.preventDefault(),a(this,_,cg).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,_,ng).call(this,X)}>
987
- <span class="p-label">${X.label}</span><span class="p-span">${a(this,_,gc).call(this,X.start,X.end,R(X.start).getFullYear()!==L||R(X.end).getFullYear()!==L)}</span>
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>
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,fc)}>
992
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,Le)}-pop" @click=${r(this,bc)}>
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,vc)}>
998
+ ?hidden=${!this.open} @keydown=${r(this,yc)}>
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,_,hc)?c`<li class="custom"><button type="button" class="preset" data-preset="custom" aria-pressed=${k?"true":"false"}
1002
- @click=${()=>a(this,_,og).call(this)}><span class="p-label">${this.t("custom")}</span></button></li>`:h}
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
1003
  ${p.map(Er)}
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,_,Sv).map(X=>{let St=B(X).slice(0,7);return c`<div class="r-month" data-month=${St}>${sc({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,_,uc).call(this,me),note:me=>{let Ve=a(this,_,uc).call(this,me);return Ve==="start"?this.t("startNote"):Ve==="end"?this.t("endNote"):""},onPick:me=>a(this,_,Bp).call(this,me),onKey:r(this,bc),onMonth:()=>{},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:me=>{r(this,We)==="end"&&(this._hover=me)}})}</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>`})}
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,_,gc).call(this,u,b,!0)} <span class="count">· ${this.t("dayCount",{count:G})}</span>`:O?`${a(this,_,gc).call(this,u,"",!0)} \u2013`:this.t("noRange")}</span>
1016
- <button type="button" class="act" @click=${()=>a(this,_,dg).call(this)}>${this.t("cancel")}</button>
1017
- <button type="button" class="act primary" ?disabled=${!O||!ve||a(this,_,Fp).call(this,"start")||a(this,_,Fp).call(this,"end")} @click=${()=>a(this,_,lg).call(this)}>${this.t("apply")}</button>
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>
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:Ha},isDateDisabled:{attribute:!1},presets:{converter:Ha},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,qa,Mp,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 HE=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."}}),nn,Re,ns,$t,on,ln,yi,F,Av,rr,sn,Dv,hg,an,jp,Rv,pg,Hv,Up,Kp,mg,Wp,Gp,Yp,xc,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,nn,"");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,on,null);m(this,ln,!1);m(this,yi,new we);m(this,Wp,e=>{let t=r(this,F,jp);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,mg).call(this,t[this._active])):(this.open=!1,a(this,F,Kp).call(this));return;case"Escape":this.open&&(e.preventDefault(),e.stopPropagation(),this.open=!1);return;case"Tab":this.open=!1;return;default:}});m(this,Gp,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,pg).call(this,t))}});m(this,Yp,()=>{this.disabled||(this.open?this.open=!1:(a(this,F,Kp).call(this),this.show()),this.renderRoot.querySelector("input")?.focus())});m(this,xc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,nn)}set locale(e){let t=r(this,nn);g(this,nn,e??""),this.requestUpdate("locale",t)}get valueAsNumber(){return Ee(this.value)}connectedCallback(){super.connectedCallback(),r(this,on)===null&&g(this,on,this.value),document.addEventListener("pointerdown",r(this,xc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,yi).close(),document.removeEventListener("pointerdown",r(this,xc),!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,on)??"",this._text=a(this,F,an).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,pg).call(this,Ee(this.value)!==null?this.value:es(this._text,r(this,F,rr))??a(this,F,Rv).call(this)),this.open=!0)}close(){this.open=!1}willUpdate(e){e.has("value")&&!r(this,ln)?this._text=a(this,F,an).call(this,this.value):(e.has("locale")||e.has("hourCycle"))&&Ee(this.value)!==null&&(this._text=a(this,F,an).call(this,this.value)),g(this,ln,!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,Hv).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,hg)}),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,sn)?r(this,Re).setValidity({stepMismatch:!0},this.t("stepMismatch",{count:r(this,F,sn)}),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,jp):[],p=Ee(this.value),u=`${r(this,$t)}-list`;return c`<div class="field">
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">
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,hg)}
1136
+ .value=${ee(this._text)} placeholder=${this.placeholder||r(this,F,ug)}
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,Gp)} @change=${()=>a(this,F,Kp).call(this)} @keydown=${r(this,Wp)} />
1140
+ @input=${r(this,Xp)} @change=${()=>a(this,F,Gp).call(this)} @keydown=${r(this,Yp)} />
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,Yp)}><cm-icon name="clock" size="16"></cm-icon></button>
1143
+ @pointerdown=${b=>b.preventDefault()} @click=${r(this,Jp)}><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
1147
  ${d.map((b,f)=>c`<li role="option" id="${r(this,$t)}-o${b}" data-value=${hi(b)}
1148
1148
  class=${f===this._active?"active":""} aria-selected=${b===p?"true":"false"}
1149
- @pointerenter=${()=>{this._active=f}} @click=${()=>a(this,F,mg).call(this,b)}>${e.format(b)}</li>`)}
1149
+ @pointerenter=${()=>{this._active=f}} @click=${()=>a(this,F,fg).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>`}};nn=new WeakMap,Re=new WeakMap,ns=new WeakMap,$t=new WeakMap,on=new WeakMap,ln=new WeakMap,yi=new WeakMap,F=new WeakSet,Av=function(){return Yi(this,this.locale)},rr=function(){return Ra(r(this,F,Av),this.hourCycle)},sn=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=720?e:1},Dv=function(){let e=Math.trunc(Number(this.interval));return e>=1&&e<=720?e:r(this,F,sn)>=5?r(this,F,sn):30},hg=function(){return $p(r(this,F,rr),{h:this.t("patternHour"),m:this.t("patternMinute")})},an=function(e){let t=Ee(e);return t===null?"":r(this,F,rr).format(t)},jp=function(){let e=Ee(this.min)??0,t=Ee(this.max)??1439,i=r(this,F,Dv),s=r(this,F,sn),l=[];for(let d=Math.ceil(e/i)*i;d<=t&&l.length<1440;d+=i)d%s===0&&l.push(d);return l},Rv=function(){let e=new Date;return hi(e.getHours()*60+e.getMinutes())},pg=function(e){let t=r(this,F,jp);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},Hv=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)},Up=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})))},Kp=function(){let e=this._text.trim(),t=e?es(e,r(this,F,rr)):"";if(t===null){g(this,ln,!0),a(this,F,Up).call(this,""),this.requestUpdate();return}a(this,F,Up).call(this,t),this._text=a(this,F,an).call(this,t)},mg=function(e){let t=hi(e);this.open=!1,a(this,F,Up).call(this,t),this._text=a(this,F,an).call(this,t),this.renderRoot.querySelector("input")?.focus()},Wp=new WeakMap,Gp=new WeakMap,Yp=new WeakMap,xc=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,qa,ma,w`
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`
1156
1156
  :host([data-cm-invalid]) .box { border-color: var(--cm-border-critical); }
1157
1157
  :host { max-width: 100%; }
1158
1158
  .pop {
@@ -1166,46 +1166,46 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 FE=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 w0(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,wc,ug,Xp,Jp,gg,fg,bg,vg,os,Nv,Pv,yg,Iv,qv,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,wc)&&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)w0(p,r(this,j,ug))?this.maxSize&&p.size>this.maxSize?(s.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,j,Jp).call(this,this.maxSize)}))):i.push(p):(s.push(p),l.push(this.t("wrongType",{name:p.name})));let d=r(this,j,Xp)?[...this.files,...i]:i.slice(-1);!r(this,j,Xp)&&!i.length&&(d=this.files),r(this,j,Xp)&&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,wc))return a(this,j,qv).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",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`
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,Pv).call(this,s))}
1176
- ${t?c`<li>${a(this,j,yg).call(this,!0)}</li>`:h}
1177
- </ul>`:a(this,j,yg).call(this,!1)}
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)}
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,wc=function(){return this.variant==="photo"},ug=function(){return this.accept||(r(this,j,wc)?"image/*":"")},Xp=function(){return this.multiple&&!r(this,j,wc)},Jp=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})})},gg=function(e){let t=r(this,wi).get(e);return t||(t=URL.createObjectURL(e),r(this,wi).set(e,t)),t},fg=function(e){return this._progress.has(e)},bg=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)},vg=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},Nv=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}`},Pv=function(e){let t=a(this,j,fg).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,gg).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,Jp).call(this,e.size)}</span></div>`}
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>`}
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,bg).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,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}
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>`},yg=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"
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
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)}>
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,vg)} @cancel=${s=>s.stopPropagation()} />
1191
+ @change=${a(this,j,wg)} @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,Nv).call(this)}</span>${this.hint?c`<span class="hint" id="${r(this,de)}-hint">${this.hint}</span>`:h}</span>`}
1194
- </label>`},Iv=function(){this.renderRoot.querySelector("input[type=file]")?.click()},qv=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,fg).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,ug)} capture=${this.capture||h}
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}
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,vg)} @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,wg)} @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,gg).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,Jp).call(this,e.size)}</span></div>`}
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>`}
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,bg).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,xg).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,Iv)}><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,Bv)}><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
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)}>
@@ -1299,75 +1299,75 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 Qp(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 Bv(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?ls(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:Qp(i[3],1);if(s===null)return null;if(t[1].startsWith("rgb")){let[u,b,f]=i.slice(0,3).map(x=>Qp(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=Bv(i[0]),d=Qp(i[1].endsWith("%")?i[1]:`${i[1]}%`,100),p=Qp(i[2].endsWith("%")?i[2]:`${i[2]}%`,100);return l===null||d===null||p===null?null:{...Ec({h:l,s:$i(d,0,100),l:$i(p,0,100),a:1}),a:$i(ls(s,3),0,1)}}function em({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 tm({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 kc({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:em({r:o,g:n,b:e,a:t}).h,s:f*100,l:b*100,a:t}}function Ec({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 Zp=o=>Math.round(o).toString(16).padStart(2,"0"),$c=({r:o,g:n,b:e})=>`#${Zp(o)}${Zp(n)}${Zp(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}=kc(o),d=`${Math.round(i)}, ${Math.round(s)}%, ${Math.round(l)}%`;return t?`hsla(${d}, ${e})`:`hsl(${d})`}return t?`${$c(o)}${Zp(e*255)}`:$c(o)}function k0(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 Ov={"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=k0(n[2]),i=180,s=t[0]?.toLowerCase().replace(/\s+/g," ")??"";if(e==="linear"){let p=Bv(s);p!==null&&/[a-z]/.test(s)?(i=p,t.shift()):s in Ov&&(i=Ov[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 Fv(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 Mc(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 xg=o=>!!qe(o)||!!Ht(o);var cn=16;function im(o,n,e=16){let t=n.trim().toLowerCase();return[n.trim(),...o.filter(i=>i.trim().toLowerCase()!==t)].slice(0,e)}function wg(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=im(t(),i,n);try{localStorage.setItem(e,JSON.stringify(s))}catch{}return s}}}function E0(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 ZE=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}"}),Vv=["#000000","#707070","#c9c9c9","#de0000","#ad5500","#f1a953","#ffc107","#81bb47","#3c7c00","#5394d9","#2e6faf","#446beb"].map(o=>({value:o})),M0=["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)||Ht(e.value))?[{value:e.value.trim(),name:e.name}]:[]}),nm,zc,pn,Sc,ki,T,kg,Eg,jv,nr,ps,dt,Mg,_g,Tg,Uv,Kv,_c,Wv,Cg,zg,Gv,rm,Sg,Yv,Tc,sm,Cc,Lg,Xv,Jv,Qv,dn,Ag,Zv,ey,am,ty,hn=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,nm,N("cm-cp"));m(this,zc);m(this,pn);m(this,Sc);m(this,ki,null)}connectedCallback(){super.connectedCallback(),a(this,T,Eg).call(this)}get allowedFormats(){let e=String(this.formats??"").split(/[\s,]+/).filter(t=>M0.includes(t));return e.length?e:["hex"]}get palette(){return this.swatches?$g(this.swatches):Vv}get brand(){return this.brandColors?$g(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,Sc,void 0),(e.has("source")||e.has("recentKey"))&&a(this,T,Eg).call(this),e.has("format")&&!this.allowedFormats.includes(this.format)&&(this.format=this.allowedFormats[0]),e.has("value")&&this.value!==r(this,zc)&&a(this,T,jv).call(this)}render(){let{h:e,s:t,v:i,a:s}=this._hsva,l=r(this,T,ps),d=$c(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",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")}>
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,Tc).call(this,!1)}
1305
- @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,Tc).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,Tc).call(this,!0)}
1307
- @keydown=${v=>{v.key.startsWith("Arrow")&&(v.preventDefault(),a(this,T,Tc).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,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>
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,sm).call(this,{type:v.target.value})}}>
1310
+ <select aria-label=${this.t("gradientType")} @change=${v=>{v.stopPropagation(),a(this,T,nm).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,sm).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,nm).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,Ag).call(this,this._stop)}><cm-icon name="trash" size="16"></cm-icon></button>
1317
+ @click=${()=>a(this,T,Hg).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,Xv)}>
1319
+ <div class="bar checker" role="group" aria-label=${this.t("stops")} @pointerdown=${a(this,T,Zv)}>
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
1323
  aria-label=${this.t("stop",{n:k+1,color:hs(v.color,this.format),position:Math.round(v.position)})}
1324
1324
  aria-current=${k===this._stop?"true":"false"} style="inset-inline-start:${v.position}%;background:${hs(v.color)}"
1325
- @pointerdown=${L=>a(this,T,Jv).call(this,L,k)} @pointermove=${L=>a(this,T,Qv).call(this,L,k)}
1326
- @pointerup=${a(this,T,_c)} @pointercancel=${a(this,T,_c)} @focus=${()=>{this._stop!==k&&a(this,T,Cc).call(this,k)}}
1327
- @keydown=${L=>a(this,T,Zv).call(this,L,k)}></button>`)}
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>`)}
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,Uv)} @pointermove=${a(this,T,Kv)} @pointerup=${a(this,T,_c)} @pointercancel=${a(this,T,_c)} @keydown=${a(this,T,Wv)}>
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)}>
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
1336
  <span class="preview checker" aria-hidden="true"><span style="background:${u?cs(u):hs(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,Cg).call(this,v,!1)} @change=${v=>a(this,T,Cg).call(this,v,!0)} />
1339
+ @input=${v=>a(this,T,Lg).call(this,v,!1)} @change=${v=>a(this,T,Lg).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,zg).call(this,v,!1)} @change=${v=>a(this,T,zg).call(this,v,!0)} /></div>`:h}
1343
+ @input=${v=>a(this,T,Ag).call(this,v,!1)} @change=${v=>a(this,T,Ag).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,Gv)}>
1347
+ ${p.length>1?c`<select aria-label=${this.t("format")} @change=${a(this,T,Jv)}>
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,ty).call(this)}
1351
- ${f?c`<button type="button" class="icon-btn" aria-label=${this.t("eyedropper")} title=${this.t("eyedropper")} @click=${a(this,T,Yv)}>
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)}>
1352
1352
  <cm-icon name="eyedropper" size="16"></cm-icon></button>`:h}
1353
1353
  </div>
1354
- ${a(this,T,am).call(this,"brand",this.brand)}
1355
- ${a(this,T,am).call(this,"recent",this.recent.map(v=>({value:v})))}
1356
- ${a(this,T,am).call(this,"palette",this.palette)}
1357
- </div>`}};nm=new WeakMap,zc=new WeakMap,pn=new WeakMap,Sc=new WeakMap,ki=new WeakMap,T=new WeakSet,kg=function(){if(this.source)return this.source;if(this.recentKey)return r(this,Sc)??g(this,Sc,wg(this.recentKey))},Eg=async function(){let e=a(this,T,kg).call(this);if(!e||e===r(this,pn))return;g(this,pn,e);let[t,i]=await Promise.allSettled([e.brandColors?.()??Promise.resolve([]),e.recentColors?.()??Promise.resolve([])]);r(this,pn)===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")))},jv=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=em(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 tm(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,zc,t),this.value=t,i&&a(this,T,Mg).call(this,"input"),e&&a(this,T,_g).call(this)},Mg=function(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))},_g=function(){a(this,T,Mg).call(this,"change");let e=this.value;if(!e||[...this.brand,...this.palette].some(l=>Mc(l.value,e)))return;let t=this.recentColors??this._recent;if(t[0]&&Mc(t[0],e))return;let i=im(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,kg).call(this)?.addRecentColor?.(e)?.then(l=>{Array.isArray(l)&&(this._recent=l)}).catch(()=>{})},Tg=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)},Uv=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,Tg).call(this,e)},Kv=function(e){r(this,ki)==="area"&&a(this,T,Tg).call(this,e)},_c=function(){r(this,ki)!==null&&(g(this,ki,null),a(this,T,_g).call(this))},Wv=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)},Cg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,h:Number(e.target.value)},a(this,T,dt).call(this,t)},zg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,a:Number(e.target.value)/100},a(this,T,dt).call(this,t)},Gv=function(e){e.stopPropagation(),this.format=e.target.value,this._drafts={},this.value&&a(this,T,dt).call(this,!0)},rm=function(e,t,i){e.stopPropagation();let s=e.target.value,l=a(this,T,Sg).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)},Sg=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=kc(i);return e==="h"?s>=0&&s<=360?Ec({...l,h:s%360,a:i.a}):null:(e==="s"||e==="l")&&s>=0&&s<=100?Ec({...l,[e]:s,a:i.a}):null},Yv=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{}},Tc=function(e){if(e!==!!this._grad){if(e){let t=r(this,T,ps),i=tm({...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)}},sm=function(e,t=!0){this._grad&&(this._grad={...this._grad,...e},a(this,T,dt).call(this,t))},Cc=function(e){this._grad&&(this._stop=e,a(this,T,nr).call(this,this._grad.stops[e].color),this._drafts={})},Lg=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)},Xv=function(e){if(!this._grad||e.button!==0||e.target.closest(".handle"))return;let t=a(this,T,Lg).call(this,e,e.currentTarget),i=Fv(this._grad,t),s=[...this._grad.stops,{color:i,position:t}];this._grad={...this._grad,stops:s},a(this,T,Cc).call(this,s.length-1),a(this,T,dt).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[s.length-1]?.focus())},Jv=function(e,t){if(e.button===0){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}a(this,T,Cc).call(this,t),g(this,ki,t)}},Qv=function(e,t){if(r(this,ki)!==t||!this._grad)return;let i=this.renderRoot.querySelector(".bar");a(this,T,dn).call(this,t,a(this,T,Lg).call(this,e,i),!1)},dn=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,sm).call(this,{stops:s},i)},Ag=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,Cc).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())},Zv=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,dn).call(this,t,l+(s&&e.key==="ArrowRight"?-i:i),!0);else if(e.key==="ArrowLeft"||e.key==="ArrowDown")a(this,T,dn).call(this,t,l-(s&&e.key==="ArrowLeft"?-i:i),!0);else if(e.key==="Home")a(this,T,dn).call(this,t,0,!0);else if(e.key==="End")a(this,T,dn).call(this,t,100,!0);else if(e.key==="Delete"||e.key==="Backspace")a(this,T,Ag).call(this,t);else return;e.preventDefault()},ey=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)},am=function(e,t){if(!t.length)return h;let i=`${r(this,nm)}-${e}`;return c`<div class="group" role="group" aria-labelledby=${i}>
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}>
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&&Mc(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,ey).call(this,s.value)}><span style="background:${s.value}"></span></button>`})}</div>
1361
- </div>`},ty=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&&_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":""}"
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,Sg).call(this,d,t[d])?"true":h}
1364
- @input=${f=>a(this,T,rm).call(this,f,d,!1)} @change=${f=>a(this,T,rm).call(this,f,d,!0)}
1365
- @keydown=${f=>{f.key==="Enter"&&a(this,T,rm).call(this,f,d,!0)}} />`,l=kc(e);return c`<div class="boxes">
1366
- ${i==="hex"?s("hex",this.t("hex"),$c(e),!1):h}
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}
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>`},hn.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}},hn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",hn);var dM=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"}),_0=[{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"}],T0={fromAttribute:o=>o===null?!1:o==="native"?"native":!0,toAttribute:o=>o==="native"?"native":o?"":null},C0=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 z0(o){let n=C0(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var it,us,gs,kt,Lc,fs,V,mn,ms,Ac,Ei,Dg,iy,ry,Rg,sy,ay,ny,oy,ly,cy,dy,hy,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,Lc,"");m(this,fs);m(this,Ac,e=>{this._open&&!e.composedPath().includes(this)&&(this._open=!1)})}connectedCallback(){super.connectedCallback(),g(this,Lc,a(this,V,ms).call(this,this.value)??this.value),document.addEventListener("pointerdown",r(this,Ac),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,Ac),!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,Lc),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,mn)&&t?.value&&xg(t.value)?t.value.trim():null);return i?[{value:i,name:t.name}]:[]}):_0.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,mn)?"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,mn),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",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">
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:${z0(x.value)}"
1458
- @click=${()=>a(this,V,Dg).call(this,v)} @keydown=${L=>a(this,V,iy).call(this,L,v)}><cm-icon name="check" size="16"></cm-icon></button>`})}
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>`})}
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,dy)}>
1470
- ${this._open?c`<cm-color-picker .value=${this.value} .format=${a(this,V,hy).call(this)} .formats=${this.formats} .alpha=${this.alpha}
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}
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,ly)} @change=${a(this,V,cy)}></cm-color-picker>`:h}
1473
+ @input=${a(this,V,hy)} @change=${a(this,V,py)}></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,ny)} @change=${a(this,V,oy)} />
1477
+ @input=${a(this,V,cy)} @change=${a(this,V,dy)} />
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,ry)} @change=${a(this,V,sy)} @keydown=${a(this,V,ay)} />
1485
+ @input=${a(this,V,ny)} @change=${a(this,V,oy)} @keydown=${a(this,V,ly)} />
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,Lc=new WeakMap,fs=new WeakMap,V=new WeakSet,mn=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,mn))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},Ac=new WeakMap,Ei=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},Dg=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")))},iy=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,Dg).call(this,l)},ry=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,mn)&&/\)\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)},Rg=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")},sy=function(e){e.stopPropagation(),a(this,V,Rg).call(this)},ay=function(e){e.key==="Enter"&&a(this,V,Rg).call(this)},ny=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"))},oy=function(e){e.stopPropagation(),a(this,V,Ei).call(this,"change")},ly=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"))},cy=function(e){e.stopPropagation(),a(this,V,Ei).call(this,"change")},dy=function(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this._open=!1,this.updateComplete.then(()=>this.renderRoot.querySelector("button.pick")?.focus()))},hy=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:T0,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,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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 vM=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."}),Hg=3,om=.7,S0=.0055,lm="#000000",py=8,Dc=2,L0=400,A0=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),ht,vs,Rc,un,Hc,Et,Mt,_t,cr,dr,Ge,Nc,hr,gn,D,Ng,cm,Pg,Mi,dm,Ig,qg,my,Og,hm,Bg,pm,uy,Fg,gy,bs,mm,Vg,jg,fy,Ug,by,Kg,vy,yy,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,Rc,N("cm-sig"));m(this,un,"");m(this,Hc,"");m(this,Et,[]);m(this,Mt);m(this,_t);m(this,cr,"");m(this,dr,0);m(this,Ge);m(this,Nc,"");m(this,hr);m(this,gn,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,D,Ng).call(this):(g(this,un,this.value),g(this,Hc,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,Hc),r(this,un)?(g(this,cr,""),this.value=r(this,un)):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,Vg).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,D,Vg).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,Ng).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,D,bs).call(this,!1)),a(this,D,pm).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,D,pm).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,Rc),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",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}"
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,jg).call(this,u,!0)} @keydown=${a(this,D,fy)}>${this.t(u)}</button>`;return c`<div class="field">
1545
+ @click=${()=>a(this,D,Wg).call(this,u,!0)} @keydown=${a(this,D,yy)}>${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,vy)}>${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,yy)}>${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,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>
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,my)} @pointermove=${a(this,D,Og)} @pointerup=${a(this,D,hm)} @pointercancel=${a(this,D,hm)}
1564
- @lostpointercapture=${a(this,D,hm)} @transitionend=${()=>a(this,D,dm).call(this)}></canvas>
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>
1565
1565
  </div>
1566
1566
  <span class="vh" id="${e}-instr">${this.t("instructions")}</span>
1567
1567
  </div>
@@ -1573,13 +1573,13 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,uy)} @change=${a(this,D,gy)} />
1576
+ @input=${a(this,D,by)} @change=${a(this,D,vy)} />
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,Rc=new WeakMap,un=new WeakMap,Hc=new WeakMap,Et=new WeakMap,Mt=new WeakMap,_t=new WeakMap,cr=new WeakMap,dr=new WeakMap,Ge=new WeakMap,Nc=new WeakMap,hr=new WeakMap,gn=new WeakMap,D=new WeakSet,Ng=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||r(this,hr)||(g(this,hr,new ResizeObserver(()=>a(this,D,Pg).call(this))),r(this,hr).observe(e))},cm=function(){return this.renderRoot.querySelector("canvas")},Pg=function(){let e=r(this,D,cm);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,gn,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,dm).call(this)},Mi=function(){r(this,dr)||g(this,dr,requestAnimationFrame(()=>{g(this,dr,0),a(this,D,dm).call(this)}))},dm=function(){let e=r(this,D,cm);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||r(this,gn);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||lm;a(this,D,Ig).call(this,t,i,l,!0)},Ig=function(e,t,i,s){let l=t/Hg,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&&!H0(i,lm)){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))D0(e,p,t)},qg=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}},my=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,qg).call(this,e,t.getBoundingClientRect())];g(this,Mt,{id:e.pointerId,stroke:i}),r(this,Et).push(i),a(this,D,Mi).call(this)},Og=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,qg).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)},hm=function(e){let t=r(this,Mt);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,D,Og).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)}},Bg=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},pm=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${r(this,D,Bg)}`,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)},()=>{})},uy=function(e){e.stopPropagation(),r(this,Ge)?clearTimeout(r(this,Ge)):g(this,Nc,this.value),this.typedName=e.target.value,g(this,Ge,setTimeout(()=>a(this,D,Fg).call(this),L0)),a(this,D,pm).call(this)},Fg=function(){r(this,Ge)&&(clearTimeout(r(this,Ge)),g(this,Ge,void 0),this.value!==r(this,Nc)&&a(this,D,mm).call(this))},gy=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,D,Fg).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,mm).call(this)},mm=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}))},Vg=function(){if(this.empty)return;let e=Math.max(r(this,D,cm)?.clientWidth||r(this,gn)||600,300),t=e/Hg,i=document.createElement("canvas");i.width=Math.round(e*Dc),i.height=Math.round(t*Dc);let s=i.getContext("2d",{willReadFrequently:!0});if(s.scale(Dc,Dc),this.mode==="type"){let l=Math.min(t*.45,64),d=r(this,D,Bg);s.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),u=e-2*py,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=lm,s.fillText(p,e/2,t*om)}else a(this,D,Ig).call(this,s,e,lm,!1);return R0(i,py*Dc)},jg=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${r(this,Rc)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,D,Pg).call(this),this.value!==i&&a(this,D,mm).call(this)})},fy=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,jg).call(this,i,!0)},Ug=function(e){a(this,D,by).call(this,this.t(e))},by=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Kg=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()})},vy=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,D,Ug).call(this,"undone"),a(this,D,Kg).call(this,e)},yy=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,D,Ug).call(this,"cleared"),a(this,D,Kg).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,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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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: ${Hg} / 1; overflow: hidden; container-type: inline-size;
1612
+ position: relative; width: 100%; aspect-ratio: ${Ig} / 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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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: ${om*100}%; height: 0;
1623
+ position: absolute; inset-inline: var(--cm-space-12); top: ${cm*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-om)*100}% + 4px);
1627
+ position: absolute; inset-inline-start: var(--cm-space-12); bottom: calc(${(1-cm)*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-om)*100}% - 0.18em);
1631
+ position: absolute; inset-inline: var(--cm-space-12); bottom: calc(${(1-cm)*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,7 +1645,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 D0(o,n,e){let t=d=>e*S0*(.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=A0(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 R0(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 H0(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 MM=z("optionGroup",{required:"Please select one of these options."}),Tt,ys,xs,fn,Pc,Yt,Wg,Gg,xy,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,fn,"");m(this,Pc,new MutationObserver(()=>a(this,Yt,Wg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,Yt,Wg).call(this),r(this,Pc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Pc).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,fn),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,fn)||g(this,fn,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`
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
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}
1650
1650
  <div class="options" part="options" role="radiogroup"
1651
1651
  aria-labelledby=${this.label?`${r(this,xs)}-l`:h} aria-label=${!this.label&&s?s:h}
@@ -1653,11 +1653,11 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
1653
1653
  aria-describedby=${l?`${r(this,xs)}-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,Gg).call(this,p)} @keydown=${u=>a(this,Yt,xy).call(this,u,p)}>${d.label}</button>`)}
1656
+ @click=${()=>a(this,Yt,Jg).call(this,p)} @keydown=${u=>a(this,Yt,ky).call(this,u,p)}>${d.label}</button>`)}
1657
1657
  </div>
1658
1658
  ${l?c`<p class="error" id="${r(this,xs)}-err" role="alert">${l}</p>`:h}
1659
1659
  <slot></slot>
1660
- `}};Tt=new WeakMap,ys=new WeakMap,xs=new WeakMap,fn=new WeakMap,Pc=new WeakMap,Yt=new WeakSet,Wg=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,fn,this.value))},Gg=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}))))},xy=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,Gg).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,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`
1661
1661
  :host { display: block; }
1662
1662
  .label {
1663
1663
  display: block; margin-bottom: var(--cm-space-8);
@@ -1691,7 +1691,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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 AM=z("segmentedControl",{required:"Please select one of these options."}),bn=class extends Gt{constructor(){super(...arguments);this.size="default"}};bn.properties={...Gt.properties,size:{reflect:!0}},bn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",bn);var PM=z("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Ic,Yg,vn=class extends C{constructor(){super(...arguments);m(this,Ic);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",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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,Ic,Yg).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,Ic,Yg).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,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>
1740
1740
  </div>`:h}
1741
1741
  <slot name="actions"></slot>
1742
1742
  </div>
1743
- </header>`}};Ic=new WeakSet,Yg=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},vn.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"}},vn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",vn);var VM=z("actionBar",{label:"Actions"}),yn=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",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")}>
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
1808
1808
  </div>
1809
1809
  </div>
1810
1810
  <div class="actions"><slot name="actions"></slot></div>
1811
- </div>`}};yn.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},yn.styles=[E,w`
1811
+ </div>`}};xn.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},xn.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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
1839
1839
 
1840
1840
  .actions { gap: var(--cm-space-8); }
1841
1841
  }
1842
- `];$("cm-action-bar",yn);var GM=z("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Xt,ws,qc,Ye,Xg,Jg,Qg,wy,$y,xn=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,qc,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,Ye,Xg).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,Ye,Jg).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,Ye,Xg).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
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}>
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,$y)}>${this.discardLabel}</cm-button>
1846
- <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${a(this,Ye,wy)}>${this.saveLabel}</cm-button>
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>
1847
1847
  </div>
1848
- </div>`}};Xt=new WeakMap,ws=new WeakMap,qc=new WeakMap,Ye=new WeakSet,Xg=function(){a(this,Ye,Jg).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,qc)))},Jg=function(){let e=r(this,Xt);e&&(e.removeEventListener("input",r(this,ws)),e.removeEventListener("change",r(this,ws)),e.removeEventListener("reset",r(this,qc)),g(this,Xt,null))},Qg=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},wy=function(){this.loading||this.saveDisabled||a(this,Ye,Qg).call(this,"cm-save")&&r(this,Xt)&&r(this,Xt).requestSubmit()},$y=function(){this.loading||a(this,Ye,Qg).call(this,"cm-discard")&&r(this,Xt)&&(r(this,Xt).reset(),this.open=!1)},xn.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:{}},xn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",xn);var e2=z("infoItem",{edit:"Edit {label}"}),wn=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",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}>
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>`}};wn.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},variant:{reflect:!0},layout:{reflect:!0},_list:{state:!0}},wn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",wn);var $n=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",$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"
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}`}};$n.properties={label:{},half:{type:Boolean,reflect:!0},editable:{type:Boolean,reflect:!0},editLabel:{attribute:"edit-label"}},$n.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}`}};kn.properties={label:{},half:{type:Boolean,reflect:!0},editable:{type:Boolean,reflect:!0},editLabel:{attribute:"edit-label"}},kn.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,7 +1914,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",$n);var $s,kn=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",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">
1918
1918
  <div class="h" role="heading" aria-level=${e}>
1919
1919
  <button type="button" part="toggle" id="${r(this,$s)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,$s)}-body"
1920
1920
  ?disabled=${this.disabled} @click=${this.toggle}>
@@ -1923,7 +1923,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
1923
1923
  </button>
1924
1924
  </div>
1925
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,kn.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},kn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
1946
1946
  .body[hidden] { display: none; }
1947
1947
 
1948
1948
 
1949
- `];$("cm-accordion",kn);var rt,ks,Zg,ky,En=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,ky).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",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">
1950
1950
  <div class="circle" part="circle" aria-hidden=${this.hasImage?h:"true"}>
1951
1951
  <slot name="image" @slotchange=${i=>a(this,rt,ks).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
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,Zg).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()},Zg=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},ky=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">
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">
1958
1958
  <span class="icon" part="circle" aria-hidden=${this.hasImage?h:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
1959
1959
  <slot name="image" @slotchange=${i=>a(this,rt,ks).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,Zg).call(this)}
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
1964
  <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>a(this,rt,ks).call(this,i,"hasActions")}></slot></span>
1965
1965
  </div>
1966
- </div>`},En.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},En.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",En);var Ey={small:34,medium:40,large:50,xlarge:186},Mn=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=Ey[this.size]??Ey.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>`)}`}};Mn.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},Mn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Mn);var N0=[472,90,90,251],P0=[94,266,134,191,138],_n=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",_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">
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]:N0)}</div>
2037
- <div class="col side">${e(P0)}</div>
2036
+ <div class="col main">${e(this.layout==="one-column"?[472,251]:q0)}</div>
2037
+ <div class="col side">${e(O0)}</div>
2038
2038
  </div>
2039
2039
  </div>
2040
- </div>`}};_n.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},_n.styles=[E,w`
2040
+ </div>`}};Tn.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Tn.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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
2061
2061
  .body { grid-template-columns: minmax(0, 1fr); }
2062
2062
  .head { height: 60px; }
2063
2063
  }
2064
- `];$("cm-skeleton-display",_n);var x2=z("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),um,My,Tn=class extends C{constructor(){super(...arguments);m(this,um);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,um,My).call(this);return c`<article part="comment">
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">
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>`}};um=new WeakSet,My=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)},Tn.properties={author:{},datetime:{},time:{}},Tn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Tn);var Oc,gm,_y,Cn=class extends C{constructor(){super(...arguments);m(this,gm);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;m(this,Oc,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,Oc)}-h">
2077
- <div class="title" id="${r(this,Oc)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
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>
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,gm,_y)}></textarea>
2080
+ @keydown=${a(this,bm,zy)}></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>`}};Oc=new WeakMap,gm=new WeakSet,_y=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},Cn.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Cn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
2102
2102
 
2103
2103
  .actions { justify-content: flex-end; }
2104
2104
  }
2105
- `];$("cm-comment-box",Cn);var fm='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',Ae,Sn,pr,mr,_i,Ln,An,pt,ef,bm,vm,ym,xm,Dn,Ty,Es,tf,rf,Ti,zn=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,Sn);m(this,pr,[]);m(this,mr);m(this,_i);m(this,Ln,!1);m(this,An,!1);m(this,bm,()=>{g(this,Ln,!0),clearTimeout(r(this,_i)),this.open||g(this,_i,setTimeout(()=>this.show(),this.delay))});m(this,vm,()=>{g(this,Ln,!1),clearTimeout(r(this,_i)),r(this,An)||this.hide()});m(this,ym,()=>{g(this,An,!0),this.show()});m(this,xm,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,An,!1),r(this,Ln)||this.hide())});m(this,Dn,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,rf).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(fm)&&i.then(()=>{t.shadowRoot?.querySelector(fm)&&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,Ty).call(this,t);if(g(this,Sn,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,tf).call(this,s),g(this,mr,new MutationObserver(()=>{s.getAttribute("aria-describedby")!==""&&a(this,pt,tf).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,bm)),this.addEventListener("pointerleave",r(this,vm)),this.addEventListener("focusin",r(this,ym)),this.addEventListener("focusout",r(this,xm)),this.addEventListener("keydown",r(this,Dn)),this.hasUpdated&&r(this,Es).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,pt,rf).call(this),a(this,pt,ef).call(this),clearTimeout(r(this,_i))}show(){clearTimeout(r(this,_i)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,Dn),!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,ef).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,Sn=new WeakMap,pr=new WeakMap,mr=new WeakMap,_i=new WeakMap,Ln=new WeakMap,An=new WeakMap,pt=new WeakSet,ef=function(){document.removeEventListener("keydown",r(this,Dn),!0),removeEventListener("scroll",r(this,Ti),!0),removeEventListener("resize",r(this,Ti))},bm=new WeakMap,vm=new WeakMap,ym=new WeakMap,xm=new WeakMap,Dn=new WeakMap,Ty=function(e){return e.matches(fm)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(fm)??e},Es=new WeakMap,tf=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)]},rf=function(){let e=r(this,Sn);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,Sn,void 0)}},Ti=new WeakMap,zn.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},zn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",zn);var S2=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"}),L2=z("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),I0=7,Bc=new Set,Fc;function Cy(o,n){n?Bc.add(o):Bc.delete(o),Bc.size&&!Fc&&(Fc=setInterval(()=>Bc.forEach(e=>e.requestUpdate()),6e4)),!Bc.size&&Fc&&(clearInterval(Fc),Fc=void 0)}var Vc,_s,Nt,sf,wm,zy,Rn=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,Vc,N("cm-tl"));m(this,_s)}connectedCallback(){super.connectedCallback(),Cy(this,!0)}disconnectedCallback(){super.disconnectedCallback(),Cy(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,sf).call(this))),r(this,_s).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,Nt,sf).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<I0?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",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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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,wm).call(this,d,"_meta")}>${this.meta}</slot></div>
2132
- <div class="body ${s?"clamp":""}" id="${r(this,Vc)}-body" part="body" ?hidden=${!this._body}
2133
- style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${d=>a(this,Nt,wm).call(this,d,"_body")}></slot></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>
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,Vc)}-body" @click=${a(this,Nt,zy)}>${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,wm).call(this,d,"_actions")}></slot></div>
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>
2137
2137
  </div>
2138
- </div>`}};Vc=new WeakMap,_s=new WeakMap,Nt=new WeakSet,sf=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},wm=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(s=>s.nodeType===Node.ELEMENT_NODE||(s.textContent??"").trim())},zy=function(){this.expanded=!this.expanded},Rn.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}},Rn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Rn);var jc,Hn,Ts,af,Sy,Ms=class extends C{constructor(){super(...arguments);m(this,Ts);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];m(this,jc,new MutationObserver(()=>a(this,Ts,af).call(this)));m(this,Hn,!1)}connectedCallback(){super.connectedCallback(),a(this,Ts,af).call(this),r(this,jc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,jc).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,Hn,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,Hn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Hn,!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",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">
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,Sy)}>${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,Ts,Dy)}>${this.moreLabel}</cm-button></div>`:h}
2191
2191
  <span class="sr" role="status">${t?this.t("loading"):""}</span>
2192
- `}};jc=new WeakMap,Hn=new WeakMap,Ts=new WeakSet,af=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},Sy=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
+ `}};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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
2212
2212
  @media (max-width: 640px) {
2213
2213
  .more { padding-inline-start: 0; }
2214
2214
  }
2215
- `];$("cm-timeline",Ms);var P2=z("smartTip",{newTab:"(opens in a new tab)"}),I2=z("smartTips",{heading:"Smart tips",tourAction:"Start"}),Nn=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",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}>
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>`}};Nn.properties={heading:{},href:{},target:{}},Nn.styles=[E,w`
2222
+ </a>`}};Pn.properties={heading:{},href:{},target:{}},Pn.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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Nn);var Pn=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",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">
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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>`}};Pn.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},Pn.styles=[E,w`
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`
2251
2251
  :host { display: block; }
2252
2252
  .card { display: flex; flex-direction: column; gap: var(--cm-space-8); }
2253
2253
  .tour {
@@ -2264,11 +2264,11 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Pn);var V2=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,qn,Ly,Ay,In=class extends C{constructor(){super(...arguments);m(this,qn);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",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`
2268
2268
  <nav part="bar" aria-label=${this.label}>
2269
2269
  ${l.length?c`<div class="rows" part="rows">
2270
2270
  <label for="${r(this,Ci)}-s">${this.t("rows")}</label>
2271
- <span class="field"><select id="${r(this,Ci)}-s" @change=${a(this,qn,Ly)}>
2271
+ <span class="field"><select id="${r(this,Ci)}-s" @change=${a(this,On,Ry)}>
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}
@@ -2279,7 +2279,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
2279
2279
  <input id="${r(this,Ci)}-p" type="number" inputmode="numeric" min="1" max=${e}
2280
2280
  .value=${this._draft??String(t)} aria-describedby="${r(this,Ci)}-of"
2281
2281
  @input=${d=>this._draft=d.target.value}
2282
- @keydown=${a(this,qn,Ay)}
2282
+ @keydown=${a(this,On,Hy)}
2283
2283
  @change=${d=>this.goTo(Number(d.target.value))} />
2284
2284
  <span id="${r(this,Ci)}-of">${this.t("of",{count:e})}</span>
2285
2285
  </span>
@@ -2291,7 +2291,7 @@ var vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("Cannot "+e);var r=(
2291
2291
  </span>
2292
2292
  </div>
2293
2293
  </nav>
2294
- `}};Ci=new WeakMap,qn=new WeakSet,Ly=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})))},Ay=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))},In.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}},In.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",In);var Y2=z("statusTabs",{label:"Status",option:"{label} ({count})"}),Bn,Kc,_e,Uc,Dy,nf,Ry,of,Hy,On=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,Bn,new ResizeObserver(()=>a(this,_e,Uc).call(this)));this._slotted=[];m(this,Kc,new MutationObserver(()=>a(this,_e,nf).call(this)))}connectedCallback(){super.connectedCallback(),a(this,_e,nf).call(this),r(this,Kc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Kc).disconnect(),r(this,Bn).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,Bn).observe(e),e.addEventListener("scroll",()=>a(this,_e,Uc).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,_e,Uc).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,Uc).call(this);for(let s of this.renderRoot.querySelectorAll(".tabs > *"))r(this,Bn).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,Ry).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
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`
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,of).call(this,l)} @keydown=${d=>a(this,_e,Hy).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,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>`)}
2342
2342
  </div>
2343
- ${this.mobile==="select"?c`<div class="pick"><select part="select" aria-label=${i} @change=${a(this,_e,Dy)}>
2343
+ ${this.mobile==="select"?c`<div class="pick"><select part="select" aria-label=${i} @change=${a(this,_e,Ny)}>
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
- `}};Bn=new WeakMap,Kc=new WeakMap,_e=new WeakSet,Uc=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)},Dy=function(e){let t=e.target.value;t!==this.value&&(this.value=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},nf=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??"")},Ry=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},of=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}))))},Hy=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,of).call(this,d)},On.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},mobile:{reflect:!0},_slotted:{state:!0},_more:{state:!0}},On.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",On);var t_=z("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),$m,Wc,zi,lf,Ny,Py,Fn=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,$m,N("cm-th"));m(this,Wc,new MutationObserver(()=>a(this,zi,lf).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,zi,lf).call(this),r(this,Wc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Wc).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",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`
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,$m)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
2411
- @change=${a(this,zi,Py)} />
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)} />
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,Ny).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,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
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
- `}};$m=new WeakMap,Wc=new WeakMap,zi=new WeakSet,lf=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"}})},Ny=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}))},Py=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}))},Fn.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}},Fn.styles=[E,w`
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`
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 vb=o=>{throw TypeError(o)};var cu=(o,n,e)=>n.has(o)||vb("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",Fn);var q0=`
2474
+ `];$("cm-table-header",Vn);var F0=`
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
- `,km=null,Iy=new WeakSet;function Em(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(!Iy.has(t)){Iy.add(t);try{km||(km=new CSSStyleSheet,km.replaceSync(q0)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,km]}catch{}}}var d_=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}"}),qy=48,Oy=16,By=!1,O0=`
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=`
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; }
@@ -2497,6 +2497,10 @@ cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var
2497
2497
  cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'], cm-data-table > table [data-type='actions'] { text-align: end; font-variant-numeric: tabular-nums; }
2498
2498
  cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'], cm-data-table > table [data-type='date'] { white-space: nowrap; }
2499
2499
  cm-data-table > table [data-type='actions'] { width: 1%; white-space: nowrap; }
2500
+ /* controls (1.22): a small form per cell. Start-aligned and as wide as the form needs (an actions column is 1% wide and
2501
+ squeezed option groups to one option per line). */
2502
+ cm-data-table > table [data-type='controls'] { text-align: start; white-space: normal; }
2503
+ cm-data-table > table td[data-type='controls'] > * { min-inline-size: max-content; }
2500
2504
  cm-data-table > table td [data-lines] { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
2501
2505
  cm-data-table > table td [data-lines='1'] { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; max-inline-size: min(var(--cm-data-table-cell-max-width, 320px), 100%); }
2502
2506
  cm-data-table > table td [data-lines='3'] { -webkit-line-clamp: 3; line-clamp: 3; }
@@ -2522,53 +2526,55 @@ cm-data-table:has(> table) { container-type: inline-size; }
2522
2526
  cm-data-table[mobile='cards'] > table tr > :not(:first-child)[data-label]::before { content: attr(data-label); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); text-align: start; font-weight: 400; }
2523
2527
  cm-data-table[mobile='cards'] > table td[data-type='actions'] { justify-content: flex-start; flex-wrap: wrap; padding-block-start: var(--cm-space-8); }
2524
2528
  cm-data-table[mobile='cards'] > table td[data-type='actions'] > * { opacity: 1; }
2529
+ cm-data-table[mobile='cards'] > table td[data-type='controls'] { display: block; text-align: start; padding-block-start: var(--cm-space-8); }
2530
+ cm-data-table[mobile='cards'] > table td[data-type='controls'] > * { min-inline-size: 0; }
2525
2531
  }
2526
- `;function B0(){if(By||typeof document>"u")return;By=!0;let o=new CSSStyleSheet;o.replaceSync(O0),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var Gc=o=>o.type==="numeric"||o.type==="money",F0=o=>(o.align??(Gc(o)||o.type==="actions"?"end":"start"))==="end",V0=o=>!o.type||o.type==="text";function Fy(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 Vy=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),jy=new Map;function j0(o){let n=jy.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"})}jy.set(o??"",n)}return n}function Uy(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"?(Fy(o)||0)-(Fy(n)||0):e==="date"?(Vy(o)||0)-(Vy(n)||0):j0(t).compare(String(o),String(n))}var Ky=o=>o.parentElement??o.getRootNode().host??null,Gn,Yn,Yc,Xn,Cs,Jn,zs,zm,S,cf,df,hf,Wy,pf,Gy,Yy,Xy,Ss,Vn,jn,Mm,Un,Kn,_m,mf,uf,gf,Jy,Qy,ff,bf,Tm,Zy,ex,tx,ur,Cm,Qn,ix,rx,sx,ax,nx,ox,lx,Wn=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,Gn,!1);m(this,Yn,N("cm-dt"));m(this,Yc,new MutationObserver(()=>a(this,S,cf).call(this)));m(this,Xn,typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a(this,S,Vn).call(this)));m(this,Cs,[]);m(this,Jn,0);m(this,zs,-1);m(this,zm,e=>{e.target?.closest?.("[data-lines]")&&a(this,S,_m).call(this,e)});m(this,Ss,()=>{r(this,Jn)||!this.stickyHeader||g(this,Jn,requestAnimationFrame(()=>{g(this,Jn,0),a(this,S,Vn).call(this)}))});m(this,ur,new we);m(this,Qn,e=>{let t=this.renderRoot.querySelector(".tools");t&&!e.composedPath().includes(t)&&a(this,S,Cm).call(this,!1)})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerover",r(this,zm)),Em(this),a(this,S,cf).call(this),r(this,Yc).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,Yc).disconnect(),r(this,Xn)?.disconnect(),g(this,Cs,[]),document.removeEventListener("scroll",r(this,Ss),{capture:!0}),window.removeEventListener("resize",r(this,Ss)),document.removeEventListener("pointerdown",r(this,Qn),{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*Uy(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,Gn)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,Gn,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,S,hf).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,Xy).call(this),a(this,S,Vn).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 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}
2527
2533
  role=${this._overflows?"region":h} aria-label=${this._overflows?this.querySelector("caption")?.textContent?.trim()||h:h}
2528
- @scroll=${()=>a(this,S,Vn).call(this)}><slot></slot></div>${i}</div>${t}</div>${e}`;let l=this.visibleColumns,d=a(this,S,uf).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,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`
2529
2535
  <div class="frame" part="frame" ?data-cards=${x}>
2530
- ${this.columnPicker?a(this,S,sx).call(this):h}
2536
+ ${this.columnPicker?a(this,S,ox).call(this):h}
2531
2537
  <div class="wrap">
2532
2538
  <div class="scroll" part="scroll" tabindex=${s?"0":h}
2533
2539
  role=${s?"region":h}
2534
- aria-label=${s&&this.caption?this.caption:h} @scroll=${()=>a(this,S,Vn).call(this)}>
2535
- <table part="table" aria-busy=${this.loading?"true":"false"} @pointerover=${a(this,S,_m)} @focusin=${a(this,S,mf)}
2536
- @focusout=${a(this,S,mf)}>
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)}>
2537
2543
  ${this.caption?c`<caption part="caption">${this.caption}</caption>`:h}
2538
- <thead><tr>${l.map(v=>a(this,S,ax).call(this,v,d))}</tr></thead>
2544
+ <thead><tr>${l.map(v=>a(this,S,lx).call(this,v,d))}</tr></thead>
2539
2545
  <tbody>
2540
- ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>c`<tr>${l.map(v=>c`<td class=${a(this,S,Un).call(this,v,d)} style=${a(this,S,Kn).call(this,v)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):u.map((v,k)=>a(this,S,nx).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,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))}
2541
2547
  ${f?c`<tr class="empty"><td colspan=${b}><slot name="empty">${this.t("empty")}</slot></td></tr>`:h}
2542
2548
  </tbody>
2543
- ${this.totals&&!this.loading&&!f?c`<tfoot><tr part="totals">${l.map(v=>c`<td class=${a(this,S,Un).call(this,v,d)} style=${a(this,S,Kn).call(this,v)}>${v.type==="actions"?h:a(this,S,jn).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,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}
2544
2550
  </table>
2545
2551
  </div>
2546
2552
  ${i}
2547
2553
  </div>
2548
2554
  ${t}
2549
- ${x?a(this,S,lx).call(this,u,l,d):h}
2555
+ ${x?a(this,S,hx).call(this,u,l,d):h}
2550
2556
  </div>${e}
2551
- `}};Gn=new WeakMap,Yn=new WeakMap,Yc=new WeakMap,Xn=new WeakMap,Cs=new WeakMap,Jn=new WeakMap,zs=new WeakMap,zm=new WeakMap,S=new WeakSet,cf=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(B0(),a(this,S,Wy).call(this))},df=function(e){this._announce=this._announce===e?`${e}\xA0`:e},hf=function(e,t){a(this,S,df).call(this,this.t("sorted",{column:e,direction:this.t(t)}))},Wy=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,pf).call(this,s),d.addEventListener("click",()=>a(this,S,Gy).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"&&!d.dataset.type&&(d.dataset.type="actions"))})},pf=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Gy=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*Uy(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,pf).call(this,f));a(this,S,hf).call(this,s,d)},Yy=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,Gn,s),s&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},Xy=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,Xn)?.disconnect(),e.forEach(t=>r(this,Xn)?.observe(t)),g(this,Cs,e))},Ss=new WeakMap,Vn=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=Ky(this);P&&P!==document.documentElement&&P!==document.body;P=Ky(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"))},jn=function(e){return e==null?"":e instanceof Date?ue(e,{},this.locale):String(e)},Mm=function(e){return this._widths[e.key]??e.width},Un=function(e,t){return[F0(e)&&"end",Gc(e)&&"num",(Gc(e)||e.type==="date")&&"nw",e.type==="actions"&&"act",e.priority==="low"&&e!==t&&"low",a(this,S,Mm).call(this,e)!==void 0&&"w"].filter(Boolean).join(" ")},Kn=function(e){let t=a(this,S,Mm).call(this,e);return t===void 0?h:`--_w: ${t}px`},_m=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"))},mf=function(e){e.type==="focusin"&&a(this,S,_m).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)},uf=function(e){return e.find(t=>t.primary)??e.find(t=>t.type!=="actions")??e[0]},gf=function(e,t){return t?a(this,S,jn).call(this,e[t.key]):""},Jy=function(e,t){let i=t[e.key];return Array.isArray(i)?i:e.actions??[]},Qy=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}))},ff=function(e,t,i){return c`<span class="acts">${a(this,S,Jy).call(this,e,t).map(s=>c`<cm-button size="slim" icon=${s.icon??h}
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}
2552
2558
  ?icon-only=${!!s.iconOnly} label=${s.iconOnly?this.t("rowAction",{action:s.label,name:i}):h} tone=${s.tone??h}
2553
- @click=${()=>a(this,S,Qy).call(this,s,t)}>${s.label}${s.iconOnly||!i?h:c`<span class="sr">, ${i}</span>`}</cm-button>`)}</span>`},bf=function(e,t,i){if(e.type==="actions")return a(this,S,ff).call(this,e,t,i);let s=a(this,S,jn).call(this,t[e.key]);if(!V0(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>`},Tm=function(e,t,i){let s=Math.max(qy,Math.round(t));this._widths={...this._widths,[e.key]:s},i&&(a(this,S,df).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})))},Zy=function(e,t){return a(this,S,Mm).call(this,e)??Math.round(t.closest("th").getBoundingClientRect().width)},ex=function(e,t){let i=se(e,this);i!=="ArrowLeft"&&i!=="ArrowRight"||(e.preventDefault(),a(this,S,Tm).call(this,t,a(this,S,Zy).call(this,t,e.currentTarget)+(i==="ArrowRight"?Oy:-Oy),!0))},tx=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,Tm).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,Tm).call(this,t,p,!0)};i.addEventListener("pointermove",u),i.addEventListener("pointerup",b),i.addEventListener("pointercancel",b)},ur=new WeakMap,Cm=function(e=!this._picker){this._picker=e,e?document.addEventListener("pointerdown",r(this,Qn),{capture:!0}):document.removeEventListener("pointerdown",r(this,Qn),{capture:!0})},Qn=new WeakMap,ix=function(e){e.key!=="Escape"||!this._picker||(e.stopPropagation(),a(this,S,Cm).call(this,!1),this.renderRoot.querySelector(".pick")?.focus())},rx=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}))},sx=function(){let e=this.columns??[],t=a(this,S,uf).call(this,this.visibleColumns);return c`<div class="tools" part="tools" @keydown=${a(this,S,ix)}>
2554
- <button type="button" class="pick" part="column-picker" aria-expanded=${this._picker?"true":"false"} aria-controls="${r(this,Yn)}-cols"
2555
- @click=${()=>a(this,S,Cm).call(this)}>${this.t("columns")}<cm-icon name="chevron-down" size="16" aria-hidden="true"></cm-icon></button>
2556
- <fieldset class="panel" id="${r(this,Yn)}-cols" part="column-panel" ?hidden=${!this._picker}>
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}>
2557
2563
  <legend class="sr">${this.t("showColumns")}</legend>
2558
2564
  ${e.map(i=>c`<label class="opt"><input type="checkbox" .checked=${i.visible!==!1} ?disabled=${i===t}
2559
- @change=${s=>a(this,S,rx).call(this,i.key,s.target.checked)} />${i.label}</label>`)}
2565
+ @change=${s=>a(this,S,nx).call(this,i.key,s.target.checked)} />${i.label}</label>`)}
2560
2566
  </fieldset>
2561
- </div>`},ax=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,Un).call(this,e,t)} style=${a(this,S,Kn).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,Yy).call(this,e)}>${d}<cm-icon
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
2562
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})}
2563
- aria-valuemin=${qy} aria-valuemax="1600"
2564
- @keydown=${p=>a(this,S,ex).call(this,p,e)} @pointerdown=${p=>a(this,S,tx).call(this,p,e)}></span>`:h}</div></th>`},nx=function(e,t,i,s,l){let d=a(this,S,gf).call(this,e,i),p=this._expanded.has(e),u=`${r(this,Yn)}-more-${l}`,b=c`<tr part="row">${t.map(f=>f===i?c`<th scope="row" class=${a(this,S,Un).call(this,f,i)} style=${a(this,S,Kn).call(this,f)} part="cell">${a(this,S,bf).call(this,f,e,d)}${s.length?c`<button type="button" class="more-btn" aria-expanded=${p?"true":"false"} aria-controls=${u}
2565
- @click=${()=>a(this,S,ox).call(this,e)}>${this.t(p?"viewLess":"viewAll")}</button>`:h}</th>`:c`<td class=${a(this,S,Un).call(this,f,i)} style=${a(this,S,Kn).call(this,f)} part="cell">${a(this,S,bf).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}>
2566
- <dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Gc(f)?"num":""}>${a(this,S,jn).call(this,e[f.key])}</dd>`)}</dl></td></tr>`:h}`},ox=function(e){let t=new Set(this._expanded);t.has(e)?t.delete(e):t.add(e),this._expanded=t},lx=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,gf).call(this,p,i);return c`<li class="card ${u?"total":""}" part="card">
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">
2567
2573
  <p class="card-title">${b}</p>
2568
- ${s.length?c`<dl class="pairs">${s.map(f=>c`<dt>${f.label}</dt><dd class=${Gc(f)?"num":""}>${a(this,S,jn).call(this,p[f.key])}</dd>`)}</dl>`:h}
2569
- ${!u&&l.length?c`<div class="card-actions">${l.map(f=>a(this,S,ff).call(this,f,p,b))}</div>`:h}
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}
2570
2576
  </li>`};return c`${this.caption?c`<p class="cards-caption" aria-hidden="true">${this.caption}</p>`:h}
2571
- <ul class="cards" part="cards" aria-label=${this.caption||h}>${e.map(p=>d(p))}${this.totals?d(this.totals,!0):h}</ul>`},Wn.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}},Wn.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>`},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`
2572
2578
  :host { display: block; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-variant-numeric: tabular-nums; }
2573
2579
  :host([density='compact']) { --cm-table-row-height: 40px; }
2574
2580
  :host([density='comfortable']) { --cm-table-row-height: 48px; }
@@ -2728,7 +2734,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2728
2734
  :host([mobile='priority']) tr.more { display: table-row; }
2729
2735
  }
2730
2736
  @media (forced-colors: active) { button.sort cm-icon { opacity: 1; } .acts { opacity: 1 !important; } }
2731
- `];$("cm-data-table",Wn);var b_=z("resourceItem",{select:"Select {name}"}),v_=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}"}),cx=w`
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`
2732
2738
  .check { position: relative; display: inline-flex; flex: none; width: 16px; height: 16px; }
2733
2739
  .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
2734
2740
  .check input:disabled { cursor: not-allowed; }
@@ -2740,17 +2746,17 @@ cm-data-table:has(> table) { container-type: inline-size; }
2740
2746
  .dash { width: 50%; height: 2px; background: currentColor; }
2741
2747
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2742
2748
  .check input:disabled + .box { border-color: var(--cm-border-subtle); background: var(--cm-bg-input-filled); }
2743
- `,Lm,io,dx,hx,eo=class extends C{constructor(){super();m(this,io);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,Lm,this.attachInternals());r(this,Lm).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
+ `,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`
2744
2750
  ${this.href&&!this.disabled?c`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:h}
2745
- <div class=${this._hasActions?"row has-actions":"row"} part="row" @click=${a(this,io,hx)}>
2751
+ <div class=${this._hasActions?"row has-actions":"row"} part="row" @click=${a(this,ro,ux)}>
2746
2752
  ${this.selectable?c`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
2747
2753
  ?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
2748
2754
  <span class="box" aria-hidden="true">${this.selected?c`<cm-icon name="check" size="12"></cm-icon>`:h}</span></span>`:h}
2749
2755
  <span class="media"><slot name="media"></slot></span>
2750
2756
  <div class="content" part="content"><slot></slot></div>
2751
- <div class="actions" part="actions"><slot name="actions" @slotchange=${a(this,io,dx)}></slot></div>
2757
+ <div class="actions" part="actions"><slot name="actions" @slotchange=${a(this,ro,mx)}></slot></div>
2752
2758
  </div>
2753
- `}};Lm=new WeakMap,io=new WeakSet,dx=function(e){this._hasActions=e.target.assignedNodes().some(t=>t.nodeType===Node.ELEMENT_NODE||t.textContent?.trim())},hx=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()},eo.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}},eo.styles=[E,cx,w`
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`
2754
2760
  :host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-subtle); }
2755
2761
  :host(:last-child) { border-bottom: 0; }
2756
2762
  /* 56px rows (a 40px thumbnail with space-8 above and below), 14px text; compact density (since 1.6): 40px rows,
@@ -2801,18 +2807,18 @@ cm-data-table:has(> table) { container-type: inline-size; }
2801
2807
  :host([columns][mobile='stack']) ::slotted(*) { overflow-wrap: break-word; }
2802
2808
  :host([columns][mobile='stack']) ::slotted(:first-child) { flex: 1 1 100%; }
2803
2809
  }
2804
- `];$("cm-resource-item",eo);var Xc,Jc,He,px,vf,Am,Dm,Zn,Sm,Rm,to=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,Xc,N("cm-rl"));m(this,Jc,new Set);m(this,Am,e=>{let t=e.target;this._hasHeader=t.assignedElements().length>0,a(this,He,vf).call(this,t)});m(this,Dm,e=>{this._hasActions=e.target.assignedElements().length>0});m(this,Rm,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,Zn).call(this),a(this,He,Sm).call(this))})}connectedCallback(){super.connectedCallback(),Em(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,Zn).call(this),a(this,He,Sm).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,He,Zn).call(this),a(this,He,Sm).call(this)}clearSelection(){this.selectPage(!1)}updated(e){(e.has("selectable")||e.has("mobile"))&&(a(this,He,Zn).call(this),a(this,He,vf).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,px).call(this),d=k=>gh(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,Dm)}></slot>`;return c`
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`
2805
2811
  ${this.selectable&&f?c`<div class="top ${this._hasActions?"has":""}" part="top-actions">${v}</div>`:h}
2806
2812
  <div class="head ${this.selectable||this._hasHeader?"on":""} ${f?"over":""}">
2807
- <div class="header ${this._hasHeader?"has":""}"><slot name="header" @slotchange=${r(this,Am)}></slot></div>
2813
+ <div class="header ${this._hasHeader?"has":""}"><slot name="header" @slotchange=${r(this,Rm)}></slot></div>
2808
2814
  ${this.selectable?c`<div class="toolbar ${f?"over":""} ${b?"busy":""}" part="toolbar">
2809
2815
  <span class="select" part="select">
2810
- <span class="check"><input id="${r(this,Xc)}-all" type="checkbox" .checked=${s} .indeterminate=${e>0&&!s}
2816
+ <span class="check"><input id="${r(this,Jc)}-all" type="checkbox" .checked=${s} .indeterminate=${e>0&&!s}
2811
2817
  ?disabled=${!i} @change=${k=>this.selectPage(k.target.checked)} />
2812
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>
2813
2819
  ${this.hideSelectMenu?h:c`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")} ?hidden=${!x}
2814
- .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,Rm)}></cm-action-menu>`}
2815
- <label for="${r(this,Xc)}-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,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>
2816
2822
  </span>
2817
2823
  <span class="status" part="status" role="status">${u}</span>
2818
2824
  <span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
@@ -2821,12 +2827,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
2821
2827
  </div>
2822
2828
  <div class="body">
2823
2829
  <div class="list" part="list" role="list" aria-label=${this.label||l.replace(/^./,k=>k.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
2824
- <slot @slotchange=${()=>a(this,He,Zn).call(this)}></slot>
2830
+ <slot @slotchange=${()=>a(this,He,eo).call(this)}></slot>
2825
2831
  </div>
2826
2832
  ${this.loading?c`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:l})}></span>`:h}
2827
2833
  </div>
2828
2834
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
2829
- `}};Xc=new WeakMap,Jc=new WeakMap,He=new WeakSet,px=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},vf=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,Jc))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,Jc,t),this._hasTable=t.size>0},Am=new WeakMap,Dm=new WeakMap,Zn=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},Sm=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},Rm=new WeakMap,to.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}},to.styles=[E,cx,w`
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`
2830
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); }
2831
2837
  /* Density (since 1.6): the rows are this element's children, so they inherit these. See density.ts. */
2832
2838
  :host([density='compact']) { --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
@@ -2884,12 +2890,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
2884
2890
  .toolbar .check { width: 20px; height: 20px; }
2885
2891
  .spinner { width: 32px; height: 32px; margin: -16px; border-width: 3px; }
2886
2892
  }
2887
- `];$("cm-resource-list",to);var E_=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}."}),M_=z("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),Nm,he,yf,xf,mx,ux,gr,gx,fx,bx,wf,vx,Pt=class Pt extends C{constructor(){super();m(this,he);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;m(this,Nm,this.attachInternals());m(this,gr,!1);r(this,Nm).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`
2888
- <div class="row" part="row" @dragover=${a(this,he,bx)} @dragleave=${a(this,he,wf)} @drop=${a(this,he,vx)}>
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)}>
2889
2895
  ${this.sortable?c`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
2890
2896
  aria-describedby="hint"
2891
- @keydown=${a(this,he,mx)} @dragstart=${a(this,he,ux)} @pointerdown=${a(this,he,gx)}
2892
- @dragend=${()=>{this.classList.remove("dragging"),Pt.dragged=null,Qc(this,null)}}><cm-icon name="drag" size="16"></cm-icon></button>`:h}
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}
2893
2899
  ${this.sortable?c`<span class="sr" id="hint">${this.t(this.list?.group?"hintGroup":"hint")}</span>`:h}
2894
2900
  <span class="label" part="label">${this.label}</span>
2895
2901
  <span class="actions" part="actions"><slot name="actions"></slot></span>
@@ -2897,7 +2903,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2897
2903
  <div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
2898
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>
2899
2905
  </div>
2900
- `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};Nm=new WeakMap,he=new WeakSet,yf=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)):[]},xf=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},mx=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,yf),p=d[d.indexOf(this.list)+(i?-1:1)];if(p){e.preventDefault(),this.moveToList(p,i?p.items.length:0)&&a(this,he,xf).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,xf).call(this)},ux=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,gx=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,fx).call(this,d.clientX,d.clientY),Qc(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"),Qc(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)},fx=function(e,t){for(let i of r(this,he,yf)){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:Hm(i.items,this,t)}}return{index:Hm(this.siblings,this,t)}},bx=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)},wf=function(){this.classList.remove("drop-before","drop-after")},vx=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,wf).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)})}};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`
2901
2907
  :host { display: block; }
2902
2908
  .row {
2903
2909
  display: flex; align-items: center; gap: var(--cm-space-12); min-height: 48px; padding: 0 var(--cm-space-16);
@@ -2924,20 +2930,20 @@ cm-data-table:has(> table) { container-type: inline-size; }
2924
2930
  .actions { gap: var(--cm-space-8); }
2925
2931
  .children { margin-inline-start: var(--cm-space-20); }
2926
2932
  }
2927
- `],Pt.dragged=null;var so=Pt;$("cm-nested-item",so);function Hm(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 Qc(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,yx,$f,kf,xx,wx,ro=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,$f).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
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`
2928
2934
  <div class="bar" part="bar">
2929
2935
  <div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,Ls)}-h">${this.heading}</div>
2930
2936
  <span class="actions"><slot name="actions"></slot></span>
2931
2937
  ${this.collapsible?c`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${r(this,Ls)}-rows"
2932
- aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${a(this,st,yx)}>
2938
+ aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${a(this,st,$x)}>
2933
2939
  <cm-icon name=${t?"chevron-up":"chevron-down"} size="16"></cm-icon></button>`:h}
2934
2940
  </div>
2935
2941
  <div class="rows ${this.group&&this._empty?"empty":""}" id="${r(this,Ls)}-rows" role="list" aria-labelledby="${r(this,Ls)}-h" ?hidden=${!t}
2936
- @dragover=${a(this,st,xx)} @drop=${a(this,st,wx)}>
2937
- <slot @slotchange=${()=>{a(this,st,$f).call(this),this._empty=!this.items.length}}></slot>
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>
2938
2944
  </div>
2939
2945
  <span class="sr" role="status">${this._msg}</span>
2940
- `}};Ls=new WeakMap,st=new WeakSet,yx=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()})},kf=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},xx=function(e){let t=so.dragged;a(this,st,kf).call(this,t)&&(e.preventDefault(),Qc(t,{list:this,index:Hm(this.items,t,e.clientY)}))},wx=function(e){let t=so.dragged;if(!a(this,st,kf).call(this,t))return;e.preventDefault();let i=Hm(this.items,t,e.clientY);Qc(t,null),t.moveToList(this,i)},ro.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}},ro.styles=[E,w`
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`
2941
2947
  :host { display: block; }
2942
2948
  .bar {
2943
2949
  display: flex; align-items: center; gap: var(--cm-space-12); min-height: 64px; padding: 0 var(--cm-space-20);
@@ -2961,9 +2967,9 @@ cm-data-table:has(> table) { container-type: inline-size; }
2961
2967
  .title { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); }
2962
2968
  .rows { margin-inline-start: var(--cm-space-8); }
2963
2969
  }
2964
- `];$("cm-nested-list",ro);var $x=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},kx=ha(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=Xb(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]),pa(o,p[k+1],i[f]),f++,k--;else if(d[x]===l[v])p[v]=Ii(i[x],s[v]),pa(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=pa(o,i[f]);Ii(U,s[v]),p[v]=U}else p[v]=Ii(P,s[v]),pa(o,i[f],P),i[L]=null;v++}else Ah(i[x]),x--;else Ah(i[f]),f++;for(;v<=k;){let L=pa(o,p[k+1]);Ii(L,s[v]),p[v++]=L}for(;f<=x;){let L=i[f++];L!==null&&Ah(L)}return this.ut=l,Lh(o,p),Pe}});function Ex(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??Ex)(e,r(this,ut),this);return t?(this.moveTo(t),!0):!1}};ye=new WeakMap,mt=new WeakMap,ut=new WeakMap;var Zc,As,Rs=class{constructor(n=document,e="assertive"){m(this,Zc);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,Zc)),this.element.textContent===n?(this.element.textContent="",g(this,As,n),g(this,Zc,setTimeout(()=>{this.element.textContent=n,g(this,As,void 0)},50))):(g(this,As,void 0),this.element.textContent=n)}};Zc=new WeakMap,As=new WeakMap;var F_=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"}),V_=z("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),j_=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}."}),U0="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",ed,Om,Mx,Hs=class extends C{constructor(){super(...arguments);m(this,Om);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";m(this,ed,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",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">
2965
2971
  ${this.locked?h:c`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
2966
- aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,ed)}-help"></div>`}
2972
+ aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,td)}-help"></div>`}
2967
2973
  <div class="content">
2968
2974
  <div class="head">
2969
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>
@@ -2971,11 +2977,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
2971
2977
  <slot name="actions"></slot>
2972
2978
  </div>
2973
2979
  <div class="lines"><slot></slot></div>
2974
- <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>a(this,Om,Mx).call(this,i,"_badges")}></slot></div>
2980
+ <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>a(this,Fm,Cx).call(this,i,"_badges")}></slot></div>
2975
2981
  </div>
2976
2982
  ${t?c`<cm-spinner class="spin" size="small" accessible-label=${this.t("saving")} aria-hidden="true"></cm-spinner>`:h}
2977
- <span id="${r(this,ed)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
2978
- </div>`}};ed=new WeakMap,Om=new WeakSet,Mx=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,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`
2979
2985
  :host { display: block; position: relative; -webkit-touch-callout: none; font-size: 14px; line-height: 20px; }
2980
2986
  .card {
2981
2987
  position: relative; display: block; padding: var(--cm-space-12) var(--cm-space-12); background: var(--cm-bg-surface);
@@ -3000,22 +3006,22 @@ cm-data-table:has(> table) { container-type: inline-size; }
3000
3006
  :host([moving]) .content { opacity: 0.5; }
3001
3007
  :host([ghost]) .card { cursor: grabbing; box-shadow: var(--cm-shadow-lg); border-color: var(--cm-border-subtle); }
3002
3008
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
3003
- `];$("cm-board-card",Hs);var oo,td,lo,co,br,Pm,_x,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,oo,!1);this._cards=[];this._drop=null;m(this,td,new MutationObserver(()=>a(this,br,Pm).call(this)));m(this,lo,N("cm-col"));m(this,co,!1)}get collapsed(){return r(this,oo)}connectedCallback(){super.connectedCallback(),a(this,br,Pm).call(this),r(this,td).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,td).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,Pm).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,oo,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",r(this,oo)),g(this,co,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,co)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,co,!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,lo)}-h" class=${t&&this.collapsed?"over":""}>
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":""}>
3004
3010
  <header part="header">
3005
- <div class="title" id="${r(this,lo)}-h" role="heading" aria-level=${f}>${this.heading}<span class="sr">, ${x}</span></div>
3011
+ <div class="title" id="${r(this,co)}-h" role="heading" aria-level=${f}>${this.heading}<span class="sr">, ${x}</span></div>
3006
3012
  <span class="count" part="count" aria-hidden="true">${this.formatNumber(i)}</span>
3007
3013
  <span class="actions"><slot class="actions"></slot></span>
3008
3014
  </header>
3009
3015
  <div class="scroll">
3010
- <ul part="list" role="list" aria-labelledby="${r(this,lo)}-h" aria-busy=${b?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
3011
- ${kx(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,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>`)}
3012
3018
  </ul>
3013
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}
3014
3020
  <div class="empty" ?hidden=${e.length>0||b||u||this.collapsed||d}><slot class="empty">${this.t("empty")}</slot></div>
3015
- ${u&&!this.collapsed?c`<div class="more"><cm-button part="more" size="medium" ?loading=${b} @click=${a(this,br,_x)}>${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,br,zx)}>${this.t("loadMore")}</cm-button></div>`:h}
3016
3022
  </div>
3017
3023
  <span class="sr" role="status">${b?this.t("loading",{column:this.heading}):""}</span>
3018
- </section>`}};oo=new WeakMap,td=new WeakMap,lo=new WeakMap,co=new WeakMap,br=new WeakSet,Pm=function(){this._cards=this.cards},_x=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>`}};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`
3019
3025
  :host {
3020
3026
  display: flex; flex-direction: column; flex: none; min-height: 0; max-height: 100%;
3021
3027
  inline-size: var(--cm-board-column-width, 272px);
@@ -3052,9 +3058,9 @@ cm-data-table:has(> table) { container-type: inline-size; }
3052
3058
  :host([collapsed]) .scroll { padding: 0; overflow: hidden; }
3053
3059
  :host([collapsed]) .actions { display: none; }
3054
3060
  :host([collapsed]) section.over { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; }
3055
- `];$("cm-board-column",Ns);var Xe,Oe,ke,Ps,ce,I,Ef,ao,Tx,Mf,Cx,zx,Sx,Lx,id,Ax,rd,_f,Tf,Cf,Im,Dx,sd,ad,nd,od,ld,cd,dd,zf,Sf,qm,Rx,fr,no=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,id,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,Lx).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,Ax).call(this,i,t);s&&(e.preventDefault(),s.focusHandle())}}});m(this,rd,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,sd,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});m(this,ad,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?.(U0)))return;let s=a(this,I,ao).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,zf).call(this)},300)),window.addEventListener("pointermove",r(this,ld),!0),window.addEventListener("pointerup",r(this,cd),!0),window.addEventListener("pointercancel",r(this,dd),!0),window.addEventListener("touchmove",r(this,nd),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,od),!0)});m(this,nd,e=>{r(this,ce)?.started&&e.cancelable&&e.preventDefault()});m(this,od,e=>{r(this,ce)&&e.preventDefault()});m(this,ld,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,zf).call(this):a(this,I,fr).call(this,!1));return}e.preventDefault(),a(this,I,Sf).call(this),a(this,I,qm).call(this)}});m(this,cd,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,dd,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,Cx).call(this,e),onDrop:(e,t)=>a(this,I,Sx).call(this,e,t),onCancel:()=>a(this,I,Mf).call(this),messages:{pickedUp:e=>a(this,I,Ef).call(this,"pickedUp",e),over:e=>a(this,I,Ef).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,id)),this.addEventListener("focusout",r(this,rd)),this.addEventListener("pointerdown",r(this,ad)),this.addEventListener("dragstart",r(this,sd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,id)),this.removeEventListener("focusout",r(this,rd)),this.removeEventListener("pointerdown",r(this,ad)),this.removeEventListener("dragstart",r(this,sd)),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,ao).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,Tx).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,ao).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,Im).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,Tf).call(this,t,i.from,i.fromIndex),i.totals&&a(this,I,Cf).call(this,i.to,i.from),a(this,I,_f).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",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}>
3056
3062
  <div class="columns" part="columns"><slot @slotchange=${()=>this.requestUpdate()}></slot></div>
3057
- </div>`}};Xe=new WeakMap,Oe=new WeakMap,ke=new WeakMap,Ps=new WeakMap,ce=new WeakMap,I=new WeakSet,Ef=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)})},ao=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)}},Tx=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})})},Mf=function(){r(this,ke)&&(r(this,ke).card.moving=!1),g(this,ke,null)},Cx=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,zx).call(this,i,s)})}},zx=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)}},Sx=function(e,t){let i=r(this,ke);if(a(this,I,Mf).call(this),!i)return;let s=this.columns[t.group];a(this,I,Im).call(this,i.card,i.column,e.index,s,t.index,"keyboard")},Lx=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,ao).call(this,i)?i:null},id=new WeakMap,Ax=function(e,t){let i=a(this,I,ao).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},rd=new WeakMap,_f=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},Tf=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)},Cf=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))},Im=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,Dx).call(this,e.key,s);else{let v=d==="keyboard"||e.matches(":focus-within");a(this,I,Tf).call(this,e,s,l);let k=t!==s;k&&a(this,I,Cf).call(this,t,s),r(this,Ps).set(e,{card:e,from:t,fromIndex:i,to:s,toIndex:l,totals:k}),a(this,I,_f).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},Dx=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)},sd=new WeakMap,ad=new WeakMap,nd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakMap,dd=new WeakMap,zf=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,Sf).call(this),a(this,I,qm).call(this);let i=()=>{r(this,ce)?.started&&(a(this,I,Rx).call(this),r(this,ce).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},Sf=function(){let e=r(this,ce);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},qm=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}))},Rx=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,qm).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,ld),!0),window.removeEventListener("pointerup",r(this,cd),!0),window.removeEventListener("pointercancel",r(this,dd),!0),window.removeEventListener("touchmove",r(this,nd),!0),window.removeEventListener("contextmenu",r(this,od),!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,Im).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},no.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},no.styles=[E,w`
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`
3058
3064
  :host { position: relative; display: block; container-type: inline-size; container-name: cm-board; min-width: 0; }
3059
3065
  .board { height: 100%; }
3060
3066
  .columns {
@@ -3068,60 +3074,60 @@ cm-data-table:has(> table) { container-type: inline-size; }
3068
3074
  ::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
3069
3075
  ::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
3070
3076
  }
3071
- `];$("cm-board",no);var Q_=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}."}),mo=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}};mo.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}},mo.styles=w`:host { display: none !important; }`;$("cm-calendar-event",mo);var Wm=o=>String(o).padStart(2,"0"),Hx=o=>`${B(o)}T${Wm(o.getHours())}:${Wm(o.getMinutes())}`,Bm=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),Nx=["month","week","day"],K0=600,Px=new Map,Ix=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=Px.get(e);return t||(t=new Intl.DateTimeFormat(o,n),Px.set(e,t)),t},Lf=o=>o.replace(/[  ]/g," ").trim(),go,Je,Qe,Ne,ae,ne,qs,Qt,ft,yd,xr,fo,bo,vo,yo,xd,y,Be,vr,hd,Fm,Jt,Af,pd,It,Df,qx,qt,ho,Ox,Bx,gt,md,ud,Vm,Fx,Vx,jx,Is,Rf,gd,Ux,fd,Kx,Wx,Gx,Yx,wd,$d,Xx,Jx,kd,bd,Qx,Hf,Nf,Pf,Zx,ew,If,qf,Of,Ed,Bf,tw,Md,_d,Td,Cd,zd,Sd,Ff,jm,iw,yr,vd,rw,Vf,sw,Um,jf,po,Km,aw,nw,ow,lw,cw,uo=class extends C{constructor(){super();m(this,y);this.view="month";this.date="";this.today="";this.step=15;m(this,go,"");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,yd,"");m(this,xr,!0);m(this,fo,0);m(this,bo,!1);m(this,vo);m(this,yo,0);m(this,xd,new MutationObserver(()=>this.requestUpdate()));m(this,wd,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,fd).call(this))i.tabIndex=i===t?0:-1}});m(this,$d,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,kd,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,Um).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,fo,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,Jx).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,y,Xx).call(this,i,t);l?(e.preventDefault(),a(this,y,Yx).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});m(this,Ed,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});m(this,Md,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,ho).call(this,i);if(!s||i.locked||i.pending)return;let l=a(this,y,Nf).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,Bf).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,Ff).call(this)},300)),window.addEventListener("pointermove",r(this,Cd),!0),window.addEventListener("pointerup",r(this,zd),!0),window.addEventListener("pointercancel",r(this,Sd),!0),window.addEventListener("touchmove",r(this,_d),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,Td),!0)});m(this,_d,e=>{r(this,ne)?.started&&e.cancelable&&e.preventDefault()});m(this,Td,e=>{r(this,ne)&&e.preventDefault()});m(this,Cd,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,Ff).call(this):a(this,y,yr).call(this,!1));return}e.preventDefault(),a(this,y,jm).call(this)}});m(this,zd,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,Sd,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,bd).call(this,r(this,ae).ev.dur):0,navigate:(e,t)=>a(this,y,Qx).call(this,e,t),onTarget:e=>a(this,y,Zx).call(this,e),onDrop:(e,t)=>a(this,y,ew).call(this,e,t),onCancel:()=>a(this,y,Pf).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,go)}set locale(e){let t=r(this,go);g(this,go,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,kd)),this.addEventListener("focusin",r(this,wd)),this.addEventListener("focusout",r(this,$d)),this.addEventListener("pointerdown",r(this,Md)),this.addEventListener("dragstart",r(this,Ed)),r(this,xd).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,vo,new ResizeObserver(()=>{cancelAnimationFrame(r(this,yo)),g(this,yo,requestAnimationFrame(()=>a(this,y,Rf).call(this)))})),r(this,vo).observe(this)),a(this,y,Rf).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,kd)),this.removeEventListener("focusin",r(this,wd)),this.removeEventListener("focusout",r(this,$d)),this.removeEventListener("pointerdown",r(this,Md)),this.removeEventListener("dragstart",r(this,Ed)),r(this,xd).disconnect(),r(this,vo)?.disconnect(),cancelAnimationFrame(r(this,yo)),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,Gx).call(this),r(this,ft)){let l=a(this,y,Kx).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,bo)&&(g(this,bo,!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,yd)&&(g(this,yd,s),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=B(a(this,y,gd).call(this,r(this,y,It),-1))}next(){this.date=B(a(this,y,gd).call(this,r(this,y,It),1))}goToToday(){this.date=r(this,y,pd)}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,ho).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,Nf).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,ho).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,Bm(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,y,Of).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,ho).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,Vm).call(this,l):i.start})),!0}render(){let e=a(this,y,qt).call(this),t=a(this,y,Bx).call(this,a(this,y,Ox).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
3072
- ${a(this,y,aw).call(this,e)}
3073
- ${r(this,y,Be)==="month"?a(this,y,ow).call(this,e,t):a(this,y,cw).call(this,e,t)}
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)}
3074
3080
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
3075
3081
  <span id="${r(this,Je)}-gh" hidden>${this.t("gridHelp")}</span>
3076
3082
  <span id="${r(this,Je)}-mv" hidden>${this.t("openHint")} ${this.t("instructions")}</span>
3077
3083
  <span id="${r(this,Je)}-op" hidden>${this.t("openHint")}</span>
3078
- </div>`}};go=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,yd=new WeakMap,xr=new WeakMap,fo=new WeakMap,bo=new WeakMap,vo=new WeakMap,yo=new WeakMap,xd=new WeakMap,y=new WeakSet,Be=function(){return Nx.includes(this.view)?this.view:"month"},vr=function(){return Yi(this,this.locale)},hd=function(){return Pa(r(this,y,vr))},Fm=function(){return Ra(r(this,y,vr),this.hourCycle)},Jt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},Af=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Na(r(this,y,vr)):(Math.trunc(e)%7+7)%7},pd=function(){return R(this.today)?this.today:Ju()},It=function(){return R(this.date)??R(r(this,y,pd))},Df=function(){return r(this,y,Be)==="month"&&this._narrow},qx=function(){return r(this,y,Be)!=="month"},qt=function(){let e=r(this,y,It),t=r(this,y,Af);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((Bm(s,Zr(e))+1)/7)*7;return Array.from({length:l},(d,p)=>te(s,p))},ho=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(Bm(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)]}},Ox=function(){return this.events.map(e=>a(this,y,ho).call(this,e)).filter(e=>!!e)},Bx=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))},md=function(e){return r(this,y,Fm).format((e%1440+1440)%1440)},ud=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},s=Ix(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=>Lf(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,md).call(this,p.getHours()*60+p.getMinutes()):r(this,y,Fm).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},Vm=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&&Bm(e.start,e.end)===1)?a(this,y,ud).call(this,e.start,e.end):this.t("timed",{date:a(this,y,gt).call(this,e.start),time:a(this,y,ud).call(this,e.start,e.end)})},Fx=function(e){let t={title:e.name,when:a(this,y,Vm).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},Vx=function(e){let t=r(this,y,vr);if(r(this,y,Be)==="month")return r(this,y,hd).monthYear(r(this,y,It));if(e.length===1)return ue(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=Ix(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return Lf(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},jx=function(e){return r(this,y,Fm).hour12?Lf(ue(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},r(this,y,vr))):a(this,y,md).call(this,e*60)},Is=function(e,t){let{start:i,end:s}=a(this,y,Hf).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,y,gt).call(this,i),time:a(this,y,ud).call(this,i,s)}):a(this,y,gt).call(this,te(R(e.origin),t.group-e.from.group))},Rf=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<K0;t!==this._narrow&&(this._narrow=t)},gd=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)},Ux=function(e){this.view!==e&&(this.view=e)},fd=function(){return[...this.renderRoot.querySelectorAll(".item")]},Kx=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},Wx=function(){let e=B(r(this,y,It));if(r(this,y,Df))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}`},Gx=function(){let e=a(this,y,fd).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,Wx).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},Yx=function(e){g(this,Qt,e.dataset.k??"");for(let t of a(this,y,fd).call(this))t.tabIndex=t===e?0:-1;e.focus()},wd=new WeakMap,$d=new WeakMap,Xx=function(e,t){let i=new Map;for(let v of a(this,y,fd).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}},Jx=function(e,t){let i=e.dataset.day??B(r(this,y,It)),s=a(this,y,gd).call(this,R(i)??r(this,y,It),t),l=B(s),d=(e.dataset.k??"").split(":")[0],p;r(this,y,Df)?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,gd).call(this,r(this,y,It),t)),g(this,Qt,p),g(this,ft,{key:p,until:Date.now()+1e3})},kd=new WeakMap,bd=function(e){return Math.floor((1440-Math.min(e,1440))/r(this,y,Jt))+1},Qx=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,bd).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}},Hf=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)}},Nf=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,qx)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/r(this,y,Jt)),a(this,y,bd).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:s,index:d}}},Pf=function(){r(this,ae)&&(r(this,ae).ev.el.moving=!1),g(this,ae,null),this._target=null},Zx=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}},ew=function(e,t){let i=r(this,ae);a(this,y,Pf).call(this),i&&(g(this,fo,performance.now()+400),a(this,y,If).call(this,i,e,t,"keyboard"))},If=function(e,t,i,s){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,y,Hf).call(this,e,i),u=B(te(R(e.origin),i.group-t.group));a(this,y,Of).call(this,e.ev,d,p,s,l,e.mode==="time"?B(d):u)},qf=function(e,t,i){return e?{start:B(t),end:B(i)}:{start:Hx(t),end:Hx(i)}},Of=function(e,t,i,s,l,d){let p=e.el,u=e.name,b=a(this,y,qf).call(this,e.allDay,e.start,e.end),f=a(this,y,qf).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,ud).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,Vm).call(this,e)})):this.revert(p)})),!0):(r(this,Qe).announce(this.t("refused",{event:u,place:k})),this.requestUpdate(),!1)},Ed=new WeakMap,Bf=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}},tw=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},Md=new WeakMap,_d=new WeakMap,Td=new WeakMap,Cd=new WeakMap,zd=new WeakMap,Sd=new WeakMap,Ff=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,jm).call(this);let t=()=>{r(this,ne)?.started&&(a(this,y,iw).call(this),r(this,ne).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},jm=function(){let e=r(this,ne);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,y,Bf).call(this,e.x,e.y);if(l){let d=a(this,y,bd).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,tw).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)}))},iw=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,jm).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,Cd),!0),window.removeEventListener("pointerup",r(this,zd),!0),window.removeEventListener("pointercancel",r(this,Sd),!0),window.removeEventListener("touchmove",r(this,_d),!0),window.removeEventListener("contextmenu",r(this,Td),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,y,If).call(this,t,t.from,t.to,"pointer")))},vd=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}))},rw=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,vd).call(this,`${t}T${Wm(l)}:${Wm(d)}`,!1)},Vf=function(e,t){if(performance.now()<r(this,fo)||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()},sw=function(e){this._more=e,g(this,bo,!0)},Um=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}))},jf=function(){return r(this,ae)?.ev??(r(this,ne)?.started?r(this,ne).ev:null)},po=function(e,t,i,s,l,d={}){let p=e.el,u=p.pending,b=a(this,y,Fx).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,md).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>`}};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}
3079
3085
  data-row=${d.row??h} aria-label=${O} aria-describedby=${ve} aria-roledescription=${K}
3080
- @click=${Z=>a(this,y,Vf).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,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}
3081
3087
  data-row=${d.row??h} aria-label=${O} aria-describedby=${ve} aria-roledescription=${K}
3082
- @click=${Z=>a(this,y,Vf).call(this,Z,e)}>${q}</button>`},Km=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.text}</div>`},aw=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,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">
3083
3089
  <div class="nav">
3084
3090
  <button type="button" class="hb icon prev" aria-label=${s} @click=${()=>this.previous()}><cm-icon name="chevron-left" size="18"></cm-icon></button>
3085
3091
  <button type="button" class="hb today" @click=${()=>this.goToToday()}>${this.t("today")}</button>
3086
3092
  <button type="button" class="hb icon next" aria-label=${l} @click=${()=>this.next()}><cm-icon name="chevron-right" size="18"></cm-icon></button>
3087
3093
  </div>
3088
- <div class="title" part="title" id="${r(this,Je)}-t" role="heading" aria-level=${d} aria-live="polite">${a(this,y,Vx).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,Kx).call(this,e)}${this.loading?c`<cm-spinner size="small" aria-hidden="true"></cm-spinner>`:h}</div>
3089
3095
  <div class="views" role="group" aria-label=${this.t("views")}>
3090
- ${Nx.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,y,Ux).call(this,p)}>${this.t(p)}</button>`)}
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>`)}
3091
3097
  </div>
3092
- </div>`},nw=function(e){let t=r(this,y,hd),i=Array.from({length:7},(s,l)=>(l+r(this,y,Af))%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>`},ow=function(e,t){let i=r(this,y,It),s=r(this,y,pd),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,y,jf).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,hd).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>`},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}>
3093
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})}
3094
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>
3095
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}
3096
3102
  aria-label=${me?this.t("dayEvents",{date:Z,count:K.length}):h} aria-current=${G===s?"date":h}>
3097
3103
  <div class="dh">${Er}<span class="vh">${Z}</span>
3098
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})}
3099
- @click=${()=>a(this,y,vd).call(this,G,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3105
+ @click=${()=>a(this,y,yd).call(this,G,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3100
3106
  </div>
3101
3107
  ${X.length||p?.iso===G&&d?c`<ul class="evs">
3102
- ${X.map(Ve=>c`<li>${a(this,y,po).call(this,Ve,G,O,"month",!0)}</li>`)}
3103
- ${p?.iso===G&&d?c`<li aria-hidden="true">${a(this,y,Km).call(this,d)}</li>`:h}
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}
3104
3110
  </ul>`:h}
3105
3111
  ${St?c`<button type="button" class="more item" data-k="more:${G}" data-i=${O} data-day=${G} aria-haspopup="dialog"
3106
3112
  aria-expanded=${this._more===G?"true":"false"} aria-label=${this.t("moreLabel",{count:St,date:Z})}
3107
- @click=${()=>this._more===G?a(this,y,Um).call(this,!1):a(this,y,sw).call(this,G)}>${this.t("more",{count:St})}</button>`:h}
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}
3108
3114
  ${this._more===G?c`<div class="pop ${ve>=4?"end":""}" role="dialog" aria-label=${Z}>
3109
- <div class="pop-h"><span>${Z}</span><button type="button" class="xb" aria-label=${this.t("close")} @click=${()=>a(this,y,Um).call(this,!0)}><cm-icon name="close" size="16"></cm-icon></button></div>
3110
- <ul>${K.map(Ve=>c`<li>${a(this,y,po).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,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>
3111
3117
  </div>`:h}
3112
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"
3113
3119
  aria-busy=${this.loading?"true":"false"}>
3114
- ${a(this,y,nw).call(this,b)}
3120
+ ${a(this,y,cw).call(this,b)}
3115
3121
  <tbody>${u.map((q,O)=>c`<tr>${q.map((ve,G)=>f(ve,O*7+G,G))}</tr>`)}</tbody>
3116
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}
3117
3123
  <section class="agenda" part="agenda" aria-labelledby="${r(this,Je)}-ag">
3118
3124
  <div class="ag-h">
3119
3125
  <div class="ag-t" id="${r(this,Je)}-ag" role="heading" aria-level=${U}>${P}</div>
3120
- ${this.readonly?h:c`<button type="button" class="hb ag-add" aria-label=${this.t("addOn",{date:P})} @click=${()=>a(this,y,vd).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,yd).call(this,v,!0)}>
3121
3127
  <cm-icon name="plus" size="16"></cm-icon>${this.t("add")}</button>`}
3122
3128
  </div>
3123
- ${k.length?c`<ul class="ag-list">${k.map(q=>c`<li>${a(this,y,po).call(this,q,v,L,"list",!1)}</li>`)}</ul>`:c`<p class="empty">${this.t("noEvents")}</p>`}
3124
- </section>`},lw=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},cw=function(e,t){let i=r(this,y,pd),s=r(this,y,hd),l=a(this,y,jf).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,lw).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,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"}
3125
3131
  style="--cols:${e.length}">
3126
3132
  <div class="tg-top" role="rowgroup">
3127
3133
  <div class="row" role="row">
@@ -3134,24 +3140,24 @@ cm-data-table:has(> table) { container-type: inline-size; }
3134
3140
  <div class="axis" role="rowheader">${this.t("allDay")}</div>
3135
3141
  ${u.map((f,x)=>c`<div class="adcell ${d?.iso===f.iso&&l?.allDay?"over":""}" role="gridcell" data-drop data-i=${x}>
3136
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"
3137
- aria-label=${this.t("addAllDay",{date:f.text})} @click=${()=>a(this,y,vd).call(this,f.iso,!0)}><cm-icon name="plus" size="16"></cm-icon></button>`}
3138
- ${f.allDay.map(v=>a(this,y,po).call(this,v,f.iso,x,"allday",!0,{row:"a"}))}
3139
- ${d?.iso===f.iso&&l?.allDay?a(this,y,Km).call(this,l):h}
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}
3140
3146
  </div>`)}
3141
3147
  </div>
3142
3148
  </div>
3143
3149
  <div class="tg-body" role="rowgroup">
3144
3150
  ${b.map(f=>c`<div class="row hr" role="row">
3145
- <div class="axis" role="rowheader"><span>${a(this,y,jx).call(this,f)}</span></div>
3151
+ <div class="axis" role="rowheader"><span>${a(this,y,Wx).call(this,f)}</span></div>
3146
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}>
3147
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}
3148
- aria-label=${this.t("addAt",{time:a(this,y,md).call(this,f*60),date:x.text})} @click=${P=>a(this,y,rw).call(this,P,x.iso,f)}></button>`}
3149
- ${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,po).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}`})})}
3150
- ${L?a(this,y,Km).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,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}
3151
3157
  </div>`})}
3152
3158
  </div>`)}
3153
3159
  </div>
3154
- </div>`},uo.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}},uo.styles=[E,w`
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`
3155
3161
  :host { display: block; position: relative; min-width: 0; font-size: 14px; line-height: 20px; }
3156
3162
  :host([dragging]) { cursor: grabbing; user-select: none; -webkit-user-select: none; }
3157
3163
  .cal { display: flex; flex-direction: column; gap: var(--cm-space-12); min-width: 0; }
@@ -3312,7 +3318,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3312
3318
  .chip.time > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3313
3319
  .chip.time .lead { display: flex; align-items: center; gap: 4px; min-width: 0; }
3314
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; }
3315
- `];$("cm-calendar",uo);var sT=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",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`
3316
3322
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="40"></cm-icon></slot></span>
3317
3323
  <span class="label">${this.label}</span>
3318
3324
  ${this.pinned?c`<span class="pin" part="pin"><cm-icon name="pin" size="16"></cm-icon>
@@ -3336,10 +3342,10 @@ cm-data-table:has(> table) { container-type: inline-size; }
3336
3342
  .icon cm-icon::part(svg) { width: 32px; height: 32px; }
3337
3343
  ::slotted([slot='icon']) { width: 32px; height: 32px; }
3338
3344
  }
3339
- `];$("cm-report-tile",Os);var xo=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",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`
3340
3346
  ${this.heading?c`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:h}
3341
3347
  <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":h}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
3342
- `}};xo.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},xo.styles=[E,w`
3348
+ `}};wo.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},wo.styles=[E,w`
3343
3349
  :host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
3344
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; }
3345
3351
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-12); }
@@ -3349,7 +3355,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3349
3355
  .title { margin-bottom: var(--cm-space-8); }
3350
3356
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-8); }
3351
3357
  }
3352
- `];$("cm-report-tiles",xo);var cT=z("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),dw=/^\s*-?\d+(\.\d+)?\s*$/,wo=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:dw.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",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">
3353
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>
3354
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`
3355
3361
  <span class="label" id="label" part="label">${this.label}</span>
@@ -3358,7 +3364,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3358
3364
  ${i}
3359
3365
  <span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
3360
3366
  </span>
3361
- `,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}`}};wo.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&dw.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}},wo.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}`}};$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`
3362
3368
  :host { display: block; align-self: stretch; min-inline-size: 0; }
3363
3369
  .tile {
3364
3370
  display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
@@ -3394,29 +3400,29 @@ cm-data-table:has(> table) { container-type: inline-size; }
3394
3400
  .value { font-size: var(--cm-type-heading-lg-resp-size); }
3395
3401
  }
3396
3402
  @media (forced-colors: active) { .change { color: CanvasText; } }
3397
- `];$("cm-metric",wo);var $o=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 hw(this)}};$o.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}},$o.styles=w`:host { display: none !important; }`;$("cm-nav-item",$o);function hw(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(hw),Uf=o=>o.value||o.href||o.label,Gm=o=>!!o.current||!!o.items?.some(Gm),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:Uf(n),href:n.href??""}}));var vT=z("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Ld,Ad,Jm,Y,Kf,Ym,Wf,pw,mw,Gf,Yf,uw,Xf,Jf,Xm,Qf,gw,ko=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,Ld,new Set);m(this,Ad);m(this,Jm,N("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,Y,Kf).call(this),g(this,Ad,wr(this,()=>a(this,Y,Kf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Ad)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,Y,Ym).call(this,e,t);r(this,Ld).has(i)||!e.items?.length||(r(this,Ld).add(i),(e.expanded||Gm(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let s=a(this,Y,Ym).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`
3398
- <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${a(this,Y,mw)}>
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)}>
3399
3405
  <slot name="header"></slot>
3400
3406
  <ul part="list">
3401
- ${this.navItems.map((t,i)=>{if(!t.items?.length)return c`<li>${a(this,Y,Qf).call(this,t,"",{index:i})}</li>`;let s=!e&&this._open.has(a(this,Y,Ym).call(this,t,i)),l=`${r(this,Jm)}-${i}`;return c`<li>
3402
- ${a(this,Y,Xm).call(this,t,c`<button type="button" class="item parent ${Gm(t)?"has-current":""}" part="item" data-index=${i}
3403
- aria-expanded=${s?"true":"false"} aria-controls=${l} @click=${()=>e?a(this,Y,uw).call(this,i):this.toggle(i)}>
3404
- ${a(this,Y,Xf).call(this,t)}${a(this,Y,Jf).call(this,t)}
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)}
3405
3411
  ${e?h:c`<cm-icon class="chev" name="chevron-down" size="16"></cm-icon>`}
3406
3412
  </button>`)}
3407
3413
  <ul class="sub" id=${l} ?hidden=${!s} aria-label=${t.label}>
3408
- ${a(this,Y,Gf).call(this,t.items).map(([d,p])=>c`<li>${a(this,Y,Qf).call(this,{...d,icon:void 0},p?"deep":"",{parent:i})}</li>`)}
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>`)}
3409
3415
  </ul>
3410
3416
  </li>`})}
3411
3417
  </ul>
3412
- ${a(this,Y,gw).call(this)}
3418
+ ${a(this,Y,vw).call(this)}
3413
3419
  <slot name="footer"></slot>
3414
3420
  <slot hidden></slot>
3415
3421
  </nav>
3416
- `}};Ld=new WeakMap,Ad=new WeakMap,Jm=new WeakMap,Y=new WeakSet,Kf=function(){this._slotted=Si(this)},Ym=function(e,t){return`${t}:${Uf(e)}`},Wf=function(e,t){$r(this,t)||e.preventDefault()},pw=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},mw=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=a(this,Y,pw).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()},Gf=function(e,t=0){return e.flatMap(i=>[[i,t],...a(this,Y,Gf).call(this,i.items??[],t+1)])},Yf=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},uw=function(e){a(this,Y,Yf).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},Xf=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},Jf=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}`},Xm=function(e,t){return this.collapsed?c`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},Qf=function(e,t,i={}){let s=c`${a(this,Y,Xf).call(this,e)}${a(this,Y,Jf).call(this,e)}`;return a(this,Y,Xm).call(this,e,e.href?c`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":h}
3417
- data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Wf).call(this,l,e)}>${s}</a>`:c`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":h}
3418
- data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>a(this,Y,Wf).call(this,l,e)}>${s}</button>`)},gw=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,Xm).call(this,{label:e},c`<button type="button" class="item toggle" part="collapse-button"
3419
- @click=${()=>a(this,Y,Yf).call(this,!this.collapsed)}>${t}</button>`)}</div>`},ko.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},ko.styles=[E,w`
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`
3420
3426
  :host { display: block; width: var(--cm-side-navigation-width, 220px); }
3421
3427
  nav {
3422
3428
  background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: var(--cm-radius-lg);
@@ -3461,7 +3467,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3461
3467
  background: var(--cm-count-bg); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
3462
3468
  }
3463
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); }
3464
- `];$("cm-side-navigation",ko);function fw(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 Eo=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=fw(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>`}};Eo.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},Eo.styles=[E,w`
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`
3465
3471
  :host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
3466
3472
  :host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
3467
3473
  :host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
@@ -3474,22 +3480,22 @@ cm-data-table:has(> table) { container-type: inline-size; }
3474
3480
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
3475
3481
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
3476
3482
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
3477
- `];$("cm-avatar",Eo);var CT=z("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),To,Li,Co,Fe,Dd,Zf,Mo,_o=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,To);m(this,Li,!1);m(this,Co,null);this.addEventListener("cm-select",e=>{let t=a(this,Fe,Dd).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,Fe,Dd).call(this)?.focus();return}this._searchOpen||(g(this,Co,Gu()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,To,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,To).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,To)?.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)||(ec(),g(this,Li,!0)),a(this,Fe,Dd).call(this)?.focus(),a(this,Fe,Mo).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,Co)??this.renderRoot.querySelector(".search-btn");g(this,Co,null),i?.isConnected&&i.focus(),a(this,Fe,Mo).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
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`
3478
3484
  <header part="bar" role="banner" aria-label=${this.label||h}>
3479
3485
  <div class="logo"><slot name="logo"></slot></div>
3480
3486
  ${this.store?c`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
3481
- @click=${()=>a(this,Fe,Mo).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="16"></cm-icon></button>`:h}
3482
- ${this._narrow?h:c`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${a(this,Fe,Zf)}></slot></div>`}
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>`}
3483
3489
  <span class="grow"></span>
3484
3490
  <div class="end">
3485
3491
  ${this._narrow&&this._hasSearch?c`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
3486
3492
  aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:h}
3487
3493
  <div class="actions"><slot name="actions"></slot></div>
3488
3494
  ${this.balance?c`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
3489
- @click=${()=>a(this,Fe,Mo).call(this,"cm-wallet")}>${this.balance}</button>`:h}
3495
+ @click=${()=>a(this,Fe,_o).call(this,"cm-wallet")}>${this.balance}</button>`:h}
3490
3496
  <slot name="end"></slot>
3491
3497
  ${this.userName?c`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
3492
- @click=${()=>a(this,Fe,Mo).call(this,"cm-account")}><span class="name">${this.userName}</span>
3498
+ @click=${()=>a(this,Fe,_o).call(this,"cm-account")}><span class="name">${this.userName}</span>
3493
3499
  <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:h}
3494
3500
  <slot name="account"></slot>
3495
3501
  </div>
@@ -3498,11 +3504,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
3498
3504
  @keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
3499
3505
  @cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
3500
3506
  <div class="layer-bar">
3501
- <div class="layer-search"><slot name="search" @slotchange=${a(this,Fe,Zf)}></slot></div>
3507
+ <div class="layer-search"><slot name="search" @slotchange=${a(this,Fe,ib)}></slot></div>
3502
3508
  <button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
3503
3509
  </div>
3504
3510
  </dialog>`:h}
3505
- `}};To=new WeakMap,Li=new WeakMap,Co=new WeakMap,Fe=new WeakSet,Dd=function(){return this.querySelector(':scope > [slot="search"]')},Zf=function(){this._hasSearch=!!a(this,Fe,Dd).call(this)},Mo=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},_o.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}},_o.styles=[E,w`
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`
3506
3512
  :host {
3507
3513
  display: block; background: var(--cm-bg-surface); container-type: inline-size;
3508
3514
  --_h: var(--cm-control-height-md); --_touch: var(--cm-control-height-touch);
@@ -3579,11 +3585,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
3579
3585
  @media (pointer: coarse) {
3580
3586
  @container (max-width: 640px) { .user { min-width: var(--_touch); } }
3581
3587
  }
3582
- `];$("cm-header-bar",_o);var HT=z("bottomNavigation",{label:"Main"}),Rd,Bs,eb,bw,zo=class extends C{constructor(){super(...arguments);m(this,Bs);this.items=[];this.fixed=!1;this.menuItem="";this.menuOpen=!1;this._slotted=[];m(this,Rd)}connectedCallback(){super.connectedCallback(),a(this,Bs,eb).call(this),g(this,Rd,wr(this,()=>a(this,Bs,eb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Rd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3583
- <ul>${this.navItems.slice(0,5).map(e=>c`<li>${a(this,Bs,bw).call(this,e)}</li>`)}</ul>
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>
3584
3590
  <slot hidden></slot>
3585
- </nav>`}};Rd=new WeakMap,Bs=new WeakSet,eb=function(){this._slotted=Si(this)},bw=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}
3586
- aria-expanded=${t?String(this.menuOpen):h} @click=${d}>${l}</button>`},zo.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}},zo.styles=[E,w`
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`
3587
3593
  :host { display: block; }
3588
3594
  :host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
3589
3595
  nav {
@@ -3608,32 +3614,32 @@ cm-data-table:has(> table) { container-type: inline-size; }
3608
3614
  .primary .icon { width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
3609
3615
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
3610
3616
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3611
- `];$("cm-bottom-navigation",zo);var FT=z("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Hd,Fs,Ze,tb,vw,ib,rb,yw,So=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,Hd);m(this,Fs,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,Ze,tb).call(this),g(this,Hd,wr(this,()=>a(this,Ze,tb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Hd)?.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",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"
3612
3618
  @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
3613
3619
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="16"></cm-icon>
3614
3620
  ${t.label}</button>
3615
- <ul class="card" aria-label=${t.label}>${t.items.map(i=>c`<li>${a(this,Ze,rb).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,nb).call(this,i,0,0,!0)}</li>`)}</ul>
3616
3622
  <slot hidden></slot>
3617
3623
  </nav>`:c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3618
- ${a(this,Ze,yw).call(this)}
3624
+ ${a(this,Ze,$w).call(this)}
3619
3625
  ${e.map((i,s)=>{let l=`${r(this,Fs)}-s${s}`;return c`<section aria-labelledby=${i.label?l:h}>
3620
3626
  ${i.label?c`<h2 class="heading" id=${l}>${i.label}</h2>`:h}
3621
- <ul class="card">${(i.items??[]).map((d,p)=>c`<li>${a(this,Ze,rb).call(this,d,s,p)}</li>`)}</ul>
3627
+ <ul class="card">${(i.items??[]).map((d,p)=>c`<li>${a(this,Ze,nb).call(this,d,s,p)}</li>`)}</ul>
3622
3628
  </section>`})}
3623
3629
  <slot hidden></slot>
3624
- </nav>`}};Hd=new WeakMap,Fs=new WeakMap,Ze=new WeakSet,tb=function(){this._slotted=Si(this)},vw=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},ib=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},rb=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}"
3625
- @click=${()=>a(this,Ze,vw).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>`},yw=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">
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">
3626
3632
  <h2 class="heading" id="${r(this,Fs)}-profile">${this.t("profile")}</h2>
3627
3633
  <ul class="card">
3628
- ${this.store?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ib).call(this,"cm-store-switch")}>
3634
+ ${this.store?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ab).call(this,"cm-store-switch")}>
3629
3635
  <span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
3630
3636
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
3631
- ${this.userName?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ib).call(this,"cm-account")}>
3637
+ ${this.userName?c`<li><button type="button" class="row" part="row" @click=${()=>a(this,Ze,ab).call(this,"cm-account")}>
3632
3638
  <span class="avatar">${this.avatarSrc?c`<img src=${this.avatarSrc} alt="">`:c`<span aria-hidden="true">${e}</span>`}</span>
3633
3639
  <span class="stack"><span>${this.userName}</span>${this.userEmail?c`<span class="email">${this.userEmail}</span>`:h}</span>
3634
3640
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:h}
3635
3641
  </ul>
3636
- </section>`},So.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}},So.styles=[E,w`
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`
3637
3643
  :host { display: block; background: var(--cm-bg-page); }
3638
3644
  nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
3639
3645
  .heading {
@@ -3679,12 +3685,12 @@ ${t.label}</button>
3679
3685
  }
3680
3686
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
3681
3687
  .sub .row { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
3682
- `];$("cm-mobile-menu",So);var GT=z("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Qm,xw,Lo=class extends C{constructor(){super(...arguments);m(this,Qm);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",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")}>
3683
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>
3684
3690
  <span class="text"><slot></slot></span>
3685
- ${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${a(this,Qm,xw)}><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,eu,kw)}><cm-icon name="close" size="16"></cm-icon>
3686
3692
  </button>`:h}
3687
- </div>`}};Qm=new WeakSet,xw=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},Lo.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},Lo.styles=[E,w`
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`
3688
3694
  :host { display: block; }
3689
3695
  .bar {
3690
3696
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--cm-space-8); min-height: 48px;
@@ -3706,11 +3712,11 @@ ${t.label}</button>
3706
3712
  @media (max-width: 640px) {
3707
3713
  .bar { min-height: 44px; justify-content: flex-start; text-align: start; }
3708
3714
  }
3709
- `];$("cm-flash-offer-bar",Lo);var tC=z("linkTabs",{label:"Sections"}),Pd,Do,Id,Ct,ww,Nd,sb,Ao=class extends C{constructor(){super(...arguments);m(this,Ct);this.items=[];this._slotted=[];this._more="";m(this,Pd);m(this,Do,new ResizeObserver(()=>a(this,Ct,Nd).call(this)));m(this,Id,"")}connectedCallback(){super.connectedCallback(),a(this,Ct,sb).call(this),g(this,Pd,wr(this,()=>a(this,Ct,sb).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Pd)?.disconnect(),r(this,Do).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector("ul");r(this,Do).observe(e),e.addEventListener("scroll",()=>a(this,Ct,Nd).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,Ct,Nd).call(this))}updated(){for(let e of this.renderRoot.querySelectorAll("li"))r(this,Do).observe(e);a(this,Ct,ww).call(this),a(this,Ct,Nd).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",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")}>
3710
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}
3711
3717
  @click=${t=>{$r(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
3712
3718
  <slot hidden></slot>
3713
- </nav>`}};Pd=new WeakMap,Do=new WeakMap,Id=new WeakMap,Ct=new WeakSet,ww=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,Id)||e.scrollWidth<=e.clientWidth)return;g(this,Id,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)},Nd=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)},sb=function(){this._slotted=Si(this)},Ao.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0},_more:{state:!0}},Ao.styles=[E,w`
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`
3714
3720
  :host { display: block; }
3715
3721
  ul {
3716
3722
  display: flex; gap: var(--cm-space-24); margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto;
@@ -3736,7 +3742,7 @@ ${t.label}</button>
3736
3742
  :host(:dir(rtl)) ul.more-start { mask-image: linear-gradient(to right, #000 calc(100% - var(--cm-space-32)), transparent); }
3737
3743
  @media (max-width: 640px) { ul { gap: var(--cm-space-16); } }
3738
3744
 
3739
- `];$("cm-link-tabs",Ao);var oC=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}"}),Ro=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",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">
3740
3746
  <div class="logo" part="logo"><slot name="logo"></slot></div>
3741
3747
  <div class="status"><slot name="status"></slot></div>
3742
3748
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
@@ -3748,7 +3754,7 @@ ${t.label}</button>
3748
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}
3749
3755
  <div class="actions"><slot name="actions"></slot>${this.href?c`<a class="details" part="details" href=${this.href}
3750
3756
  aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:h}</div>
3751
- </article>`}};Ro.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},Ro.styles=[E,w`
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`
3752
3758
  :host { display: block; container-type: inline-size; }
3753
3759
  article {
3754
3760
  position: relative; display: flex; flex-direction: column; gap: var(--cm-space-8); height: 100%; padding: var(--cm-space-20);
@@ -3785,21 +3791,21 @@ ${t.label}</button>
3785
3791
  .actions { gap: var(--cm-space-8); }
3786
3792
  .details { margin-inline-start: auto; }
3787
3793
  }
3788
- `];$("cm-app-card",Ro);var Zm,$w,Ho=class extends le{constructor(){super(...arguments);m(this,Zm);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",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">
3789
3795
  ${this.renderHeader()}
3790
3796
  <div class="body" part="body"><slot></slot></div>
3791
- <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${a(this,Zm,$w)}></slot></footer>
3792
- </div>`)}};Zm=new WeakSet,$w=function(e){this._hasFooter=e.target.assignedElements().length>0},Ho.properties={...le.properties,size:{reflect:!0},_hasFooter:{state:!0}},Ho.styles=[...le.overlayStyles,w`
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`
3793
3799
  dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
3794
3800
  :host([size='small']) dialog { --cm-modal-width: 400px; }
3795
3801
  :host([size='large']) dialog { --cm-modal-width: 900px; }
3796
3802
  .panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-lg); box-shadow: var(--cm-shadow-lg); }
3797
3803
 
3798
- `];$("cm-modal",Ho);var eu,kw,Zt=class extends le{constructor(){super(...arguments);m(this,eu);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,eu,kw)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
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">
3799
3805
  ${this.renderHeader()}
3800
3806
  <div class="body" part="body">${this.renderBody()}</div>
3801
3807
  <footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
3802
- </div>`)}};eu=new WeakSet,kw=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>`)}};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`
3803
3809
  dialog {
3804
3810
  position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
3805
3811
  }
@@ -3817,23 +3823,23 @@ ${t.label}</button>
3817
3823
  .panel { border-radius: var(--cm-radius-lg); }
3818
3824
 
3819
3825
  }
3820
- `];$("cm-side-panel",Zt);var kC=z("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),Po,tu,No=class extends Zt{constructor(){super(...arguments);this.search=!1;this.query="";m(this,Po,()=>{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,tu,()=>{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",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}
3821
3827
  placeholder=${this.searchPlaceholder}
3822
3828
  @input=${e=>{this.query=e.target.value}}
3823
- @cm-search=${e=>{e.stopPropagation(),r(this,Po).call(this)}}></cm-search>`:h}
3824
- <slot @submit=${e=>{e.preventDefault(),r(this,Po).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${r(this,tu)}>${this.resetLabel}</cm-button>
3825
- <cm-button part="apply" variant="primary" @click=${r(this,Po)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};Po=new WeakMap,tu=new WeakMap,No.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"}},No.styles=[...Zt.styles,w`
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`
3826
3832
  .search { display: block; margin-bottom: var(--cm-space-20); }
3827
3833
  .foot { justify-content: center; }
3828
3834
  ::slotted(form) { display: grid; gap: var(--cm-space-12); }
3829
- `];$("cm-filter-panel",No);var SC=z("accountMenu",{trigger:"Account: {name}"}),Io=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",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)}
3830
3836
  aria-label=${this.t("trigger",{name:this.name})} ?disabled=${this.disabled} @click=${e} @keydown=${t}>
3831
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">
3832
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)}
3833
3839
  ${this.orgName?c`<div class="split"></div>
3834
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)}
3835
3841
  ${this.plan?c`<div class="plan"><cm-icon name="check-circle" size="16"></cm-icon>${this.plan}</div>`:h}`:h}
3836
- </div>`}};Io.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:{}},Io.styles=[...Ft.styles,w`
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`
3837
3843
  /* The avatar button: 36px round with a ring (40 and a 44px hit area on touch screens). */
3838
3844
  .trigger.account {
3839
3845
  position: relative; width: var(--cm-control-height-md, 36px); height: var(--cm-control-height-md, 36px); min-height: 0; padding: 2px;
@@ -3866,8 +3872,8 @@ ${t.label}</button>
3866
3872
  .plan cm-icon { color: var(--cm-text-success); }
3867
3873
  .split { height: 0; margin: var(--cm-space-4) var(--cm-space-12); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
3868
3874
  :host(:dir(rtl)) .chev { transform: scaleX(-1); }
3869
- `];$("cm-account-menu",Io);var HC=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"}),W0=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})},G0=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())},qo=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">
3870
- <line class="base" x1="0" y1=${s} x2=${i} y2=${s}></line>${b}</svg>`}};qo.properties={values:{converter:{fromAttribute:W0}},labels:{converter:{fromAttribute:G0}},label:{},type:{reflect:!0},tone:{reflect:!0}},qo.styles=[E,w`
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`
3871
3877
  :host { display: block; width: 100%; max-width: var(--cm-sparkline-width, none); height: var(--cm-sparkline-height, 32px); color: var(--cm-icon-default); }
3872
3878
  :host([tone='information']) { color: var(--cm-text-information); }
3873
3879
  :host([tone='success']) { color: var(--cm-text-success); }
@@ -3880,17 +3886,17 @@ ${t.label}</button>
3880
3886
  .line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
3881
3887
  .dot { stroke: var(--cm-text-default); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
3882
3888
  :host([tone='information']) .dot, :host([tone='success']) .dot { stroke: currentColor; }
3883
- `];$("cm-sparkline",qo);var qd,Vs,ab,Ew,Oo=class extends le{constructor(){super(...arguments);m(this,Vs);this.heading="";this.items=[];this._slotted=[];m(this,qd)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=$l(this),g(this,qd,wh(this,()=>{this._slotted=$l(this)}))}disconnectedCallback(){super.disconnectedCallback(),r(this,qd)?.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",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">
3884
3890
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
3885
3891
  <cm-icon name="close" size="16"></cm-icon></button>
3886
3892
  ${this.heading?c`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:h}
3887
3893
  <div class="content">
3888
- ${e.length?c`<ul class=${t?"icons":""} part="list">${e.map(i=>c`<li>${a(this,Vs,Ew).call(this,i)}</li>`)}</ul>`:h}
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}
3889
3895
  <slot ?hidden=${this._slotted.length>0}></slot>
3890
3896
  </div>
3891
- </div>`)}};qd=new WeakMap,Vs=new WeakSet,ab=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")},Ew=function(e){let t=`row${e.critical?" critical":""}`,i=c`${e.icon?c`<cm-icon class="lead" name=${e.icon} size="16"></cm-icon>
3892
- `: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,ab).call(this,s,e)}>${i}</a>`:c`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":h}
3893
- @click=${s=>a(this,Vs,ab).call(this,s,e)}>${i}</button>`},Oo.properties={...le.properties,items:{type:Array},_slotted:{state:!0}},Oo.styles=[...le.overlayStyles,w`
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`
3894
3900
  dialog {
3895
3901
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: var(--cm-space-24);
3896
3902
  }
@@ -3924,17 +3930,17 @@ ${t.label}</button>
3924
3930
  }
3925
3931
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
3926
3932
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
3927
- `];$("cm-bottom-sheet",Oo);var WC=z("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),Y0={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},Bo=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}};Bo.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},Bo.styles=w`:host { display: none; }`;$("cm-notification-item",Bo);var Vo,at,nb,ob,Mw,_w,Tw,Fo=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,Vo)}connectedCallback(){super.connectedCallback(),a(this,at,nb).call(this),g(this,Vo,new MutationObserver(()=>a(this,at,nb).call(this))),r(this,Vo).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Vo)?.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,_w)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
3928
- <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,Mw).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",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">
3929
3935
  ${this.renderHeader(t)}
3930
3936
  ${i}
3931
3937
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
3932
3938
  ${this.moreHref?c`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:h}
3933
- <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${a(this,at,Tw)}></slot></div>
3939
+ <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${a(this,at,Sw)}></slot></div>
3934
3940
  <slot hidden></slot>
3935
- </div>`)}};Vo=new WeakMap,at=new WeakSet,nb=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")}})},ob=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")},Mw=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||Y0[t]||"bell"} size="14"></cm-icon></span>
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>
3936
3942
  <span class="label">${e.unread?c`<span class="vh">${this.t("unread")}</span>`:h}${i}</span>
3937
- ${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,ob).call(this,d,e)}>${s}</a>`:c`<button type="button" class=${l} part="row" @click=${d=>a(this,at,ob).call(this,d,e)}>${s}</button>`},_w=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()},Tw=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},Fo.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}},Fo.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,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`
3938
3944
  dialog {
3939
3945
  position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
3940
3946
  width: min(380px, calc(100vw - 32px));
@@ -3984,15 +3990,15 @@ ${t.label}</button>
3984
3990
  @media (max-width: 599px) {
3985
3991
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
3986
3992
  }
3987
- `];$("cm-notification-panel",Fo);var ZC=z("toastRegion",{label:"Notifications"}),ez=z("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),Cw=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},lb=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},X0=2e3,zw=1e4,Sw=150,Od,Ot,Ai,Bd,Wo,Go,js,kr,Us,Te,iu,Lw,jo,cb,Fd,Vd,jd,Ud,Aw,Uo=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,Od);m(this,Ot);m(this,Ai,0);m(this,Bd,0);m(this,Wo,!1);m(this,Go,!1);m(this,js);m(this,kr);m(this,Us);m(this,Fd,()=>{g(this,Wo,!0),a(this,Te,cb).call(this)});m(this,Vd,()=>{g(this,Wo,!1),a(this,Te,jo).call(this)});m(this,jd,()=>{g(this,Go,!0),a(this,Te,cb).call(this)});m(this,Ud,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Go,!1),a(this,Te,jo).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?zw:5e3);return Math.min(zw,Math.max(X0,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,Od,setTimeout(()=>{this._primed=!0},Sw)),this.addEventListener("pointerenter",r(this,Fd)),this.addEventListener("pointerleave",r(this,Vd)),this.addEventListener("focusin",r(this,jd)),this.addEventListener("focusout",r(this,Ud))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,kr)&&queueMicrotask(()=>{!this.isConnected&&this.open&&a(this,Te,iu).call(this,"removed")}),clearTimeout(r(this,Ot)),clearTimeout(r(this,Od)),this.removeEventListener("pointerenter",r(this,Fd)),this.removeEventListener("pointerleave",r(this,Vd)),this.removeEventListener("focusin",r(this,jd)),this.removeEventListener("focusout",r(this,Ud))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Us,void 0):r(this,kr)&&a(this,Te,iu).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,jo).call(this)))}show(){this.open?(g(this,Ai,this.effectiveDuration),a(this,Te,jo).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,iu).call(this,e),!0):(e==="timeout"&&(g(this,Ai,this.effectiveDuration),a(this,Te,jo).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
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">
3988
3994
  ${this.tone==="critical"?c`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:h}
3989
3995
  <div class="message" part="message">${this.message}<slot></slot></div>
3990
- ${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${a(this,Te,Aw)}>${this.actionLabel}</button>`:h}
3996
+ ${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${a(this,Te,Hw)}>${this.actionLabel}</button>`:h}
3991
3997
  <button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
3992
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>
3993
3999
  </button>
3994
4000
  ${this.actionLabel&&this._inRegion&&this.t("shortcut")?c`<span class="hint">${this.t("shortcut")}</span>`:h}
3995
- </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};Od=new WeakMap,Ot=new WeakMap,Ai=new WeakMap,Bd=new WeakMap,Wo=new WeakMap,Go=new WeakMap,js=new WeakMap,kr=new WeakMap,Us=new WeakMap,Te=new WeakSet,iu=function(e){g(this,Us,e);let t=r(this,kr);g(this,js,g(this,kr,void 0)),t?.(e)},Lw=function(){return r(this,Wo)||r(this,Go)},jo=function(){clearTimeout(r(this,Ot)),!(!this.open||r(this,Te,Lw))&&(g(this,Bd,Date.now()),g(this,Ot,setTimeout(()=>this.dismiss("timeout"),r(this,Ai))))},cb=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,Bd)))))},Fd=new WeakMap,Vd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Aw=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Uo.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Uo.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>`}};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`
3996
4002
  :host { display: block; pointer-events: auto; }
3997
4003
  :host(:not([open])) { display: none; }
3998
4004
  .toast {
@@ -4024,13 +4030,13 @@ ${t.label}</button>
4024
4030
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
4025
4031
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
4026
4032
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
4027
- `];$("cm-toast",Uo);var Ks,Kd,Wd,Gd,Yd,Xd,Yo,ru,Ko=class extends C{constructor(){super(...arguments);m(this,Yo);this.max=3;m(this,Ks,null);m(this,Kd,!1);m(this,Wd,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,Yo,ru).call(this)})});m(this,Gd,e=>{let t=e.relatedTarget;t&&!lb(this,t)&&g(this,Ks,t)});m(this,Yd,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,Xd,e=>{if(e.key!=="F6"||e.altKey||e.ctrlKey||e.metaKey||e.defaultPrevented)return;(this.matches(":focus-within")?a(this,Yo,ru).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,Kd,!0)),this.addEventListener("cm-dismiss",r(this,Wd)),this.addEventListener("focusin",r(this,Gd)),this.addEventListener("keydown",r(this,Yd)),document.addEventListener("keydown",r(this,Xd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,Wd)),this.removeEventListener("focusin",r(this,Gd)),this.removeEventListener("keydown",r(this,Yd)),document.removeEventListener("keydown",r(this,Xd))}updated(){r(this,Kd)&&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=Cw();return s&&!lb(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,Yo,ru).call(this),e}render(){return c`<slot></slot>`}};Ks=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Gd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Yo=new WeakSet,ru=function(){let e=r(this,Ks);return g(this,Ks,null),e?.isConnected?(e.focus(),lb(e,Cw())||e.shadowRoot?.querySelector("button, a[href], input, select, textarea, [tabindex]")?.focus(),!0):!1},Ko.properties={max:{type:Number}},Ko.styles=[E,w`
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`
4028
4034
  :host {
4029
4035
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
4030
4036
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-8);
4031
4037
  padding-inline: var(--cm-space-12); pointer-events: none;
4032
4038
  }
4033
- `];$("cm-toast-region",Ko);function Dw(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),Sw),s}return t.add(s)}async function J0(o,n,e){await o();let{message:t,undoLabel:i,...s}=e,l=i??fh("toast","undo",void 0,s.root??document.body),d=await Dw(t,{...s,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var nz=z("progressBar",{inProgress:"In progress"}),su,Xo=class extends C{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";m(this,su,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,su)}-label`;return c`
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`
4034
4040
  <div class="head ${this.labelHidden?"vh":""}">
4035
4041
  <span id=${t} part="label">${this.label}</span>
4036
4042
  ${this.showValue&&e!==null?c`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:h}
@@ -4040,7 +4046,7 @@ ${t.label}</button>
4040
4046
  aria-valuenow=${e===null?h:Math.round(e)}
4041
4047
  aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
4042
4048
  <div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
4043
- </div>`}};su=new WeakMap,Xo.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Xo.styles=[E,w`
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`
4044
4050
  :host { display: block; }
4045
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); }
4046
4052
  .value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
@@ -4058,7 +4064,7 @@ ${t.label}</button>
4058
4064
  .fill { transition: none; }
4059
4065
  .indeterminate .fill { animation-duration: 4s; }
4060
4066
  }
4061
- `];$("cm-progress-bar",Xo);var Jo=class extends A{constructor(){super(...arguments);this.tone="neutral"}render(){return c`<span part="badge"><slot></slot></span>`}};Jo.properties={tone:{reflect:!0}},Jo.styles=[E,w`
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`
4062
4068
  :host { display: inline-flex; vertical-align: middle; }
4063
4069
  span {
4064
4070
  display: inline-flex; align-items: center; box-sizing: border-box; height: 24px; padding: 0 var(--cm-space-8); white-space: nowrap;
@@ -4075,12 +4081,12 @@ ${t.label}</button>
4075
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); }
4076
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); }
4077
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); }
4078
- `];$("cm-badge",Jo);var Zo,el,Bt,Rw,Hw,Jd,Nw,au,db,Qo=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,Zo,!1);m(this,el,!1);m(this,Jd,!1);m(this,au,()=>{this.href||this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))})}willUpdate(){this.selected&&g(this,Jd,!0)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=r(this,Bt,Nw),i=t?a(this,Bt,db).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,Zo)}><slot name="title-adornment" @slotchange=${a(this,Bt,Rw)}></slot></span></div>`:h;return c`<section part="card" aria-label=${!t&&this.heading||h}>${t&&!this.heading?a(this,Bt,db).call(this,h):h}
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}
4079
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>
4080
- <div class="actions"><slot name="actions"></slot></div></header>`:c`<div class="bare" ?hidden=${!r(this,el)}><div class="actions"><slot name="actions" @slotchange=${a(this,Bt,Hw)}></slot></div></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>`}
4081
4087
  <slot></slot>
4082
- </section>`}};Zo=new WeakMap,el=new WeakMap,Bt=new WeakSet,Rw=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==r(this,Zo)&&(g(this,Zo,t),this.requestUpdate())},Hw=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())},Jd=new WeakMap,Nw=function(){return String(this.variant||"").split(/\s+/).includes("interactive")},au=new WeakMap,db=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}
4083
- 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,Jd)?"false":h} aria-label=${i} @click=${r(this,au)}>${e}</button>`},Qo.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:{}},Qo.styles=[E,w`
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`
4084
4090
  /* Owner standard (1.6): 24px padding and a 16px gap under the header; compact 16px and 12px; 16px on phones. */
4085
4091
  :host { display: block; --_pad: var(--cm-space-24); --_gap: var(--cm-space-16); }
4086
4092
  :host([variant~='compact']) { --_pad: var(--cm-space-16); --_gap: var(--cm-space-12); }
@@ -4127,13 +4133,16 @@ ${t.label}</button>
4127
4133
  .adornment { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-8); }
4128
4134
  .adornment[hidden] { display: none; }
4129
4135
  .desc { margin: var(--cm-space-4) 0 0; font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); color: var(--cm-text-tertiary); }
4136
+ /* A long unbroken heading or description (a reference number, a bank narration) breaks instead of widening the
4137
+ card and the page (1.22). */
4138
+ .title, .desc { overflow-wrap: anywhere; }
4130
4139
  .actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); align-items: center; }
4131
4140
  /* Actions on a card without a heading or description: a row of their own, at the end. */
4132
4141
  .bare { display: flex; justify-content: flex-end; margin-bottom: var(--_gap); }
4133
4142
  .bare[hidden] { display: none; }
4134
4143
  :host([flush]) .bare { padding: var(--_pad) var(--_pad) 0; margin-bottom: var(--cm-space-8); }
4135
- `];$("cm-card",Qo);var Q0=["0","4","8","12","16","20","24","32","40","48","64"],Z0={10:"8",15:"16",22:"24",30:"32"};function tl(o,n){let e=(t,i)=>`:host([${o}='${t}']) { ${n}: ${i==="0"?"0px":`var(--cm-space-${i})`}; }`;return sh([...Q0.map(t=>e(t,t)),...Object.entries(Z0).map(([t,i])=>e(t,i))].join(`
4136
- `))}var il=class extends A{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return c`<slot></slot>`}};il.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},il.styles=[E,w`
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`
4137
4146
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
4138
4147
  :host([direction='inline']) { flex-direction: row; align-items: center; }
4139
4148
  :host([wrap]) { flex-wrap: wrap; }
@@ -4146,13 +4155,13 @@ ${t.label}</button>
4146
4155
  :host([justify='center']) { justify-content: center; }
4147
4156
  :host([justify='end']) { justify-content: flex-end; }
4148
4157
  :host([justify='space-between']) { justify-content: space-between; }
4149
- `,tl("gap","gap")];$("cm-stack",il);var Pw="important",e$=" !"+Pw,Iw=ha(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(e$);t.includes("-")||s?e.setProperty(t,s?i.slice(0,-11):i,s?Pw:""):e[t]=i}}return Pe}});var rl=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=${Iw({gridTemplateColumns:i})}><slot></slot></div>`}};rl.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},rl.styles=[E,w`
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`
4150
4159
  :host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
4151
4160
  .grid { display: grid; gap: var(--_gap); align-items: start; }
4152
4161
  @container cm-grid (max-width: 640px) {
4153
4162
  .grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
4154
4163
  }
4155
- `,tl("gap","--_gap")];$("cm-grid",rl);var lu,Ws,Gs,Zd,xe,nu,hb,Qd,ou,pb,sl=class extends A{constructor(){super(...arguments);m(this,xe);this.gap="24";this.variant="default";this.asidePosition="above";this.stickyAside=!1;m(this,lu,this.attachInternals());m(this,Ws);m(this,Gs,[]);m(this,Zd,()=>a(this,xe,ou).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,xe,hb).call(this)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&a(this,xe,Qd).call(this)}updated(e){(e.has("stickyAside")||e.has("variant"))&&a(this,xe,Qd).call(this)}get asideSticks(){let e=a(this,xe,nu).call(this)[0];return!!e&&getComputedStyle(e).position==="sticky"}render(){return c`<div class="layout" part="layout"><slot @slotchange=${()=>{this.stickyAside&&a(this,xe,Qd).call(this)}}></slot></div>`}};lu=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,Zd=new WeakMap,xe=new WeakSet,nu=function(){return[...this.children].filter(e=>e.getAttribute("variant")==="aside")},hb=function(){r(this,Ws)?.disconnect(),g(this,Ws,void 0),g(this,Gs,[]),window.removeEventListener("resize",r(this,Zd)),a(this,xe,pb).call(this,!1)},Qd=function(){a(this,xe,hb).call(this),!(!this.stickyAside||this.variant!=="record"||!this.isConnected)&&(g(this,Ws,new ResizeObserver(()=>a(this,xe,ou).call(this))),g(this,Gs,[this,...a(this,xe,nu).call(this)]),r(this,Gs).forEach(e=>r(this,Ws).observe(e)),window.addEventListener("resize",r(this,Zd)),a(this,xe,ou).call(this))},ou=function(){let e=a(this,xe,nu).call(this);if(e.some(i=>!r(this,Gs).includes(i))){a(this,xe,Qd).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,pb).call(this,t)},pb=function(e){let t=r(this,lu).states;if(t)try{e?t.add("aside-fits"):t.delete("aside-fits")}catch{}},sl.properties={gap:{reflect:!0},variant:{reflect:!0},asidePosition:{attribute:"aside-position",reflect:!0},stickyAside:{type:Boolean,attribute:"sticky-aside",reflect:!0}},sl.styles=[E,w`
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`
4156
4165
  :host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-24); }
4157
4166
  .layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
4158
4167
  @container cm-layout (max-width: 767px) {
@@ -4196,9 +4205,9 @@ ${t.label}</button>
4196
4205
  /* Read back by #measure(); only takes effect once the aside is sticky. --_header: cm-app-frame's header height. */
4197
4206
  inset-block-start: var(--cm-layout-sticky-top, calc(var(--_header, 0px) + var(--cm-space-24)));
4198
4207
  }
4199
- `,tl("gap","--_gap")];var al=class extends A{constructor(){super(...arguments);this.variant="full"}render(){return c`<slot></slot>`}};al.properties={variant:{reflect:!0}},al.styles=[E,w`
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`
4200
4209
  :host { display: flex; flex-direction: column; gap: var(--_cm-section-gap, var(--cm-space-24)); min-inline-size: 0; }
4201
- `];$("cm-layout",sl);$("cm-layout-section",al);var mb=1024,t$=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o},Xs,ol,Di,pe,ub,gb,fb,bb,Ys,qw,eh,th,nl=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,ol,null);m(this,Di,!1);m(this,eh,e=>{if(!this.menuItem)return;let t=a(this,pe,qw).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,th,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,eh)),this.addEventListener("keydown",r(this,th));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=mb),this.hasUpdated&&a(this,pe,fb).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",r(this,eh)),this.removeEventListener("keydown",r(this,th)),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,ub).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=mb!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=mb}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>r(this,Xs).observe(t))}updated(e){e.has("_wide")&&a(this,pe,ub).call(this),(e.has("menuOpen")||e.has("menuItem"))&&a(this,pe,bb).call(this),a(this,pe,fb).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,gb).call(this);return c`<div class="frame ${e?"wide":""}" part="frame">
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">
4202
4211
  <div class="probe"></div>
4203
4212
  <div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
4204
4213
  <div class="body">
@@ -4206,8 +4215,8 @@ ${t.label}</button>
4206
4215
  <main part="main" ?inert=${t}><slot></slot></main>
4207
4216
  </div>
4208
4217
  <div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
4209
- <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation" @slotchange=${()=>a(this,pe,bb).call(this)}></slot></div>
4210
- </div>`}};Xs=new WeakMap,ol=new WeakMap,Di=new WeakMap,pe=new WeakSet,ub=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`)},gb=function(){return this.menuOpen&&!this._wide&&!!this.querySelector(':scope > [slot="mobile-menu"]')},fb=function(){let e=this.isConnected&&a(this,pe,gb).call(this);e&&!r(this,Di)?(ec(),g(this,Di,!0)):!e&&r(this,Di)&&(Gi(),g(this,Di,!1))},bb=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,ol,t$()),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,ol)?.focus(),g(this,ol,null))}))},qw=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},eh=new WeakMap,th=new WeakMap,nl.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},panel:{type:Boolean,reflect:!0},_wide:{state:!0}},nl.styles=[E,w`
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`
4211
4220
  :host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
4212
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); }
4213
4222
  .body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
@@ -4240,7 +4249,7 @@ ${t.label}</button>
4240
4249
  .menu::-webkit-scrollbar { display: none; }
4241
4250
  .probe { block-size: 0; }
4242
4251
  [hidden] { display: none !important; }
4243
- `];$("cm-app-frame",nl);var ll=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>`}};ll.properties={width:{reflect:!0},fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},ll.styles=[E,w`
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`
4244
4253
  :host { display: block; container: cm-page / inline-size; background: var(--cm-page-background, var(--cm-bg-page)); min-block-size: 100%; }
4245
4254
  .content {
4246
4255
  box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
@@ -4252,16 +4261,16 @@ ${t.label}</button>
4252
4261
  :host([width='detail']) .content { max-inline-size: 1040px; }
4253
4262
  :host([width='wide']) .content { max-inline-size: 1600px; }
4254
4263
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-16); } }
4255
- `];$("cm-page",ll);var dl,Ow,Bw,cl=class extends C{constructor(){super(...arguments);m(this,dl);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",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}>
4256
4265
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
4257
4266
  <div class="body">
4258
4267
  ${this.heading?c`<p class="title">${this.heading}</p>`:h}
4259
4268
  <div><slot></slot></div>
4260
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${a(this,dl,Ow)}></slot></div>
4269
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${a(this,hl,Vw)}></slot></div>
4261
4270
  </div>
4262
- ${this.dismissible?c`<button class="close" aria-label=${this.t("dismiss")} @click=${a(this,dl,Bw)}>
4271
+ ${this.dismissible?c`<button class="close" aria-label=${this.t("dismiss")} @click=${a(this,hl,jw)}>
4263
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}
4264
- </div>`}};dl=new WeakSet,Ow=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},Bw=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},cl.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},cl.styles=[E,w`
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`
4265
4274
  :host { display: block; }
4266
4275
  .banner {
4267
4276
  display: flex; gap: var(--cm-space-12); align-items: flex-start;
@@ -4285,10 +4294,10 @@ ${t.label}</button>
4285
4294
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
4286
4295
  }
4287
4296
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
4288
- `];$("cm-banner",cl);var eS=z("thumbnail",{noImage:"{alt} (no image)"}),hl=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",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}
4289
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}
4290
4299
  aria-label=${this.alt?this.t("noImage",{alt:this.alt}):h} aria-hidden=${this.alt?h:"true"}>
4291
- <cm-icon name="box" size=${e}></cm-icon></span>`}};hl.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},hl.styles=[E,w`
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`
4292
4301
  :host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
4293
4302
  :host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
4294
4303
  :host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
@@ -4298,7 +4307,7 @@ ${t.label}</button>
4298
4307
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
4299
4308
  }
4300
4309
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
4301
- `];$("cm-thumbnail",hl);export{Rs as Announcer,kn as CmAccordion,Io as CmAccountMenu,yn as CmActionBar,Ft as CmActionMenu,Ro as CmAppCard,nl as CmAppFrame,Eo as CmAvatar,Jo as CmBadge,cl as CmBanner,no as CmBoard,Hs as CmBoardCard,Ns as CmBoardColumn,zo as CmBottomNavigation,Oo as CmBottomSheet,Sr as CmButton,da as CmButtonGroup,uo as CmCalendar,mo as CmCalendarEvent,Qo as CmCard,Bi as CmCheckbox,or as CmColorField,hn as CmColorPicker,Wi as CmCombobox,Da as CmCommandPalette,Tn as CmComment,Cn as CmCommentBox,Wn as CmDataTable,Qi as CmDatePicker,tr as CmDateRangePicker,En as CmEmptyState,ar as CmFileUpload,No as CmFilterPanel,Lo as CmFlashOfferBar,Qr as CmGlobalSearch,rl as CmGrid,_o as CmHeaderBar,Zs as CmIcon,$n as CmInfoItem,wn as CmInfoPanel,sl as CmLayout,al as CmLayoutSection,Ao as CmLinkTabs,C as CmLocalizedElement,ea as CmMenuItem,wo as CmMetric,So as CmMobileMenu,Ho as CmModal,$o as CmNavItem,so as CmNestedItem,ro as CmNestedList,Bo as CmNotificationItem,Fo as CmNotificationPanel,Gt as CmOptionGroup,ll as CmPage,vn as CmPageHeader,In as CmPagination,Xo as CmProgressBar,Br as CmRadio,Fr as CmRadioGroup,Os as CmReportTile,xo as CmReportTiles,eo as CmResourceItem,to as CmResourceList,xn as CmSaveBar,Ki as CmSearch,bn as CmSegmentedControl,Ui as CmSelect,ko as CmSideNavigation,Zt as CmSidePanel,lr as CmSignatureField,Mn as CmSkeleton,_n as CmSkeletonDisplay,Nn as CmSmartTip,Pn as CmSmartTips,qo as CmSparkline,sa as CmSpinner,il as CmStack,On as CmStatusTabs,Fn as CmTableHeader,Gr as CmTag,Oi as CmTextField,hl as CmThumbnail,sr as CmTimePicker,Ms as CmTimeline,Rn as CmTimelineItem,Uo as CmToast,Ko as CmToastRegion,Fi as CmToggle,zn as CmTooltip,Vv as DEFAULT_PALETTE,cn as MAX_RECENT,Ds as MoveModel,vv as commandMatches,r0 as configure,z as defineStrings,Ob as directionalIcons,hs as formatColor,ue as formatDate,cs as formatGradient,Ib as formatMessage,ku as formatNumber,t0 as getDefaultStrings,Ec as hslToRgb,tm as hsvToRgb,E0 as httpColorSource,fw as initials,Xl as isApplePlatform,xg as isColorValue,Ex as listNavigation,wg as localColorSource,xl as localeFor,ju as matchesShortcut,ds as normalizeHex,qe as parseColor,Ht as parseGradient,gh as pluralCategory,im as pushRecent,s0 as resetStrings,Ip as resolvePreset,kc as rgbToHsl,em as rgbToHsv,Mc as sameColor,i0 as setStrings,dp as shortcutKeys,Dw as showToast,fh as translate,J0 as undoable};
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};
4302
4311
  /*! Bundled license information:
4303
4312
 
4304
4313
  @lit/reactive-element/css-tag.js: