@webmcpui/core 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";var webmcpui=(()=>{var me=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Bt=Object.prototype.hasOwnProperty;var jt=(s,e)=>{for(var t in e)me(s,t,{get:e[t],enumerable:!0})},zt=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vt(e))!Bt.call(s,i)&&i!==t&&me(s,i,{get:()=>e[i],enumerable:!(r=rt(e,i))||r.enumerable});return s};var qt=s=>zt(me({},"__esModule",{value:!0}),s),v=(s,e,t,r)=>{for(var i=r>1?void 0:r?rt(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&me(e,t,i),i};var pr={};jt(pr,{WmcpCheckbox:()=>F,WmcpFormControl:()=>u,WmcpInput:()=>q,WmcpRadio:()=>X,WmcpRadioGroup:()=>D,WmcpSelect:()=>U,WmcpTextarea:()=>G,defineComponents:()=>Ue,exposeTool:()=>Ne,isStandardSchema:()=>Me,isWebMCPAvailable:()=>Nt,textFieldStyles:()=>k,validateStandard:()=>Pe});var st=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var T=function(s,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!i:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(s,t):i?i.value=t:e.set(s,t),t},E=function(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)},J,ve,fe,ee,He,te,ge,H,re,N,_e,it;var S={__proto__:null};S.enumerable=!0;Object.freeze(S);var We=(N=class{constructor(e,t={}){if(J.set(this,!1),ve.set(this,!1),fe.set(this,!1),ee.set(this,!1),He.set(this,Date.now()),te.set(this,!1),ge.set(this,void 0),H.set(this,void 0),re.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:r,cancelable:i,composed:o}=t;T(this,J,!!i,"f"),T(this,ve,!!r,"f"),T(this,fe,!!o,"f"),T(this,ge,`${e}`,"f"),T(this,H,null,"f"),T(this,re,!1,"f")}initEvent(e,t,r){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){T(this,ee,!0,"f")}get target(){return E(this,H,"f")}get currentTarget(){return E(this,H,"f")}get srcElement(){return E(this,H,"f")}get type(){return E(this,ge,"f")}get cancelable(){return E(this,J,"f")}get defaultPrevented(){return E(this,J,"f")&&E(this,ee,"f")}get timeStamp(){return E(this,He,"f")}composedPath(){return E(this,re,"f")?[E(this,H,"f")]:[]}get returnValue(){return!E(this,J,"f")||!E(this,ee,"f")}get bubbles(){return E(this,ve,"f")}get composed(){return E(this,fe,"f")}get eventPhase(){return E(this,re,"f")?N.AT_TARGET:N.NONE}get cancelBubble(){return E(this,te,"f")}set cancelBubble(e){e&&T(this,te,!0,"f")}stopPropagation(){T(this,te,!0,"f")}get isTrusted(){return!1}},J=new WeakMap,ve=new WeakMap,fe=new WeakMap,ee=new WeakMap,He=new WeakMap,te=new WeakMap,ge=new WeakMap,H=new WeakMap,re=new WeakMap,N.NONE=0,N.CAPTURING_PHASE=1,N.AT_TARGET=2,N.BUBBLING_PHASE=3,N);Object.defineProperties(We.prototype,{initEvent:S,stopImmediatePropagation:S,preventDefault:S,target:S,currentTarget:S,srcElement:S,type:S,cancelable:S,defaultPrevented:S,timeStamp:S,composedPath:S,returnValue:S,bubbles:S,composed:S,eventPhase:S,cancelBubble:S,stopPropagation:S,isTrusted:S});var ot=(it=class extends We{constructor(e,t={}){super(e,t),_e.set(this,void 0),T(this,_e,t?.detail??null,"f")}initCustomEvent(e,t,r,i){throw new Error("Method not implemented.")}get detail(){return E(this,_e,"f")}},_e=new WeakMap,it);Object.defineProperties(ot.prototype,{detail:S});var R=We,Ve=ot;var $;var yr=($=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},$.STYLE_RULE=1,$.CHARSET_RULE=2,$.IMPORT_RULE=3,$.MEDIA_RULE=4,$.FONT_FACE_RULE=5,$.PAGE_RULE=6,$.NAMESPACE_RULE=10,$.KEYFRAMES_RULE=7,$.KEYFRAME_RULE=8,$.SUPPORTS_RULE=12,$.COUNTER_STYLE_RULE=11,$.FONT_FEATURE_VALUES_RULE=14,$.MARGIN_RULE=9,$);globalThis.Event??=R;globalThis.CustomEvent??=Ve;var je=Symbol(),nt=s=>typeof s=="boolean"?s:s?.capture??!1,C={__proto__:null};C.enumerable=!0;Object.freeze(C);var be=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,r){if(t==null)return;let i=nt(r)?this.__captureEventListeners:this.__eventListeners,o=i.get(e);if(o===void 0)o=new Map,i.set(e,o);else if(o.has(t))return;let n=typeof r=="object"&&r?r:{};n.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,r)),o.set(t,n??{})}removeEventListener(e,t,r){if(t==null)return;let i=nt(r)?this.__captureEventListeners:this.__eventListeners,o=i.get(e);o!==void 0&&(o.delete(t),o.size||i.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let r=!1,i=!1,o=R.NONE,n=null,l=null,a=null,m=e.stopPropagation,b=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return n??l},...C},srcElement:{get(){return e.target},...C},currentTarget:{get(){return a},...C},eventPhase:{get(){return o},...C},composedPath:{value:()=>t,...C},stopPropagation:{value:()=>{r=!0,m.call(e)},...C},stopImmediatePropagation:{value:()=>{i=!0,b.call(e)},...C}});let c=(g,A,Q)=>{typeof g=="function"?g(e):typeof g?.handleEvent=="function"&&g.handleEvent(e),A.once&&Q.delete(g)},p=()=>(a=null,o=R.NONE,!e.defaultPrevented),d=t.slice().reverse();n=!this.__host||!e.composed?this:null;let y=g=>{for(l=this;l.__host&&g.includes(l.__host);)l=l.__host};for(let g of d){!n&&(!l||l===g.__host)&&y(d.slice(d.indexOf(g))),a=g,o=g===e.target?R.AT_TARGET:R.CAPTURING_PHASE;let A=g.__captureEventListeners.get(e.type);if(A){for(let[Q,De]of A)if(c(Q,De,A),i)return p()}if(r)return p()}let w=e.bubbles?t:[this];l=null;for(let g of w){!n&&(!l||g===l.__host)&&y(w.slice(0,w.indexOf(g)+1)),a=g,o=g===e.target?R.AT_TARGET:R.BUBBLING_PHASE;let A=g.__eventListeners.get(e.type);if(A){for(let[Q,De]of A)if(c(Q,De,A),i)return p()}if(r)return p()}return p()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,ct,Jt]}};var at=new WeakMap,se=s=>{let e=at.get(s);return e===void 0&&at.set(s,e=new Map),e},ie=class extends be{getRootNode(e){return e?.composed?Be:this.__host?.__shadowRoot??Be}};var lt=class extends ie{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var ct=new lt,Be=ct;var ht=class extends ie{constructor(e){if(super(),e!==je)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ye,customElements:qe,document:Be,Document:lt,Element:dt,EventTarget:be,HTMLElement:ut,Node:ie,ShadowRoot:pt,window:this,Window:ht})}};var dt=class extends ie{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(se(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){se(this).set(e,String(t))}removeAttribute(e){se(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return se(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new pt(je,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new st(this);return this.__internals=e,e}getAttribute(e){return se(this).get(e)??null}};var ut=class extends dt{},ze=ut;var pt=class extends ie{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new ze,"localName",{get(){return"lit-server-root"}});function Gt(){let s,e;return{promise:new Promise((r,i)=>{s=r,e=i}),resolve:s,reject:e}}var ye=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let r=this.__pendingWhenDefineds.get(e);return r||(r=Gt(),this.__pendingWhenDefineds.set(e,r)),r.promise}},Ft=ye;var qe=new Ft,Jt=new ht(je);var oe=globalThis,Se=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ge=Symbol(),mt=new WeakMap,ne=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ge)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Se&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=mt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&mt.set(t,e))}return e}toString(){return this.cssText}},vt=s=>new ne(typeof s=="string"?s:s+"",void 0,Ge),x=(s,...e)=>{let t=s.length===1?s[0]:e.reduce((r,i,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1],s[0]);return new ne(t,s,Ge)},ft=(s,e)=>{if(Se)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=oe.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,s.appendChild(r)}},Fe=Se||oe.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return vt(t)})(s):s;var{is:Kt,defineProperty:Yt,getOwnPropertyDescriptor:Zt,getOwnPropertyNames:Xt,getOwnPropertySymbols:Qt,getPrototypeOf:er}=Object,ce=globalThis;ce.customElements??=qe;var gt=ce.trustedTypes,tr=gt?gt.emptyScript:"",rr=ce.reactiveElementPolyfillSupport,ae=(s,e)=>s,le={toAttribute(s,e){switch(e){case Boolean:s=s?tr:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},Ee=(s,e)=>!Kt(s,e),_t={attribute:!0,type:String,converter:le,reflect:!1,useDefault:!1,hasChanged:Ee};Symbol.metadata??=Symbol("metadata"),ce.litPropertyMetadata??=new WeakMap;var O=class extends(globalThis.HTMLElement??ze){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_t){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&Yt(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=Zt(this.prototype,e)??{get(){return this[t]},set(n){this[t]=n}};return{get:i,set(n){let l=i?.call(this);o?.call(this,n),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_t}static _$Ei(){if(this.hasOwnProperty(ae("elementProperties")))return;let e=er(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ae("properties"))){let t=this.properties,r=[...Xt(t),...Qt(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(Fe(i))}else e!==void 0&&t.push(Fe(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:le).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let o=r.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:le;this._$Em=i;let l=n.fromAttribute(t,o.type);this[i]=l??this._$Ej?.get(i)??l,this._$Em=null}}requestUpdate(e,t,r,i=!1,o){if(e!==void 0){let n=this.constructor;if(i===!1&&(o=this[e]),r??=n.getPropertyOptions(e),!((r.hasChanged??Ee)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:o},n){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,n??t??this[e]),o!==!0||n!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,o]of r){let{wrapped:n}=o,l=this[i];n!==!0||this._$AL.has(i)||l===void 0||this.C(i,void 0,o,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[ae("elementProperties")]=new Map,O[ae("finalized")]=new Map,rr?.({ReactiveElement:O}),(ce.reactiveElementVersions??=[]).push("2.1.2");var Ce=globalThis,bt=s=>s,$e=Ce.trustedTypes,yt=$e?$e.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ke="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,Ye="?"+P,sr=`<${Ye}>`,B=Ce.document===void 0?{createTreeWalker:()=>({})}:document,de=()=>B.createComment(""),ue=s=>s===null||typeof s!="object"&&typeof s!="function",Ze=Array.isArray,At=s=>Ze(s)||typeof s?.[Symbol.iterator]=="function",Je=`[
3
- \f\r]`,he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,St=/-->/g,Et=/>/g,W=RegExp(`>|${Je}(?:([^\\s"'>=/]+)(${Je}*=${Je}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),$t=/'/g,xt=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Xe=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),_=Xe(1),Qr=Xe(2),es=Xe(3),M=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),wt=new WeakMap,V=B.createTreeWalker(B,129);function Rt(s,e){if(!Ze(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return yt!==void 0?yt.createHTML(e):e}var Ct=(s,e)=>{let t=s.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",n=he;for(let l=0;l<t;l++){let a=s[l],m,b,c=-1,p=0;for(;p<a.length&&(n.lastIndex=p,b=n.exec(a),b!==null);)p=n.lastIndex,n===he?b[1]==="!--"?n=St:b[1]!==void 0?n=Et:b[2]!==void 0?(Tt.test(b[2])&&(i=RegExp("</"+b[2],"g")),n=W):b[3]!==void 0&&(n=W):n===W?b[0]===">"?(n=i??he,c=-1):b[1]===void 0?c=-2:(c=n.lastIndex-b[2].length,m=b[1],n=b[3]===void 0?W:b[3]==='"'?xt:$t):n===xt||n===$t?n=W:n===St||n===Et?n=he:(n=W,i=void 0);let d=n===W&&s[l+1].startsWith("/>")?" ":"";o+=n===he?a+sr:c>=0?(r.push(m),a.slice(0,c)+Ke+a.slice(c)+P+d):a+P+(c===-2?l:d)}return[Rt(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},pe=class s{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,n=0,l=e.length-1,a=this.parts,[m,b]=Ct(e,t);if(this.el=s.createElement(m,r),V.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=V.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(Ke)){let p=b[n++],d=i.getAttribute(c).split(P),y=/([.?@])?(.*)/.exec(p);a.push({type:1,index:o,name:y[2],strings:d,ctor:y[1]==="."?we:y[1]==="?"?Ae:y[1]==="@"?Te:z}),i.removeAttribute(c)}else c.startsWith(P)&&(a.push({type:6,index:o}),i.removeAttribute(c));if(Tt.test(i.tagName)){let c=i.textContent.split(P),p=c.length-1;if(p>0){i.textContent=$e?$e.emptyScript:"";for(let d=0;d<p;d++)i.append(c[d],de()),V.nextNode(),a.push({type:2,index:++o});i.append(c[p],de())}}}else if(i.nodeType===8)if(i.data===Ye)a.push({type:2,index:o});else{let c=-1;for(;(c=i.data.indexOf(P,c+1))!==-1;)a.push({type:7,index:o}),c+=P.length-1}o++}}static createElement(e,t){let r=B.createElement("template");return r.innerHTML=e,r}};function j(s,e,t=s,r){if(e===M)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=ue(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=j(s,i._$AS(s,e.values),i,r)),e}var xe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??B).importNode(t,!0);V.currentNode=i;let o=V.nextNode(),n=0,l=0,a=r[0];for(;a!==void 0;){if(n===a.index){let m;a.type===2?m=new K(o,o.nextSibling,this,e):a.type===1?m=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(m=new Re(o,this,e)),this._$AV.push(m),a=r[++l]}n!==a?.index&&(o=V.nextNode(),n++)}return V.currentNode=B,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},K=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=j(this,e,t),ue(e)?e===h||e==null||e===""?(this._$AH!==h&&this._$AR(),this._$AH=h):e!==this._$AH&&e!==M&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):At(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==h&&ue(this._$AH)?this._$AA.nextSibling.data=e:this.T(B.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=pe.createElement(Rt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new xe(i,this),n=o.u(this.options);o.p(t),this.T(n),this._$AH=o}}_$AC(e){let t=wt.get(e.strings);return t===void 0&&wt.set(e.strings,t=new pe(e)),t}k(e){Ze(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new s(this.O(de()),this.O(de()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=bt(e).nextSibling;bt(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=h}_$AI(e,t=this,r,i){let o=this.strings,n=!1;if(o===void 0)e=j(this,e,t,0),n=!ue(e)||e!==this._$AH&&e!==M,n&&(this._$AH=e);else{let l=e,a,m;for(e=o[0],a=0;a<o.length-1;a++)m=j(this,l[r+a],t,a),m===M&&(m=this._$AH[a]),n||=!ue(m)||m!==this._$AH[a],m===h?e=h:e!==h&&(e+=(m??"")+o[a+1]),this._$AH[a]=m}n&&!i&&this.j(e)}j(e){e===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},we=class extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===h?void 0:e}},Ae=class extends z{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==h)}},Te=class extends z{constructor(e,t,r,i,o){super(e,t,r,i,o),this.type=5}_$AI(e,t=this){if((e=j(this,e,t,0)??h)===M)return;let r=this._$AH,i=e===h&&r!==h||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==h&&(r===h||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Re=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){j(this,e)}},Ot={M:Ke,P,A:Ye,C:1,L:Ct,R:xe,D:At,V:j,I:K,H:z,N:Ae,U:Te,B:we,F:Re},ir=Ce.litHtmlPolyfillSupport;ir?.(pe,K),(Ce.litHtmlVersions??=[]).push("3.3.3");var Pt=(s,e,t)=>{let r=t?.renderBefore??e,i=r._$litPart$;if(i===void 0){let o=t?.renderBefore??null;r._$litPart$=i=new K(e.insertBefore(de(),o),o,void 0,t??{})}return i._$AI(s),i};var Qe=globalThis,L=class extends O{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Pt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};L._$litElement$=!0,L.finalized=!0,Qe.litElementHydrateSupport?.({LitElement:L});var or=Qe.litElementPolyfillSupport;or?.({LitElement:L});(Qe.litElementVersions??=[]).push("4.2.2");var nr={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:Ee},ar=(s=nr,e,t)=>{let{kind:r,metadata:i}=t,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),r==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(t.name,s),r==="accessor"){let{name:n}=t;return{set(l){let a=e.get.call(this);e.set.call(this,l),this.requestUpdate(n,a,s,!0,l)},init(l){return l!==void 0&&this.C(n,void 0,s,l),l}}}if(r==="setter"){let{name:n}=t;return function(l){let a=this[n];e.call(this,l),this.requestUpdate(n,a,s,!0,l)}}throw Error("Unsupported decorator location: "+r)};function f(s){return(e,t)=>typeof t=="object"?ar(s,e,t):((r,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,r),n?Object.getOwnPropertyDescriptor(i,o):void 0})(s,e,t)}function Y(s){return f({...s,state:!0,attribute:!1})}async function Pe(s,e){let t=await s["~standard"].validate(e);return t.issues?{valid:!1,errors:t.issues.map(r=>r.message)}:{valid:!0,value:t.value,errors:[]}}function Me(s){return typeof s=="object"&&s!==null&&"~standard"in s&&typeof s["~standard"]?.validate=="function"}function Mt(){let s=typeof document<"u"?document.modelContext:void 0,e=typeof navigator<"u"?navigator.modelContext:void 0,t=s??e;return t&&typeof t.registerTool=="function"?t:void 0}function Nt(){return Mt()!==void 0}var lr=globalThis.process?.env?.NODE_ENV!=="production",et=new Set;function Ne(s){let e=Mt();if(!e?.registerTool)return()=>{};let t={name:s.name,description:s.description,inputSchema:s.inputSchema??{type:"object",properties:{}},execute:s.execute};lr&&et.has(t.name)&&console.warn(`[webmcpui] A WebMCP tool named "${t.name}" is already registered on this page. Tool names are page-global, so the host rejects the duplicate and this control won't be agent-callable. Give one control a unique \`name\`, or override it with \`tool-name\`.`),et.add(t.name);let r=typeof AbortController=="function"?new AbortController:void 0,i=e.registerTool(t,r?{signal:r.signal}:void 0),o=!1;return()=>{if(!o){o=!0,et.delete(t.name);try{r?.abort(),i&&typeof i.unregister=="function"?i.unregister():typeof e.unregisterTool=="function"&&e.unregisterTool(s.name)}catch{}}}}var k=x`
1
+ "use strict";var webmcpui=(()=>{var we=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Yt=Object.prototype.hasOwnProperty;var Zt=(i,t)=>{for(var e in t)we(i,e,{get:t[e],enumerable:!0})},Xt=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Kt(t))!Yt.call(i,o)&&o!==e&&we(i,o,{get:()=>t[o],enumerable:!(r=dt(t,o))||r.enumerable});return i};var Qt=i=>Xt(we({},"__esModule",{value:!0}),i),l=(i,t,e,r)=>{for(var o=r>1?void 0:r?dt(t,e):t,s=i.length-1,n;s>=0;s--)(n=i[s])&&(o=(r?n(t,e,o):n(o))||o);return r&&o&&we(t,e,o),o};var _r={};Zt(_r,{WmcpAction:()=>E,WmcpButton:()=>N,WmcpCheckbox:()=>oe,WmcpDialog:()=>V,WmcpExposable:()=>R,WmcpFormControl:()=>b,WmcpInput:()=>te,WmcpMenu:()=>I,WmcpPopover:()=>L,WmcpRadio:()=>ae,WmcpRadioGroup:()=>J,WmcpSelect:()=>F,WmcpTabs:()=>z,WmcpTextarea:()=>re,WmcpToast:()=>C,defineComponents:()=>qe,exposeTool:()=>Ve,isStandardSchema:()=>Be,isWebMCPAvailable:()=>Bt,textFieldStyles:()=>q,validateStandard:()=>Ue});var pt=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var P=function(i,t,e,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(i,e):o?o.value=e:t.set(i,e),e},w=function(i,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?i!==t||!r:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(i):r?r.value:t.get(i)},ie,Ee,$e,ce,Fe,de,Te,K,pe,j,Re,ut;var _={__proto__:null};_.enumerable=!0;Object.freeze(_);var Je=(j=class{constructor(t,e={}){if(ie.set(this,!1),Ee.set(this,!1),$e.set(this,!1),ce.set(this,!1),Fe.set(this,Date.now()),de.set(this,!1),Te.set(this,void 0),K.set(this,void 0),pe.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof e!="object"||!e)throw new Error('The "options" argument must be an object');let{bubbles:r,cancelable:o,composed:s}=e;P(this,ie,!!o,"f"),P(this,Ee,!!r,"f"),P(this,$e,!!s,"f"),P(this,Te,`${t}`,"f"),P(this,K,null,"f"),P(this,pe,!1,"f")}initEvent(t,e,r){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){P(this,ce,!0,"f")}get target(){return w(this,K,"f")}get currentTarget(){return w(this,K,"f")}get srcElement(){return w(this,K,"f")}get type(){return w(this,Te,"f")}get cancelable(){return w(this,ie,"f")}get defaultPrevented(){return w(this,ie,"f")&&w(this,ce,"f")}get timeStamp(){return w(this,Fe,"f")}composedPath(){return w(this,pe,"f")?[w(this,K,"f")]:[]}get returnValue(){return!w(this,ie,"f")||!w(this,ce,"f")}get bubbles(){return w(this,Ee,"f")}get composed(){return w(this,$e,"f")}get eventPhase(){return w(this,pe,"f")?j.AT_TARGET:j.NONE}get cancelBubble(){return w(this,de,"f")}set cancelBubble(t){t&&P(this,de,!0,"f")}stopPropagation(){P(this,de,!0,"f")}get isTrusted(){return!1}},ie=new WeakMap,Ee=new WeakMap,$e=new WeakMap,ce=new WeakMap,Fe=new WeakMap,de=new WeakMap,Te=new WeakMap,K=new WeakMap,pe=new WeakMap,j.NONE=0,j.CAPTURING_PHASE=1,j.AT_TARGET=2,j.BUBBLING_PHASE=3,j);Object.defineProperties(Je.prototype,{initEvent:_,stopImmediatePropagation:_,preventDefault:_,target:_,currentTarget:_,srcElement:_,type:_,cancelable:_,defaultPrevented:_,timeStamp:_,composedPath:_,returnValue:_,bubbles:_,composed:_,eventPhase:_,cancelBubble:_,stopPropagation:_,isTrusted:_});var ht=(ut=class extends Je{constructor(t,e={}){super(t,e),Re.set(this,void 0),P(this,Re,e?.detail??null,"f")}initCustomEvent(t,e,r,o){throw new Error("Method not implemented.")}get detail(){return w(this,Re,"f")}},Re=new WeakMap,ut);Object.defineProperties(ht.prototype,{detail:_});var W=Je,Ke=ht;var $;var kr=($=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},$.STYLE_RULE=1,$.CHARSET_RULE=2,$.IMPORT_RULE=3,$.MEDIA_RULE=4,$.FONT_FACE_RULE=5,$.PAGE_RULE=6,$.NAMESPACE_RULE=10,$.KEYFRAMES_RULE=7,$.KEYFRAME_RULE=8,$.SUPPORTS_RULE=12,$.COUNTER_STYLE_RULE=11,$.FONT_FEATURE_VALUES_RULE=14,$.MARGIN_RULE=9,$);globalThis.Event??=W;globalThis.CustomEvent??=Ke;var Ze=Symbol(),mt=i=>typeof i=="boolean"?i:i?.capture??!1,D={__proto__:null};D.enumerable=!0;Object.freeze(D);var Ae=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(t,e,r){if(e==null)return;let o=mt(r)?this.__captureEventListeners:this.__eventListeners,s=o.get(t);if(s===void 0)s=new Map,o.set(t,s);else if(s.has(e))return;let n=typeof r=="object"&&r?r:{};n.signal?.addEventListener("abort",()=>this.removeEventListener(t,e,r)),s.set(e,n??{})}removeEventListener(t,e,r){if(e==null)return;let o=mt(r)?this.__captureEventListeners:this.__eventListeners,s=o.get(t);s!==void 0&&(s.delete(e),s.size||o.delete(t))}dispatchEvent(t){let e=this.__resolveFullEventPath();!t.composed&&this.__host&&(e=e.slice(0,e.indexOf(this.__host)));let r=!1,o=!1,s=W.NONE,n=null,c=null,a=null,g=t.stopPropagation,x=t.stopImmediatePropagation;Object.defineProperties(t,{target:{get(){return n??c},...D},srcElement:{get(){return t.target},...D},currentTarget:{get(){return a},...D},eventPhase:{get(){return s},...D},composedPath:{value:()=>e,...D},stopPropagation:{value:()=>{r=!0,g.call(t)},...D},stopImmediatePropagation:{value:()=>{o=!0,x.call(t)},...D}});let u=(y,A,le)=>{typeof y=="function"?y(t):typeof y?.handleEvent=="function"&&y.handleEvent(t),A.once&&le.delete(y)},v=()=>(a=null,s=W.NONE,!t.defaultPrevented),m=e.slice().reverse();n=!this.__host||!t.composed?this:null;let S=y=>{for(c=this;c.__host&&y.includes(c.__host);)c=c.__host};for(let y of m){!n&&(!c||c===y.__host)&&S(m.slice(m.indexOf(y))),a=y,s=y===t.target?W.AT_TARGET:W.CAPTURING_PHASE;let A=y.__captureEventListeners.get(t.type);if(A){for(let[le,Ge]of A)if(u(le,Ge,A),o)return v()}if(r)return v()}let T=t.bubbles?e:[this];c=null;for(let y of T){!n&&(!c||y===c.__host)&&S(T.slice(0,T.indexOf(y)+1)),a=y,s=y===t.target?W.AT_TARGET:W.BUBBLING_PHASE;let A=y.__eventListeners.get(t.type);if(A){for(let[le,Ge]of A)if(u(le,Ge,A),o)return v()}if(r)return v()}return v()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,gt,rr]}};var vt=new WeakMap,ue=i=>{let t=vt.get(i);return t===void 0&&vt.set(i,t=new Map),t},he=class extends Ae{getRootNode(t){return t?.composed?Ye:this.__host?.__shadowRoot??Ye}};var bt=class extends he{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var gt=new bt,Ye=gt;var ft=class extends he{constructor(t){if(super(),t!==Ze)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ke,customElements:Qe,document:Ye,Document:bt,Element:yt,EventTarget:Ae,HTMLElement:xt,Node:he,ShadowRoot:St,window:this,Window:ft})}};var yt=class extends he{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ue(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(t,e){ue(this).set(t,String(e))}removeAttribute(t){ue(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return ue(this).has(t)}attachShadow(t){this.__shadowRootMode=t.mode;let e=new St(Ze,t);return e.__eventTargetParent=this,e.__host=this,this.__shadowRoot=e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new pt(this);return this.__internals=t,t}getAttribute(t){return ue(this).get(t)??null}};var xt=class extends yt{},Xe=xt;var St=class extends he{get host(){return this.__host}constructor(t,e){if(super(),t!==t)throw new TypeError("Illegal constructor");this.mode=e.mode}};globalThis.litServerRoot??=Object.defineProperty(new Xe,"localName",{get(){return"lit-server-root"}});function er(){let i,t;return{promise:new Promise((r,o)=>{i=r,t=o}),resolve:i,reject:t}}var ke=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
+ Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(this.__reverseDefinitions.has(e))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(e)}`);e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:e.observedAttributes??[]}),this.__reverseDefinitions.set(e,t),this.__pendingWhenDefineds.get(t)?.resolve(e),this.__pendingWhenDefineds.delete(t)}get(t){return this.__definitions.get(t)?.ctor}getName(t){return this.__reverseDefinitions.get(t)??null}initialize(t){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(t){let e=this.__definitions.get(t);if(e)return e.ctor;let r=this.__pendingWhenDefineds.get(t);return r||(r=er(),this.__pendingWhenDefineds.set(t,r)),r.promise}},tr=ke;var Qe=new tr,rr=new ft(Ze);var me=globalThis,Ce=me.ShadowRoot&&(me.ShadyCSS===void 0||me.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol(),_t=new WeakMap,ve=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==et)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Ce&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&_t.set(e,t))}return t}toString(){return this.cssText}},wt=i=>new ve(typeof i=="string"?i:i+"",void 0,et),f=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,o,s)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[s+1],i[0]);return new ve(e,i,et)},Et=(i,t)=>{if(Ce)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),o=me.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=e.cssText,i.appendChild(r)}},tt=Ce||me.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return wt(e)})(i):i;var{is:or,defineProperty:ir,getOwnPropertyDescriptor:sr,getOwnPropertyNames:nr,getOwnPropertySymbols:ar,getPrototypeOf:lr}=Object,fe=globalThis;fe.customElements??=Qe;var $t=fe.trustedTypes,cr=$t?$t.emptyScript:"",dr=fe.reactiveElementPolyfillSupport,be=(i,t)=>i,ge={toAttribute(i,t){switch(t){case Boolean:i=i?cr:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},Pe=(i,t)=>!or(i,t),Tt={attribute:!0,type:String,converter:ge,reflect:!1,useDefault:!1,hasChanged:Pe};Symbol.metadata??=Symbol("metadata"),fe.litPropertyMetadata??=new WeakMap;var H=class extends(globalThis.HTMLElement??Xe){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(t,r,e);o!==void 0&&ir(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){let{get:o,set:s}=sr(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:o,set(n){let c=o?.call(this);s?.call(this,n),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Tt}static _$Ei(){if(this.hasOwnProperty(be("elementProperties")))return;let t=lr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(be("properties"))){let e=this.properties,r=[...nr(e),...ar(e)];for(let o of r)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,o]of e)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let o=this._$Eu(e,r);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let o of r)e.unshift(tt(o))}else t!==void 0&&e.push(tt(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,r);if(o!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:ge).toAttribute(e,r.type);this._$Em=t,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,e){let r=this.constructor,o=r._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let s=r.getPropertyOptions(o),n=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ge;this._$Em=o;let c=n.fromAttribute(e,s.type);this[o]=c??this._$Ej?.get(o)??c,this._$Em=null}}requestUpdate(t,e,r,o=!1,s){if(t!==void 0){let n=this.constructor;if(o===!1&&(s=this[t]),r??=n.getPropertyOptions(t),!((r.hasChanged??Pe)(s,e)||r.useDefault&&r.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:o,wrapped:s},n){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),s!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,s]of r){let{wrapped:n}=s,c=this[o];n!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,s,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[be("elementProperties")]=new Map,H[be("finalized")]=new Map,dr?.({ReactiveElement:H}),(fe.reactiveElementVersions??=[]).push("2.1.2");var De=globalThis,Rt=i=>i,Oe=De.trustedTypes,At=Oe?Oe.createPolicy("lit-html",{createHTML:i=>i}):void 0,ot="$lit$",U=`lit$${Math.random().toFixed(9).slice(2)}$`,it="?"+U,pr=`<${it}>`,X=De.document===void 0?{createTreeWalker:()=>({})}:document,xe=()=>X.createComment(""),Se=i=>i===null||typeof i!="object"&&typeof i!="function",st=Array.isArray,Nt=i=>st(i)||typeof i?.[Symbol.iterator]=="function",rt=`[
3
+ \f\r]`,ye=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kt=/-->/g,Ct=/>/g,Y=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Pt=/'/g,Ot=/"/g,It=/^(?:script|style|textarea|title)$/i,nt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),h=nt(1),lo=nt(2),co=nt(3),B=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),Mt=new WeakMap,Z=X.createTreeWalker(X,129);function Lt(i,t){if(!st(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return At!==void 0?At.createHTML(t):t}var Wt=(i,t)=>{let e=i.length-1,r=[],o,s=t===2?"<svg>":t===3?"<math>":"",n=ye;for(let c=0;c<e;c++){let a=i[c],g,x,u=-1,v=0;for(;v<a.length&&(n.lastIndex=v,x=n.exec(a),x!==null);)v=n.lastIndex,n===ye?x[1]==="!--"?n=kt:x[1]!==void 0?n=Ct:x[2]!==void 0?(It.test(x[2])&&(o=RegExp("</"+x[2],"g")),n=Y):x[3]!==void 0&&(n=Y):n===Y?x[0]===">"?(n=o??ye,u=-1):x[1]===void 0?u=-2:(u=n.lastIndex-x[2].length,g=x[1],n=x[3]===void 0?Y:x[3]==='"'?Ot:Pt):n===Ot||n===Pt?n=Y:n===kt||n===Ct?n=ye:(n=Y,o=void 0);let m=n===Y&&i[c+1].startsWith("/>")?" ":"";s+=n===ye?a+pr:u>=0?(r.push(g),a.slice(0,u)+ot+a.slice(u)+U+m):a+U+(u===-2?c:m)}return[Lt(i,s+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},_e=class i{constructor({strings:t,_$litType$:e},r){let o;this.parts=[];let s=0,n=0,c=t.length-1,a=this.parts,[g,x]=Wt(t,e);if(this.el=i.createElement(g,r),Z.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(o=Z.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let u of o.getAttributeNames())if(u.endsWith(ot)){let v=x[n++],m=o.getAttribute(u).split(U),S=/([.?@])?(.*)/.exec(v);a.push({type:1,index:s,name:S[2],strings:m,ctor:S[1]==="."?Ne:S[1]==="?"?Ie:S[1]==="@"?Le:ee}),o.removeAttribute(u)}else u.startsWith(U)&&(a.push({type:6,index:s}),o.removeAttribute(u));if(It.test(o.tagName)){let u=o.textContent.split(U),v=u.length-1;if(v>0){o.textContent=Oe?Oe.emptyScript:"";for(let m=0;m<v;m++)o.append(u[m],xe()),Z.nextNode(),a.push({type:2,index:++s});o.append(u[v],xe())}}}else if(o.nodeType===8)if(o.data===it)a.push({type:2,index:s});else{let u=-1;for(;(u=o.data.indexOf(U,u+1))!==-1;)a.push({type:7,index:s}),u+=U.length-1}s++}}static createElement(t,e){let r=X.createElement("template");return r.innerHTML=t,r}};function Q(i,t,e=i,r){if(t===B)return t;let o=r!==void 0?e._$Co?.[r]:e._$Cl,s=Se(t)?void 0:t._$litDirective$;return o?.constructor!==s&&(o?._$AO?.(!1),s===void 0?o=void 0:(o=new s(i),o._$AT(i,e,r)),r!==void 0?(e._$Co??=[])[r]=o:e._$Cl=o),o!==void 0&&(t=Q(i,o._$AS(i,t.values),o,r)),t}var Me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,o=(t?.creationScope??X).importNode(e,!0);Z.currentNode=o;let s=Z.nextNode(),n=0,c=0,a=r[0];for(;a!==void 0;){if(n===a.index){let g;a.type===2?g=new se(s,s.nextSibling,this,t):a.type===1?g=new a.ctor(s,a.name,a.strings,this,t):a.type===6&&(g=new We(s,this,t)),this._$AV.push(g),a=r[++c]}n!==a?.index&&(s=Z.nextNode(),n++)}return Z.currentNode=X,o}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},se=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,o){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),Se(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==B&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Nt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&Se(this._$AH)?this._$AA.nextSibling.data=t:this.T(X.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=_e.createElement(Lt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(e);else{let s=new Me(o,this),n=s.u(this.options);s.p(e),this.T(n),this._$AH=s}}_$AC(t){let e=Mt.get(t.strings);return e===void 0&&Mt.set(t.strings,e=new _e(t)),e}k(t){st(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,o=0;for(let s of t)o===e.length?e.push(r=new i(this.O(xe()),this.O(xe()),this,this.options)):r=e[o],r._$AI(s),o++;o<e.length&&(this._$AR(r&&r._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=Rt(t).nextSibling;Rt(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ee=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,o,s){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,e=this,r,o){let s=this.strings,n=!1;if(s===void 0)t=Q(this,t,e,0),n=!Se(t)||t!==this._$AH&&t!==B,n&&(this._$AH=t);else{let c=t,a,g;for(t=s[0],a=0;a<s.length-1;a++)g=Q(this,c[r+a],e,a),g===B&&(g=this._$AH[a]),n||=!Se(g)||g!==this._$AH[a],g===p?t=p:t!==p&&(t+=(g??"")+s[a+1]),this._$AH[a]=g}n&&!o&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Ne=class extends ee{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},Ie=class extends ee{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},Le=class extends ee{constructor(t,e,r,o,s){super(t,e,r,o,s),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??p)===B)return;let r=this._$AH,o=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==p&&(r===p||o);o&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},We=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}},Dt={M:ot,P:U,A:it,C:1,L:Wt,R:Me,D:Nt,V:Q,I:se,H:ee,N:Ie,U:Le,B:Ne,F:We},ur=De.litHtmlPolyfillSupport;ur?.(_e,se),(De.litHtmlVersions??=[]).push("3.3.3");var Ht=(i,t,e)=>{let r=e?.renderBefore??t,o=r._$litPart$;if(o===void 0){let s=e?.renderBefore??null;r._$litPart$=o=new se(t.insertBefore(xe(),s),s,void 0,e??{})}return o._$AI(i),o};var at=globalThis,O=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ht(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};O._$litElement$=!0,O.finalized=!0,at.litElementHydrateSupport?.({LitElement:O});var hr=at.litElementPolyfillSupport;hr?.({LitElement:O});(at.litElementVersions??=[]).push("4.2.2");var mr={attribute:!0,type:String,converter:ge,reflect:!1,hasChanged:Pe},vr=(i=mr,t,e)=>{let{kind:r,metadata:o}=e,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),s.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(c){let a=t.get.call(this);t.set.call(this,c),this.requestUpdate(n,a,i,!0,c)},init(c){return c!==void 0&&this.C(n,void 0,i,c),c}}}if(r==="setter"){let{name:n}=e;return function(c){let a=this[n];t.call(this,c),this.requestUpdate(n,a,i,!0,c)}}throw Error("Unsupported decorator location: "+r)};function d(i){return(t,e)=>typeof e=="object"?vr(i,t,e):((r,o,s)=>{let n=o.hasOwnProperty(s);return o.constructor.createProperty(s,r),n?Object.getOwnPropertyDescriptor(o,s):void 0})(i,t,e)}function k(i){return d({...i,state:!0,attribute:!1})}async function Ue(i,t){let e=await i["~standard"].validate(t);return e.issues?{valid:!1,errors:e.issues.map(r=>r.message)}:{valid:!0,value:e.value,errors:[]}}function Be(i){return typeof i=="object"&&i!==null&&"~standard"in i&&typeof i["~standard"]?.validate=="function"}function Ut(){let i=typeof document<"u"?document.modelContext:void 0,t=typeof navigator<"u"?navigator.modelContext:void 0,e=i??t;return e&&typeof e.registerTool=="function"?e:void 0}function Bt(){return Ut()!==void 0}var br=globalThis.process?.env?.NODE_ENV!=="production",lt=new Set;function Ve(i){let t=Ut();if(!t?.registerTool)return()=>{};let e={name:i.name,description:i.description,inputSchema:i.inputSchema??{type:"object",properties:{}},execute:i.execute};br&&lt.has(e.name)&&console.warn(`[webmcpui] A WebMCP tool named "${e.name}" is already registered on this page. Tool names are page-global, so the host rejects the duplicate and this control won't be agent-callable. Give one control a unique \`name\`, or override it with \`tool-name\`.`),lt.add(e.name);let r=typeof AbortController=="function"?new AbortController:void 0,o=t.registerTool(e,r?{signal:r.signal}:void 0),s=!1;return()=>{if(!s){s=!0,lt.delete(e.name);try{r?.abort(),o&&typeof o.unregister=="function"?o.unregister():typeof t.unregisterTool=="function"&&t.unregisterTool(i.name)}catch{}}}}var R=class extends O{constructor(){super(...arguments);this.expose=!1;this.toolName="";this.toolDescription="";this.toolDisposer=()=>{}}toolInputSchema(){return{type:"object",properties:{}}}get toolReactiveProps(){return["expose","toolName","toolDescription"]}connectedCallback(){super.connectedCallback(),this.expose&&this.registerTool()}disconnectedCallback(){super.disconnectedCallback(),this.toolDisposer(),this.toolDisposer=()=>{}}updated(e){this.expose&&this.toolReactiveProps.some(r=>e.has(r))?this.registerTool():!this.expose&&e.has("expose")&&(this.toolDisposer(),this.toolDisposer=()=>{})}registerTool(){this.toolDisposer(),this.toolDisposer=Ve({name:this.resolvedToolName,description:this.toolDescription||this.defaultToolDescription,inputSchema:this.toolInputSchema(),execute:e=>this.executeTool(e)})}};l([d({type:Boolean})],R.prototype,"expose",2),l([d({attribute:"tool-name"})],R.prototype,"toolName",2),l([d({attribute:"tool-description"})],R.prototype,"toolDescription",2);var q=f`
5
5
  .control {
6
6
  box-sizing: border-box;
7
7
  width: 100%;
@@ -42,7 +42,7 @@ Make sure to test your application with a production build as repeat registratio
42
42
  var(--destructive, oklch(0.577 0.245 27.325))
43
43
  );
44
44
  }
45
- `,u=class extends L{constructor(){super(...arguments);this.label="";this.name="";this.value="";this.placeholder="";this.required=!1;this.disabled=!1;this.helperText="";this.requiredMessage="";this.expose=!1;this.toolName="";this.toolDescription="";this.error="";this.internals=this.attachInternals();this.toolDisposer=()=>{};this.onInvalid=()=>{this.error=this.internals.validationMessage,this.toggleAttribute("invalid",!0)}}static{this.formAssociated=!0}static{this.styles=x`
45
+ `,b=class extends R{constructor(){super(...arguments);this.label="";this.name="";this.value="";this.placeholder="";this.required=!1;this.disabled=!1;this.helperText="";this.requiredMessage="";this.error="";this.internals=this.attachInternals();this.onInvalid=()=>{this.error=this.internals.validationMessage,this.toggleAttribute("invalid",!0)}}static{this.formAssociated=!0}static{this.styles=f`
46
46
  :host {
47
47
  display: inline-flex;
48
48
  flex-direction: column;
@@ -74,52 +74,52 @@ Make sure to test your application with a production build as repeat registratio
74
74
  var(--destructive, oklch(0.577 0.245 27.325))
75
75
  );
76
76
  }
77
- `}get controlNoun(){return"field"}get control(){return this.renderRoot?.querySelector("input, textarea, select")??null}get describedBy(){return this.error?"wmcp-error":this.helperText?"wmcp-helper":void 0}connectedCallback(){super.connectedCallback(),this.syncFormValue(),this.addEventListener("invalid",this.onInvalid),this.validate(!1),this.expose&&this.registerTool()}getFormValue(){return this.value}syncFormValue(){this.internals.setFormValue(this.getFormValue())}get validationValue(){return this.value}get isEmpty(){return this.value===""}get requiredMessageDefault(){return"This field is required."}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this.onInvalid),this.toolDisposer(),this.toolDisposer=()=>{}}updated(t){this.syncFormValue(),this.expose&&(t.has("expose")||t.has("name")||t.has("toolName")||t.has("toolDescription"))&&this.registerTool()}get resolvedToolName(){return this.toolName||`fill_${this.name||this.controlNoun}`}registerTool(){this.toolDisposer();let t=this.label||this.name||this.controlNoun;this.toolDisposer=Ne({name:this.resolvedToolName,description:this.toolDescription||`Set the value of the "${t}" field.`,inputSchema:this.toolInputSchema(),execute:async r=>(await this.applyAgentValue(r),{content:[{type:"text",text:this.error?`Set "${t}" but validation failed: ${this.error}`:`Set "${t}" to "${this.stateDescription()}".`}],isError:!!this.error})})}async applyAgentValue(t){let r=t.value;await this.setValueFromAgent(r==null?"":String(r))}stateDescription(){return this.value}toolInputSchema(){return{type:"object",properties:{value:{type:"string",description:this.label||this.name||"The value to set."}},required:["value"]}}async setValueFromAgent(t){this.value=t,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}async onInput(t){this.value=t.target.value,await this.validate()}async computeValidity(){if(this.required&&this.isEmpty)return{valid:!1,message:this.requiredMessage||this.requiredMessageDefault,flags:{valueMissing:!0}};if(Me(this.schema)){let t=await Pe(this.schema,this.validationValue);if(!t.valid)return{valid:!1,message:t.errors[0]??"Invalid value",flags:{customError:!0}}}return{valid:!0,message:"",flags:{}}}async validate(t=!0){let{valid:r,message:i,flags:o}=await this.computeValidity();return r?this.internals.setValidity({}):this.internals.setValidity(o,i,this.control??void 0),t&&(this.error=r?"":i,this.toggleAttribute("invalid",!r)),r}formResetCallback(){this.value="",this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}renderMessage(){return this.error?_`<span id="wmcp-error" class="message error" role="alert"
77
+ `}get controlNoun(){return"field"}get control(){return this.renderRoot?.querySelector("input, textarea, select")??null}get describedBy(){return this.error?"wmcp-error":this.helperText?"wmcp-helper":void 0}connectedCallback(){super.connectedCallback(),this.syncFormValue(),this.addEventListener("invalid",this.onInvalid),this.validate(!1)}getFormValue(){return this.value}syncFormValue(){this.internals.setFormValue(this.getFormValue())}get validationValue(){return this.value}get isEmpty(){return this.value===""}get requiredMessageDefault(){return"This field is required."}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this.onInvalid)}updated(e){super.updated(e),this.syncFormValue()}get resolvedToolName(){return this.toolName||`fill_${this.name||this.controlNoun}`}get defaultToolDescription(){return`Set the value of the "${this.label||this.name||this.controlNoun}" field.`}get toolReactiveProps(){return[...super.toolReactiveProps,"name"]}async executeTool(e){let r=this.label||this.name||this.controlNoun;return await this.applyAgentValue(e),{content:[{type:"text",text:this.error?`Set "${r}" but validation failed: ${this.error}`:`Set "${r}" to "${this.stateDescription()}".`}],isError:!!this.error}}async applyAgentValue(e){let r=e.value;await this.setValueFromAgent(r==null?"":String(r))}stateDescription(){return this.value}toolInputSchema(){return{type:"object",properties:{value:{type:"string",description:this.label||this.name||"The value to set."}},required:["value"]}}async setValueFromAgent(e){this.value=e,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}async onInput(e){this.value=e.target.value,await this.validate()}async computeValidity(){if(this.required&&this.isEmpty)return{valid:!1,message:this.requiredMessage||this.requiredMessageDefault,flags:{valueMissing:!0}};if(Be(this.schema)){let e=await Ue(this.schema,this.validationValue);if(!e.valid)return{valid:!1,message:e.errors[0]??"Invalid value",flags:{customError:!0}}}return{valid:!0,message:"",flags:{}}}async validate(e=!0){let{valid:r,message:o,flags:s}=await this.computeValidity();return r?this.internals.setValidity({}):this.internals.setValidity(s,o,this.control??void 0),e&&(this.error=r?"":o,this.toggleAttribute("invalid",!r)),r}formResetCallback(){this.value="",this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}renderMessage(){return this.error?h`<span id="wmcp-error" class="message error" role="alert"
78
78
  >${this.error}</span
79
- >`:this.helperText?_`<span id="wmcp-helper" class="message helper"
79
+ >`:this.helperText?h`<span id="wmcp-helper" class="message helper"
80
80
  >${this.helperText}</span
81
- >`:h}render(){return _`
82
- ${this.label?_`<label for="control">${this.label}</label>`:h}
81
+ >`:p}render(){return h`
82
+ ${this.label?h`<label for="control">${this.label}</label>`:p}
83
83
  ${this.renderControl()}
84
84
  ${this.renderMessage()}
85
- `}};v([f()],u.prototype,"label",2),v([f()],u.prototype,"name",2),v([f()],u.prototype,"value",2),v([f()],u.prototype,"placeholder",2),v([f({type:Boolean,reflect:!0})],u.prototype,"required",2),v([f({type:Boolean,reflect:!0})],u.prototype,"disabled",2),v([f({attribute:"helper-text"})],u.prototype,"helperText",2),v([f({attribute:"required-message"})],u.prototype,"requiredMessage",2),v([f({type:Boolean})],u.prototype,"expose",2),v([f({attribute:"tool-name"})],u.prototype,"toolName",2),v([f({attribute:"tool-description"})],u.prototype,"toolDescription",2),v([f({attribute:!1})],u.prototype,"schema",2),v([Y()],u.prototype,"error",2);var q=class extends u{constructor(){super(...arguments);this.type="text"}static{this.tagName="wmcp-input"}static{this.styles=[u.styles,k,x`
85
+ `}};l([d()],b.prototype,"label",2),l([d()],b.prototype,"name",2),l([d()],b.prototype,"value",2),l([d()],b.prototype,"placeholder",2),l([d({type:Boolean,reflect:!0})],b.prototype,"required",2),l([d({type:Boolean,reflect:!0})],b.prototype,"disabled",2),l([d({attribute:"helper-text"})],b.prototype,"helperText",2),l([d({attribute:"required-message"})],b.prototype,"requiredMessage",2),l([d({attribute:!1})],b.prototype,"schema",2),l([k()],b.prototype,"error",2);var te=class extends b{constructor(){super(...arguments);this.type="text"}static{this.tagName="wmcp-input"}static{this.styles=[b.styles,q,f`
86
86
  .control {
87
87
  height: var(--input-height-md, 2.25rem);
88
88
  }
89
- `]}get controlNoun(){return"input"}toolInputSchema(){return{type:"object",properties:{value:{type:this.type==="number"?"number":"string",description:this.label||this.name||"The value to set."}},required:["value"]}}renderControl(){return _`
89
+ `]}get controlNoun(){return"input"}toolInputSchema(){return{type:"object",properties:{value:{type:this.type==="number"?"number":"string",description:this.label||this.name||"The value to set."}},required:["value"]}}renderControl(){return h`
90
90
  <input
91
91
  id="control"
92
92
  class="control"
93
93
  part="control"
94
94
  .type=${this.type}
95
95
  .value=${this.value}
96
- placeholder=${this.placeholder||h}
96
+ placeholder=${this.placeholder||p}
97
97
  ?required=${this.required}
98
98
  ?disabled=${this.disabled}
99
99
  aria-invalid=${this.error?"true":"false"}
100
- aria-describedby=${this.describedBy??h}
100
+ aria-describedby=${this.describedBy??p}
101
101
  @input=${this.onInput}
102
102
  />
103
- `}};v([f()],q.prototype,"type",2);var G=class extends u{constructor(){super(...arguments);this.rows=3}static{this.tagName="wmcp-textarea"}static{this.styles=[u.styles,k,x`
103
+ `}};l([d()],te.prototype,"type",2);var re=class extends b{constructor(){super(...arguments);this.rows=3}static{this.tagName="wmcp-textarea"}static{this.styles=[b.styles,q,f`
104
104
  .control {
105
105
  min-height: var(--textarea-min-height, 4.5rem);
106
106
  resize: vertical;
107
107
  }
108
- `]}get controlNoun(){return"textarea"}renderControl(){return _`
108
+ `]}get controlNoun(){return"textarea"}renderControl(){return h`
109
109
  <textarea
110
110
  id="control"
111
111
  class="control"
112
112
  part="control"
113
113
  rows=${this.rows}
114
114
  .value=${this.value}
115
- placeholder=${this.placeholder||h}
115
+ placeholder=${this.placeholder||p}
116
116
  ?required=${this.required}
117
117
  ?disabled=${this.disabled}
118
118
  aria-invalid=${this.error?"true":"false"}
119
- aria-describedby=${this.describedBy??h}
119
+ aria-describedby=${this.describedBy??p}
120
120
  @input=${this.onInput}
121
121
  ></textarea>
122
- `}};v([f({type:Number})],G.prototype,"rows",2);var Lt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},kt=s=>(...e)=>({_$litDirective$:s,values:e}),Le=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:cr}=Ot,It=s=>s;var Ut=()=>document.createComment(""),Z=(s,e,t)=>{let r=s._$AA.parentNode,i=e===void 0?s._$AB:e._$AA;if(t===void 0){let o=r.insertBefore(Ut(),i),n=r.insertBefore(Ut(),i);t=new cr(o,n,s,s.options)}else{let o=t._$AB.nextSibling,n=t._$AM,l=n!==s;if(l){let a;t._$AQ?.(s),t._$AM=s,t._$AP!==void 0&&(a=s._$AU)!==n._$AU&&t._$AP(a)}if(o!==i||l){let a=t._$AA;for(;a!==o;){let m=It(a).nextSibling;It(r).insertBefore(a,i),a=m}}}return t},I=(s,e,t=s)=>(s._$AI(e,t),s),hr={},Dt=(s,e=hr)=>s._$AH=e,Ht=s=>s._$AH,ke=s=>{s._$AR(),s._$AA.remove()};var Wt=(s,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(s[i],i);return r},Ie=kt(class extends Le{constructor(s){if(super(s),s.type!==Lt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],o=[],n=0;for(let l of s)i[n]=r?r(l,n):n,o[n]=t(l,n),n++;return{values:o,keys:i}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,r]){let i=Ht(s),{values:o,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,o;let l=this.ut??=[],a=[],m,b,c=0,p=i.length-1,d=0,y=o.length-1;for(;c<=p&&d<=y;)if(i[c]===null)c++;else if(i[p]===null)p--;else if(l[c]===n[d])a[d]=I(i[c],o[d]),c++,d++;else if(l[p]===n[y])a[y]=I(i[p],o[y]),p--,y--;else if(l[c]===n[y])a[y]=I(i[c],o[y]),Z(s,a[y+1],i[c]),c++,y--;else if(l[p]===n[d])a[d]=I(i[p],o[d]),Z(s,i[c],i[p]),p--,d++;else if(m===void 0&&(m=Wt(n,d,y),b=Wt(l,c,p)),m.has(l[c]))if(m.has(l[p])){let w=b.get(n[d]),g=w!==void 0?i[w]:null;if(g===null){let A=Z(s,i[c]);I(A,o[d]),a[d]=A}else a[d]=I(g,o[d]),Z(s,i[c],g),i[w]=null;d++}else ke(i[p]),p--;else ke(i[c]),c++;for(;d<=y;){let w=Z(s,a[y+1]);I(w,o[d]),a[d++]=w}for(;c<=p;){let w=i[c++];w!==null&&ke(w)}return this.ut=n,Dt(s,a),M}});function tt(s){return Array.isArray(s.options)}var U=class extends u{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[]}static{this.tagName="wmcp-select"}static{this.styles=[u.styles,k,x`
122
+ `}};l([d({type:Number})],re.prototype,"rows",2);var Vt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},zt=i=>(...t)=>({_$litDirective$:i,values:t}),ze=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:gr}=Dt,jt=i=>i;var qt=()=>document.createComment(""),ne=(i,t,e)=>{let r=i._$AA.parentNode,o=t===void 0?i._$AB:t._$AA;if(e===void 0){let s=r.insertBefore(qt(),o),n=r.insertBefore(qt(),o);e=new gr(s,n,i,i.options)}else{let s=e._$AB.nextSibling,n=e._$AM,c=n!==i;if(c){let a;e._$AQ?.(i),e._$AM=i,e._$AP!==void 0&&(a=i._$AU)!==n._$AU&&e._$AP(a)}if(s!==o||c){let a=e._$AA;for(;a!==s;){let g=jt(a).nextSibling;jt(r).insertBefore(a,o),a=g}}}return e},G=(i,t,e=i)=>(i._$AI(t,e),i),fr={},Gt=(i,t=fr)=>i._$AH=t,Ft=i=>i._$AH,je=i=>{i._$AR(),i._$AA.remove()};var Jt=(i,t,e)=>{let r=new Map;for(let o=t;o<=e;o++)r.set(i[o],o);return r},M=zt(class extends ze{constructor(i){if(super(i),i.type!==Vt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let o=[],s=[],n=0;for(let c of i)o[n]=r?r(c,n):n,s[n]=e(c,n),n++;return{values:s,keys:o}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,r]){let o=Ft(i),{values:s,keys:n}=this.dt(t,e,r);if(!Array.isArray(o))return this.ut=n,s;let c=this.ut??=[],a=[],g,x,u=0,v=o.length-1,m=0,S=s.length-1;for(;u<=v&&m<=S;)if(o[u]===null)u++;else if(o[v]===null)v--;else if(c[u]===n[m])a[m]=G(o[u],s[m]),u++,m++;else if(c[v]===n[S])a[S]=G(o[v],s[S]),v--,S--;else if(c[u]===n[S])a[S]=G(o[u],s[S]),ne(i,a[S+1],o[u]),u++,S--;else if(c[v]===n[m])a[m]=G(o[v],s[m]),ne(i,o[u],o[v]),v--,m++;else if(g===void 0&&(g=Jt(n,m,S),x=Jt(c,u,v)),g.has(c[u]))if(g.has(c[v])){let T=x.get(n[m]),y=T!==void 0?o[T]:null;if(y===null){let A=ne(i,o[u]);G(A,s[m]),a[m]=A}else a[m]=G(y,s[m]),ne(i,o[u],y),o[T]=null;m++}else je(o[v]),v--;else je(o[u]),u++;for(;m<=S;){let T=ne(i,a[S+1]);G(T,s[m]),a[m++]=T}for(;u<=v;){let T=o[u++];T!==null&&je(T)}return this.ut=n,Gt(i,a),B}});function ct(i){return Array.isArray(i.options)}var F=class extends b{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[]}static{this.tagName="wmcp-select"}static{this.styles=[b.styles,q,f`
123
123
  .control {
124
124
  height: var(--input-height-md, 2.25rem);
125
125
  cursor: pointer;
@@ -127,13 +127,13 @@ Make sure to test your application with a production build as repeat registratio
127
127
  .control:disabled {
128
128
  cursor: not-allowed;
129
129
  }
130
- `]}get controlNoun(){return"select"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(t){t.has("options")&&this.syncOptions()}updated(t){super.updated(t),this.expose&&t.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){let t=i=>({value:i.value,label:i.textContent?.trim()||i.value,disabled:i.disabled}),r=[];for(let i of Array.from(this.children))i instanceof HTMLOptGroupElement?r.push({label:i.label,options:Array.from(i.querySelectorAll("option")).map(t)}):i instanceof HTMLOptionElement&&r.push(t(i));return r}flatOptions(){return this.resolvedOptions.flatMap(t=>tt(t)?t.options:[t])}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.flatOptions().map(t=>t.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}renderOption(t){return _`<option
131
- value=${t.value}
132
- ?disabled=${t.disabled??!1}
133
- ?selected=${t.value===this.value}
130
+ `]}get controlNoun(){return"select"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(e){e.has("options")&&this.syncOptions()}updated(e){super.updated(e),this.expose&&e.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){let e=o=>({value:o.value,label:o.textContent?.trim()||o.value,disabled:o.disabled}),r=[];for(let o of Array.from(this.children))o instanceof HTMLOptGroupElement?r.push({label:o.label,options:Array.from(o.querySelectorAll("option")).map(e)}):o instanceof HTMLOptionElement&&r.push(e(o));return r}flatOptions(){return this.resolvedOptions.flatMap(e=>ct(e)?e.options:[e])}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.flatOptions().map(e=>e.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}renderOption(e){return h`<option
131
+ value=${e.value}
132
+ ?disabled=${e.disabled??!1}
133
+ ?selected=${e.value===this.value}
134
134
  >
135
- ${t.label}
136
- </option>`}renderControl(){return _`
135
+ ${e.label}
136
+ </option>`}renderControl(){return h`
137
137
  <select
138
138
  id="control"
139
139
  class="control"
@@ -141,17 +141,17 @@ Make sure to test your application with a production build as repeat registratio
141
141
  ?required=${this.required}
142
142
  ?disabled=${this.disabled}
143
143
  aria-invalid=${this.error?"true":"false"}
144
- aria-describedby=${this.describedBy??h}
144
+ aria-describedby=${this.describedBy??p}
145
145
  @change=${this.onInput}
146
146
  >
147
- ${this.placeholder?_`<option value="" disabled ?selected=${!this.value}>
147
+ ${this.placeholder?h`<option value="" disabled ?selected=${!this.value}>
148
148
  ${this.placeholder}
149
- </option>`:h}
150
- ${Ie(this.resolvedOptions,(t,r)=>tt(t)?`g:${t.label}:${r}`:`o:${t.value}`,t=>tt(t)?_`<optgroup label=${t.label}>
151
- ${t.options.map(r=>this.renderOption(r))}
152
- </optgroup>`:this.renderOption(t))}
149
+ </option>`:p}
150
+ ${M(this.resolvedOptions,(e,r)=>ct(e)?`g:${e.label}:${r}`:`o:${e.value}`,e=>ct(e)?h`<optgroup label=${e.label}>
151
+ ${e.options.map(r=>this.renderOption(r))}
152
+ </optgroup>`:this.renderOption(e))}
153
153
  </select>
154
- `}};v([f({attribute:!1})],U.prototype,"options",2),v([Y()],U.prototype,"resolvedOptions",2);var F=class extends u{constructor(){super();this.checked=!1;this.defaultChecked=!1;this.value="on"}static{this.tagName="wmcp-checkbox"}static{this.styles=[u.styles,x`
154
+ `}};l([d({attribute:!1})],F.prototype,"options",2),l([k()],F.prototype,"resolvedOptions",2);var oe=class extends b{constructor(){super();this.checked=!1;this.defaultChecked=!1;this.value="on"}static{this.tagName="wmcp-checkbox"}static{this.styles=[b.styles,f`
155
155
  .row {
156
156
  display: inline-flex;
157
157
  align-items: center;
@@ -184,7 +184,7 @@ Make sure to test your application with a production build as repeat registratio
184
184
  font-size: var(--input-font-size, 0.875rem);
185
185
  color: var(--input-text, var(--foreground, oklch(0.145 0 0)));
186
186
  }
187
- `]}get controlNoun(){return"checkbox"}connectedCallback(){this.defaultChecked=this.checked,super.connectedCallback()}getFormValue(){return this.checked?this.value:null}get validationValue(){return this.checked}get isEmpty(){return!this.checked}get requiredMessageDefault(){return"Please check this box."}toolInputSchema(){return{type:"object",properties:{checked:{type:"boolean",description:this.label||this.name||"Whether the box is checked."}},required:["checked"]}}async applyAgentValue(t){this.checked=!!t.checked,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}stateDescription(){return this.checked?"checked":"unchecked"}formResetCallback(){this.checked=this.defaultChecked,this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}async onToggle(t){this.checked=t.target.checked,await this.validate()}renderControl(){return _`
187
+ `]}get controlNoun(){return"checkbox"}connectedCallback(){this.defaultChecked=this.checked,super.connectedCallback()}getFormValue(){return this.checked?this.value:null}get validationValue(){return this.checked}get isEmpty(){return!this.checked}get requiredMessageDefault(){return"Please check this box."}toolInputSchema(){return{type:"object",properties:{checked:{type:"boolean",description:this.label||this.name||"Whether the box is checked."}},required:["checked"]}}async applyAgentValue(e){this.checked=!!e.checked,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}stateDescription(){return this.checked?"checked":"unchecked"}formResetCallback(){this.checked=this.defaultChecked,this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}async onToggle(e){this.checked=e.target.checked,await this.validate()}renderControl(){return h`
188
188
  <input
189
189
  id="control"
190
190
  class="control"
@@ -194,16 +194,16 @@ Make sure to test your application with a production build as repeat registratio
194
194
  ?required=${this.required}
195
195
  ?disabled=${this.disabled}
196
196
  aria-invalid=${this.error?"true":"false"}
197
- aria-describedby=${this.describedBy??h}
197
+ aria-describedby=${this.describedBy??p}
198
198
  @change=${this.onToggle}
199
199
  />
200
- `}render(){return _`
200
+ `}render(){return h`
201
201
  <label class="row">
202
202
  ${this.renderControl()}
203
- ${this.label?_`<span class="label-text">${this.label}</span>`:h}
203
+ ${this.label?h`<span class="label-text">${this.label}</span>`:p}
204
204
  </label>
205
205
  ${this.renderMessage()}
206
- `}};v([f({type:Boolean,reflect:!0})],F.prototype,"checked",2);var dr=0,X=class extends HTMLElement{static{this.tagName="wmcp-radio"}get value(){return this.getAttribute("value")??""}get label(){return this.getAttribute("label")??this.textContent?.trim()??""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.style.display="none"}},D=class extends u{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[];this.groupName=`wmcp-radio-${++dr}`}static{this.tagName="wmcp-radio-group"}static{this.styles=[u.styles,x`
206
+ `}};l([d({type:Boolean,reflect:!0})],oe.prototype,"checked",2);var yr=0,ae=class extends HTMLElement{static{this.tagName="wmcp-radio"}get value(){return this.getAttribute("value")??""}get label(){return this.getAttribute("label")??this.textContent?.trim()??""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.style.display="none"}},J=class extends b{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[];this.groupName=`wmcp-radio-${++yr}`}static{this.tagName="wmcp-radio-group"}static{this.styles=[b.styles,f`
207
207
  .group-label {
208
208
  font-size: var(--input-font-size-label, 0.875rem);
209
209
  font-weight: var(--input-font-weight-label, 500);
@@ -246,35 +246,689 @@ Make sure to test your application with a production build as repeat registratio
246
246
  font-size: var(--input-font-size, 0.875rem);
247
247
  color: var(--input-text, var(--foreground, oklch(0.145 0 0)));
248
248
  }
249
- `]}get controlNoun(){return"radio"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(t){t.has("options")&&this.syncOptions()}updated(t){super.updated(t),this.expose&&t.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){return Array.from(this.querySelectorAll(":scope > wmcp-radio")).map(t=>({value:t.getAttribute("value")??"",label:t.getAttribute("label")??t.textContent?.trim()??"",disabled:t.hasAttribute("disabled")}))}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.resolvedOptions.map(t=>t.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}async onSelect(t){this.value=t.target.value,await this.validate()}renderControl(){return _`
249
+ `]}get controlNoun(){return"radio"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(e){e.has("options")&&this.syncOptions()}updated(e){super.updated(e),this.expose&&e.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){return Array.from(this.querySelectorAll(":scope > wmcp-radio")).map(e=>({value:e.getAttribute("value")??"",label:e.getAttribute("label")??e.textContent?.trim()??"",disabled:e.hasAttribute("disabled")}))}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.resolvedOptions.map(e=>e.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}async onSelect(e){this.value=e.target.value,await this.validate()}renderControl(){return h`
250
250
  <div
251
251
  class="group"
252
252
  role="radiogroup"
253
- aria-labelledby=${this.label?"group-label":h}
254
- aria-describedby=${this.describedBy??h}
253
+ aria-labelledby=${this.label?"group-label":p}
254
+ aria-describedby=${this.describedBy??p}
255
255
  aria-invalid=${this.error?"true":"false"}
256
256
  >
257
- ${Ie(this.resolvedOptions,t=>t.value,t=>_`
257
+ ${M(this.resolvedOptions,e=>e.value,e=>h`
258
258
  <label class="row">
259
259
  <input
260
260
  type="radio"
261
261
  class="control"
262
262
  part="control"
263
263
  name=${this.groupName}
264
- value=${t.value}
265
- ?disabled=${t.disabled??this.disabled}
266
- .checked=${t.value===this.value}
264
+ value=${e.value}
265
+ ?disabled=${e.disabled??this.disabled}
266
+ .checked=${e.value===this.value}
267
267
  @change=${this.onSelect}
268
268
  />
269
- <span class="label-text">${t.label}</span>
269
+ <span class="label-text">${e.label}</span>
270
270
  </label>
271
271
  `)}
272
272
  </div>
273
- `}render(){return _`
274
- ${this.label?_`<span id="group-label" class="group-label">${this.label}</span>`:h}
273
+ `}render(){return h`
274
+ ${this.label?h`<span id="group-label" class="group-label">${this.label}</span>`:p}
275
275
  ${this.renderControl()}
276
276
  ${this.renderMessage()}
277
- `}};v([f({attribute:!1})],D.prototype,"options",2),v([Y()],D.prototype,"resolvedOptions",2);var ur=[q,G,U,F,X,D];function Ue(){if(!(typeof customElements>"u"))for(let s of ur)customElements.get(s.tagName)||customElements.define(s.tagName,s)}Ue();return qt(pr);})();
277
+ `}};l([d({attribute:!1})],J.prototype,"options",2),l([k()],J.prototype,"resolvedOptions",2);var E=class extends R{constructor(){super(...arguments);this.name="";this.label=""}get defaultNameSuffix(){return"element"}get actionNoun(){return this.label||this.name||this.defaultNameSuffix}get resolvedToolName(){return this.toolName||`${this.actionVerb}_${this.name||this.defaultNameSuffix}`}get defaultToolDescription(){return`Activate the "${this.actionNoun}".`}get toolReactiveProps(){return[...super.toolReactiveProps,"name","label"]}};l([d()],E.prototype,"name",2),l([d()],E.prototype,"label",2);var N=class extends E{constructor(){super(...arguments);this.variant="primary";this.size="md";this.type="button";this.disabled=!1;this.internals=this.attachInternals()}static{this.tagName="wmcp-button"}static{this.formAssociated=!0}static{this.shadowRootOptions={...O.shadowRootOptions,delegatesFocus:!0}}static{this.styles=f`
278
+ :host {
279
+ display: inline-block;
280
+ font-family: var(
281
+ --button-font-family,
282
+ var(--input-font-family, ui-sans-serif, system-ui, sans-serif)
283
+ );
284
+ }
285
+ :host([hidden]) {
286
+ display: none;
287
+ }
288
+ .control {
289
+ box-sizing: border-box;
290
+ display: inline-flex;
291
+ align-items: center;
292
+ justify-content: center;
293
+ gap: var(--button-gap, 0.5rem);
294
+ width: 100%;
295
+ font-family: inherit;
296
+ font-size: var(--button-font-size, 0.875rem);
297
+ font-weight: var(--button-font-weight, 500);
298
+ line-height: 1;
299
+ white-space: nowrap;
300
+ cursor: pointer;
301
+ user-select: none;
302
+ border: var(--button-border-width, 1px) solid transparent;
303
+ border-radius: var(--button-radius, var(--radius, 0.625rem));
304
+ transition: background-color var(--button-transition-duration, 150ms)
305
+ var(--button-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
306
+ color var(--button-transition-duration, 150ms)
307
+ var(--button-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
308
+ border-color var(--button-transition-duration, 150ms)
309
+ var(--button-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
310
+ box-shadow var(--button-transition-duration, 150ms)
311
+ var(--button-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
312
+ }
313
+ /* Sizes */
314
+ :host([size='sm']) .control {
315
+ height: var(--button-height-sm, 2rem);
316
+ padding-inline: var(--button-padding-x-sm, 0.75rem);
317
+ }
318
+ .control {
319
+ height: var(--button-height-md, 2.25rem);
320
+ padding-inline: var(--button-padding-x-md, 1rem);
321
+ }
322
+ :host([size='lg']) .control {
323
+ height: var(--button-height-lg, 2.5rem);
324
+ padding-inline: var(--button-padding-x-lg, 1.5rem);
325
+ }
326
+ /* Primary (default) */
327
+ .control {
328
+ color: var(--button-primary-text, var(--primary-foreground, oklch(0.985 0 0)));
329
+ background: var(--button-primary-bg, var(--primary, oklch(0.205 0 0)));
330
+ }
331
+ .control:hover:not(:disabled) {
332
+ background: var(
333
+ --button-primary-bg-hover,
334
+ color-mix(in oklch, var(--primary, oklch(0.205 0 0)) 90%, transparent)
335
+ );
336
+ }
337
+ /* Secondary */
338
+ :host([variant='secondary']) .control {
339
+ color: var(--button-secondary-text, var(--secondary-foreground, oklch(0.205 0 0)));
340
+ background: var(--button-secondary-bg, var(--secondary, oklch(0.97 0 0)));
341
+ }
342
+ :host([variant='secondary']) .control:hover:not(:disabled) {
343
+ background: var(
344
+ --button-secondary-bg-hover,
345
+ color-mix(in oklch, var(--secondary, oklch(0.97 0 0)) 80%, var(--foreground, oklch(0.145 0 0)))
346
+ );
347
+ }
348
+ /* Destructive */
349
+ :host([variant='destructive']) .control {
350
+ color: var(--button-destructive-text, var(--destructive-foreground, oklch(0.985 0 0)));
351
+ background: var(--button-destructive-bg, var(--destructive, oklch(0.577 0.245 27.325)));
352
+ }
353
+ :host([variant='destructive']) .control:hover:not(:disabled) {
354
+ background: var(
355
+ --button-destructive-bg-hover,
356
+ color-mix(in oklch, var(--destructive, oklch(0.577 0.245 27.325)) 90%, transparent)
357
+ );
358
+ }
359
+ /* Outline */
360
+ :host([variant='outline']) .control {
361
+ color: var(--button-outline-text, var(--foreground, oklch(0.145 0 0)));
362
+ background: var(--button-outline-bg, var(--background, oklch(1 0 0)));
363
+ border-color: var(--button-outline-border, var(--border, oklch(0.922 0 0)));
364
+ }
365
+ :host([variant='outline']) .control:hover:not(:disabled) {
366
+ background: var(--button-outline-bg-hover, var(--accent, oklch(0.97 0 0)));
367
+ color: var(--button-outline-text-hover, var(--accent-foreground, oklch(0.205 0 0)));
368
+ }
369
+ /* Ghost */
370
+ :host([variant='ghost']) .control {
371
+ color: var(--button-ghost-text, var(--foreground, oklch(0.145 0 0)));
372
+ background: transparent;
373
+ }
374
+ :host([variant='ghost']) .control:hover:not(:disabled) {
375
+ background: var(--button-ghost-bg-hover, var(--accent, oklch(0.97 0 0)));
376
+ color: var(--button-ghost-text-hover, var(--accent-foreground, oklch(0.205 0 0)));
377
+ }
378
+ /* Focus + disabled (shared across variants) */
379
+ .control:focus-visible {
380
+ outline: none;
381
+ box-shadow: 0 0 0 var(--ring-width, 3px)
382
+ color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
383
+ }
384
+ .control:disabled {
385
+ opacity: var(--button-disabled-opacity, 0.5);
386
+ cursor: not-allowed;
387
+ }
388
+ `}get button(){return this.renderRoot?.querySelector("button")??null}get actionVerb(){return"click"}get defaultNameSuffix(){return"button"}get actionNoun(){return this.label||this.textContent?.trim()||this.name||"button"}get defaultToolDescription(){return`Click the "${this.actionNoun}" button.`}executeTool(){let e=this.actionNoun;if(this.disabled)return{content:[{type:"text",text:`The "${e}" button is disabled and can't be activated.`}],isError:!0};this.activate();let r=this.type==="submit"?" (submitted the form)":this.type==="reset"?" (reset the form)":"";return{content:[{type:"text",text:`Clicked the "${e}" button${r}.`}]}}activate(){this.button?.click()}onInnerClick(){this.disabled||(this.type==="submit"?this.internals.form?.requestSubmit():this.type==="reset"&&this.internals.form?.reset())}render(){return h`
389
+ <button
390
+ class="control"
391
+ part="control"
392
+ type="button"
393
+ ?disabled=${this.disabled}
394
+ aria-label=${this.label||p}
395
+ @click=${this.onInnerClick}
396
+ >
397
+ <slot></slot>
398
+ </button>
399
+ `}};l([d({reflect:!0})],N.prototype,"variant",2),l([d({reflect:!0})],N.prototype,"size",2),l([d()],N.prototype,"type",2),l([d({type:Boolean,reflect:!0})],N.prototype,"disabled",2);var V=class extends E{constructor(){super(...arguments);this.open=!1;this.modal=!0;this.staticBackdrop=!1;this.returnValue=""}static{this.tagName="wmcp-dialog"}static{this.styles=f`
400
+ :host {
401
+ display: contents;
402
+ }
403
+ dialog {
404
+ box-sizing: border-box;
405
+ width: var(--dialog-width, min(92vw, 32rem));
406
+ max-width: var(--dialog-max-width, 32rem);
407
+ max-height: var(--dialog-max-height, 85dvh);
408
+ color: var(--dialog-text, var(--popover-foreground, oklch(0.145 0 0)));
409
+ background: var(--dialog-bg, var(--popover, oklch(1 0 0)));
410
+ border: var(--dialog-border-width, 1px) solid
411
+ var(--dialog-border, var(--border, oklch(0.922 0 0)));
412
+ border-radius: var(--dialog-radius, var(--radius, 0.625rem));
413
+ box-shadow: var(
414
+ --dialog-shadow,
415
+ 0 10px 38px -10px color-mix(in oklch, oklch(0 0 0) 35%, transparent),
416
+ 0 10px 20px -15px color-mix(in oklch, oklch(0 0 0) 20%, transparent)
417
+ );
418
+ font-family: var(
419
+ --dialog-font-family,
420
+ ui-sans-serif,
421
+ system-ui,
422
+ sans-serif
423
+ );
424
+ overflow: auto;
425
+ }
426
+ dialog::backdrop {
427
+ background: var(
428
+ --dialog-backdrop,
429
+ color-mix(in oklch, oklch(0 0 0) 50%, transparent)
430
+ );
431
+ }
432
+ /* Padding lives on the panel, not the dialog, so the dialog's box is the
433
+ panel's box — a click whose target is the <dialog> is unambiguously the
434
+ backdrop, never the dialog's own visible frame. */
435
+ .panel {
436
+ padding: var(--dialog-padding, 1.5rem);
437
+ }
438
+ /* Modern-CSS entrance: fade + lift, honoring reduced-motion. */
439
+ @media (prefers-reduced-motion: no-preference) {
440
+ dialog,
441
+ dialog::backdrop {
442
+ transition: opacity var(--dialog-transition-duration, 180ms)
443
+ var(--dialog-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
444
+ translate var(--dialog-transition-duration, 180ms)
445
+ var(--dialog-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
446
+ overlay var(--dialog-transition-duration, 180ms) allow-discrete,
447
+ display var(--dialog-transition-duration, 180ms) allow-discrete;
448
+ }
449
+ dialog:not([open]),
450
+ dialog:not([open])::backdrop {
451
+ opacity: 0;
452
+ }
453
+ dialog:not([open]) {
454
+ translate: 0 0.5rem;
455
+ }
456
+ @starting-style {
457
+ dialog[open],
458
+ dialog[open]::backdrop {
459
+ opacity: 0;
460
+ }
461
+ dialog[open] {
462
+ translate: 0 0.5rem;
463
+ }
464
+ }
465
+ }
466
+ `}get dialogEl(){return this.renderRoot?.querySelector("dialog")??null}get actionVerb(){return"open"}get defaultNameSuffix(){return"dialog"}get defaultToolDescription(){return`Open the "${this.actionNoun}" dialog for the user to review.`}executeTool(){let e=this.actionNoun;return this.open?{content:[{type:"text",text:`The "${e}" dialog is already open.`}]}:(this.show(),{content:[{type:"text",text:`Opened the "${e}" dialog for the user to review.`}]})}updated(e){super.updated(e),e.has("open")&&this.syncNativeOpen()}show(){this.open=!0}close(e){e!==void 0&&(this.returnValue=e),this.open=!1}syncNativeOpen(){let e=this.dialogEl;e&&(this.open&&!e.open?(this.modal?e.showModal():e.show(),this.dispatchEvent(new Event("open",{bubbles:!0,composed:!0}))):!this.open&&e.open&&e.close(this.returnValue))}onNativeClose(){this.returnValue=this.dialogEl?.returnValue??this.returnValue,this.open&&(this.open=!1),this.dispatchEvent(new Event("close",{bubbles:!0,composed:!0}))}onDialogClick(e){this.staticBackdrop||e.target===this.dialogEl&&this.close()}render(){return h`
467
+ <dialog
468
+ part="dialog"
469
+ aria-label=${this.label||this.actionNoun}
470
+ @close=${this.onNativeClose}
471
+ @click=${this.onDialogClick}
472
+ >
473
+ <div class="panel" part="panel">
474
+ <slot></slot>
475
+ </div>
476
+ </dialog>
477
+ `}};l([d({type:Boolean,reflect:!0})],V.prototype,"open",2),l([d({type:Boolean})],V.prototype,"modal",2),l([d({type:Boolean,attribute:"static-backdrop"})],V.prototype,"staticBackdrop",2);var I=class extends E{constructor(){super(...arguments);this.label="";this.items=[];this.open=!1;this.resolvedItems=[]}static{this.tagName="wmcp-menu"}static{this.styles=f`
478
+ :host {
479
+ display: inline-block;
480
+ font-family: var(
481
+ --menu-font-family,
482
+ var(--input-font-family, ui-sans-serif, system-ui, sans-serif)
483
+ );
484
+ }
485
+ :host([hidden]) {
486
+ display: none;
487
+ }
488
+ .trigger {
489
+ box-sizing: border-box;
490
+ display: inline-flex;
491
+ align-items: center;
492
+ gap: var(--menu-trigger-gap, 0.375rem);
493
+ height: var(--menu-trigger-height, 2.25rem);
494
+ padding-inline: var(--menu-trigger-padding-x, 1rem);
495
+ font: inherit;
496
+ font-size: var(--menu-font-size, 0.875rem);
497
+ font-weight: var(--menu-trigger-font-weight, 500);
498
+ color: var(--menu-trigger-text, var(--foreground, oklch(0.145 0 0)));
499
+ background: var(--menu-trigger-bg, var(--background, oklch(1 0 0)));
500
+ border: 1px solid var(--menu-trigger-border, var(--border, oklch(0.922 0 0)));
501
+ border-radius: var(--menu-radius, var(--radius, 0.625rem));
502
+ cursor: pointer;
503
+ anchor-name: --wmcp-menu-anchor;
504
+ }
505
+ .trigger:hover {
506
+ background: var(--menu-trigger-bg-hover, var(--accent, oklch(0.97 0 0)));
507
+ }
508
+ .trigger:focus-visible {
509
+ outline: none;
510
+ box-shadow: 0 0 0 var(--ring-width, 3px)
511
+ color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
512
+ }
513
+ .caret {
514
+ width: 0.75rem;
515
+ height: 0.75rem;
516
+ transition: rotate 150ms cubic-bezier(0.4, 0, 0.2, 1);
517
+ }
518
+ .trigger[aria-expanded='true'] .caret {
519
+ rotate: 180deg;
520
+ }
521
+ .menu {
522
+ box-sizing: border-box;
523
+ min-width: var(--menu-min-width, 11rem);
524
+ margin: 0;
525
+ padding: var(--menu-padding, 0.25rem);
526
+ color: var(--menu-text, var(--popover-foreground, oklch(0.145 0 0)));
527
+ background: var(--menu-bg, var(--popover, oklch(1 0 0)));
528
+ border: 1px solid var(--menu-border, var(--border, oklch(0.922 0 0)));
529
+ border-radius: var(--menu-radius, var(--radius, 0.625rem));
530
+ box-shadow: var(
531
+ --menu-shadow,
532
+ 0 10px 38px -10px color-mix(in oklch, oklch(0 0 0) 35%, transparent)
533
+ );
534
+ /* Anchor the popover under the trigger; margin is the no-anchor fallback. */
535
+ position-anchor: --wmcp-menu-anchor;
536
+ inset: auto;
537
+ top: anchor(bottom);
538
+ left: anchor(left);
539
+ margin-top: var(--menu-offset, 0.25rem);
540
+ }
541
+ @media (prefers-reduced-motion: no-preference) {
542
+ .menu {
543
+ transition: opacity 130ms ease, translate 130ms ease,
544
+ overlay 130ms allow-discrete, display 130ms allow-discrete;
545
+ }
546
+ .menu:not(:popover-open) {
547
+ opacity: 0;
548
+ translate: 0 -0.25rem;
549
+ }
550
+ @starting-style {
551
+ .menu:popover-open {
552
+ opacity: 0;
553
+ translate: 0 -0.25rem;
554
+ }
555
+ }
556
+ }
557
+ .item {
558
+ display: flex;
559
+ width: 100%;
560
+ align-items: center;
561
+ gap: var(--menu-item-gap, 0.5rem);
562
+ padding: var(--menu-item-padding, 0.4rem 0.6rem);
563
+ font: inherit;
564
+ font-size: var(--menu-font-size, 0.875rem);
565
+ color: inherit;
566
+ text-align: start;
567
+ background: transparent;
568
+ border: 0;
569
+ border-radius: var(--menu-item-radius, 0.4rem);
570
+ cursor: pointer;
571
+ }
572
+ .item:hover:not(:disabled),
573
+ .item:focus-visible {
574
+ outline: none;
575
+ background: var(--menu-item-bg-hover, var(--accent, oklch(0.97 0 0)));
576
+ color: var(--menu-item-text-hover, var(--accent-foreground, oklch(0.205 0 0)));
577
+ }
578
+ .item:disabled {
579
+ opacity: var(--menu-item-disabled-opacity, 0.5);
580
+ cursor: not-allowed;
581
+ }
582
+ `}get menuEl(){return this.renderRoot?.querySelector(".menu")??null}get itemButtons(){return Array.from(this.renderRoot?.querySelectorAll(".item")??[])}get actionVerb(){return"select"}get defaultNameSuffix(){return"menu"}get actionNoun(){return this.label||this.name||"menu"}get defaultToolDescription(){return`Select an item from the "${this.actionNoun}" menu.`}get toolReactiveProps(){return[...super.toolReactiveProps,"resolvedItems"]}toolInputSchema(){return{type:"object",properties:{item:{type:"string",enum:this.resolvedItems.filter(e=>!e.disabled).map(e=>e.value),description:`Which item to select from the "${this.actionNoun}" menu.`}},required:["item"]}}executeTool(e){let r=e.item==null?"":String(e.item),o=this.resolvedItems.find(s=>s.value===r);return o?o.disabled?{content:[{type:"text",text:`The "${o.label}" item is disabled.`}],isError:!0}:(this.selectItem(o),{content:[{type:"text",text:`Selected "${o.label}" from the "${this.actionNoun}" menu.`}]}):{content:[{type:"text",text:`No item "${r}" in the "${this.actionNoun}" menu.`}],isError:!0}}connectedCallback(){this.syncItems(),super.connectedCallback(),this.itemObserver=new MutationObserver(()=>this.syncItems()),this.itemObserver.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.itemObserver?.disconnect(),this.itemObserver=void 0}willUpdate(e){e.has("items")&&this.syncItems()}syncItems(){this.resolvedItems=this.items.length>0?this.items:this.readDeclarativeItems()}readDeclarativeItems(){return Array.from(this.querySelectorAll("option")).map(e=>({value:e.value,label:e.textContent?.trim()||e.value,disabled:e.disabled}))}selectItem(e){this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,label:e.label},bubbles:!0,composed:!0})),this.menuEl?.hidePopover()}onItemClick(e){e.disabled||this.selectItem(e)}onToggle(e){this.open=e.newState==="open",this.open&&this.itemButtons.find(r=>!r.disabled)?.focus()}onMenuKeydown(e){let r=this.itemButtons.filter(n=>!n.disabled);if(r.length===0)return;let o=r.indexOf(this.shadowRoot?.activeElement),s=-1;switch(e.key){case"ArrowDown":s=o<0?0:(o+1)%r.length;break;case"ArrowUp":s=o<=0?r.length-1:o-1;break;case"Home":s=0;break;case"End":s=r.length-1;break;default:return}e.preventDefault(),r[s]?.focus()}render(){return h`
583
+ <button
584
+ type="button"
585
+ class="trigger"
586
+ part="trigger"
587
+ popovertarget="menu-pop"
588
+ aria-haspopup="menu"
589
+ aria-expanded=${this.open?"true":"false"}
590
+ >
591
+ <span>${this.label||"Menu"}</span>
592
+ <svg class="caret" viewBox="0 0 16 16" aria-hidden="true">
593
+ <path
594
+ d="M4 6l4 4 4-4"
595
+ fill="none"
596
+ stroke="currentColor"
597
+ stroke-width="1.5"
598
+ stroke-linecap="round"
599
+ stroke-linejoin="round"
600
+ />
601
+ </svg>
602
+ </button>
603
+ <div
604
+ id="menu-pop"
605
+ class="menu"
606
+ part="menu"
607
+ popover="auto"
608
+ role="menu"
609
+ aria-label=${this.label||"Menu"}
610
+ @toggle=${this.onToggle}
611
+ @keydown=${this.onMenuKeydown}
612
+ >
613
+ ${this.resolvedItems.length===0?p:M(this.resolvedItems,e=>e.value,e=>h`
614
+ <button
615
+ type="button"
616
+ class="item"
617
+ role="menuitem"
618
+ part="item"
619
+ ?disabled=${e.disabled??!1}
620
+ @click=${()=>this.onItemClick(e)}
621
+ >
622
+ ${e.label}
623
+ </button>
624
+ `)}
625
+ </div>
626
+ `}};l([d()],I.prototype,"label",2),l([d({attribute:!1})],I.prototype,"items",2),l([d({type:Boolean,reflect:!0})],I.prototype,"open",2),l([k()],I.prototype,"resolvedItems",2);var z=class extends E{constructor(){super(...arguments);this.active="";this.label="";this.tabs=[]}static{this.tagName="wmcp-tabs"}static{this.styles=f`
627
+ :host {
628
+ display: block;
629
+ font-family: var(
630
+ --tabs-font-family,
631
+ var(--input-font-family, ui-sans-serif, system-ui, sans-serif)
632
+ );
633
+ }
634
+ :host([hidden]) {
635
+ display: none;
636
+ }
637
+ [role='tablist'] {
638
+ display: flex;
639
+ gap: var(--tabs-gap, 0.25rem);
640
+ border-bottom: 1px solid var(--tabs-border, var(--border, oklch(0.922 0 0)));
641
+ }
642
+ .tab {
643
+ position: relative;
644
+ appearance: none;
645
+ border: 0;
646
+ background: transparent;
647
+ padding: var(--tabs-tab-padding, 0.5rem 0.875rem);
648
+ margin-bottom: -1px;
649
+ font: inherit;
650
+ font-size: var(--tabs-font-size, 0.875rem);
651
+ font-weight: var(--tabs-font-weight, 500);
652
+ color: var(--tabs-tab-text, var(--muted-foreground, oklch(0.556 0 0)));
653
+ cursor: pointer;
654
+ border-bottom: 2px solid transparent;
655
+ transition: color 150ms ease, border-color 150ms ease;
656
+ }
657
+ .tab:hover:not(:disabled) {
658
+ color: var(--tabs-tab-text-hover, var(--foreground, oklch(0.145 0 0)));
659
+ }
660
+ .tab[aria-selected='true'] {
661
+ color: var(--tabs-tab-text-active, var(--foreground, oklch(0.145 0 0)));
662
+ border-bottom-color: var(--tabs-indicator, var(--primary, oklch(0.205 0 0)));
663
+ }
664
+ .tab:focus-visible {
665
+ outline: none;
666
+ border-radius: 0.375rem;
667
+ box-shadow: 0 0 0 var(--ring-width, 3px)
668
+ color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
669
+ }
670
+ .tab:disabled {
671
+ opacity: var(--tabs-tab-disabled-opacity, 0.5);
672
+ cursor: not-allowed;
673
+ }
674
+ .panels {
675
+ padding-top: var(--tabs-panel-padding-top, 1rem);
676
+ }
677
+ `}get actionVerb(){return"switch"}get defaultNameSuffix(){return"tabs"}get actionNoun(){return this.label||this.name||"tabs"}get defaultToolDescription(){return`Switch the active tab in the "${this.actionNoun}" tabs.`}get toolReactiveProps(){return[...super.toolReactiveProps,"tabs"]}toolInputSchema(){return{type:"object",properties:{tab:{type:"string",enum:this.tabs.filter(e=>!e.disabled).map(e=>e.value),description:`Which tab to switch to in the "${this.actionNoun}" tabs.`}},required:["tab"]}}executeTool(e){let r=e.tab==null?"":String(e.tab),o=this.tabs.find(s=>s.value===r);return o?o.disabled?{content:[{type:"text",text:`The "${o.label}" tab is disabled.`}],isError:!0}:(this.switchTo(o.value),{content:[{type:"text",text:`Switched to the "${o.label}" tab in the "${this.actionNoun}" tabs.`}]}):{content:[{type:"text",text:`No tab "${r}" in the "${this.actionNoun}" tabs.`}],isError:!0}}connectedCallback(){this.syncTabs(),this.ensureActive(),super.connectedCallback(),this.panelObserver=new MutationObserver(()=>{this.syncTabs(),this.ensureActive()}),this.panelObserver.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.panelObserver?.disconnect(),this.panelObserver=void 0}updated(e){super.updated(e),(e.has("active")||e.has("tabs"))&&this.applyPanels()}get panelEls(){return Array.from(this.querySelectorAll("[tab]"))}syncTabs(){this.tabs=this.panelEls.map(e=>({value:e.getAttribute("tab")??"",label:e.getAttribute("tab-label")||e.getAttribute("tab")||"",disabled:e.hasAttribute("tab-disabled")}))}ensureActive(){this.tabs.some(r=>r.value===this.active&&!r.disabled)||(this.active=this.tabs.find(r=>!r.disabled)?.value??"")}applyPanels(){for(let e of this.panelEls){let r=e.getAttribute("tab")??"",o=this.tabs.find(s=>s.value===r);e.setAttribute("role","tabpanel"),e.setAttribute("tabindex","0"),o?.label&&e.setAttribute("aria-label",o.label),e.toggleAttribute("hidden",r!==this.active)}}switchTo(e){e!==this.active&&(this.active=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})))}get tabButtons(){return Array.from(this.renderRoot?.querySelectorAll(".tab")??[])}onKeydown(e){let r=this.tabs.filter(a=>!a.disabled);if(r.length===0)return;let o=r.map(a=>a.value),s=o.indexOf(this.active),n=-1;switch(e.key){case"ArrowRight":case"ArrowDown":n=(s+1)%o.length;break;case"ArrowLeft":case"ArrowUp":n=s<=0?o.length-1:s-1;break;case"Home":n=0;break;case"End":n=o.length-1;break;default:return}e.preventDefault();let c=o[n];this.switchTo(c),this.updateComplete.then(()=>{this.tabButtons.find(a=>a.dataset.value===c)?.focus()})}render(){return h`
678
+ <div role="tablist" aria-label=${this.label||p} @keydown=${this.onKeydown}>
679
+ ${M(this.tabs,e=>e.value,e=>{let r=e.value===this.active;return h`<button
680
+ type="button"
681
+ class="tab"
682
+ part="tab"
683
+ role="tab"
684
+ data-value=${e.value}
685
+ aria-selected=${r?"true":"false"}
686
+ tabindex=${r?"0":"-1"}
687
+ ?disabled=${e.disabled??!1}
688
+ @click=${()=>this.switchTo(e.value)}
689
+ >
690
+ ${e.label}
691
+ </button>`})}
692
+ </div>
693
+ <div class="panels" part="panels"><slot></slot></div>
694
+ `}};l([d({reflect:!0})],z.prototype,"active",2),l([d()],z.prototype,"label",2),l([k()],z.prototype,"tabs",2);var L=class extends E{constructor(){super(...arguments);this.open=!1;this.label="";this.placement="bottom";this.trigger="click"}static{this.tagName="wmcp-popover"}static{this.styles=f`
695
+ :host {
696
+ display: inline-block;
697
+ font-family: var(
698
+ --popover-font-family,
699
+ var(--input-font-family, ui-sans-serif, system-ui, sans-serif)
700
+ );
701
+ }
702
+ :host([hidden]) {
703
+ display: none;
704
+ }
705
+ .trigger {
706
+ appearance: none;
707
+ font: inherit;
708
+ cursor: pointer;
709
+ anchor-name: --wmcp-pop-anchor;
710
+ /* Unstyled by default so any trigger content (text, a button, an icon)
711
+ sits flush; consumers theme via ::part(trigger). */
712
+ border: 0;
713
+ background: none;
714
+ padding: 0;
715
+ color: inherit;
716
+ }
717
+ .panel {
718
+ box-sizing: border-box;
719
+ width: max-content;
720
+ max-width: var(--popover-max-width, 18rem);
721
+ margin: 0;
722
+ padding: var(--popover-padding, 0.75rem 0.875rem);
723
+ color: var(--popover-text, var(--popover-foreground, oklch(0.145 0 0)));
724
+ background: var(--popover-bg, var(--popover, oklch(1 0 0)));
725
+ border: 1px solid var(--popover-border, var(--border, oklch(0.922 0 0)));
726
+ border-radius: var(--popover-radius, var(--radius, 0.625rem));
727
+ box-shadow: var(
728
+ --popover-shadow,
729
+ 0 10px 38px -10px color-mix(in oklch, oklch(0 0 0) 35%, transparent)
730
+ );
731
+ font-size: var(--popover-font-size, 0.875rem);
732
+ position-anchor: --wmcp-pop-anchor;
733
+ inset: auto;
734
+ }
735
+ :host([placement='bottom']) .panel {
736
+ top: anchor(bottom);
737
+ left: anchor(left);
738
+ margin-top: var(--popover-offset, 0.4rem);
739
+ }
740
+ :host([placement='top']) .panel {
741
+ bottom: anchor(top);
742
+ left: anchor(left);
743
+ margin-bottom: var(--popover-offset, 0.4rem);
744
+ }
745
+ :host([placement='right']) .panel {
746
+ left: anchor(right);
747
+ top: anchor(top);
748
+ margin-left: var(--popover-offset, 0.4rem);
749
+ }
750
+ :host([placement='left']) .panel {
751
+ right: anchor(left);
752
+ top: anchor(top);
753
+ margin-right: var(--popover-offset, 0.4rem);
754
+ }
755
+ @media (prefers-reduced-motion: no-preference) {
756
+ .panel {
757
+ transition: opacity 130ms ease, translate 130ms ease,
758
+ overlay 130ms allow-discrete, display 130ms allow-discrete;
759
+ }
760
+ .panel:not(:popover-open) {
761
+ opacity: 0;
762
+ translate: 0 -0.25rem;
763
+ }
764
+ @starting-style {
765
+ .panel:popover-open {
766
+ opacity: 0;
767
+ translate: 0 -0.25rem;
768
+ }
769
+ }
770
+ }
771
+ `}get panelEl(){return this.renderRoot?.querySelector(".panel")??null}get actionVerb(){return"open"}get defaultNameSuffix(){return"popover"}get defaultToolDescription(){return`Open the "${this.actionNoun}" popover.`}executeTool(){let e=this.actionNoun;return this.open?{content:[{type:"text",text:`The "${e}" popover is already open.`}]}:(this.show(),{content:[{type:"text",text:`Opened the "${e}" popover.`}]})}updated(e){super.updated(e),e.has("open")&&this.syncNativeOpen()}show(){this.open=!0}close(){this.open=!1}syncNativeOpen(){let e=this.panelEl;if(!e)return;let r=e.matches(":popover-open");this.open&&!r?e.showPopover():!this.open&&r&&e.hidePopover()}onToggle(e){let r=e.newState==="open";this.open=r,this.dispatchEvent(new Event(r?"open":"close",{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.cancelScheduledClose()}openOnHover(){this.trigger==="hover"&&(this.cancelScheduledClose(),this.show())}scheduleHoverClose(){this.trigger==="hover"&&(this.cancelScheduledClose(),this.closeTimer=setTimeout(()=>this.close(),120))}cancelScheduledClose(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}render(){let e=this.trigger==="hover";return h`
772
+ <button
773
+ type="button"
774
+ class="trigger"
775
+ part="trigger"
776
+ popovertarget=${this.trigger==="click"?"wmcp-pop":p}
777
+ aria-haspopup=${e?p:"dialog"}
778
+ aria-expanded=${e?p:this.open?"true":"false"}
779
+ aria-describedby=${e?"wmcp-pop":p}
780
+ @pointerenter=${this.openOnHover}
781
+ @pointerleave=${this.scheduleHoverClose}
782
+ @focusin=${this.openOnHover}
783
+ @focusout=${this.scheduleHoverClose}
784
+ >
785
+ <slot name="trigger">${this.label}</slot>
786
+ </button>
787
+ <div
788
+ id="wmcp-pop"
789
+ class="panel"
790
+ part="panel"
791
+ popover=${e?"manual":"auto"}
792
+ role=${e?"tooltip":"dialog"}
793
+ aria-label=${this.label||this.actionNoun}
794
+ @toggle=${this.onToggle}
795
+ @pointerenter=${this.openOnHover}
796
+ @pointerleave=${this.scheduleHoverClose}
797
+ @focusin=${this.openOnHover}
798
+ @focusout=${this.scheduleHoverClose}
799
+ >
800
+ <slot></slot>
801
+ </div>
802
+ `}};l([d({type:Boolean,reflect:!0})],L.prototype,"open",2),l([d()],L.prototype,"label",2),l([d({reflect:!0})],L.prototype,"placement",2),l([d()],L.prototype,"trigger",2);var xr=3e4,C=class extends R{constructor(){super(...arguments);this.name="";this.label="";this.placement="bottom-right";this.duration=5e3;this.toasts=[];this.recent=[];this.nextId=0;this.timers=new Map}static{this.tagName="wmcp-toast"}static{this.styles=f`
803
+ :host {
804
+ position: fixed;
805
+ z-index: var(--toast-z, 1000);
806
+ display: flex;
807
+ flex-direction: column;
808
+ gap: var(--toast-gap, 0.5rem);
809
+ width: max-content;
810
+ max-width: var(--toast-max-width, min(92vw, 22rem));
811
+ pointer-events: none;
812
+ font-family: var(
813
+ --toast-font-family,
814
+ var(--input-font-family, ui-sans-serif, system-ui, sans-serif)
815
+ );
816
+ }
817
+ :host([placement='bottom-right']) {
818
+ right: var(--toast-inset, 1rem);
819
+ bottom: var(--toast-inset, 1rem);
820
+ }
821
+ :host([placement='bottom-left']) {
822
+ left: var(--toast-inset, 1rem);
823
+ bottom: var(--toast-inset, 1rem);
824
+ }
825
+ :host([placement='top-right']) {
826
+ right: var(--toast-inset, 1rem);
827
+ top: var(--toast-inset, 1rem);
828
+ }
829
+ :host([placement='top-left']) {
830
+ left: var(--toast-inset, 1rem);
831
+ top: var(--toast-inset, 1rem);
832
+ }
833
+ .toast {
834
+ pointer-events: auto;
835
+ display: flex;
836
+ align-items: start;
837
+ gap: var(--toast-item-gap, 0.625rem);
838
+ padding: var(--toast-padding, 0.75rem 0.875rem);
839
+ color: var(--toast-text, var(--popover-foreground, oklch(0.145 0 0)));
840
+ background: var(--toast-bg, var(--popover, oklch(1 0 0)));
841
+ border: 1px solid var(--toast-border, var(--border, oklch(0.922 0 0)));
842
+ border-left: 3px solid var(--toast-accent, var(--border, oklch(0.922 0 0)));
843
+ border-radius: var(--toast-radius, var(--radius, 0.625rem));
844
+ box-shadow: var(
845
+ --toast-shadow,
846
+ 0 10px 38px -10px color-mix(in oklch, oklch(0 0 0) 35%, transparent)
847
+ );
848
+ font-size: var(--toast-font-size, 0.875rem);
849
+ }
850
+ .toast[data-variant='success'] {
851
+ --toast-accent: var(--toast-accent-success, oklch(0.627 0.13 160));
852
+ }
853
+ .toast[data-variant='warning'] {
854
+ --toast-accent: var(--toast-accent-warning, oklch(0.7 0.16 75));
855
+ }
856
+ .toast[data-variant='error'] {
857
+ --toast-accent: var(--toast-accent-error, var(--destructive, oklch(0.577 0.245 27.325)));
858
+ }
859
+ .toast[data-variant='info'] {
860
+ --toast-accent: var(--toast-accent-info, var(--primary, oklch(0.205 0 0)));
861
+ }
862
+ .body {
863
+ flex: 1;
864
+ min-width: 0;
865
+ }
866
+ .title {
867
+ font-weight: 600;
868
+ }
869
+ .message {
870
+ color: var(--toast-message, var(--muted-foreground, oklch(0.556 0 0)));
871
+ }
872
+ .title + .message {
873
+ margin-top: 0.125rem;
874
+ }
875
+ .close {
876
+ appearance: none;
877
+ flex-shrink: 0;
878
+ width: 1.25rem;
879
+ height: 1.25rem;
880
+ padding: 0;
881
+ border: 0;
882
+ border-radius: 0.25rem;
883
+ background: transparent;
884
+ color: var(--toast-message, var(--muted-foreground, oklch(0.556 0 0)));
885
+ cursor: pointer;
886
+ line-height: 1;
887
+ }
888
+ .close:hover {
889
+ color: var(--toast-text, var(--foreground, oklch(0.145 0 0)));
890
+ }
891
+ @media (prefers-reduced-motion: no-preference) {
892
+ .toast {
893
+ animation: toast-in 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
894
+ }
895
+ @keyframes toast-in {
896
+ from {
897
+ opacity: 0;
898
+ translate: 0 0.5rem;
899
+ }
900
+ }
901
+ }
902
+ `}show(e){let r={...e,id:this.nextId++,variant:e.variant??"info",shownAt:Date.now()};this.toasts=[...this.toasts,r],this.recent=[r,...this.recent].slice(0,10);let o=e.duration??this.duration;return o>0&&this.timers.set(r.id,setTimeout(()=>this.dismiss(r.id),o)),r.id}dismiss(e){this.toasts=this.toasts.filter(o=>o.id!==e);let r=this.timers.get(e);r&&(clearTimeout(r),this.timers.delete(e))}clear(){for(let e of[...this.toasts])this.dismiss(e.id)}disconnectedCallback(){super.disconnectedCallback();for(let e of this.timers.values())clearTimeout(e);this.timers.clear()}get resolvedToolName(){return this.toolName||`read_${this.name||"notifications"}`}get defaultToolDescription(){return"Read the notifications currently shown to the user (with any that appeared in the last few seconds), so you can tell what just happened on the page."}get toolReactiveProps(){return[...super.toolReactiveProps,"name"]}executeTool(){let e=s=>`[${s.variant}] ${s.title?`${s.title}: `:""}${s.message}`;if(this.toasts.length>0)return{content:[{type:"text",text:`${this.toasts.length} notification(s) showing:
903
+ `+this.toasts.map(e).join(`
904
+ `)}]};let r=Date.now()-xr,o=this.recent.filter(s=>s.shownAt>=r);return o.length>0?{content:[{type:"text",text:`No notifications are showing now. Recently shown:
905
+ `+o.map(e).join(`
906
+ `)}]}:{content:[{type:"text",text:"No notifications."}]}}render(){return h`
907
+ <div role="region" aria-label=${this.label||"Notifications"} aria-live="polite">
908
+ ${M(this.toasts,e=>e.id,e=>h`
909
+ <div
910
+ class="toast"
911
+ part="toast"
912
+ data-variant=${e.variant}
913
+ role=${e.variant==="error"?"alert":"status"}
914
+ >
915
+ <div class="body">
916
+ ${e.title?h`<div class="title">${e.title}</div>`:p}
917
+ <div class="message">${e.message}</div>
918
+ </div>
919
+ <button
920
+ class="close"
921
+ part="close"
922
+ type="button"
923
+ aria-label="Dismiss notification"
924
+ @click=${()=>this.dismiss(e.id)}
925
+ >
926
+
927
+ </button>
928
+ </div>
929
+ `)}
930
+ </div>
931
+ `}};l([d()],C.prototype,"name",2),l([d()],C.prototype,"label",2),l([d({reflect:!0})],C.prototype,"placement",2),l([d({type:Number})],C.prototype,"duration",2),l([k()],C.prototype,"toasts",2);var Sr=[te,re,F,oe,ae,J,N,V,I,z,L,C];function qe(){if(!(typeof customElements>"u"))for(let i of Sr)customElements.get(i.tagName)||customElements.define(i.tagName,i)}qe();return Qt(_r);})();
278
932
  /*! Bundled license information:
279
933
 
280
934
  @lit-labs/ssr-dom-shim/lib/element-internals.js: