@simai-studio/ui 5.20261021.26 → 5.20261022.1233

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.
Files changed (42) hide show
  1. package/README.md +4 -4
  2. package/distr/component/dropdown/js/dropdown.min.js +1 -1
  3. package/distr/core/css/core.css +16 -11
  4. package/distr/core/css/core.min.css +1 -1
  5. package/distr/core/js/composition/sortable.mjs +39 -1
  6. package/distr/core/js/core-loader.js +133 -7
  7. package/distr/core/js/core-loader.min.js +1 -1
  8. package/distr/core/js/smart-base.js +122 -3
  9. package/distr/core/js/smart-base.min.js +1 -1
  10. package/distr/smart/buttons/js/buttons.min.js +8 -8
  11. package/distr/smart/buttons/smart.manifest.json +1 -1
  12. package/distr/smart/composition-overlay/smart.manifest.json +1 -1
  13. package/distr/smart/country-code/js/country-code.min.js +9 -7
  14. package/distr/smart/country-code/smart.manifest.json +6 -1
  15. package/distr/smart/country-code/template/default.js +12 -4
  16. package/distr/smart/datepicker/js/datepicker.min.js +12 -9
  17. package/distr/smart/datepicker/smart.manifest.json +13 -3
  18. package/distr/smart/datepicker/template/default.js +4 -1
  19. package/distr/smart/dropdown/js/dropdown.min.js +10 -10
  20. package/distr/smart/dropdown/smart.manifest.json +1 -1
  21. package/distr/smart/dropdown/template/default.js +10 -3
  22. package/distr/smart/field-renderers/js/field-renderers.min.js +17 -17
  23. package/distr/smart/icon-buttons/js/icon-buttons.min.js +1 -1
  24. package/distr/smart/icon-buttons/smart.manifest.json +1 -1
  25. package/distr/smart/icons/js/icons.min.js +1 -1
  26. package/distr/smart/icons/smart.manifest.json +1 -1
  27. package/distr/smart/inputs/js/inputs.min.js +33 -31
  28. package/distr/smart/inputs/smart.manifest.json +6 -1
  29. package/distr/smart/inputs/template/default.js +8 -0
  30. package/distr/smart/popover/js/popover.min.js +1 -1
  31. package/distr/smart/popover/smart.manifest.json +1 -1
  32. package/distr/smart/resizer/js/resizer.min.js +1 -1
  33. package/distr/smart/resizer/smart.manifest.json +2 -2
  34. package/distr/smart/sortable/js/sortable.min.js +1 -1
  35. package/distr/smart/sortable/smart.manifest.json +2 -2
  36. package/distr/smart/switch/js/switch.min.js +12 -11
  37. package/distr/smart/switch/smart.manifest.json +6 -1
  38. package/distr/smart/switch/template/default.js +2 -1
  39. package/distr/smart/theme-generator/js/theme-generator.min.js +1 -1
  40. package/distr/smart/theme-generator/smart.manifest.json +2 -2
  41. package/package-manifest.json +42 -42
  42. package/package.json +4 -4
@@ -1943,7 +1943,31 @@ class SfBaseElement extends HTMLElement {
1943
1943
  this.setAttribute(attr, String(value));
1944
1944
  });
1945
1945
  return this;
1946
- }
1946
+ } // Host attributes the component does not own are copied to the control it
1947
+ // renders, so a native button gets the author's aria- and ordinary
1948
+ // attributes. A data-* is moved, not copied: it ends up on the control alone.
1949
+ //
1950
+ // One element carries it, and it is the one that has a box, paints, takes
1951
+ // focus, is clicked and is dragged. Both other shapes failed in production.
1952
+ // Copying a data-* to the control while the host kept it put every one on two
1953
+ // elements: querySelectorAll('[data-action="close"]') answered 2 where the
1954
+ // product had written 1, and the first match was the display:contents host --
1955
+ // no box, so a drag through its bounding box threw, and no paint, so a probe
1956
+ // reading a filled button read the wrong element (consumer cases
1957
+ // larena.property-view-arranging, larena.property-view,
1958
+ // larena.table-sortable-lists, larena.admin-menu-search, 2026-10-22). Keeping
1959
+ // it on the host alone leaves one element, but a boxless one, so the drag and
1960
+ // the paint still have nothing to read: a display:contents host generates no
1961
+ // box at all, and no JavaScript can give it one.
1962
+ //
1963
+ // So the control carries it, and the host is reached back from it with
1964
+ // closest('sf-button') -- the direction that always exists. The host's own
1965
+ // record of what the author wrote is readable as element.dataAttributes
1966
+ // (consumer case ui-mail.button-data-attributes, 2026-10-21: a product that
1967
+ // wrote data-add on <sf-button> needs a way to read it back), and
1968
+ // removeHostDataAttribute() takes one off the host's record and the control
1969
+ // together.
1970
+
1947
1971
 
1948
1972
  forwardHostAttributes(target, options = {}) {
1949
1973
  if (!target) {
@@ -1986,13 +2010,20 @@ class SfBaseElement extends HTMLElement {
1986
2010
 
1987
2011
  nextKeys.add(name);
1988
2012
  target.setAttribute(name, value);
1989
- });
2013
+ }); // The record outlives the host attribute, because the attribute is taken
2014
+ // off the host: it is what the control is given again on every render.
2015
+
1990
2016
  dataAttributes.forEach((value, name) => {
1991
2017
  nextKeys.add(name);
1992
2018
  target.setAttribute(name, value);
1993
2019
  });
1994
2020
  target[targetStorageKey] = nextKeys;
1995
- this[storageKey] = dataAttributes;
2021
+ this[storageKey] = dataAttributes; // Where element.dataAttributes and removeHostDataAttribute() read and
2022
+ // write, whatever storage key the component chose.
2023
+
2024
+ this.__sfHostDataAttributes = dataAttributes;
2025
+ this.__sfHostDataAttributeTarget = target;
2026
+ this.__sfHostDataAttributeTargetKeys = targetStorageKey;
1996
2027
 
1997
2028
  if (dataAttributeNamesToRemove.length) {
1998
2029
  this.__sfForwardingHostAttributes = true;
@@ -2000,6 +2031,43 @@ class SfBaseElement extends HTMLElement {
2000
2031
  this.__sfForwardingHostAttributes = false;
2001
2032
  }
2002
2033
 
2034
+ return this;
2035
+ } // What the author wrote as data-* on this host, read the way dataset reads:
2036
+ // dataAttributes.add for data-add. The attributes themselves live on the
2037
+ // native control, so host.dataset is empty and this is the host's answer.
2038
+
2039
+
2040
+ get dataAttributes() {
2041
+ const record = this.__sfHostDataAttributes;
2042
+
2043
+ if (!record || !record.size) {
2044
+ return {};
2045
+ }
2046
+
2047
+ const read = {};
2048
+ record.forEach((value, name) => {
2049
+ const key = name.slice(5).replace(/-([a-z])/gu, (_, letter) => letter.toUpperCase());
2050
+ read[key] = value;
2051
+ });
2052
+ return read;
2053
+ } // Take a data-* off the host's record and off the control together. Removing
2054
+ // it from the control alone is undone on the next render, because the record
2055
+ // is what the control is given again.
2056
+
2057
+
2058
+ removeHostDataAttribute(name) {
2059
+ if (typeof name !== "string" || !name) {
2060
+ return this;
2061
+ }
2062
+
2063
+ const attribute = name.startsWith("data-") ? name : `data-${name.replace(/[A-Z]/gu, letter => `-${letter.toLowerCase()}`)}`;
2064
+ this.__sfForwardingHostAttributes = true;
2065
+ this.removeAttribute(attribute);
2066
+ this.__sfForwardingHostAttributes = false;
2067
+ this.__sfHostDataAttributes?.delete(attribute);
2068
+ this.__sfHostDataAttributeTarget?.removeAttribute?.(attribute);
2069
+ const keys = this.__sfHostDataAttributeTargetKeys;
2070
+ if (keys) this.__sfHostDataAttributeTarget?.[keys]?.delete?.(attribute);
2003
2071
  return this;
2004
2072
  }
2005
2073
 
@@ -2028,6 +2096,57 @@ class SfBaseElement extends HTMLElement {
2028
2096
  this._forwardHostAttributeObserver?.disconnect?.();
2029
2097
  this._forwardHostAttributeObserver = null;
2030
2098
  return this;
2099
+ } // The control inside the host that takes focus on the host's behalf. A Smart
2100
+ // host lays out as display:contents, so it generates no box and cannot be
2101
+ // focused: focus() on it did nothing and left document.activeElement where it
2102
+ // was. A component that renders a native control names it here.
2103
+ //
2104
+ // This is what makes a data-* on the host usable as a handle. A product finds
2105
+ // the host by the attribute it wrote -- the one element that carries it -- and
2106
+ // then focuses what it found: Larena's admin menu returns focus to its
2107
+ // magnifier that way, with this.querySelector('[data-sf-admin-search-toggle]')
2108
+ // and .focus() on the answer (consumer case larena.admin-menu-search,
2109
+ // 2026-10-22). Focus lands on the native control, so document.activeElement is
2110
+ // the control and host.contains(document.activeElement) is true.
2111
+
2112
+
2113
+ focusDelegate() {
2114
+ return null;
2115
+ }
2116
+
2117
+ focus(options) {
2118
+ const target = this.focusDelegate?.();
2119
+
2120
+ if (target && typeof target.focus === "function") {
2121
+ target.focus(options);
2122
+ return;
2123
+ } // Asked before the control exists: focus once it does, and only if nothing
2124
+ // else took focus while this waited -- a queued focus must not steal it back.
2125
+
2126
+
2127
+ if (!target && typeof this.focusDelegate === "function" && !this.isRendered) {
2128
+ const activeWhenAsked = this.ownerDocument?.activeElement || null;
2129
+ this.whenRendered(() => {
2130
+ const ready = this.focusDelegate?.();
2131
+ if (!ready || typeof ready.focus !== "function") return;
2132
+ if ((this.ownerDocument?.activeElement || null) !== activeWhenAsked) return;
2133
+ ready.focus(options);
2134
+ });
2135
+ return;
2136
+ }
2137
+
2138
+ super.focus(options);
2139
+ }
2140
+
2141
+ blur() {
2142
+ const target = this.focusDelegate?.();
2143
+
2144
+ if (target && typeof target.blur === "function") {
2145
+ target.blur();
2146
+ return;
2147
+ }
2148
+
2149
+ super.blur();
2031
2150
  }
2032
2151
 
2033
2152
  removeAttributes(attributeNames = []) {
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see smart-base.min.js.LICENSE.txt */
2
- (()=>{"use strict";const t={d:(e,s)=>{if(Array.isArray(s))for(var n=0;n<s.length;){var i=s[n++],r=s[n++];t.o(e,i)?0===r&&n++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:s[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};var e={};t.r(e),t.d(e,{CSSResult:()=>g,LitElement:()=>Ct,ReactiveElement:()=>k,_$LE:()=>xt,_$LH:()=>wt,adoptStyles:()=>_,css:()=>b,defaultConverter:()=>O,getCompatibleStyle:()=>v,html:()=>it,isServer:()=>!1,mathml:()=>ot,noChange:()=>at,notEqual:()=>L,nothing:()=>lt,render:()=>$t,supportsAdoptingStyleSheets:()=>p,svg:()=>rt,unsafeCSS:()=>y});var s={};t.r(s),t.d(s,{Directive:()=>Nt,PartType:()=>Rt,directive:()=>Pt});var n={};t.r(n),t.d(n,{TemplateResultType:()=>kt,clearPart:()=>Kt,getCommittedValue:()=>qt,getDirectiveClass:()=>Ut,insertPart:()=>zt,isCompiledTemplateResult:()=>jt,isDirectiveResult:()=>Dt,isPrimitive:()=>Mt,isSingleExpression:()=>Bt,isTemplateResult:()=>Ht,removePart:()=>Gt,setChildPartValue:()=>Wt,setCommittedValue:()=>Vt});var i={};t.r(i),t.d(i,{createRef:()=>se,ref:()=>re});var r={};t.r(r),t.d(r,{keyed:()=>oe});var o={};t.r(o),t.d(o,{UnsafeHTMLDirective:()=>ae,unsafeHTML:()=>le});var a={};t.r(a),t.d(a,{repeat:()=>he});var l={};t.r(l),t.d(l,{isRussianPage:()=>$e,language:()=>Ce,pageLanguage:()=>we,pageLocale:()=>Se,pageText:()=>Ee});var c={};t.r(c),t.d(c,{applySmartProps:()=>Le,createSmartElement:()=>ke,default:()=>je,normalizeEnum:()=>Pe,parseJsonAttribute:()=>Ne,smartElement:()=>Me,toAttributeName:()=>xe,toBoolean:()=>Te,toNumber:()=>Re});var h={};t.r(h),t.d(h,{anchor:()=>rn,default:()=>an,resolveLength:()=>nn});var u={};t.r(u),t.d(u,{resolveControlSpacing:()=>hn});const d=globalThis,p=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),m=new WeakMap;class g{constructor(t,e,s){if(this._$cssResult$=!0,s!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(p&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=m.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&m.set(e,t))}return t}toString(){return this.cssText}}const y=t=>new g("string"==typeof t?t:t+"",void 0,f),b=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1],t[0]);return new g(s,t,f)},_=(t,e)=>{if(p)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),n=d.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=s.cssText,t.appendChild(e)}},v=p?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return y(e)})(t):t,{is:A,defineProperty:w,getOwnPropertyDescriptor:S,getOwnPropertyNames:$,getOwnPropertySymbols:E,getPrototypeOf:C}=Object,T=globalThis,x=T.trustedTypes,R=x?x.emptyScript:"",P=T.reactiveElementPolyfillSupport,N=(t,e)=>t,O={toAttribute(t,e){switch(e){case Boolean:t=t?R:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},L=(t,e)=>!A(t,e),M={attribute:!0,type:String,converter:O,reflect:!1,useDefault:!1,hasChanged:L};Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class k extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=M){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){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);void 0!==n&&w(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:i}=S(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const r=n?.call(this);i?.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??M}static _$Ei(){if(this.hasOwnProperty(N("elementProperties")))return;const t=C(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(N("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(N("properties"))){const t=this.properties,e=[...$(t),...E(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(v(t))}else void 0!==t&&e.push(v(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?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),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _(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,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(void 0!==n&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:O).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,n=s._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=s.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:O;this._$Em=n;const r=i.fromAttribute(e,t.type);this[n]=r??this._$Ej?.get(n)??r,this._$Em=null}}requestUpdate(t,e,s,n=!1,i){if(void 0!==t){const r=this.constructor;if(!1===n&&(i=this[t]),s??=r.getPropertyOptions(t),!((s.hasChanged??L)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:i},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==i||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,s,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.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(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[N("elementProperties")]=new Map,k[N("finalized")]=new Map,P?.({ReactiveElement:k}),(T.reactiveElementVersions??=[]).push("2.1.2");const H=globalThis,j=t=>t,D=H.trustedTypes,U=D?D.createPolicy("lit-html",{createHTML:t=>t}):void 0,B="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,z="?"+F,W=`<${z}>`,I=document,V=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,K=t=>G(t)||"function"==typeof t?.[Symbol.iterator],J="[ \t\n\f\r]",Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,Q=/>/g,X=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,st=/^(?:script|style|textarea|title)$/i,nt=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),it=nt(1),rt=nt(2),ot=nt(3),at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),ct=new WeakMap,ht=I.createTreeWalker(I,129);function ut(t,e){if(!G(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==U?U.createHTML(e):e}const dt=(t,e)=>{const s=t.length-1,n=[];let i,r=2===e?"<svg>":3===e?"<math>":"",o=Z;for(let e=0;e<s;e++){const s=t[e];let a,l,c=-1,h=0;for(;h<s.length&&(o.lastIndex=h,l=o.exec(s),null!==l);)h=o.lastIndex,o===Z?"!--"===l[1]?o=Y:void 0!==l[1]?o=Q:void 0!==l[2]?(st.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=X):void 0!==l[3]&&(o=X):o===X?">"===l[0]?(o=i??Z,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?X:'"'===l[3]?et:tt):o===et||o===tt?o=X:o===Y||o===Q?o=Z:(o=X,i=void 0);const u=o===X&&t[e+1].startsWith("/>")?" ":"";r+=o===Z?s+W:c>=0?(n.push(a),s.slice(0,c)+B+s.slice(c)+F+u):s+F+(-2===c?e:u)}return[ut(t,r+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class pt{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,r=0;const o=t.length-1,a=this.parts,[l,c]=dt(t,e);if(this.el=pt.createElement(l,s),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=ht.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(B)){const e=c[r++],s=n.getAttribute(t).split(F),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:i,name:o[2],strings:s,ctor:"."===o[1]?bt:"?"===o[1]?_t:"@"===o[1]?vt:yt}),n.removeAttribute(t)}else t.startsWith(F)&&(a.push({type:6,index:i}),n.removeAttribute(t));if(st.test(n.tagName)){const t=n.textContent.split(F),e=t.length-1;if(e>0){n.textContent=D?D.emptyScript:"";for(let s=0;s<e;s++)n.append(t[s],V()),ht.nextNode(),a.push({type:2,index:++i});n.append(t[e],V())}}}else if(8===n.nodeType)if(n.data===z)a.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(F,t+1));)a.push({type:7,index:i}),t+=F.length-1}i++}}static createElement(t,e){const s=I.createElement("template");return s.innerHTML=t,s}}function ft(t,e,s=t,n){if(e===at)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const r=q(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),void 0===r?i=void 0:(i=new r(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=ft(t,i._$AS(t,e.values),i,n)),e}class mt{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){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??I).importNode(e,!0);ht.currentNode=n;let i=ht.nextNode(),r=0,o=0,a=s[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new gt(i,i.nextSibling,this,t):1===a.type?e=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(e=new At(i,this,t)),this._$AV.push(e),a=s[++o]}r!==a?.index&&(i=ht.nextNode(),r++)}return ht.currentNode=I,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class gt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=lt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ft(this,t,e),q(t)?t===lt||null==t||""===t?(this._$AH!==lt&&this._$AR(),this._$AH=lt):t!==this._$AH&&t!==at&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):K(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!==lt&&q(this._$AH)?this._$AA.nextSibling.data=t:this.T(I.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=pt.createElement(ut(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new mt(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=ct.get(t.strings);return void 0===e&&ct.set(t.strings,e=new pt(t)),e}k(t){G(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new gt(this.O(V()),this.O(V()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=j(t).nextSibling;j(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class yt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=lt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=lt}_$AI(t,e=this,s,n){const i=this.strings;let r=!1;if(void 0===i)t=ft(this,t,e,0),r=!q(t)||t!==this._$AH&&t!==at,r&&(this._$AH=t);else{const n=t;let o,a;for(t=i[0],o=0;o<i.length-1;o++)a=ft(this,n[s+o],e,o),a===at&&(a=this._$AH[o]),r||=!q(a)||a!==this._$AH[o],a===lt?t=lt:t!==lt&&(t+=(a??"")+i[o+1]),this._$AH[o]=a}r&&!n&&this.j(t)}j(t){t===lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bt extends yt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===lt?void 0:t}}class _t extends yt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==lt)}}class vt extends yt{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=ft(this,t,e,0)??lt)===at)return;const s=this._$AH,n=t===lt&&s!==lt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==lt&&(s===lt||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){ft(this,t)}}const wt={M:B,P:F,A:z,C:1,L:dt,R:mt,D:K,V:ft,I:gt,H:yt,N:_t,U:vt,B:bt,F:At},St=H.litHtmlPolyfillSupport;St?.(pt,gt),(H.litHtmlVersions??=[]).push("3.3.3");const $t=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new gt(e.insertBefore(V(),t),t,void 0,s??{})}return i._$AI(t),i},Et=globalThis;class Ct extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return at}}Ct._$litElement$=!0,Ct.finalized=!0,Et.litElementHydrateSupport?.({LitElement:Ct});const Tt=Et.litElementPolyfillSupport;Tt?.({LitElement:Ct});const xt={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(Et.litElementVersions??=[]).push("4.2.2");const Rt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Pt=t=>(...e)=>({_$litDirective$:t,values:e});class Nt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const{I:Ot}=wt,Lt=t=>t,Mt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,kt={HTML:1,SVG:2,MATHML:3},Ht=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,jt=t=>null!=t?._$litType$?.h,Dt=t=>void 0!==t?._$litDirective$,Ut=t=>t?._$litDirective$,Bt=t=>void 0===t.strings,Ft=()=>document.createComment(""),zt=(t,e,s)=>{const n=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=n.insertBefore(Ft(),i),r=n.insertBefore(Ft(),i);s=new Ot(e,r,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,o=r!==t;if(o){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==i||o){let t=s._$AA;for(;t!==e;){const e=Lt(t).nextSibling;Lt(n).insertBefore(t,i),t=e}}}return s},Wt=(t,e,s=t)=>(t._$AI(e,s),t),It={},Vt=(t,e=It)=>t._$AH=e,qt=t=>t._$AH,Gt=t=>{t._$AR(),t._$AA.remove()},Kt=t=>{t._$AR()},Jt=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),Jt(t,e);return!0},Zt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},Yt=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),te(e)}};function Qt(t){void 0!==this._$AN?(Zt(this),this._$AM=t,Yt(this)):this._$AM=t}function Xt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)Jt(n[t],!1),Zt(n[t]);else null!=n&&(Jt(n,!1),Zt(n));else Jt(this,t)}const te=t=>{t.type==Rt.CHILD&&(t._$AP??=Xt,t._$AQ??=Qt)};class ee extends Nt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Yt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Jt(this,t),Zt(this))}setValue(t){if(Bt(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const se=()=>new ne;class ne{}const ie=new WeakMap,re=Pt(class extends ee{render(t){return lt}update(t,[e]){const s=e!==this.G;return s&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),lt}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=ie.get(e);void 0===s&&(s=new WeakMap,ie.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?ie.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),oe=Pt(class extends Nt{constructor(){super(...arguments),this.key=lt}render(t,e){return this.key=t,e}update(t,[e,s]){return e!==this.key&&(Vt(t),this.key=e),s}});class ae extends Nt{constructor(t){if(super(t),this.it=lt,t.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===lt||null==t)return this._t=void 0,this.it=t;if(t===at)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ae.directiveName="unsafeHTML",ae.resultType=1;const le=Pt(ae),ce=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},he=Pt(class extends Nt{constructor(t){if(super(t),t.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],r=[];let o=0;for(const e of t)i[o]=n?n(e,o):o,r[o]=s(e,o),o++;return{values:r,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const i=qt(t),{values:r,keys:o}=this.dt(e,s,n);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,h,u=0,d=i.length-1,p=0,f=r.length-1;for(;u<=d&&p<=f;)if(null===i[u])u++;else if(null===i[d])d--;else if(a[u]===o[p])l[p]=Wt(i[u],r[p]),u++,p++;else if(a[d]===o[f])l[f]=Wt(i[d],r[f]),d--,f--;else if(a[u]===o[f])l[f]=Wt(i[u],r[f]),zt(t,l[f+1],i[u]),u++,f--;else if(a[d]===o[p])l[p]=Wt(i[d],r[p]),zt(t,i[u],i[d]),d--,p++;else if(void 0===c&&(c=ce(o,p,f),h=ce(a,u,d)),c.has(a[u]))if(c.has(a[d])){const e=h.get(o[p]),s=void 0!==e?i[e]:null;if(null===s){const e=zt(t,i[u]);Wt(e,r[p]),l[p]=e}else l[p]=Wt(s,r[p]),zt(t,i[u],s),i[e]=null;p++}else Gt(i[d]),d--;else Gt(i[u]),u++;for(;p<=f;){const e=zt(t,l[f+1]);Wt(e,r[p]),l[p++]=e}for(;u<=d;){const t=i[u++];null!==t&&Gt(t)}return this.ut=o,Vt(t,l),at}});function ue(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function de({component:t="",kind:e="attribute",attribute:s="",from:n,to:i=null}={}){if(!n)return;const r=[t,e,s,n].join("|"),o=ue(),a=o.get(r);if(a)a.count+=1;else if(o.set(r,{component:t,kind:e,attribute:s,from:n,to:i,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const r=t?`${t}: `:"",o="value"===e?`${s}="${n}"`:`${e} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${r}${o} is a legacy name${i?`; write ${i}`:""}. See contracts/changes/journal.json.`)}}if("undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...ue().values()].map(t=>({...t}))},t.clear=function(){ue().clear()},t.note=de,globalThis.SF.deprecations=t}const pe=Object.freeze(["send","receive","runtimeModules","runtimeArrived","runtimeLoading","runtimeSettled","smartBaseAnnounced","litHtml"]);"undefined"!=typeof globalThis&&function(t=globalThis){const e=t.SF=t.SF||{};e.__internal&&"object"==typeof e.__internal||Object.defineProperty(e,"__internal",{value:{},configurable:!0,enumerable:!1,writable:!1});const s=e.__internal;for(const t of pe){const n=Object.getOwnPropertyDescriptor(e,t);if(n?.get?.sfInternalAlias)continue;n&&"value"in n&&!(t in s)&&(s[t]=n.value);const i=()=>(de({kind:"global",from:`SF.${t}`,to:`SF.__internal.${t}`}),s[t]);i.sfInternalAlias=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:i,set(e){s[t]=e}})}}(globalThis);const fe=(()=>{const t="undefined"!=typeof globalThis?globalThis:{},e="__sfPageLanguage";return t[e]||(t[e]={listeners:new Set,registered:new Map,chosen:null}),t[e]})(),me=fe.listeners,ge=fe.registered,ye=t=>String(t??"").trim().toLowerCase().replace("_","-"),be=t=>{const e=ye(t),s=e.split("-")[0],n=[];for(const t of[e,s,"en"])t&&!n.includes(t)&&n.push(t);return n},_e=t=>{const e=t?.tagName;return"string"==typeof e?e.toLowerCase():null},ve=()=>{for(const t of[...me])try{t()}catch{}};function Ae(t){let e=t;for(;e;){const t="function"==typeof e.closest?e.closest("[lang]"):null;if(t)return t;const s="function"==typeof e.getRootNode?e.getRootNode():null;e=s&&s!==e&&s.host?s.host:null}return null}function we(t){if(fe.chosen)return fe.chosen.split("-")[0];const e=Ae(t),s=e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return ye(s).split("-")[0]||"en"}function Se(t){if(fe.chosen)return fe.chosen;const e=Ae(t);return ye(e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function $e(t){return"ru"===we(t)}function Ee(t,e,s,n){const i=n??_e(s);for(const n of be(Se(s))){const s=i?ge.get(i)?.get(n)?.[e]:void 0;if(void 0!==s)return s;const r=t?.[n]?.[e];if(void 0!==r)return r}return e}const Ce={current:(t=globalThis.document?.documentElement??null)=>Se(t),use(t){const e=null==t?null:ye(t);return e===fe.chosen||(fe.chosen=e,ve()),fe.chosen},register(t,e,s){const n=String(t??"").toLowerCase(),i=ye(e);if(!n||!i)throw new TypeError("a component and a language are required");ge.has(n)||ge.set(n,new Map);const r=ge.get(n);return null===s?r.delete(i):r.set(i,{...r.get(i)??{},...s}),ve(),this},registerAll(t,e={}){for(const[s,n]of Object.entries(e))this.register(s,t,n);return this},known(t){const e=String(t??"").toLowerCase();return[...ge.get(e)?.keys()??[]]},components:()=>[...ge.keys()],onChange:t=>"function"!=typeof t?()=>{}:(me.add(t),()=>me.delete(t)),forget(){return ge.clear(),fe.chosen=null,ve(),this}};function Te(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on","checked","disabled","download","indeterminate","multiple"].includes(String(t).toLowerCase())}function xe(t){return"className"===t?"class":String(t||"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Re(t,e=0){const s=Number(t);return Number.isFinite(s)?s:e}function Pe(t,e,s,n=null,i=null){const r=String(t||s).trim().toLowerCase();if(Array.isArray(e)&&e.includes(r))return r;if(n)for(const[t,e]of Object.entries(n)){if((Array.isArray(e)?e:[e]).map(t=>String(t).toLowerCase()).includes(r))return i?.(r,t),t}return s}function Ne(t,e,s=null){const n=t?.getAttribute?.(e);if(!n)return s;try{return JSON.parse(n)}catch(n){return console.warn(`${t?.tagName?.toLowerCase?.()||"sf-element"}: invalid ${e} JSON`,n),s}}function Oe(t){const e=String(t||"").startsWith("sf-")?String(t):`sf-${String(t||"")}`;if(!/^sf-[a-z0-9-]+$/.test(e))throw new Error(`Invalid SF tag name: ${e}`);return e}function Le(t,e={},s=null){const n=s?.listeners??new Map,i=s?.attributes??new Set,r=new Map,o=new Set;for(const[s,n]of Object.entries(e||{})){if(":key"===s||null==n)continue;if(":ref"===s){"function"==typeof n?n(t):n&&"object"==typeof n&&(n.value=t);continue}const e=s.startsWith("@")?s.slice(1):/^on[A-Z]/.test(s)?s.slice(2).toLowerCase():null;if(e&&"function"==typeof n){r.set(e,n);continue}const i=xe(s);"boolean"!=typeof n?"object"!=typeof n&&"function"!=typeof n?(t.getAttribute(i)!==String(n)&&t.setAttribute(i,String(n)),o.add(i)):t[s]=n:(t.toggleAttribute(i,n),o.add(i))}for(const[e,s]of n)r.get(e)!==s&&t.removeEventListener(e,s);for(const[e,s]of r)n.get(e)!==s&&t.addEventListener(e,s);for(const e of i)o.has(e)||t.removeAttribute(e);return{listeners:r,attributes:o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=Ce,window.SF.pageLanguage=we,window.SF.pageText=Ee);const Me=Pt(class extends Nt{constructor(t){if(super(t),t.type!==Rt.CHILD)throw new Error("renderSmartElement belongs in a child position of a template");this._element=null,this._tagName="",this._written=null}render(t,e={}){const s=Oe(t);return this._element&&this._tagName===s||(this._element=document.createElement(s),this._tagName=s,this._written=null),this._written=Le(this._element,e,this._written),this._element}});function ke(t,e={}){const s=document.createElement(Oe(t));return Le(s,e,null),s}class He extends HTMLElement{static externalTemplateBasePath="/local/smart/templates";static externalTemplateModules=new Map;static externalTemplateMisses=new Set;static externalTemplateChecks=new Map;static externalTemplateCssLoaded=new Set;static externalTemplateCssMisses=new Set;static waitForStylesBeforeRenderReady=!0;static styleReadyTimeout=3e3;static styleReadinessCssId="sf-smart-style-readiness";static get props(){return{}}static get observedAttributes(){return Array.from(new Set([...this.propsToAttributes(),"template","root-class","root-style","style"]))}static propsToAttributes(t=this.props){return Object.entries(t||{}).flatMap(([t,e])=>{const s=this.normalizePropConfig(t,e);return[s.attribute,...s.aliases]}).filter(Boolean)}static normalizePropConfig(t,e=""){const s=e&&"object"==typeof e&&!Array.isArray(e)&&(Object.prototype.hasOwnProperty.call(e,"type")||Object.prototype.hasOwnProperty.call(e,"default")||Object.prototype.hasOwnProperty.call(e,"attribute")||Object.prototype.hasOwnProperty.call(e,"parser")||Object.prototype.hasOwnProperty.call(e,"parse")||Object.prototype.hasOwnProperty.call(e,"values"))?{...e}:{default:e},n=s.default,i=s.type||(Array.isArray(n)?Array:null!==n&&"object"==typeof n?Object:"boolean"==typeof n?Boolean:"number"==typeof n?Number:String),r=(Array.isArray(s.aliases)?s.aliases:s.aliases?[s.aliases]:[]).map(t=>!1===t?"":xe(t)).filter(Boolean);return{...s,key:t,attribute:!1===s.attribute?"":s.attribute||xe(t),aliases:r,default:n,type:i}}static toBoolean(t,e=!1){return Te(t,e)}static toAttributeName(t){return xe(t)}static toNumber(t,e=0){return Re(t,e)}static normalizeEnum(t,e,s){return Pe(t,e,s)}static parseJsonAttribute(t,e,s=null){return Ne(t,e,s)}static get tagName(){return this.resolveTagName()}static resolveTagName(t=this.name){const e=String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/_/g,"-").toLowerCase();return e?e.includes("-")?e:`sf-${e}`:""}static get sfElementBrand(){return"simai.smart-base.v1"}static isSameComponentAs(t){if(t===this)return!0;if(!t||t.sfElementBrand!==this.sfElementBrand)return!1;const e=t=>/^[A-Z][A-Za-z0-9_]{2,}$/.test(String(t||""));return!e(t.name)||!e(this.name)||t.name===this.name}static define(t){const e=String(t||this.resolveTagName()).trim().toLowerCase();if(!e||!e.includes("-"))throw new Error(`${this.name||"SfBaseElement"}.define(): cannot resolve custom element tag. Call define() on a named subclass or pass tagName explicitly.`);const s=customElements.get(e);return s?(this.isSameComponentAs(s)||console.warn(`${this.name||"SfBaseElement"}.define(): ${e} is already defined`,s),s):(customElements.define(e,this),this)}static ensureStyleReadinessCss(){if("undefined"==typeof document||document.getElementById(this.styleReadinessCssId))return;const t=document.createElement("style");t.id=this.styleReadinessCssId,t.textContent="[data-sf-style-pending],[data-sf-style-pending] *{visibility:hidden!important;}",document.head.append(t)}constructor(){super(),this._updateScheduled=!1,this._changedAttributes=new Set,this._updateLoopCount=0,this._updateLoopResetScheduled=!1,this._updateLoopBlocked=!1,this._updateLoopWarned=!1,this._isMounted=!1,this._hasRendered=!1,this._renderToken=0,this._externalTemplateModule=null,this._slotTemplates=new Map,this._liveSlotNodes=new Map,this._slotTemplatesCaptured=!1,this._customTemplateProps=new Map,this._refEffects=new Map,this._activeRefEffects=null,this._hostStyle="",this._syncingHostStyle=!1,this._authorStyleElement=null,this._authorStyleObserver=null,this._styleReady=!1,this._styleReadyPromise=null,this.__sfSmartElement=!0,this.__sfSourceCaptured=!1}connectedCallback(){this.constructor.ensureStyleReadinessCss(),this.captureHostStyle(),this.applyHostDisplayStyle(),this.captureSlotTemplates(),this.__sfSourceCaptured=!0,this._isMounted=!0,this.onConnected(),this.__sfLanguageOff=Ce.onChange(()=>{this._isMounted&&this.requestComponentUpdate("language")}),this.emitComponentEvent("connected"),this.requestComponentUpdate("connected")}disconnectedCallback(){this._isMounted=!1,this.__sfLanguageOff?.(),this.__sfLanguageOff=null;try{this.onDisconnected()}finally{this._releaseExternalTemplate()}this.emitComponentEvent("disconnected")}toBoolean(t,e=!1){return Te(t,e)}toAttributeName(t){return xe(t)}renderSmartElement(t,e={}){return Me(t,e)}toNumber(t,e=0){return Re(t,e)}normalizeEnum(t,e,s){return Pe(t,e,s)}parseJsonAttribute(t,e=null){return Ne(this,t,e)}getBooleanAttr(t,e=!1){const s=this.attributeName(t);if(!s||!this.hasAttribute(s))return e;const n=this.getAttribute(s);return""===n||Te(n,e)}getNumberAttr(t,e=0){const s=this.attributeName(t);if(!s||!this.hasAttribute(s))return e;const n=this.getAttribute(s);return""===n?e:Re(n,e)}resolveAttributeName({attribute:t="",aliases:e=[]}={}){if(t&&this.hasAttribute(t))return t;const s=e.find(t=>this.hasAttribute(t));return s&&de({component:this.localName,kind:"attribute",from:s,to:t||null}),s||t}getEnumAttr(t,e=[],s="",n=[]){const i=e&&!Array.isArray(e)&&"object"==typeof e?e:{values:e,fallback:s,aliases:n},r=this.resolveAttributeName({attribute:this.attributeName(t),aliases:(Array.isArray(i.aliases)?i.aliases:[i.aliases]).filter(Boolean).map(t=>this.attributeName(t))});return Pe(r&&this.hasAttribute(r)?this.getAttribute(r):void 0,i.values??[],i.fallback??"",i.valueAliases??null,(e,s)=>de({component:this.localName,kind:"value",attribute:this.attributeName(t),from:e,to:s}))}hasDeclaredProps(){return Object.keys(this.constructor.props||{}).length>0}createRef(){const t=se();return t.__sfOwner=this,t}registerRefEffect(t,e,s={}){if(!t||"function"!=typeof e)return this;const n={...this._refEffects.get(t)||{},callback:e,once:!0===s.once};return this._refEffects.set(t,n),this._activeRefEffects?.add(t),this}flushRefEffects(){if(!this._refEffects.size)return this;const t=this._activeRefEffects;return this._refEffects.forEach((e,s)=>{if(t&&!t.has(s))return"function"==typeof e.cleanup&&e.cleanup(),void this._refEffects.delete(s);const n=s?.value||null;if(Object.is(e.value,n))return;if("function"==typeof e.cleanup&&e.cleanup(),e.value=n,e.cleanup=null,!n)return;const i=e.callback.call(this,n,{component:this,ref:s,value:n});e.cleanup="function"==typeof i?i:null,e.once&&this._refEffects.delete(s)}),this._activeRefEffects=null,this}getPropsContext(t=this.constructor.props||{}){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,this.getPropValue(t,e)]))}getProp(t,e=""){const s=this.constructor.props||{};return this.getPropValue(t,s[t]??e)}getPropValue(t,e=""){const s=this.constructor.normalizePropConfig(t,e),{type:n,default:i}=s,r=s.parser||s.parse,o=this.resolveAttributeName(s),a=!!o&&this.hasAttribute(o),l=a?this.getAttribute(o):void 0;return!a&&Object.prototype.hasOwnProperty.call(this,t)?this.coercePropValue(this[t],s):"function"==typeof r?r.call(this,l,i,this):a?this.coercePropValue(l,s):this.clonePropDefault(i,n)}coercePropValue(t,e={}){const{type:s,default:n,values:i,valueAliases:r}=e;if(s===Boolean)return""===t||Te(t,Boolean(n));if(s===Number)return Re(t,Number(n||0));if(s===Array||s===Object){if("string"!=typeof t)return t??this.clonePropDefault(n,s);try{return JSON.parse(t)}catch(t){return console.warn(`${this.tagName.toLowerCase()}: invalid ${e.attribute} JSON`,t),this.clonePropDefault(n,s)}}return Array.isArray(i)?Pe(t,i,n||i[0]||"",r||null,(t,s)=>de({component:this.localName,kind:"value",attribute:e.attribute||e.key||"",from:t,to:s})):t??this.clonePropDefault(n,s)}clonePropDefault(t,e){return Array.isArray(t)?[...t]:!t||"object"!=typeof t||e!==Object&&e!==Array?void 0!==t?t:e!==Boolean&&(e===Number?0:e===Array?[]:e===Object?{}:""):{...t}}get value(){return this.getAttribute("value")||""}set value(t){!t||"object"!=typeof t||Array.isArray(t)?this.setAttributeValue("value",t):this.setValueAttributes(t)}getAttributeValue(t="value",e=""){return this.getAttribute(t)||e}setAttributeValue(t="value",e=""){const s=xe(t);return s?null==e?(this.removeAttribute(s),this):(this.setAttribute(s,String(e)),this):this}setValueAttributes(t={},e={}){if(!t||"object"!=typeof t)return this;const{stringifyObjects:s=!0,removeEmptyString:n=!0}=e;return Object.entries(t).forEach(([t,e])=>{const i=xe(t);i&&(this.setCustomTemplateProp(t,e),!1===e||null==e||n&&""===e?this.removeAttribute(i):!0!==e?!s||!Array.isArray(e)&&"object"!=typeof e?this.setAttribute(i,String(e)):this.setAttribute(i,JSON.stringify(e)):this.setAttribute(i,""))}),this}attributeChangedCallback(t,e,s){if(e!==s){if("style"===t){if(this._syncingHostStyle)return;this._hostStyle=this.normalizeHostStyle(s),this.syncAuthorStyle(),this.applyHostDisplayStyle()}this.requestComponentUpdate(t)}}get updateLoopLimit(){const t=Number(this.constructor.updateLoopLimit??50);return Number.isFinite(t)?t:50}resetUpdateLoopGuard(){this._updateLoopCount=0,this._updateLoopResetScheduled=!1,this._updateLoopBlocked=!1,this._updateLoopWarned=!1}scheduleUpdateLoopGuardReset(){this._updateLoopResetScheduled||(this._updateLoopResetScheduled=!0,setTimeout(()=>{this.resetUpdateLoopGuard()},0))}canScheduleComponentUpdate(t="unknown"){if(this._updateLoopBlocked)return!1;const e=this.updateLoopLimit;return e<=0||(this.scheduleUpdateLoopGuardReset(),this._updateLoopCount+=1,this._updateLoopCount<=e||(this._updateLoopBlocked=!0,this._changedAttributes.clear(),this._updateLoopWarned||(this._updateLoopWarned=!0,console.warn(`${this.componentTagName||"sf-element"}: update loop limit reached`,{reason:t,limit:e,component:this})),!1))}requestComponentUpdate(t="unknown"){this._updateLoopBlocked||(t&&this._changedAttributes.add(t),this._updateScheduled||this.canScheduleComponentUpdate(t)&&(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._isMounted)return;const t=Array.from(this._changedAttributes);this._changedAttributes.clear(),this.performComponentUpdate(t).catch(t=>this.reportComponentError(t,"render"))})))}reportComponentError(t,e="render"){console.error(t),this.setAttribute("data-sf-error",e),this.dispatchEvent(new CustomEvent("sf-component-error",{bubbles:!0,composed:!0,detail:{phase:e,message:String(t?.message??t),element:this.localName}}))}async performComponentUpdate(t=[]){const e=this.hasBuiltInTemplate(this.componentTemplateName)&&!this._externalTemplateModule?this.resolveUpdateMode(t):"lit";if("dom"===e&&!1!==this.updateDom(t))return this.afterUpdate(t,e),this.emitComponentEvent("updated",{changedAttributes:t,updateMode:e}),void this.emitComponentEvent("props-change",this.createPropChangeDetail(t,e));await this.renderComponent(t),this.afterUpdate(t,"lit"),this.emitComponentEvent("updated",{changedAttributes:t,updateMode:"lit"}),this.emitComponentEvent("props-change",this.createPropChangeDetail(t,"lit"))}async renderComponent(t=[]){const e=++this._renderToken;if(!this._isMounted)return;this._activeRefEffects=new Set,this.beforeRender(t),this.emitComponentEvent("before-render",{changedAttributes:t}),this.runExternalHook("beforeRender",{changedAttributes:t,root:this});const s=await this.resolveTemplateResult(t);this._isMounted&&e===this._renderToken&&(this.prepareRenderContainer(t),this.markStylePending(this),$t(s,this),this.flushRefEffects(),await this.whenRenderedStylesReady(this),this._isMounted&&e===this._renderToken&&(this._hasRendered=!0,this.afterRender(t),this._childrenDefinedPromise=null,this.runExternalHook("afterRender",{changedAttributes:t,root:this}),this.emitComponentEvent("after-render",{changedAttributes:t})))}shouldWaitForStylesReady(){return!1!==this.constructor.waitForStylesBeforeRenderReady}markStylePending(t=this){return this.shouldWaitForStylesReady()&&!this._styleReady&&t?.setAttribute&&(t.setAttribute("data-sf-style-pending",""),t.removeAttribute("data-sf-style-ready")),this}markStyleReady(t=this){return this._styleReady=!0,[t,this].forEach(t=>{t?.removeAttribute&&t?.setAttribute&&(t.removeAttribute("data-sf-style-pending"),t.setAttribute("data-sf-style-ready",""))}),this}async whenRenderedStylesReady(t=this){if(!this.shouldWaitForStylesReady())return;const e=window.SF?.Loader;if(!e||"function"!=typeof e.ensureStylesReady)return void this.markStyleReady(t);const s=Promise.resolve().then(()=>e.ensureStylesReady(t||this,{autoLoad:!0})),n=Number(this.constructor.styleReadyTimeout??3e3);this._styleReadyPromise=n>0?Promise.race([s,new Promise(t=>{setTimeout(t,n)})]):s,await this._styleReadyPromise.catch(t=>{console.warn(`${this.componentTagName||"sf-element"}: style readiness failed`,t)}),this.markStyleReady(t)}getChildCustomElements(){return Array.from(this.querySelectorAll("*")).filter(t=>(t?.tagName?.toLowerCase?.()||"").startsWith("sf-"))}async whenChildrenDefined(){return this._childrenDefinedPromise||(this._childrenDefinedPromise=Promise.resolve().then(async()=>{const t=this.getChildCustomElements();return await Promise.all(t.map(async t=>{const e=t.tagName?.toLowerCase?.();e&&window.customElements?.whenDefined&&(await window.customElements.whenDefined(e),t.updateComplete?.then&&await t.updateComplete,t._updateScheduled&&await Promise.resolve())})),t})),this._childrenDefinedPromise}get componentTagName(){return this.tagName?.toLowerCase?.()||""}get componentTemplateName(){return this.getAttribute("template")||"default"}get externalTemplateComponentName(){return this.componentTagName.startsWith("sf-")?this.componentTagName.replace(/^sf-/,""):this.componentTagName}get externalTemplateBasePath(){return window.SF_SMART_TEMPLATE_PATH||window.SFSmartTemplatePath||this.constructor.externalTemplateBasePath}emitComponentEvent(t,e={}){const s={component:this,tagName:this.componentTagName,template:this.componentTemplateName,...e};this.dispatchEvent(new CustomEvent(`sf-${t}`,{bubbles:!0,composed:!0,detail:s}))}attributeName(t){return String(t||"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}shouldSerializeFalseAttribute(t){const e=this.constructor.defaultTrueAttributes;return!!e&&(e instanceof Set?e.has(t):!!Array.isArray(e)&&e.includes(t))}setAttributes(t={}){return t&&"object"==typeof t?(Object.entries(t).forEach(([t,e])=>{const s=this.attributeName(t);s&&(this.setCustomTemplateProp(t,e),!1===e&&this.shouldSerializeFalseAttribute(s)?this.setAttribute(s,"false"):!1!==e&&null!=e&&""!==e?!0!==e?this.setAttribute(s,String(e)):this.setAttribute(s,""):this.removeAttribute(s))}),this):this}forwardHostAttributes(t,e={}){if(!t)return this;const{exclude:s=[],transferDataAttributes:n=!0,storageKey:i="__sfForwardedDataAttributes",targetStorageKey:r="__sfForwardedAttributeKeys"}=e,o=s instanceof Set?s:new Set(s),a=this[i]||new Map,l=t[r]||new Set,c=[],h=new Set;return l.forEach(e=>{t.removeAttribute(e)}),Array.from(this.attributes).forEach(e=>{const{name:s,value:i}=e;if(!o.has(s)&&!/^on[a-z]/i.test(s)){if(n&&s.startsWith("data-"))return a.set(s,i),void c.push(s);h.add(s),t.setAttribute(s,i)}}),a.forEach((e,s)=>{h.add(s),t.setAttribute(s,e)}),t[r]=h,this[i]=a,c.length&&(this.__sfForwardingHostAttributes=!0,c.forEach(t=>this.removeAttribute(t)),this.__sfForwardingHostAttributes=!1),this}observeForwardedHostAttributes(t,e={}){if(this._forwardHostAttributeObserver)return this;const s="function"==typeof t?t:()=>t;return this._forwardHostAttributeObserver=new MutationObserver(()=>{this.__sfForwardingHostAttributes||this.forwardHostAttributes(s(),e)}),this._forwardHostAttributeObserver.observe(this,{attributes:!0}),this}disconnectForwardedHostAttributes(){return this._forwardHostAttributeObserver?.disconnect?.(),this._forwardHostAttributeObserver=null,this}removeAttributes(t=[]){return(Array.isArray(t)?t:[t]).filter(Boolean).forEach(t=>this.removeAttribute(this.attributeName(t))),this}refresh(t="manual"){return this.requestComponentUpdate(t),this}get isRendered(){return!0===this._hasRendered}createRenderDetail(t={}){return{component:this,tagName:this.componentTagName,template:this.componentTemplateName,...t}}runRenderedCallback(t,e={},s=null){if("function"==typeof t)return t.call(this,this.createRenderDetail(e),s)}whenRendered(t=null,e={}){const s=!0===e.next;if(this.isRendered&&!s){const e=this.createRenderDetail({changedAttributes:[],immediate:!0});return Promise.resolve().then(()=>(this.runRenderedCallback(t,e),e))}return new Promise(e=>{this.addEventListener("sf-after-render",s=>{const n=s?.detail||this.createRenderDetail();this.runRenderedCallback(t,n,s),e(n)},{once:!0})})}onAfterRender(t,e={}){const s=!1!==e.immediate,n=!1!==e.once;if(s&&this.isRendered&&(this.runRenderedCallback(t,{changedAttributes:[],immediate:!0}),n))return()=>{};const i=e=>{this.runRenderedCallback(t,e?.detail||{},e),n&&this.removeEventListener("sf-after-render",i)};return this.addEventListener("sf-after-render",i),()=>this.removeEventListener("sf-after-render",i)}getState(){return void 0!==this.state?this.state:this.hasDeclaredProps()?this.templateContext():void 0!==this.value?this.value:this.templateContext()}normalizeStateCallbackArgs(t,e,s="state"){return"function"==typeof t?{reason:s,callback:t}:{reason:t||s,callback:e}}runStateCallback(t,e={}){return"function"!=typeof t||t.call(this,{component:this,state:this.getState(),...e}),this}scheduleStateCallback(t,e={}){return"function"!=typeof t?this:this._isMounted&&this._updateScheduled?(this.whenRendered(s=>{this.runStateCallback(t,{...e,renderDetail:s})},{next:!0}),this):(Promise.resolve().then(()=>{this.runStateCallback(t,e)}),this)}setState(t={},e=null){return this.setAttributes(t),this.scheduleStateCallback(e,{patch:t,reason:"attributes"}),this}patchState(t={},e="state",s=null){const{reason:n,callback:i}=this.normalizeStateCallbackArgs(e,s,"state"),r=this.state&&"object"==typeof this.state?this.state:{},o="function"==typeof t?t(r):t;if(!o||"object"!=typeof o||Object.is(o,r))return this.scheduleStateCallback(i,{patch:o,reason:n,changed:!1,changedKeys:[],prevState:r,nextState:r}),this;let a=!1;const l=[],c={...r};return Object.entries(o).forEach(([t,e])=>{Object.is(c[t],e)||(c[t]=e,a=!0,l.push(t))}),a?(this.state=c,this.requestComponentUpdate(n),this.scheduleStateCallback(i,{patch:o,reason:n,changed:!0,changedKeys:l,prevState:r,nextState:c}),this):(this.scheduleStateCallback(i,{patch:o,reason:n,changed:!1,changedKeys:l,prevState:r,nextState:r}),this)}set(t={},e="state",s=null){return this.patchState(t,e,s)}getRootClass(){return this.getAttribute("root-class")||""}normalizeHostStyle(t=""){const e=document.createElement("div");return e.setAttribute("style",String(t||"")),e.style.removeProperty("display"),e.style.cssText}get style(){return this._authorStyleElement||(this._authorStyleElement=document.createElement("div"),this._hostStyle=this.normalizeHostStyle(this.getAttribute("style"))||this._hostStyle,this.syncAuthorStyle(),this._authorStyleObserver=new MutationObserver(()=>this.flushAuthorStyle()),this._authorStyleObserver.observe(this._authorStyleElement,{attributes:!0,attributeFilter:["style"]})),this._authorStyleElement.style}set style(t){this.style.cssText=null==t?"":String(t)}syncAuthorStyle(){if(!this._authorStyleElement)return;const t=`${this._hostStyle} display: contents;`.trim();this._authorStyleElement.style.cssText!==t&&(this._authorStyleElement.style.cssText=t)}flushAuthorStyle(){if(!this._authorStyleElement)return;const t=this.normalizeHostStyle(this._authorStyleElement.style.cssText);t!==this._hostStyle?this.setAttribute("style",t):"contents"!==this._authorStyleElement.style.display&&this.syncAuthorStyle()}captureHostStyle(){this.flushAuthorStyle();const t=this.normalizeHostStyle(this.getAttribute("style"));return!t&&this._hostStyle||(this._hostStyle=t),this.syncAuthorStyle(),this}applyHostDisplayStyle(){const t="display: contents;";return this.getAttribute("style")===t||(this._syncingHostStyle=!0,this.setAttribute("style",t),this._syncingHostStyle=!1),this}getRootStyle(){return this.flushAuthorStyle(),[this._hostStyle,this.getAttribute("root-style")].filter(Boolean).join("; ")}setRootClass(t=""){const e=String(t||"").trim();return e?(this.setAttribute("root-class",e),this):(this.removeAttribute("root-class"),this)}addRootClass(...t){const e=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return t.flat().filter(Boolean).forEach(t=>{String(t).split(/\s+/).filter(Boolean).forEach(t=>e.add(t))}),this.setRootClass(Array.from(e).join(" "))}setRootStyle(t=""){const e=String(t||"").trim();return e?(this.setAttribute("root-style",e),this):(this.removeAttribute("root-style"),this)}removeRootClass(...t){const e=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return t.flat().filter(Boolean).forEach(t=>{String(t).split(/\s+/).filter(Boolean).forEach(t=>e.delete(t))}),this.setRootClass(Array.from(e).join(" "))}toggleRootClass(t,e){const s=String(t||"").trim();if(!s)return this;const n=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return("boolean"==typeof e?e:!n.has(s))?n.add(s):n.delete(s),this.setRootClass(Array.from(n).join(" ")),this}setHidden(t=!0){const e=Te(t,!0);return this.toggleAttribute("hidden",e),this.toggleRootClass("hidden",e),this}isHidden(){const t=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return this.hasAttribute("hidden")||t.has("hidden")}createPropChangeDetail(t=[],e="lit"){return{changedAttributes:t,updateMode:e,state:this.getState()}}onPropChange(t,e){return"function"==typeof t&&this.addEventListener("sf-props-change",e=>{t(e.detail?.state,e.detail,e)},e),this}onUpdate(t,e){return"function"==typeof t&&this.addEventListener("sf-updated",e=>{t(this.getState(),e.detail,e)},e),this}createTemplateContext(t={}){const e=this.hasDeclaredProps()?this.getPropsContext():{},s={component:this,rootClass:this.getRootClass(),rootStyle:this.getRootStyle(),...e,...t},n=this.getCustomTemplateProps(s);return{...n,...s,custom:n}}getCustomTemplateProps(t={}){const e=this.getReservedTemplateAttributes(),s=this.getReservedTemplateKeys(t),n={};return this._customTemplateProps.forEach((e,s)=>{this.isCustomTemplateProp(s,t)&&(n[s]=e)}),Object.entries(this.getOwnCustomTemplateProps(t)).forEach(([t,e])=>{!t||s.has(t)||Object.prototype.hasOwnProperty.call(n,t)||(n[t]=e)}),Array.from(this.attributes||[]).forEach(({name:t,value:i})=>{if(e.has(t))return;const r=this.attributeToPropertyName(t);!r||s.has(r)||Object.prototype.hasOwnProperty.call(n,r)||(n[r]=i)}),n}getOwnCustomTemplateProps(t={}){const e={},s=this.getReservedTemplateKeys(t);return Object.keys(this).forEach(t=>{t.startsWith("_")||s.has(t)||"function"==typeof this[t]||(e[t]=this[t])}),e}getReservedTemplateAttributes(){const t=new Set(["class","style","id","slot","template"]);return(this.constructor.observedAttributes||[]).forEach(e=>{const s=xe(e);s&&t.add(s)}),t}getReservedTemplateKeys(t={}){const e=new Set(["custom"]);return Object.keys(t||{}).forEach(t=>{e.add(t)}),this.getReservedTemplateAttributes().forEach(t=>{const s=this.attributeToPropertyName(t);s&&e.add(s)}),e}isCustomTemplateProp(t,e={}){const s=this.attributeToPropertyName(xe(t));if(!s)return!1;const n=xe(s),i=this.getReservedTemplateAttributes(),r=this.getReservedTemplateKeys(e);return!i.has(n)&&!r.has(s)}setCustomTemplateProps(t={},e={}){return t&&"object"==typeof t?(Object.entries(t).forEach(([t,s])=>{this.setCustomTemplateProp(t,s,e)}),this):this}setCustomTemplateProp(t,e,s={}){const n=this.attributeToPropertyName(xe(t));return this.isCustomTemplateProp(n,s)?!1===e||null==e?(this._customTemplateProps.delete(n)&&this.requestComponentUpdate(n),this):(this._customTemplateProps.get(n)===e||(this._customTemplateProps.set(n,e),this.requestComponentUpdate(n)),this):this}attributeToPropertyName(t){return String(t||"").replace(/-([a-z0-9])/g,(t,e)=>e.toUpperCase())}resolveUpdateMode(){return"lit"}createPropsTemplateContext(t={}){return this.createTemplateContext({component:this,...this.getPropsContext(),...t})}templateContext(){return this.createPropsTemplateContext()}captureSlotTemplates(){this._slotTemplatesCaptured||(this._slotTemplatesCaptured=!0,Array.from(this.children).forEach(t=>{if(!(t instanceof HTMLElement))return;const e=t.getAttribute("slot");if(!e)return;if("template"===t.tagName?.toLowerCase?.())return this._slotTemplates.has(e)||this._slotTemplates.set(e,[]),Array.from(t.content?.childNodes||[]).forEach(t=>{this._slotTemplates.get(e).push(t.cloneNode(!0))}),void t.remove();this._liveSlotNodes.has(e)||this._liveSlotNodes.set(e,[]);const s=1===t.getAttributeNames().length&&t.hasAttribute("slot")?Array.from(t.childNodes):[t];this._liveSlotNodes.get(e).push(...s),t.remove()}))}captureChildTemplates(t,e,s={}){if(!t)return[];const{append:n=!0,remove:i=!0}=s,r="function"==typeof e?e:t=>t instanceof Element&&"string"==typeof e&&t.matches?.(e),o=Array.from(this.childNodes||[]).filter(t=>r(t));if(!o.length)return[];n&&this._slotTemplates.has(t)||this._slotTemplates.set(t,[]);const a=o.map(t=>t.cloneNode(!0));return a.forEach(e=>{this._slotTemplates.get(t).push(e)}),i&&o.forEach(t=>t.remove()),a.map(t=>t.cloneNode(!0))}hasSlotContent(t){return(this._liveSlotNodes.get(t)||[]).length>0||(this._slotTemplates.get(t)||[]).length>0}getSlotContent(t){const e=this._liveSlotNodes.get(t)||[];if(e.length)return 1===e.length?e[0]:e;const s=this._slotTemplates.get(t)||[];return s.length?1===s.length?s[0].cloneNode(!0):s.map(t=>t.cloneNode(!0)):lt}setSlot(t,...e){if(!t)return this;const s=e.map(t=>{if("string"==typeof t){const e=document.createElement("div");return e.innerHTML=t,Array.from(e.childNodes)}return[t]}).flat().filter(t=>t instanceof Node);return this._slotTemplates.delete(t),this._liveSlotNodes.set(t,s),this.requestComponentUpdate("slot-change"),this}copyRuntimeData(t,e){if(!(t instanceof Node&&e instanceof Node))return;t.__sfCreateEventHandlers&&Object.defineProperty(e,"__sfCreateEventHandlers",{configurable:!0,enumerable:!1,value:t.__sfCreateEventHandlers.slice()});const s=Array.from(t.childNodes||[]),n=Array.from(e.childNodes||[]);s.forEach((t,e)=>{this.copyRuntimeData(t,n[e])})}clearSlot(t){return t?(this._slotTemplates.delete(t),this._liveSlotNodes&&this._liveSlotNodes.delete(t),this.requestComponentUpdate("slot-change"),this):this}async resolveTemplateResult(t=[]){const e=this.componentTemplateName,s=this._renderToken;if(this.hasBuiltInTemplate(e))return this._releaseExternalTemplate(),this.template();const n=await this.resolveExternalTemplateModule(e);if(!this._isMounted||s!==this._renderToken||e!==this.componentTemplateName)return lt;if(n!==this._externalTemplateModule&&this._releaseExternalTemplate(),this._externalTemplateModule=n||null,n){const e=this.templateContext(),s=this.createTemplateContext(this.mapExternalTemplateContext(e,n)),i="function"==typeof n.default?n.default:null;if(i)return i({html:it,nothing:lt,context:s,component:this,changedAttributes:t})}return this._externalTemplateModule=null,this.template()}hasBuiltInTemplate(t=this.componentTemplateName){return!t||"default"===t}mapExternalTemplateContext(t,e){return"function"==typeof e?.mapContext&&e.mapContext({context:t,component:this,html:it,nothing:lt})||t}async resolveExternalTemplateModule(t=this.componentTemplateName){if(!t)return null;const e=this.getExternalTemplateModuleUrl(t);if(!e)return null;if(await this.loadExternalTemplateCss(t),this.constructor.externalTemplateModules.has(e))return this.constructor.externalTemplateModules.get(e);if(this.constructor.externalTemplateMisses.has(e))return null;if(!await this.checkExternalTemplateModule(e))return this.constructor.externalTemplateMisses.add(e),null;try{const t=await import(e);return this.constructor.externalTemplateModules.set(e,t),t}catch(t){return console.warn(t),this.constructor.externalTemplateMisses.add(e),null}}async checkExternalTemplateModule(t){if(!t)return!1;if(this.constructor.externalTemplateChecks.has(t))return this.constructor.externalTemplateChecks.get(t);const e=fetch(t,{method:"GET",cache:"no-store"}).then(t=>t.ok).catch(()=>!1);this.constructor.externalTemplateChecks.set(t,e);const s=await e;return s||this.constructor.externalTemplateChecks.delete(t),s}getExternalTemplateModuleUrl(t=this.componentTemplateName){const e=String(this.externalTemplateBasePath||"").replace(/\/$/,""),s=this.externalTemplateComponentName;return e&&s&&t?`${e}/${s}/${t}/index.js`:""}getExternalTemplateCssUrl(t=this.componentTemplateName){const e=String(this.externalTemplateBasePath||"").replace(/\/$/,""),s=this.externalTemplateComponentName;return e&&s&&t?`${e}/${s}/${t}/index.css`:""}loadExternalTemplateCss(t=this.componentTemplateName){const e=this.getExternalTemplateCssUrl(t);if(!e)return Promise.resolve(!1);if(this.constructor.externalTemplateCssLoaded.has(e))return Promise.resolve(!0);if(this.constructor.externalTemplateCssMisses.has(e))return Promise.resolve(!1);return document.querySelector(`link[data-sf-smart-css="${e}"]`)?(this.constructor.externalTemplateCssLoaded.add(e),Promise.resolve(!0)):new Promise(t=>{const s=document.createElement("link");s.rel="stylesheet",s.href=e,s.dataset.sfSmartCss=e,s.onload=()=>{this.constructor.externalTemplateCssLoaded.add(e),t(!0)},s.onerror=()=>{this.constructor.externalTemplateCssMisses.add(e),t(!1)},document.head.append(s)})}_releaseExternalTemplate(){const t=this._externalTemplateModule;t&&(this._externalTemplateModule=null,this.runExternalHook("destroy",{},t))}runExternalHook(t,e={},s=this._externalTemplateModule){if("function"==typeof s?.[t])try{s[t]({component:this,root:this,html:it,nothing:lt,context:this.templateContext(),...e})}catch(t){console.warn(t)}}updateDom(){return!1}shouldClearLightDomBeforeFirstRender(){return!0===this.constructor.clearLightDomBeforeFirstRender}prepareRenderContainer(){!this._hasRendered&&this.shouldClearLightDomBeforeFirstRender()&&this.replaceChildren()}template(){return lt}beforeRender(){}afterRender(t){if("function"==typeof t)return this.whenRendered(t)}afterUpdate(){}onConnected(){}onDisconnected(){this._releaseExternalTemplate()}}const je=He;if("undefined"!=typeof window&&(window.SfBaseElement=He,window.html=it,window.nothing=lt,window.render=$t,window.SF||(window.SF={}),window.SF.SfBaseElement=He,window.SF.html=it,window.SF.nothing=lt,window.SF.render=$t,window.SF.smart={...window.SF.smart||{},SfBaseElement:He,html:it,nothing:lt,render:$t,toBoolean:Te,toAttributeName:xe,toNumber:Re,normalizeEnum:Pe,parseJsonAttribute:Ne},!window.SF.__internal.smartBaseAnnounced)){window.SF.__internal.smartBaseAnnounced=!0;try{window.dispatchEvent(new CustomEvent("sf-smart-base-ready",{detail:{smart:window.SF.smart,loader:window.SF.Loader||null,timestamp:Date.now()}}))}catch(t){console.warn("sf-smart-base-ready dispatch failed",t)}}const De=Math.min,Ue=Math.max,Be=Math.round,Fe=Math.floor,ze=t=>({x:t,y:t}),We={left:"right",right:"left",bottom:"top",top:"bottom"};function Ie(t,e){return"function"==typeof t?t(e):t}function Ve(t){return t.split("-")[0]}function qe(t){return t.split("-")[1]}function Ge(t){return"x"===t?"y":"x"}function Ke(t){return"y"===t?"height":"width"}function Je(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function Ze(t){return Ge(Je(t))}function Ye(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Qe=["left","right"],Xe=["right","left"],ts=["top","bottom"],es=["bottom","top"];function ss(t,e,s,n){const i=qe(t);let r=function(t,e,s){switch(t){case"top":case"bottom":return s?e?Xe:Qe:e?Qe:Xe;case"left":case"right":return e?ts:es;default:return[]}}(Ve(t),"start"===s,n);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(Ye)))),r}function ns(t){const e=Ve(t);return We[e]+t.slice(e.length)}function is(t){const{x:e,y:s,width:n,height:i}=t;return{width:n,height:i,top:s,left:e,right:e+n,bottom:s+i,x:e,y:s}}function rs(t,e,s){let{reference:n,floating:i}=t;const r=Je(e),o=Ze(e),a=Ke(o),l=Ve(e),c="y"===r,h=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(l){case"top":p={x:h,y:n.y-i.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-i.width,y:u};break;default:p={x:n.x,y:n.y}}const f=qe(e);return f&&(p[o]+=d*("end"===f?1:-1)*(s&&c?-1:1)),p}async function os(t,e){var s;void 0===e&&(e={});const{x:n,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=Ie(e,t),f=function(t){return"number"!=typeof t?function(t){var e,s,n,i;return{top:null!=(e=t.top)?e:0,right:null!=(s=t.right)?s:0,bottom:null!=(n=t.bottom)?n:0,left:null!=(i=t.left)?i:0}}(t):{top:t,right:t,bottom:t,left:t}}(p),m=a[d?"floating"===u?"reference":"floating":u],g=is(await r.getClippingRect({element:null==(s=await(null==r.isElement?void 0:r.isElement(m)))||s?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),y="floating"===u?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),_=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},v=is(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-v.top+f.top)/_.y,bottom:(v.bottom-g.bottom+f.bottom)/_.y,left:(g.left-v.left+f.left)/_.x,right:(v.right-g.right+f.right)/_.x}}const as=new Set(["left","top"]);function ls(){return"undefined"!=typeof window}function cs(t){return ds(t)?(t.nodeName||"").toLowerCase():"#document"}function hs(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function us(t){var e;return null==(e=(ds(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ds(t){return!!ls()&&(t instanceof Node||t instanceof hs(t).Node)}function ps(t){return!!ls()&&(t instanceof Element||t instanceof hs(t).Element)}function fs(t){return!!ls()&&(t instanceof HTMLElement||t instanceof hs(t).HTMLElement)}function ms(t){return!(!ls()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof hs(t).ShadowRoot)}function gs(t){const{overflow:e,overflowX:s,overflowY:n,display:i}=Cs(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+s)&&"inline"!==i&&"contents"!==i}function ys(t){return/^(table|td|th)$/.test(cs(t))}function bs(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const _s=/transform|translate|scale|rotate|perspective|filter/,vs=/paint|layout|strict|content/,As=t=>!!t&&"none"!==t;let ws;function Ss(t){const e=ps(t)?Cs(t):t;return As(e.transform)||As(e.translate)||As(e.scale)||As(e.rotate)||As(e.perspective)||!$s()&&(As(e.backdropFilter)||As(e.filter))||_s.test(e.willChange||"")||vs.test(e.contain||"")}function $s(){return null==ws&&(ws="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ws}function Es(t){return/^(html|body|#document)$/.test(cs(t))}function Cs(t){return hs(t).getComputedStyle(t)}function Ts(t){return ps(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if("html"===cs(t))return t;const e=t.assignedSlot||t.parentNode||ms(t)&&t.host||us(t);return ms(e)?e.host:e}function Rs(t){const e=xs(t);return Es(e)?(t.ownerDocument||t).body:fs(e)&&gs(e)?e:Rs(e)}function Ps(t,e,s){var n;void 0===e&&(e=[]),void 0===s&&(s=!0);const i=Rs(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=hs(i);if(r){const t=Ns(o);return e.concat(o,o.visualViewport||[],gs(i)?i:[],t&&s?Ps(t):[])}return e.concat(i,Ps(i,[],s))}function Ns(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Os(t){const e=Cs(t);let s=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=fs(t),r=i?t.offsetWidth:s,o=i?t.offsetHeight:n,a=Be(s)!==r||Be(n)!==o;return a&&(s=r,n=o),{width:s,height:n,$:a}}function Ls(t){return ps(t)?t:t.contextElement}function Ms(t){const e=Ls(t);if(!fs(e))return ze(1);const s=e.getBoundingClientRect(),{width:n,height:i,$:r}=Os(e);let o=(r?Be(s.width):s.width)/n,a=(r?Be(s.height):s.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}const ks=ze(0);function Hs(t){const e=hs(t);return $s()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ks}function js(t,e,s,n){void 0===e&&(e=!1),void 0===s&&(s=!1);const i=t.getBoundingClientRect(),r=Ls(t);let o=ze(1);e&&(n?ps(n)&&(o=Ms(n)):o=Ms(t));const a=function(t,e,s){return void 0===e&&(e=!1),!!s&&e&&s===hs(t)}(r,s,n)?Hs(r):ze(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,h=i.width/o.x,u=i.height/o.y;if(r&&n){const t=hs(r),e=ps(n)?hs(n):n;let s=t,i=Ns(s);for(;i&&e!==s;){const t=Ms(i),e=i.getBoundingClientRect(),n=Cs(i),r=e.left+(i.clientLeft+parseFloat(n.paddingLeft))*t.x,o=e.top+(i.clientTop+parseFloat(n.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=o,s=hs(i),i=Ns(s)}}return is({width:h,height:u,x:l,y:c})}function Ds(t,e){const s=Ts(t).scrollLeft;return e?e.left+s:js(us(t)).left+s}function Us(t,e){const s=t.getBoundingClientRect();return{x:s.left+e.scrollLeft-Ds(t,s),y:s.top+e.scrollTop}}function Bs(t,e,s){let n;if("viewport"===e||"layoutViewport"===e)n=function(t,e,s){void 0===s&&(s="viewport");const n="layoutViewport"===s,i=hs(t),r=us(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,h=0;if(o){const t=!$s()||"fixed"===e;n?t||(c=-o.offsetLeft,h=-o.offsetTop):(a=o.width,l=o.height,t&&(c=o.offsetLeft,h=o.offsetTop))}if(Ds(r)<=0){const t=r.ownerDocument,e=t.body,s=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(s.marginLeft)+parseFloat(s.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-n),o="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;o<=25&&(a-=o)}return{width:a,height:l,x:c,y:h}}(t,s,e);else if("document"===e)n=function(t){const e=Ts(t),s=t.ownerDocument.body,n=Ue(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Ue(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-e.scrollLeft+Ds(t);const o=-e.scrollTop;return"rtl"===Cs(s).direction&&(r+=Ue(t.clientWidth,s.clientWidth)-n),{width:n,height:i,x:r,y:o}}(us(t));else if(ps(e))n=function(t,e){const s=js(t,!0,"fixed"===e),n=s.top+t.clientTop,i=s.left+t.clientLeft,r=Ms(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:n*r.y}}(e,s);else{const s=Hs(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return is(n)}function Fs(t,e,s){const n=fs(e),i=us(e),r="fixed"===s,o=js(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ze(0);if((n||!r)&&(("body"!==cs(e)||gs(i))&&(a=Ts(e)),n)){const t=js(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}!n&&i&&(l.x=Ds(i));const c=!i||n||r?ze(0):Us(i,a);return{x:o.left+a.scrollLeft-l.x-c.x,y:o.top+a.scrollTop-l.y-c.y,width:o.width,height:o.height}}function zs(t){return"static"===Cs(t).position}function Ws(t,e){if(!fs(t)||"fixed"===Cs(t).position)return null;if(e)return e(t);let s=t.offsetParent;return us(t)===s&&(s=s.ownerDocument.body),s}function Is(t,e){const s=hs(t);if(bs(t))return s;if(!fs(t)){let e=xs(t);for(;e&&!Es(e);){if(ps(e)&&!zs(e))return e;e=xs(e)}return s}let n=Ws(t,e);for(;n&&ys(n)&&zs(n);)n=Ws(n,e);return n&&Es(n)&&zs(n)&&!Ss(n)?s:n||function(t){let e=xs(t);for(;fs(e)&&!Es(e);){if(Ss(e))return e;if(bs(e))return null;e=xs(e)}return null}(t)||s}const Vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:s,offsetParent:n,strategy:i}=t;const r="fixed"===i,o=us(n),a=!!e&&bs(e.floating);if(n===o||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=ze(1);const h=ze(0),u=fs(n);if((u||!r)&&(("body"!==cs(n)||gs(o))&&(l=Ts(n)),u)){const t=js(n);c=Ms(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}const d=!o||u||r?ze(0):Us(o,l);return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:s.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:us,getClippingRect:function(t){let{element:e,boundary:s,rootBoundary:n,strategy:i}=t;const r=[..."clippingAncestors"===s?bs(e)?[]:function(t,e){const s=e.get(t);if(s)return s;let n=Ps(t,[],!1).filter(t=>ps(t)&&"body"!==cs(t)),i=null;const r="fixed"===Cs(t).position;let o=r?xs(t):t;for(;ps(o)&&!Es(o);){const t=Cs(o),e=Ss(o),s=i?i.position:r?"fixed":"";e||"fixed"!==s&&("absolute"!==s||"static"!==t.position)?i=t:n=n.filter(t=>t!==o),o=xs(o)}return e.set(t,n),n}(e,this._c):[].concat(s),n],o=Bs(e,r[0],i);let a=o.top,l=o.right,c=o.bottom,h=o.left;for(let t=1;t<r.length;t++){const s=Bs(e,r[t],i);a=Ue(s.top,a),l=De(s.right,l),c=De(s.bottom,c),h=Ue(s.left,h)}return{width:l-h,height:c-a,x:h,y:a}},getOffsetParent:Is,getElementRects:async function(t){const e=this.getOffsetParent||Is,s=this.getDimensions,n=await s(t.floating);return{reference:Fs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:s}=Os(t);return{width:e,height:s}},getScale:Ms,isElement:ps,isRTL:function(t){return"rtl"===Cs(t).direction}};function qs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Gs(t,e,s,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Ls(t),h=i||r?[...c?Ps(c):[],...e?Ps(e):[]]:[];h.forEach(t=>{i&&t.addEventListener("scroll",s),r&&t.addEventListener("resize",s)});const u=c&&a?function(t,e,s){let n,i=null;const r=us(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:p}=c;if(s||e(),!d||!p)return;const f={rootMargin:-Fe(u)+"px "+-Fe(r.clientWidth-(h+d))+"px "+-Fe(r.clientHeight-(u+p))+"px "+-Fe(h)+"px",threshold:Ue(0,De(1,l))||1};let m=!0;function g(e){const s=e[0].intersectionRatio;if(!qs(c,t.getBoundingClientRect()))return a();if(s!==l){if(!m)return a();s?a(!1,s):n=setTimeout(()=>{a(!1,1e-7)},1e3)}m=!1}try{i=new IntersectionObserver(g,{...f,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(g,f)}i.observe(t)}const l=hs(t),c=()=>a(s);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}(c,s,r):null;let d,p=-1,f=null;o&&(f=new ResizeObserver(t=>{let[n]=t;n&&n.target===c&&f&&e&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),s()}),c&&!l&&f.observe(c),e&&f.observe(e));let m=l?js(t):null;return l&&function e(){const n=js(t);m&&!qs(m,n)&&s();m=n,d=requestAnimationFrame(e)}(),s(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",s),r&&t.removeEventListener("resize",s)}),null==u||u(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(d)}}const Ks=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var s,n;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await async function(t,e){const{placement:s,platform:n,elements:i}=t,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),o=Ve(s),a=qe(s),l="y"===Je(s),c=as.has(o)?-1:1,h=r&&l?-1:1,u=Ie(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*h,y:d*c}:{x:d*c,y:p*h}}(e,t);return o===(null==(s=a.offset)?void 0:s.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Js=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:s,y:n,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:e,y:s}=t;return{x:e,y:s}}},...c}=Ie(t,e),h={x:s,y:n},u=await r.detectOverflow(e,c),d=Je(i),p=Ge(d);let f=h[p],m=h[d];const g=(t,e)=>{return s=e+u["y"===t?"top":"left"],n=e,i=e-u["y"===t?"bottom":"right"],Ue(s,De(n,i));var s,n,i};o&&(f=g(p,f)),a&&(m=g(d,m));const y=l.fn({...e,[p]:f,[d]:m});return{...y,data:{x:y.x-s,y:y.y-n,enabled:{[p]:o,[d]:a}}}}}},Zs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var s,n;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Ie(t,e);if(null!=(s=r.arrow)&&s.alignmentOffset)return{};const y=Ve(i),b=Je(a),_=Ve(a)===a,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),A=d||(_||!m?[ns(a)]:function(t){const e=ns(t);return[Ye(t),e,Ye(e)]}(a)),w="none"!==f;!d&&w&&A.push(...ss(a,m,f,v));const S=[a,...A],$=await l.detectOverflow(e,g),E=[];let C=(null==(n=r.flip)?void 0:n.overflows)||[];if(h&&E.push($[y]),u){const t=function(t,e,s){void 0===s&&(s=!1);const n=qe(t),i=Ze(t),r=Ke(i);let o="x"===i?n===(s?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=ns(o)),[o,ns(o)]}(i,o,v);E.push($[t[0]],$[t[1]])}if(C=[...C,{placement:i,overflows:E}],!E.every(t=>t<=0)){var T,x;const t=((null==(T=r.flip)?void 0:T.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&b!==Je(e))||C.every(t=>Je(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let s=null==(x=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:x.placement;if(!s)switch(p){case"bestFit":{var R;const t=null==(R=C.filter(t=>{if(w){const e=Je(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:R[0];t&&(s=t);break}case"initialPlacement":s=a}if(i!==s)return{reset:{placement:s}}}return{}}}},Ys=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:s,rects:n,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Ie(t,e),l=await i.detectOverflow(e,a),c=Ve(s),h=qe(s),u="y"===Je(s),{width:d,height:p}=n.floating;let f,m;"top"===c||"bottom"===c?(f=c,m=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(m=c,f="end"===h?"top":"bottom");const g=p-l.top-l.bottom,y=d-l.left-l.right,b=De(p-l[f],g),_=De(d-l[m],y),v=e.middlewareData.shift,A=!v;let w=b,S=_;null!=v&&v.enabled.x&&(S=y),null!=v&&v.enabled.y&&(w=g),A&&!h&&(u?S=d-2*Ue(l.left,l.right):w=p-2*Ue(l.top,l.bottom)),await o({...e,availableWidth:S,availableHeight:w});const $=await i.getDimensions(r.floating);return d!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}},Qs=(t,e,s)=>{const n=new Map,i=null!=s?s:{},r={...Vs,...i.platform,_c:n};return(async(t,e,s)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:o}=s,a=o.detectOverflow?o:{...o,detectOverflow:os},l=await(null==o.isRTL?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=rs(c,n,l),d=n,p=0;const f={};for(let s=0;s<r.length;s++){const m=r[s];if(!m)continue;const{name:g,fn:y}=m,{x:b,y:_,data:v,reset:A}=await y({x:h,y:u,initialPlacement:n,placement:d,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});h=null!=b?b:h,u=null!=_?_:u,f[g]={...f[g],...v},A&&p<50&&(p++,"object"==typeof A&&(A.placement&&(d=A.placement),A.rects&&(c=!0===A.rects?await o.getElementRects({reference:t,floating:e,strategy:i}):A.rects),({x:h,y:u}=rs(c,d,l))),s=-1)}return{x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})},Xs=["block-start","block-end","inline-start","inline-end"],tn=["start","center","end"];function en(t="block-end",e="start",s=!1){if(!Xs.includes(t))throw new TypeError(`Unknown placement side: ${t}`);if(!tn.includes(e))throw new TypeError(`Unknown placement alignment: ${e}`);const n="block-start"===t?"top":"block-end"===t?"bottom":"inline-start"===t?s?"right":"left":s?"left":"right";return"center"===e?n:`${n}-${e}`}function sn(t,e=!1){const s=String(t).split("-")[0];return"top"===s?"block-start":"bottom"===s?"block-end":"left"===s?e?"inline-end":"inline-start":e?"inline-start":"inline-end"}function nn(t,e=document.body){if("number"==typeof t)return Number.isFinite(t)?t:0;if("string"!=typeof t||""===t.trim())return 0;const s=document.createElement("span");s.style.cssText="position:absolute;visibility:hidden;pointer-events:none;block-size:0;padding:0;border:0",s.style.inlineSize=t,(e?.isConnected?e:document.body).append(s);const n=parseFloat(getComputedStyle(s).width)||0;return s.remove(),n}function rn(t,e,s={}){if(!(t instanceof Element&&e instanceof HTMLElement))throw new TypeError("Anchored positioning needs a reference element and a floating element");const n={side:"block-end",align:"start",offset:"var(--sf-space-1\\/4)",alignmentOffset:0,padding:"var(--sf-space-1\\/2)",flip:!0,shift:!0,matchWidth:!1,fitHeight:!0,autoUpdate:!0,onPosition:null,...s},i=["position","left","top","right","bottom","margin","max-height","max-width",...n.matchWidth?["width"]:[]].map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]),r={maxHeight:e.style.getPropertyValue("max-height")},o=getComputedStyle(e),a=(t,e)=>{const s=parseFloat(t);return Number.isFinite(s)?String(t).trim().endsWith("%")?s/100*e:s:1/0},l=a(o.maxHeight,document.documentElement.clientHeight),c=a(o.maxWidth,document.documentElement.clientWidth),h={side:n.side,stopped:!1};let u=null,d=!1;const p=async()=>{const s="rtl"===getComputedStyle(t).direction;const i=nn(n.offset,t.parentElement),o=nn(n.padding,t.parentElement);n.fitHeight&&(e.style.maxHeight=r.maxHeight||"");const a=t.getBoundingClientRect(),u=document.documentElement.clientWidth,d={top:o,bottom:o,left:Math.min(o,Math.max(0,a.left)),right:Math.min(o,Math.max(0,u-a.right))},p=[Ks({mainAxis:i,alignmentAxis:nn(n.alignmentOffset,t.parentElement)})];n.flip&&p.push(Zs({padding:o,crossAxis:!1})),n.shift&&p.push(Js({padding:d,crossAxis:!1})),p.push(Ys({padding:d,apply({availableWidth:t,availableHeight:e,rects:s,elements:i}){if(h.stopped)return;const r=u-d.left-d.right;n.matchWidth&&(i.floating.style.width=`${Math.max(0,Math.min(s.reference.width,r))}px`),i.floating.style.maxWidth=`${Math.max(0,Math.min(t,r,c))}px`,n.fitHeight&&(i.floating.style.maxHeight=`${Math.max(0,Math.min(e,l))}px`)}}));const f=await Qs(t,e,{strategy:"fixed",placement:en(n.side,n.align,s),middleware:p});return h.stopped||(Object.assign(e.style,{position:"fixed",left:`${f.x}px`,top:`${f.y}px`,right:"auto",bottom:"auto",margin:"0"}),h.side=sn(f.placement,s),e.dataset.sfSide=h.side,n.onPosition?.({side:h.side,placement:f.placement,x:f.x,y:f.y})),f};h.update=()=>h.stopped?Promise.resolve(null):u?(d=!0,u):(u=p().finally(()=>{u=null,d&&!h.stopped&&(d=!1,h.update())}),u);const f=n.autoUpdate?Gs(t,e,h.update):null;return h.stop=()=>{h.stopped=!0,f?.(),delete e.dataset.sfSide;for(const[t,s,n]of i)s?e.style.setProperty(t,s,n):e.style.removeProperty(t)},n.autoUpdate||h.update(),h}const on=Object.freeze({anchor:rn,logicalSide:sn,physicalPlacement:en,resolveLength:nn});"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Position||(globalThis.SF.Position=on));const an=on,ln=Object.freeze({compact:"low",normal:"",comfortable:"high",spacious:"highest"}),cn=Object.freeze({"":"normal",default:"normal",low:"compact",high:"comfortable",highest:"spacious"});function hn({spacing:t,tightness:e}={}){const s=[],n=null!=t,i=t=>String(t??"").trim().toLowerCase(),r=i(e);let o;if(n){const n=i(t);o=Object.hasOwn(ln,n)?n:"normal",Object.hasOwn(ln,n)||s.push("invalid-spacing"),null!=e&&Object.hasOwn(cn,r)&&cn[r]!==o&&s.push("spacing-overrides-tightness")}else o=Object.hasOwn(cn,r)?cn[r]:"normal",Object.hasOwn(cn,r)||s.push("invalid-tightness");return{spacing:o,tightness:ln[o],diagnostics:s}}const un=t=>Object.freeze({__esModule:!0,...t}),dn=Object.freeze({lit:un(e),"lit/directive.js":un(s),"lit/directive-helpers.js":un(n),"lit/directives/ref.js":un(i),"lit/directives/keyed.js":un(r),"lit/directives/unsafe-html.js":un(o),"lit/directives/repeat.js":un(a),"smart-base":un(c),"page-language":un(l),position:un(h),"control-spacing":un(u)}),pn=window.SF=window.SF||{};pn.__internal.runtimeModules=dn,pn.runtimeModule||(pn.runtimeModule=t=>dn[t]?Promise.resolve(dn[t]):Promise.reject(new Error(`SF runtime: no shared module "${t}"`))),"function"==typeof pn.__internal.runtimeArrived&&pn.__internal.runtimeArrived(dn);try{window.dispatchEvent(new CustomEvent("sf-runtime-ready",{detail:{modules:Object.keys(dn)}}))}catch(t){console.warn("sf-runtime-ready dispatch failed",t)}})();
2
+ (()=>{"use strict";const t={d:(e,s)=>{if(Array.isArray(s))for(var n=0;n<s.length;){var i=s[n++],r=s[n++];t.o(e,i)?0===r&&n++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:s[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};var e={};t.r(e),t.d(e,{CSSResult:()=>g,LitElement:()=>Ct,ReactiveElement:()=>k,_$LE:()=>xt,_$LH:()=>wt,adoptStyles:()=>_,css:()=>b,defaultConverter:()=>O,getCompatibleStyle:()=>v,html:()=>it,isServer:()=>!1,mathml:()=>ot,noChange:()=>at,notEqual:()=>L,nothing:()=>lt,render:()=>$t,supportsAdoptingStyleSheets:()=>p,svg:()=>rt,unsafeCSS:()=>y});var s={};t.r(s),t.d(s,{Directive:()=>Nt,PartType:()=>Rt,directive:()=>Pt});var n={};t.r(n),t.d(n,{TemplateResultType:()=>kt,clearPart:()=>Kt,getCommittedValue:()=>qt,getDirectiveClass:()=>Ut,insertPart:()=>zt,isCompiledTemplateResult:()=>Dt,isDirectiveResult:()=>jt,isPrimitive:()=>Mt,isSingleExpression:()=>Bt,isTemplateResult:()=>Ht,removePart:()=>Gt,setChildPartValue:()=>Wt,setCommittedValue:()=>Vt});var i={};t.r(i),t.d(i,{createRef:()=>se,ref:()=>re});var r={};t.r(r),t.d(r,{keyed:()=>oe});var o={};t.r(o),t.d(o,{UnsafeHTMLDirective:()=>ae,unsafeHTML:()=>le});var a={};t.r(a),t.d(a,{repeat:()=>he});var l={};t.r(l),t.d(l,{isRussianPage:()=>$e,language:()=>Ce,pageLanguage:()=>we,pageLocale:()=>Se,pageText:()=>Ee});var c={};t.r(c),t.d(c,{applySmartProps:()=>Le,createSmartElement:()=>ke,default:()=>De,normalizeEnum:()=>Pe,parseJsonAttribute:()=>Ne,smartElement:()=>Me,toAttributeName:()=>xe,toBoolean:()=>Te,toNumber:()=>Re});var h={};t.r(h),t.d(h,{anchor:()=>rn,default:()=>an,resolveLength:()=>nn});var u={};t.r(u),t.d(u,{resolveControlSpacing:()=>hn});const d=globalThis,p=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),m=new WeakMap;class g{constructor(t,e,s){if(this._$cssResult$=!0,s!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(p&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=m.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&m.set(e,t))}return t}toString(){return this.cssText}}const y=t=>new g("string"==typeof t?t:t+"",void 0,f),b=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1],t[0]);return new g(s,t,f)},_=(t,e)=>{if(p)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),n=d.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=s.cssText,t.appendChild(e)}},v=p?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return y(e)})(t):t,{is:A,defineProperty:w,getOwnPropertyDescriptor:S,getOwnPropertyNames:$,getOwnPropertySymbols:E,getPrototypeOf:C}=Object,T=globalThis,x=T.trustedTypes,R=x?x.emptyScript:"",P=T.reactiveElementPolyfillSupport,N=(t,e)=>t,O={toAttribute(t,e){switch(e){case Boolean:t=t?R:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},L=(t,e)=>!A(t,e),M={attribute:!0,type:String,converter:O,reflect:!1,useDefault:!1,hasChanged:L};Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class k extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=M){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){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);void 0!==n&&w(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:i}=S(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const r=n?.call(this);i?.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??M}static _$Ei(){if(this.hasOwnProperty(N("elementProperties")))return;const t=C(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(N("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(N("properties"))){const t=this.properties,e=[...$(t),...E(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(v(t))}else void 0!==t&&e.push(v(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?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),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _(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,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(void 0!==n&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:O).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,n=s._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=s.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:O;this._$Em=n;const r=i.fromAttribute(e,t.type);this[n]=r??this._$Ej?.get(n)??r,this._$Em=null}}requestUpdate(t,e,s,n=!1,i){if(void 0!==t){const r=this.constructor;if(!1===n&&(i=this[t]),s??=r.getPropertyOptions(t),!((s.hasChanged??L)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:i},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==i||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,s,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.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(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[N("elementProperties")]=new Map,k[N("finalized")]=new Map,P?.({ReactiveElement:k}),(T.reactiveElementVersions??=[]).push("2.1.2");const H=globalThis,D=t=>t,j=H.trustedTypes,U=j?j.createPolicy("lit-html",{createHTML:t=>t}):void 0,B="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,z="?"+F,W=`<${z}>`,I=document,V=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,K=t=>G(t)||"function"==typeof t?.[Symbol.iterator],J="[ \t\n\f\r]",Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,Q=/>/g,X=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,st=/^(?:script|style|textarea|title)$/i,nt=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),it=nt(1),rt=nt(2),ot=nt(3),at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),ct=new WeakMap,ht=I.createTreeWalker(I,129);function ut(t,e){if(!G(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==U?U.createHTML(e):e}const dt=(t,e)=>{const s=t.length-1,n=[];let i,r=2===e?"<svg>":3===e?"<math>":"",o=Z;for(let e=0;e<s;e++){const s=t[e];let a,l,c=-1,h=0;for(;h<s.length&&(o.lastIndex=h,l=o.exec(s),null!==l);)h=o.lastIndex,o===Z?"!--"===l[1]?o=Y:void 0!==l[1]?o=Q:void 0!==l[2]?(st.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=X):void 0!==l[3]&&(o=X):o===X?">"===l[0]?(o=i??Z,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?X:'"'===l[3]?et:tt):o===et||o===tt?o=X:o===Y||o===Q?o=Z:(o=X,i=void 0);const u=o===X&&t[e+1].startsWith("/>")?" ":"";r+=o===Z?s+W:c>=0?(n.push(a),s.slice(0,c)+B+s.slice(c)+F+u):s+F+(-2===c?e:u)}return[ut(t,r+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class pt{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,r=0;const o=t.length-1,a=this.parts,[l,c]=dt(t,e);if(this.el=pt.createElement(l,s),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=ht.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(B)){const e=c[r++],s=n.getAttribute(t).split(F),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:i,name:o[2],strings:s,ctor:"."===o[1]?bt:"?"===o[1]?_t:"@"===o[1]?vt:yt}),n.removeAttribute(t)}else t.startsWith(F)&&(a.push({type:6,index:i}),n.removeAttribute(t));if(st.test(n.tagName)){const t=n.textContent.split(F),e=t.length-1;if(e>0){n.textContent=j?j.emptyScript:"";for(let s=0;s<e;s++)n.append(t[s],V()),ht.nextNode(),a.push({type:2,index:++i});n.append(t[e],V())}}}else if(8===n.nodeType)if(n.data===z)a.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(F,t+1));)a.push({type:7,index:i}),t+=F.length-1}i++}}static createElement(t,e){const s=I.createElement("template");return s.innerHTML=t,s}}function ft(t,e,s=t,n){if(e===at)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const r=q(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),void 0===r?i=void 0:(i=new r(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=ft(t,i._$AS(t,e.values),i,n)),e}class mt{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){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??I).importNode(e,!0);ht.currentNode=n;let i=ht.nextNode(),r=0,o=0,a=s[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new gt(i,i.nextSibling,this,t):1===a.type?e=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(e=new At(i,this,t)),this._$AV.push(e),a=s[++o]}r!==a?.index&&(i=ht.nextNode(),r++)}return ht.currentNode=I,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class gt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=lt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ft(this,t,e),q(t)?t===lt||null==t||""===t?(this._$AH!==lt&&this._$AR(),this._$AH=lt):t!==this._$AH&&t!==at&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):K(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!==lt&&q(this._$AH)?this._$AA.nextSibling.data=t:this.T(I.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=pt.createElement(ut(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new mt(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=ct.get(t.strings);return void 0===e&&ct.set(t.strings,e=new pt(t)),e}k(t){G(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new gt(this.O(V()),this.O(V()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=D(t).nextSibling;D(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class yt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=lt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=lt}_$AI(t,e=this,s,n){const i=this.strings;let r=!1;if(void 0===i)t=ft(this,t,e,0),r=!q(t)||t!==this._$AH&&t!==at,r&&(this._$AH=t);else{const n=t;let o,a;for(t=i[0],o=0;o<i.length-1;o++)a=ft(this,n[s+o],e,o),a===at&&(a=this._$AH[o]),r||=!q(a)||a!==this._$AH[o],a===lt?t=lt:t!==lt&&(t+=(a??"")+i[o+1]),this._$AH[o]=a}r&&!n&&this.j(t)}j(t){t===lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bt extends yt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===lt?void 0:t}}class _t extends yt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==lt)}}class vt extends yt{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=ft(this,t,e,0)??lt)===at)return;const s=this._$AH,n=t===lt&&s!==lt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==lt&&(s===lt||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){ft(this,t)}}const wt={M:B,P:F,A:z,C:1,L:dt,R:mt,D:K,V:ft,I:gt,H:yt,N:_t,U:vt,B:bt,F:At},St=H.litHtmlPolyfillSupport;St?.(pt,gt),(H.litHtmlVersions??=[]).push("3.3.3");const $t=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new gt(e.insertBefore(V(),t),t,void 0,s??{})}return i._$AI(t),i},Et=globalThis;class Ct extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return at}}Ct._$litElement$=!0,Ct.finalized=!0,Et.litElementHydrateSupport?.({LitElement:Ct});const Tt=Et.litElementPolyfillSupport;Tt?.({LitElement:Ct});const xt={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(Et.litElementVersions??=[]).push("4.2.2");const Rt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Pt=t=>(...e)=>({_$litDirective$:t,values:e});class Nt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const{I:Ot}=wt,Lt=t=>t,Mt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,kt={HTML:1,SVG:2,MATHML:3},Ht=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,Dt=t=>null!=t?._$litType$?.h,jt=t=>void 0!==t?._$litDirective$,Ut=t=>t?._$litDirective$,Bt=t=>void 0===t.strings,Ft=()=>document.createComment(""),zt=(t,e,s)=>{const n=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=n.insertBefore(Ft(),i),r=n.insertBefore(Ft(),i);s=new Ot(e,r,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,o=r!==t;if(o){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==i||o){let t=s._$AA;for(;t!==e;){const e=Lt(t).nextSibling;Lt(n).insertBefore(t,i),t=e}}}return s},Wt=(t,e,s=t)=>(t._$AI(e,s),t),It={},Vt=(t,e=It)=>t._$AH=e,qt=t=>t._$AH,Gt=t=>{t._$AR(),t._$AA.remove()},Kt=t=>{t._$AR()},Jt=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),Jt(t,e);return!0},Zt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},Yt=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),te(e)}};function Qt(t){void 0!==this._$AN?(Zt(this),this._$AM=t,Yt(this)):this._$AM=t}function Xt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)Jt(n[t],!1),Zt(n[t]);else null!=n&&(Jt(n,!1),Zt(n));else Jt(this,t)}const te=t=>{t.type==Rt.CHILD&&(t._$AP??=Xt,t._$AQ??=Qt)};class ee extends Nt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Yt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Jt(this,t),Zt(this))}setValue(t){if(Bt(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const se=()=>new ne;class ne{}const ie=new WeakMap,re=Pt(class extends ee{render(t){return lt}update(t,[e]){const s=e!==this.G;return s&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),lt}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=ie.get(e);void 0===s&&(s=new WeakMap,ie.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?ie.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),oe=Pt(class extends Nt{constructor(){super(...arguments),this.key=lt}render(t,e){return this.key=t,e}update(t,[e,s]){return e!==this.key&&(Vt(t),this.key=e),s}});class ae extends Nt{constructor(t){if(super(t),this.it=lt,t.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===lt||null==t)return this._t=void 0,this.it=t;if(t===at)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ae.directiveName="unsafeHTML",ae.resultType=1;const le=Pt(ae),ce=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},he=Pt(class extends Nt{constructor(t){if(super(t),t.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],r=[];let o=0;for(const e of t)i[o]=n?n(e,o):o,r[o]=s(e,o),o++;return{values:r,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const i=qt(t),{values:r,keys:o}=this.dt(e,s,n);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,h,u=0,d=i.length-1,p=0,f=r.length-1;for(;u<=d&&p<=f;)if(null===i[u])u++;else if(null===i[d])d--;else if(a[u]===o[p])l[p]=Wt(i[u],r[p]),u++,p++;else if(a[d]===o[f])l[f]=Wt(i[d],r[f]),d--,f--;else if(a[u]===o[f])l[f]=Wt(i[u],r[f]),zt(t,l[f+1],i[u]),u++,f--;else if(a[d]===o[p])l[p]=Wt(i[d],r[p]),zt(t,i[u],i[d]),d--,p++;else if(void 0===c&&(c=ce(o,p,f),h=ce(a,u,d)),c.has(a[u]))if(c.has(a[d])){const e=h.get(o[p]),s=void 0!==e?i[e]:null;if(null===s){const e=zt(t,i[u]);Wt(e,r[p]),l[p]=e}else l[p]=Wt(s,r[p]),zt(t,i[u],s),i[e]=null;p++}else Gt(i[d]),d--;else Gt(i[u]),u++;for(;p<=f;){const e=zt(t,l[f+1]);Wt(e,r[p]),l[p++]=e}for(;u<=d;){const t=i[u++];null!==t&&Gt(t)}return this.ut=o,Vt(t,l),at}});function ue(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function de({component:t="",kind:e="attribute",attribute:s="",from:n,to:i=null}={}){if(!n)return;const r=[t,e,s,n].join("|"),o=ue(),a=o.get(r);if(a)a.count+=1;else if(o.set(r,{component:t,kind:e,attribute:s,from:n,to:i,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const r=t?`${t}: `:"",o="value"===e?`${s}="${n}"`:`${e} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${r}${o} is a legacy name${i?`; write ${i}`:""}. See contracts/changes/journal.json.`)}}if("undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...ue().values()].map(t=>({...t}))},t.clear=function(){ue().clear()},t.note=de,globalThis.SF.deprecations=t}const pe=Object.freeze(["send","receive","runtimeModules","runtimeArrived","runtimeLoading","runtimeSettled","smartBaseAnnounced","litHtml"]);"undefined"!=typeof globalThis&&function(t=globalThis){const e=t.SF=t.SF||{};e.__internal&&"object"==typeof e.__internal||Object.defineProperty(e,"__internal",{value:{},configurable:!0,enumerable:!1,writable:!1});const s=e.__internal;for(const t of pe){const n=Object.getOwnPropertyDescriptor(e,t);if(n?.get?.sfInternalAlias)continue;n&&"value"in n&&!(t in s)&&(s[t]=n.value);const i=()=>(de({kind:"global",from:`SF.${t}`,to:`SF.__internal.${t}`}),s[t]);i.sfInternalAlias=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:i,set(e){s[t]=e}})}}(globalThis);const fe=(()=>{const t="undefined"!=typeof globalThis?globalThis:{},e="__sfPageLanguage";return t[e]||(t[e]={listeners:new Set,registered:new Map,chosen:null}),t[e]})(),me=fe.listeners,ge=fe.registered,ye=t=>String(t??"").trim().toLowerCase().replace("_","-"),be=t=>{const e=ye(t),s=e.split("-")[0],n=[];for(const t of[e,s,"en"])t&&!n.includes(t)&&n.push(t);return n},_e=t=>{const e=t?.tagName;return"string"==typeof e?e.toLowerCase():null},ve=()=>{for(const t of[...me])try{t()}catch{}};function Ae(t){let e=t;for(;e;){const t="function"==typeof e.closest?e.closest("[lang]"):null;if(t)return t;const s="function"==typeof e.getRootNode?e.getRootNode():null;e=s&&s!==e&&s.host?s.host:null}return null}function we(t){if(fe.chosen)return fe.chosen.split("-")[0];const e=Ae(t),s=e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return ye(s).split("-")[0]||"en"}function Se(t){if(fe.chosen)return fe.chosen;const e=Ae(t);return ye(e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function $e(t){return"ru"===we(t)}function Ee(t,e,s,n){const i=n??_e(s);for(const n of be(Se(s))){const s=i?ge.get(i)?.get(n)?.[e]:void 0;if(void 0!==s)return s;const r=t?.[n]?.[e];if(void 0!==r)return r}return e}const Ce={current:(t=globalThis.document?.documentElement??null)=>Se(t),use(t){const e=null==t?null:ye(t);return e===fe.chosen||(fe.chosen=e,ve()),fe.chosen},register(t,e,s){const n=String(t??"").toLowerCase(),i=ye(e);if(!n||!i)throw new TypeError("a component and a language are required");ge.has(n)||ge.set(n,new Map);const r=ge.get(n);return null===s?r.delete(i):r.set(i,{...r.get(i)??{},...s}),ve(),this},registerAll(t,e={}){for(const[s,n]of Object.entries(e))this.register(s,t,n);return this},known(t){const e=String(t??"").toLowerCase();return[...ge.get(e)?.keys()??[]]},components:()=>[...ge.keys()],onChange:t=>"function"!=typeof t?()=>{}:(me.add(t),()=>me.delete(t)),forget(){return ge.clear(),fe.chosen=null,ve(),this}};function Te(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on","checked","disabled","download","indeterminate","multiple"].includes(String(t).toLowerCase())}function xe(t){return"className"===t?"class":String(t||"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Re(t,e=0){const s=Number(t);return Number.isFinite(s)?s:e}function Pe(t,e,s,n=null,i=null){const r=String(t||s).trim().toLowerCase();if(Array.isArray(e)&&e.includes(r))return r;if(n)for(const[t,e]of Object.entries(n)){if((Array.isArray(e)?e:[e]).map(t=>String(t).toLowerCase()).includes(r))return i?.(r,t),t}return s}function Ne(t,e,s=null){const n=t?.getAttribute?.(e);if(!n)return s;try{return JSON.parse(n)}catch(n){return console.warn(`${t?.tagName?.toLowerCase?.()||"sf-element"}: invalid ${e} JSON`,n),s}}function Oe(t){const e=String(t||"").startsWith("sf-")?String(t):`sf-${String(t||"")}`;if(!/^sf-[a-z0-9-]+$/.test(e))throw new Error(`Invalid SF tag name: ${e}`);return e}function Le(t,e={},s=null){const n=s?.listeners??new Map,i=s?.attributes??new Set,r=new Map,o=new Set;for(const[s,n]of Object.entries(e||{})){if(":key"===s||null==n)continue;if(":ref"===s){"function"==typeof n?n(t):n&&"object"==typeof n&&(n.value=t);continue}const e=s.startsWith("@")?s.slice(1):/^on[A-Z]/.test(s)?s.slice(2).toLowerCase():null;if(e&&"function"==typeof n){r.set(e,n);continue}const i=xe(s);"boolean"!=typeof n?"object"!=typeof n&&"function"!=typeof n?(t.getAttribute(i)!==String(n)&&t.setAttribute(i,String(n)),o.add(i)):t[s]=n:(t.toggleAttribute(i,n),o.add(i))}for(const[e,s]of n)r.get(e)!==s&&t.removeEventListener(e,s);for(const[e,s]of r)n.get(e)!==s&&t.addEventListener(e,s);for(const e of i)o.has(e)||t.removeAttribute(e);return{listeners:r,attributes:o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=Ce,window.SF.pageLanguage=we,window.SF.pageText=Ee);const Me=Pt(class extends Nt{constructor(t){if(super(t),t.type!==Rt.CHILD)throw new Error("renderSmartElement belongs in a child position of a template");this._element=null,this._tagName="",this._written=null}render(t,e={}){const s=Oe(t);return this._element&&this._tagName===s||(this._element=document.createElement(s),this._tagName=s,this._written=null),this._written=Le(this._element,e,this._written),this._element}});function ke(t,e={}){const s=document.createElement(Oe(t));return Le(s,e,null),s}class He extends HTMLElement{static externalTemplateBasePath="/local/smart/templates";static externalTemplateModules=new Map;static externalTemplateMisses=new Set;static externalTemplateChecks=new Map;static externalTemplateCssLoaded=new Set;static externalTemplateCssMisses=new Set;static waitForStylesBeforeRenderReady=!0;static styleReadyTimeout=3e3;static styleReadinessCssId="sf-smart-style-readiness";static get props(){return{}}static get observedAttributes(){return Array.from(new Set([...this.propsToAttributes(),"template","root-class","root-style","style"]))}static propsToAttributes(t=this.props){return Object.entries(t||{}).flatMap(([t,e])=>{const s=this.normalizePropConfig(t,e);return[s.attribute,...s.aliases]}).filter(Boolean)}static normalizePropConfig(t,e=""){const s=e&&"object"==typeof e&&!Array.isArray(e)&&(Object.prototype.hasOwnProperty.call(e,"type")||Object.prototype.hasOwnProperty.call(e,"default")||Object.prototype.hasOwnProperty.call(e,"attribute")||Object.prototype.hasOwnProperty.call(e,"parser")||Object.prototype.hasOwnProperty.call(e,"parse")||Object.prototype.hasOwnProperty.call(e,"values"))?{...e}:{default:e},n=s.default,i=s.type||(Array.isArray(n)?Array:null!==n&&"object"==typeof n?Object:"boolean"==typeof n?Boolean:"number"==typeof n?Number:String),r=(Array.isArray(s.aliases)?s.aliases:s.aliases?[s.aliases]:[]).map(t=>!1===t?"":xe(t)).filter(Boolean);return{...s,key:t,attribute:!1===s.attribute?"":s.attribute||xe(t),aliases:r,default:n,type:i}}static toBoolean(t,e=!1){return Te(t,e)}static toAttributeName(t){return xe(t)}static toNumber(t,e=0){return Re(t,e)}static normalizeEnum(t,e,s){return Pe(t,e,s)}static parseJsonAttribute(t,e,s=null){return Ne(t,e,s)}static get tagName(){return this.resolveTagName()}static resolveTagName(t=this.name){const e=String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/_/g,"-").toLowerCase();return e?e.includes("-")?e:`sf-${e}`:""}static get sfElementBrand(){return"simai.smart-base.v1"}static isSameComponentAs(t){if(t===this)return!0;if(!t||t.sfElementBrand!==this.sfElementBrand)return!1;const e=t=>/^[A-Z][A-Za-z0-9_]{2,}$/.test(String(t||""));return!e(t.name)||!e(this.name)||t.name===this.name}static define(t){const e=String(t||this.resolveTagName()).trim().toLowerCase();if(!e||!e.includes("-"))throw new Error(`${this.name||"SfBaseElement"}.define(): cannot resolve custom element tag. Call define() on a named subclass or pass tagName explicitly.`);const s=customElements.get(e);return s?(this.isSameComponentAs(s)||console.warn(`${this.name||"SfBaseElement"}.define(): ${e} is already defined`,s),s):(customElements.define(e,this),this)}static ensureStyleReadinessCss(){if("undefined"==typeof document||document.getElementById(this.styleReadinessCssId))return;const t=document.createElement("style");t.id=this.styleReadinessCssId,t.textContent="[data-sf-style-pending],[data-sf-style-pending] *{visibility:hidden!important;}",document.head.append(t)}constructor(){super(),this._updateScheduled=!1,this._changedAttributes=new Set,this._updateLoopCount=0,this._updateLoopResetScheduled=!1,this._updateLoopBlocked=!1,this._updateLoopWarned=!1,this._isMounted=!1,this._hasRendered=!1,this._renderToken=0,this._externalTemplateModule=null,this._slotTemplates=new Map,this._liveSlotNodes=new Map,this._slotTemplatesCaptured=!1,this._customTemplateProps=new Map,this._refEffects=new Map,this._activeRefEffects=null,this._hostStyle="",this._syncingHostStyle=!1,this._authorStyleElement=null,this._authorStyleObserver=null,this._styleReady=!1,this._styleReadyPromise=null,this.__sfSmartElement=!0,this.__sfSourceCaptured=!1}connectedCallback(){this.constructor.ensureStyleReadinessCss(),this.captureHostStyle(),this.applyHostDisplayStyle(),this.captureSlotTemplates(),this.__sfSourceCaptured=!0,this._isMounted=!0,this.onConnected(),this.__sfLanguageOff=Ce.onChange(()=>{this._isMounted&&this.requestComponentUpdate("language")}),this.emitComponentEvent("connected"),this.requestComponentUpdate("connected")}disconnectedCallback(){this._isMounted=!1,this.__sfLanguageOff?.(),this.__sfLanguageOff=null;try{this.onDisconnected()}finally{this._releaseExternalTemplate()}this.emitComponentEvent("disconnected")}toBoolean(t,e=!1){return Te(t,e)}toAttributeName(t){return xe(t)}renderSmartElement(t,e={}){return Me(t,e)}toNumber(t,e=0){return Re(t,e)}normalizeEnum(t,e,s){return Pe(t,e,s)}parseJsonAttribute(t,e=null){return Ne(this,t,e)}getBooleanAttr(t,e=!1){const s=this.attributeName(t);if(!s||!this.hasAttribute(s))return e;const n=this.getAttribute(s);return""===n||Te(n,e)}getNumberAttr(t,e=0){const s=this.attributeName(t);if(!s||!this.hasAttribute(s))return e;const n=this.getAttribute(s);return""===n?e:Re(n,e)}resolveAttributeName({attribute:t="",aliases:e=[]}={}){if(t&&this.hasAttribute(t))return t;const s=e.find(t=>this.hasAttribute(t));return s&&de({component:this.localName,kind:"attribute",from:s,to:t||null}),s||t}getEnumAttr(t,e=[],s="",n=[]){const i=e&&!Array.isArray(e)&&"object"==typeof e?e:{values:e,fallback:s,aliases:n},r=this.resolveAttributeName({attribute:this.attributeName(t),aliases:(Array.isArray(i.aliases)?i.aliases:[i.aliases]).filter(Boolean).map(t=>this.attributeName(t))});return Pe(r&&this.hasAttribute(r)?this.getAttribute(r):void 0,i.values??[],i.fallback??"",i.valueAliases??null,(e,s)=>de({component:this.localName,kind:"value",attribute:this.attributeName(t),from:e,to:s}))}hasDeclaredProps(){return Object.keys(this.constructor.props||{}).length>0}createRef(){const t=se();return t.__sfOwner=this,t}registerRefEffect(t,e,s={}){if(!t||"function"!=typeof e)return this;const n={...this._refEffects.get(t)||{},callback:e,once:!0===s.once};return this._refEffects.set(t,n),this._activeRefEffects?.add(t),this}flushRefEffects(){if(!this._refEffects.size)return this;const t=this._activeRefEffects;return this._refEffects.forEach((e,s)=>{if(t&&!t.has(s))return"function"==typeof e.cleanup&&e.cleanup(),void this._refEffects.delete(s);const n=s?.value||null;if(Object.is(e.value,n))return;if("function"==typeof e.cleanup&&e.cleanup(),e.value=n,e.cleanup=null,!n)return;const i=e.callback.call(this,n,{component:this,ref:s,value:n});e.cleanup="function"==typeof i?i:null,e.once&&this._refEffects.delete(s)}),this._activeRefEffects=null,this}getPropsContext(t=this.constructor.props||{}){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,this.getPropValue(t,e)]))}getProp(t,e=""){const s=this.constructor.props||{};return this.getPropValue(t,s[t]??e)}getPropValue(t,e=""){const s=this.constructor.normalizePropConfig(t,e),{type:n,default:i}=s,r=s.parser||s.parse,o=this.resolveAttributeName(s),a=!!o&&this.hasAttribute(o),l=a?this.getAttribute(o):void 0;return!a&&Object.prototype.hasOwnProperty.call(this,t)?this.coercePropValue(this[t],s):"function"==typeof r?r.call(this,l,i,this):a?this.coercePropValue(l,s):this.clonePropDefault(i,n)}coercePropValue(t,e={}){const{type:s,default:n,values:i,valueAliases:r}=e;if(s===Boolean)return""===t||Te(t,Boolean(n));if(s===Number)return Re(t,Number(n||0));if(s===Array||s===Object){if("string"!=typeof t)return t??this.clonePropDefault(n,s);try{return JSON.parse(t)}catch(t){return console.warn(`${this.tagName.toLowerCase()}: invalid ${e.attribute} JSON`,t),this.clonePropDefault(n,s)}}return Array.isArray(i)?Pe(t,i,n||i[0]||"",r||null,(t,s)=>de({component:this.localName,kind:"value",attribute:e.attribute||e.key||"",from:t,to:s})):t??this.clonePropDefault(n,s)}clonePropDefault(t,e){return Array.isArray(t)?[...t]:!t||"object"!=typeof t||e!==Object&&e!==Array?void 0!==t?t:e!==Boolean&&(e===Number?0:e===Array?[]:e===Object?{}:""):{...t}}get value(){return this.getAttribute("value")||""}set value(t){!t||"object"!=typeof t||Array.isArray(t)?this.setAttributeValue("value",t):this.setValueAttributes(t)}getAttributeValue(t="value",e=""){return this.getAttribute(t)||e}setAttributeValue(t="value",e=""){const s=xe(t);return s?null==e?(this.removeAttribute(s),this):(this.setAttribute(s,String(e)),this):this}setValueAttributes(t={},e={}){if(!t||"object"!=typeof t)return this;const{stringifyObjects:s=!0,removeEmptyString:n=!0}=e;return Object.entries(t).forEach(([t,e])=>{const i=xe(t);i&&(this.setCustomTemplateProp(t,e),!1===e||null==e||n&&""===e?this.removeAttribute(i):!0!==e?!s||!Array.isArray(e)&&"object"!=typeof e?this.setAttribute(i,String(e)):this.setAttribute(i,JSON.stringify(e)):this.setAttribute(i,""))}),this}attributeChangedCallback(t,e,s){if(e!==s){if("style"===t){if(this._syncingHostStyle)return;this._hostStyle=this.normalizeHostStyle(s),this.syncAuthorStyle(),this.applyHostDisplayStyle()}this.requestComponentUpdate(t)}}get updateLoopLimit(){const t=Number(this.constructor.updateLoopLimit??50);return Number.isFinite(t)?t:50}resetUpdateLoopGuard(){this._updateLoopCount=0,this._updateLoopResetScheduled=!1,this._updateLoopBlocked=!1,this._updateLoopWarned=!1}scheduleUpdateLoopGuardReset(){this._updateLoopResetScheduled||(this._updateLoopResetScheduled=!0,setTimeout(()=>{this.resetUpdateLoopGuard()},0))}canScheduleComponentUpdate(t="unknown"){if(this._updateLoopBlocked)return!1;const e=this.updateLoopLimit;return e<=0||(this.scheduleUpdateLoopGuardReset(),this._updateLoopCount+=1,this._updateLoopCount<=e||(this._updateLoopBlocked=!0,this._changedAttributes.clear(),this._updateLoopWarned||(this._updateLoopWarned=!0,console.warn(`${this.componentTagName||"sf-element"}: update loop limit reached`,{reason:t,limit:e,component:this})),!1))}requestComponentUpdate(t="unknown"){this._updateLoopBlocked||(t&&this._changedAttributes.add(t),this._updateScheduled||this.canScheduleComponentUpdate(t)&&(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._isMounted)return;const t=Array.from(this._changedAttributes);this._changedAttributes.clear(),this.performComponentUpdate(t).catch(t=>this.reportComponentError(t,"render"))})))}reportComponentError(t,e="render"){console.error(t),this.setAttribute("data-sf-error",e),this.dispatchEvent(new CustomEvent("sf-component-error",{bubbles:!0,composed:!0,detail:{phase:e,message:String(t?.message??t),element:this.localName}}))}async performComponentUpdate(t=[]){const e=this.hasBuiltInTemplate(this.componentTemplateName)&&!this._externalTemplateModule?this.resolveUpdateMode(t):"lit";if("dom"===e&&!1!==this.updateDom(t))return this.afterUpdate(t,e),this.emitComponentEvent("updated",{changedAttributes:t,updateMode:e}),void this.emitComponentEvent("props-change",this.createPropChangeDetail(t,e));await this.renderComponent(t),this.afterUpdate(t,"lit"),this.emitComponentEvent("updated",{changedAttributes:t,updateMode:"lit"}),this.emitComponentEvent("props-change",this.createPropChangeDetail(t,"lit"))}async renderComponent(t=[]){const e=++this._renderToken;if(!this._isMounted)return;this._activeRefEffects=new Set,this.beforeRender(t),this.emitComponentEvent("before-render",{changedAttributes:t}),this.runExternalHook("beforeRender",{changedAttributes:t,root:this});const s=await this.resolveTemplateResult(t);this._isMounted&&e===this._renderToken&&(this.prepareRenderContainer(t),this.markStylePending(this),$t(s,this),this.flushRefEffects(),await this.whenRenderedStylesReady(this),this._isMounted&&e===this._renderToken&&(this._hasRendered=!0,this.afterRender(t),this._childrenDefinedPromise=null,this.runExternalHook("afterRender",{changedAttributes:t,root:this}),this.emitComponentEvent("after-render",{changedAttributes:t})))}shouldWaitForStylesReady(){return!1!==this.constructor.waitForStylesBeforeRenderReady}markStylePending(t=this){return this.shouldWaitForStylesReady()&&!this._styleReady&&t?.setAttribute&&(t.setAttribute("data-sf-style-pending",""),t.removeAttribute("data-sf-style-ready")),this}markStyleReady(t=this){return this._styleReady=!0,[t,this].forEach(t=>{t?.removeAttribute&&t?.setAttribute&&(t.removeAttribute("data-sf-style-pending"),t.setAttribute("data-sf-style-ready",""))}),this}async whenRenderedStylesReady(t=this){if(!this.shouldWaitForStylesReady())return;const e=window.SF?.Loader;if(!e||"function"!=typeof e.ensureStylesReady)return void this.markStyleReady(t);const s=Promise.resolve().then(()=>e.ensureStylesReady(t||this,{autoLoad:!0})),n=Number(this.constructor.styleReadyTimeout??3e3);this._styleReadyPromise=n>0?Promise.race([s,new Promise(t=>{setTimeout(t,n)})]):s,await this._styleReadyPromise.catch(t=>{console.warn(`${this.componentTagName||"sf-element"}: style readiness failed`,t)}),this.markStyleReady(t)}getChildCustomElements(){return Array.from(this.querySelectorAll("*")).filter(t=>(t?.tagName?.toLowerCase?.()||"").startsWith("sf-"))}async whenChildrenDefined(){return this._childrenDefinedPromise||(this._childrenDefinedPromise=Promise.resolve().then(async()=>{const t=this.getChildCustomElements();return await Promise.all(t.map(async t=>{const e=t.tagName?.toLowerCase?.();e&&window.customElements?.whenDefined&&(await window.customElements.whenDefined(e),t.updateComplete?.then&&await t.updateComplete,t._updateScheduled&&await Promise.resolve())})),t})),this._childrenDefinedPromise}get componentTagName(){return this.tagName?.toLowerCase?.()||""}get componentTemplateName(){return this.getAttribute("template")||"default"}get externalTemplateComponentName(){return this.componentTagName.startsWith("sf-")?this.componentTagName.replace(/^sf-/,""):this.componentTagName}get externalTemplateBasePath(){return window.SF_SMART_TEMPLATE_PATH||window.SFSmartTemplatePath||this.constructor.externalTemplateBasePath}emitComponentEvent(t,e={}){const s={component:this,tagName:this.componentTagName,template:this.componentTemplateName,...e};this.dispatchEvent(new CustomEvent(`sf-${t}`,{bubbles:!0,composed:!0,detail:s}))}attributeName(t){return String(t||"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}shouldSerializeFalseAttribute(t){const e=this.constructor.defaultTrueAttributes;return!!e&&(e instanceof Set?e.has(t):!!Array.isArray(e)&&e.includes(t))}setAttributes(t={}){return t&&"object"==typeof t?(Object.entries(t).forEach(([t,e])=>{const s=this.attributeName(t);s&&(this.setCustomTemplateProp(t,e),!1===e&&this.shouldSerializeFalseAttribute(s)?this.setAttribute(s,"false"):!1!==e&&null!=e&&""!==e?!0!==e?this.setAttribute(s,String(e)):this.setAttribute(s,""):this.removeAttribute(s))}),this):this}forwardHostAttributes(t,e={}){if(!t)return this;const{exclude:s=[],transferDataAttributes:n=!0,storageKey:i="__sfForwardedDataAttributes",targetStorageKey:r="__sfForwardedAttributeKeys"}=e,o=s instanceof Set?s:new Set(s),a=this[i]||new Map,l=t[r]||new Set,c=[],h=new Set;return l.forEach(e=>{t.removeAttribute(e)}),Array.from(this.attributes).forEach(e=>{const{name:s,value:i}=e;if(!o.has(s)&&!/^on[a-z]/i.test(s)){if(n&&s.startsWith("data-"))return a.set(s,i),void c.push(s);h.add(s),t.setAttribute(s,i)}}),a.forEach((e,s)=>{h.add(s),t.setAttribute(s,e)}),t[r]=h,this[i]=a,this.__sfHostDataAttributes=a,this.__sfHostDataAttributeTarget=t,this.__sfHostDataAttributeTargetKeys=r,c.length&&(this.__sfForwardingHostAttributes=!0,c.forEach(t=>this.removeAttribute(t)),this.__sfForwardingHostAttributes=!1),this}get dataAttributes(){const t=this.__sfHostDataAttributes;if(!t||!t.size)return{};const e={};return t.forEach((t,s)=>{const n=s.slice(5).replace(/-([a-z])/gu,(t,e)=>e.toUpperCase());e[n]=t}),e}removeHostDataAttribute(t){if("string"!=typeof t||!t)return this;const e=t.startsWith("data-")?t:`data-${t.replace(/[A-Z]/gu,t=>`-${t.toLowerCase()}`)}`;this.__sfForwardingHostAttributes=!0,this.removeAttribute(e),this.__sfForwardingHostAttributes=!1,this.__sfHostDataAttributes?.delete(e),this.__sfHostDataAttributeTarget?.removeAttribute?.(e);const s=this.__sfHostDataAttributeTargetKeys;return s&&this.__sfHostDataAttributeTarget?.[s]?.delete?.(e),this}observeForwardedHostAttributes(t,e={}){if(this._forwardHostAttributeObserver)return this;const s="function"==typeof t?t:()=>t;return this._forwardHostAttributeObserver=new MutationObserver(()=>{this.__sfForwardingHostAttributes||this.forwardHostAttributes(s(),e)}),this._forwardHostAttributeObserver.observe(this,{attributes:!0}),this}disconnectForwardedHostAttributes(){return this._forwardHostAttributeObserver?.disconnect?.(),this._forwardHostAttributeObserver=null,this}focusDelegate(){return null}focus(t){const e=this.focusDelegate?.();if(e&&"function"==typeof e.focus)e.focus(t);else{if(!e&&"function"==typeof this.focusDelegate&&!this.isRendered){const e=this.ownerDocument?.activeElement||null;return void this.whenRendered(()=>{const s=this.focusDelegate?.();s&&"function"==typeof s.focus&&(this.ownerDocument?.activeElement||null)===e&&s.focus(t)})}super.focus(t)}}blur(){const t=this.focusDelegate?.();t&&"function"==typeof t.blur?t.blur():super.blur()}removeAttributes(t=[]){return(Array.isArray(t)?t:[t]).filter(Boolean).forEach(t=>this.removeAttribute(this.attributeName(t))),this}refresh(t="manual"){return this.requestComponentUpdate(t),this}get isRendered(){return!0===this._hasRendered}createRenderDetail(t={}){return{component:this,tagName:this.componentTagName,template:this.componentTemplateName,...t}}runRenderedCallback(t,e={},s=null){if("function"==typeof t)return t.call(this,this.createRenderDetail(e),s)}whenRendered(t=null,e={}){const s=!0===e.next;if(this.isRendered&&!s){const e=this.createRenderDetail({changedAttributes:[],immediate:!0});return Promise.resolve().then(()=>(this.runRenderedCallback(t,e),e))}return new Promise(e=>{this.addEventListener("sf-after-render",s=>{const n=s?.detail||this.createRenderDetail();this.runRenderedCallback(t,n,s),e(n)},{once:!0})})}onAfterRender(t,e={}){const s=!1!==e.immediate,n=!1!==e.once;if(s&&this.isRendered&&(this.runRenderedCallback(t,{changedAttributes:[],immediate:!0}),n))return()=>{};const i=e=>{this.runRenderedCallback(t,e?.detail||{},e),n&&this.removeEventListener("sf-after-render",i)};return this.addEventListener("sf-after-render",i),()=>this.removeEventListener("sf-after-render",i)}getState(){return void 0!==this.state?this.state:this.hasDeclaredProps()?this.templateContext():void 0!==this.value?this.value:this.templateContext()}normalizeStateCallbackArgs(t,e,s="state"){return"function"==typeof t?{reason:s,callback:t}:{reason:t||s,callback:e}}runStateCallback(t,e={}){return"function"!=typeof t||t.call(this,{component:this,state:this.getState(),...e}),this}scheduleStateCallback(t,e={}){return"function"!=typeof t?this:this._isMounted&&this._updateScheduled?(this.whenRendered(s=>{this.runStateCallback(t,{...e,renderDetail:s})},{next:!0}),this):(Promise.resolve().then(()=>{this.runStateCallback(t,e)}),this)}setState(t={},e=null){return this.setAttributes(t),this.scheduleStateCallback(e,{patch:t,reason:"attributes"}),this}patchState(t={},e="state",s=null){const{reason:n,callback:i}=this.normalizeStateCallbackArgs(e,s,"state"),r=this.state&&"object"==typeof this.state?this.state:{},o="function"==typeof t?t(r):t;if(!o||"object"!=typeof o||Object.is(o,r))return this.scheduleStateCallback(i,{patch:o,reason:n,changed:!1,changedKeys:[],prevState:r,nextState:r}),this;let a=!1;const l=[],c={...r};return Object.entries(o).forEach(([t,e])=>{Object.is(c[t],e)||(c[t]=e,a=!0,l.push(t))}),a?(this.state=c,this.requestComponentUpdate(n),this.scheduleStateCallback(i,{patch:o,reason:n,changed:!0,changedKeys:l,prevState:r,nextState:c}),this):(this.scheduleStateCallback(i,{patch:o,reason:n,changed:!1,changedKeys:l,prevState:r,nextState:r}),this)}set(t={},e="state",s=null){return this.patchState(t,e,s)}getRootClass(){return this.getAttribute("root-class")||""}normalizeHostStyle(t=""){const e=document.createElement("div");return e.setAttribute("style",String(t||"")),e.style.removeProperty("display"),e.style.cssText}get style(){return this._authorStyleElement||(this._authorStyleElement=document.createElement("div"),this._hostStyle=this.normalizeHostStyle(this.getAttribute("style"))||this._hostStyle,this.syncAuthorStyle(),this._authorStyleObserver=new MutationObserver(()=>this.flushAuthorStyle()),this._authorStyleObserver.observe(this._authorStyleElement,{attributes:!0,attributeFilter:["style"]})),this._authorStyleElement.style}set style(t){this.style.cssText=null==t?"":String(t)}syncAuthorStyle(){if(!this._authorStyleElement)return;const t=`${this._hostStyle} display: contents;`.trim();this._authorStyleElement.style.cssText!==t&&(this._authorStyleElement.style.cssText=t)}flushAuthorStyle(){if(!this._authorStyleElement)return;const t=this.normalizeHostStyle(this._authorStyleElement.style.cssText);t!==this._hostStyle?this.setAttribute("style",t):"contents"!==this._authorStyleElement.style.display&&this.syncAuthorStyle()}captureHostStyle(){this.flushAuthorStyle();const t=this.normalizeHostStyle(this.getAttribute("style"));return!t&&this._hostStyle||(this._hostStyle=t),this.syncAuthorStyle(),this}applyHostDisplayStyle(){const t="display: contents;";return this.getAttribute("style")===t||(this._syncingHostStyle=!0,this.setAttribute("style",t),this._syncingHostStyle=!1),this}getRootStyle(){return this.flushAuthorStyle(),[this._hostStyle,this.getAttribute("root-style")].filter(Boolean).join("; ")}setRootClass(t=""){const e=String(t||"").trim();return e?(this.setAttribute("root-class",e),this):(this.removeAttribute("root-class"),this)}addRootClass(...t){const e=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return t.flat().filter(Boolean).forEach(t=>{String(t).split(/\s+/).filter(Boolean).forEach(t=>e.add(t))}),this.setRootClass(Array.from(e).join(" "))}setRootStyle(t=""){const e=String(t||"").trim();return e?(this.setAttribute("root-style",e),this):(this.removeAttribute("root-style"),this)}removeRootClass(...t){const e=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return t.flat().filter(Boolean).forEach(t=>{String(t).split(/\s+/).filter(Boolean).forEach(t=>e.delete(t))}),this.setRootClass(Array.from(e).join(" "))}toggleRootClass(t,e){const s=String(t||"").trim();if(!s)return this;const n=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return("boolean"==typeof e?e:!n.has(s))?n.add(s):n.delete(s),this.setRootClass(Array.from(n).join(" ")),this}setHidden(t=!0){const e=Te(t,!0);return this.toggleAttribute("hidden",e),this.toggleRootClass("hidden",e),this}isHidden(){const t=new Set(this.getRootClass().split(/\s+/).filter(Boolean));return this.hasAttribute("hidden")||t.has("hidden")}createPropChangeDetail(t=[],e="lit"){return{changedAttributes:t,updateMode:e,state:this.getState()}}onPropChange(t,e){return"function"==typeof t&&this.addEventListener("sf-props-change",e=>{t(e.detail?.state,e.detail,e)},e),this}onUpdate(t,e){return"function"==typeof t&&this.addEventListener("sf-updated",e=>{t(this.getState(),e.detail,e)},e),this}createTemplateContext(t={}){const e=this.hasDeclaredProps()?this.getPropsContext():{},s={component:this,rootClass:this.getRootClass(),rootStyle:this.getRootStyle(),...e,...t},n=this.getCustomTemplateProps(s);return{...n,...s,custom:n}}getCustomTemplateProps(t={}){const e=this.getReservedTemplateAttributes(),s=this.getReservedTemplateKeys(t),n={};return this._customTemplateProps.forEach((e,s)=>{this.isCustomTemplateProp(s,t)&&(n[s]=e)}),Object.entries(this.getOwnCustomTemplateProps(t)).forEach(([t,e])=>{!t||s.has(t)||Object.prototype.hasOwnProperty.call(n,t)||(n[t]=e)}),Array.from(this.attributes||[]).forEach(({name:t,value:i})=>{if(e.has(t))return;const r=this.attributeToPropertyName(t);!r||s.has(r)||Object.prototype.hasOwnProperty.call(n,r)||(n[r]=i)}),n}getOwnCustomTemplateProps(t={}){const e={},s=this.getReservedTemplateKeys(t);return Object.keys(this).forEach(t=>{t.startsWith("_")||s.has(t)||"function"==typeof this[t]||(e[t]=this[t])}),e}getReservedTemplateAttributes(){const t=new Set(["class","style","id","slot","template"]);return(this.constructor.observedAttributes||[]).forEach(e=>{const s=xe(e);s&&t.add(s)}),t}getReservedTemplateKeys(t={}){const e=new Set(["custom"]);return Object.keys(t||{}).forEach(t=>{e.add(t)}),this.getReservedTemplateAttributes().forEach(t=>{const s=this.attributeToPropertyName(t);s&&e.add(s)}),e}isCustomTemplateProp(t,e={}){const s=this.attributeToPropertyName(xe(t));if(!s)return!1;const n=xe(s),i=this.getReservedTemplateAttributes(),r=this.getReservedTemplateKeys(e);return!i.has(n)&&!r.has(s)}setCustomTemplateProps(t={},e={}){return t&&"object"==typeof t?(Object.entries(t).forEach(([t,s])=>{this.setCustomTemplateProp(t,s,e)}),this):this}setCustomTemplateProp(t,e,s={}){const n=this.attributeToPropertyName(xe(t));return this.isCustomTemplateProp(n,s)?!1===e||null==e?(this._customTemplateProps.delete(n)&&this.requestComponentUpdate(n),this):(this._customTemplateProps.get(n)===e||(this._customTemplateProps.set(n,e),this.requestComponentUpdate(n)),this):this}attributeToPropertyName(t){return String(t||"").replace(/-([a-z0-9])/g,(t,e)=>e.toUpperCase())}resolveUpdateMode(){return"lit"}createPropsTemplateContext(t={}){return this.createTemplateContext({component:this,...this.getPropsContext(),...t})}templateContext(){return this.createPropsTemplateContext()}captureSlotTemplates(){this._slotTemplatesCaptured||(this._slotTemplatesCaptured=!0,Array.from(this.children).forEach(t=>{if(!(t instanceof HTMLElement))return;const e=t.getAttribute("slot");if(!e)return;if("template"===t.tagName?.toLowerCase?.())return this._slotTemplates.has(e)||this._slotTemplates.set(e,[]),Array.from(t.content?.childNodes||[]).forEach(t=>{this._slotTemplates.get(e).push(t.cloneNode(!0))}),void t.remove();this._liveSlotNodes.has(e)||this._liveSlotNodes.set(e,[]);const s=1===t.getAttributeNames().length&&t.hasAttribute("slot")?Array.from(t.childNodes):[t];this._liveSlotNodes.get(e).push(...s),t.remove()}))}captureChildTemplates(t,e,s={}){if(!t)return[];const{append:n=!0,remove:i=!0}=s,r="function"==typeof e?e:t=>t instanceof Element&&"string"==typeof e&&t.matches?.(e),o=Array.from(this.childNodes||[]).filter(t=>r(t));if(!o.length)return[];n&&this._slotTemplates.has(t)||this._slotTemplates.set(t,[]);const a=o.map(t=>t.cloneNode(!0));return a.forEach(e=>{this._slotTemplates.get(t).push(e)}),i&&o.forEach(t=>t.remove()),a.map(t=>t.cloneNode(!0))}hasSlotContent(t){return(this._liveSlotNodes.get(t)||[]).length>0||(this._slotTemplates.get(t)||[]).length>0}getSlotContent(t){const e=this._liveSlotNodes.get(t)||[];if(e.length)return 1===e.length?e[0]:e;const s=this._slotTemplates.get(t)||[];return s.length?1===s.length?s[0].cloneNode(!0):s.map(t=>t.cloneNode(!0)):lt}setSlot(t,...e){if(!t)return this;const s=e.map(t=>{if("string"==typeof t){const e=document.createElement("div");return e.innerHTML=t,Array.from(e.childNodes)}return[t]}).flat().filter(t=>t instanceof Node);return this._slotTemplates.delete(t),this._liveSlotNodes.set(t,s),this.requestComponentUpdate("slot-change"),this}copyRuntimeData(t,e){if(!(t instanceof Node&&e instanceof Node))return;t.__sfCreateEventHandlers&&Object.defineProperty(e,"__sfCreateEventHandlers",{configurable:!0,enumerable:!1,value:t.__sfCreateEventHandlers.slice()});const s=Array.from(t.childNodes||[]),n=Array.from(e.childNodes||[]);s.forEach((t,e)=>{this.copyRuntimeData(t,n[e])})}clearSlot(t){return t?(this._slotTemplates.delete(t),this._liveSlotNodes&&this._liveSlotNodes.delete(t),this.requestComponentUpdate("slot-change"),this):this}async resolveTemplateResult(t=[]){const e=this.componentTemplateName,s=this._renderToken;if(this.hasBuiltInTemplate(e))return this._releaseExternalTemplate(),this.template();const n=await this.resolveExternalTemplateModule(e);if(!this._isMounted||s!==this._renderToken||e!==this.componentTemplateName)return lt;if(n!==this._externalTemplateModule&&this._releaseExternalTemplate(),this._externalTemplateModule=n||null,n){const e=this.templateContext(),s=this.createTemplateContext(this.mapExternalTemplateContext(e,n)),i="function"==typeof n.default?n.default:null;if(i)return i({html:it,nothing:lt,context:s,component:this,changedAttributes:t})}return this._externalTemplateModule=null,this.template()}hasBuiltInTemplate(t=this.componentTemplateName){return!t||"default"===t}mapExternalTemplateContext(t,e){return"function"==typeof e?.mapContext&&e.mapContext({context:t,component:this,html:it,nothing:lt})||t}async resolveExternalTemplateModule(t=this.componentTemplateName){if(!t)return null;const e=this.getExternalTemplateModuleUrl(t);if(!e)return null;if(await this.loadExternalTemplateCss(t),this.constructor.externalTemplateModules.has(e))return this.constructor.externalTemplateModules.get(e);if(this.constructor.externalTemplateMisses.has(e))return null;if(!await this.checkExternalTemplateModule(e))return this.constructor.externalTemplateMisses.add(e),null;try{const t=await import(e);return this.constructor.externalTemplateModules.set(e,t),t}catch(t){return console.warn(t),this.constructor.externalTemplateMisses.add(e),null}}async checkExternalTemplateModule(t){if(!t)return!1;if(this.constructor.externalTemplateChecks.has(t))return this.constructor.externalTemplateChecks.get(t);const e=fetch(t,{method:"GET",cache:"no-store"}).then(t=>t.ok).catch(()=>!1);this.constructor.externalTemplateChecks.set(t,e);const s=await e;return s||this.constructor.externalTemplateChecks.delete(t),s}getExternalTemplateModuleUrl(t=this.componentTemplateName){const e=String(this.externalTemplateBasePath||"").replace(/\/$/,""),s=this.externalTemplateComponentName;return e&&s&&t?`${e}/${s}/${t}/index.js`:""}getExternalTemplateCssUrl(t=this.componentTemplateName){const e=String(this.externalTemplateBasePath||"").replace(/\/$/,""),s=this.externalTemplateComponentName;return e&&s&&t?`${e}/${s}/${t}/index.css`:""}loadExternalTemplateCss(t=this.componentTemplateName){const e=this.getExternalTemplateCssUrl(t);if(!e)return Promise.resolve(!1);if(this.constructor.externalTemplateCssLoaded.has(e))return Promise.resolve(!0);if(this.constructor.externalTemplateCssMisses.has(e))return Promise.resolve(!1);return document.querySelector(`link[data-sf-smart-css="${e}"]`)?(this.constructor.externalTemplateCssLoaded.add(e),Promise.resolve(!0)):new Promise(t=>{const s=document.createElement("link");s.rel="stylesheet",s.href=e,s.dataset.sfSmartCss=e,s.onload=()=>{this.constructor.externalTemplateCssLoaded.add(e),t(!0)},s.onerror=()=>{this.constructor.externalTemplateCssMisses.add(e),t(!1)},document.head.append(s)})}_releaseExternalTemplate(){const t=this._externalTemplateModule;t&&(this._externalTemplateModule=null,this.runExternalHook("destroy",{},t))}runExternalHook(t,e={},s=this._externalTemplateModule){if("function"==typeof s?.[t])try{s[t]({component:this,root:this,html:it,nothing:lt,context:this.templateContext(),...e})}catch(t){console.warn(t)}}updateDom(){return!1}shouldClearLightDomBeforeFirstRender(){return!0===this.constructor.clearLightDomBeforeFirstRender}prepareRenderContainer(){!this._hasRendered&&this.shouldClearLightDomBeforeFirstRender()&&this.replaceChildren()}template(){return lt}beforeRender(){}afterRender(t){if("function"==typeof t)return this.whenRendered(t)}afterUpdate(){}onConnected(){}onDisconnected(){this._releaseExternalTemplate()}}const De=He;if("undefined"!=typeof window&&(window.SfBaseElement=He,window.html=it,window.nothing=lt,window.render=$t,window.SF||(window.SF={}),window.SF.SfBaseElement=He,window.SF.html=it,window.SF.nothing=lt,window.SF.render=$t,window.SF.smart={...window.SF.smart||{},SfBaseElement:He,html:it,nothing:lt,render:$t,toBoolean:Te,toAttributeName:xe,toNumber:Re,normalizeEnum:Pe,parseJsonAttribute:Ne},!window.SF.__internal.smartBaseAnnounced)){window.SF.__internal.smartBaseAnnounced=!0;try{window.dispatchEvent(new CustomEvent("sf-smart-base-ready",{detail:{smart:window.SF.smart,loader:window.SF.Loader||null,timestamp:Date.now()}}))}catch(t){console.warn("sf-smart-base-ready dispatch failed",t)}}const je=Math.min,Ue=Math.max,Be=Math.round,Fe=Math.floor,ze=t=>({x:t,y:t}),We={left:"right",right:"left",bottom:"top",top:"bottom"};function Ie(t,e){return"function"==typeof t?t(e):t}function Ve(t){return t.split("-")[0]}function qe(t){return t.split("-")[1]}function Ge(t){return"x"===t?"y":"x"}function Ke(t){return"y"===t?"height":"width"}function Je(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function Ze(t){return Ge(Je(t))}function Ye(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Qe=["left","right"],Xe=["right","left"],ts=["top","bottom"],es=["bottom","top"];function ss(t,e,s,n){const i=qe(t);let r=function(t,e,s){switch(t){case"top":case"bottom":return s?e?Xe:Qe:e?Qe:Xe;case"left":case"right":return e?ts:es;default:return[]}}(Ve(t),"start"===s,n);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(Ye)))),r}function ns(t){const e=Ve(t);return We[e]+t.slice(e.length)}function is(t){const{x:e,y:s,width:n,height:i}=t;return{width:n,height:i,top:s,left:e,right:e+n,bottom:s+i,x:e,y:s}}function rs(t,e,s){let{reference:n,floating:i}=t;const r=Je(e),o=Ze(e),a=Ke(o),l=Ve(e),c="y"===r,h=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(l){case"top":p={x:h,y:n.y-i.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-i.width,y:u};break;default:p={x:n.x,y:n.y}}const f=qe(e);return f&&(p[o]+=d*("end"===f?1:-1)*(s&&c?-1:1)),p}async function os(t,e){var s;void 0===e&&(e={});const{x:n,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=Ie(e,t),f=function(t){return"number"!=typeof t?function(t){var e,s,n,i;return{top:null!=(e=t.top)?e:0,right:null!=(s=t.right)?s:0,bottom:null!=(n=t.bottom)?n:0,left:null!=(i=t.left)?i:0}}(t):{top:t,right:t,bottom:t,left:t}}(p),m=a[d?"floating"===u?"reference":"floating":u],g=is(await r.getClippingRect({element:null==(s=await(null==r.isElement?void 0:r.isElement(m)))||s?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),y="floating"===u?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),_=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},v=is(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-v.top+f.top)/_.y,bottom:(v.bottom-g.bottom+f.bottom)/_.y,left:(g.left-v.left+f.left)/_.x,right:(v.right-g.right+f.right)/_.x}}const as=new Set(["left","top"]);function ls(){return"undefined"!=typeof window}function cs(t){return ds(t)?(t.nodeName||"").toLowerCase():"#document"}function hs(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function us(t){var e;return null==(e=(ds(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ds(t){return!!ls()&&(t instanceof Node||t instanceof hs(t).Node)}function ps(t){return!!ls()&&(t instanceof Element||t instanceof hs(t).Element)}function fs(t){return!!ls()&&(t instanceof HTMLElement||t instanceof hs(t).HTMLElement)}function ms(t){return!(!ls()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof hs(t).ShadowRoot)}function gs(t){const{overflow:e,overflowX:s,overflowY:n,display:i}=Cs(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+s)&&"inline"!==i&&"contents"!==i}function ys(t){return/^(table|td|th)$/.test(cs(t))}function bs(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const _s=/transform|translate|scale|rotate|perspective|filter/,vs=/paint|layout|strict|content/,As=t=>!!t&&"none"!==t;let ws;function Ss(t){const e=ps(t)?Cs(t):t;return As(e.transform)||As(e.translate)||As(e.scale)||As(e.rotate)||As(e.perspective)||!$s()&&(As(e.backdropFilter)||As(e.filter))||_s.test(e.willChange||"")||vs.test(e.contain||"")}function $s(){return null==ws&&(ws="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ws}function Es(t){return/^(html|body|#document)$/.test(cs(t))}function Cs(t){return hs(t).getComputedStyle(t)}function Ts(t){return ps(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if("html"===cs(t))return t;const e=t.assignedSlot||t.parentNode||ms(t)&&t.host||us(t);return ms(e)?e.host:e}function Rs(t){const e=xs(t);return Es(e)?(t.ownerDocument||t).body:fs(e)&&gs(e)?e:Rs(e)}function Ps(t,e,s){var n;void 0===e&&(e=[]),void 0===s&&(s=!0);const i=Rs(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=hs(i);if(r){const t=Ns(o);return e.concat(o,o.visualViewport||[],gs(i)?i:[],t&&s?Ps(t):[])}return e.concat(i,Ps(i,[],s))}function Ns(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Os(t){const e=Cs(t);let s=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=fs(t),r=i?t.offsetWidth:s,o=i?t.offsetHeight:n,a=Be(s)!==r||Be(n)!==o;return a&&(s=r,n=o),{width:s,height:n,$:a}}function Ls(t){return ps(t)?t:t.contextElement}function Ms(t){const e=Ls(t);if(!fs(e))return ze(1);const s=e.getBoundingClientRect(),{width:n,height:i,$:r}=Os(e);let o=(r?Be(s.width):s.width)/n,a=(r?Be(s.height):s.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}const ks=ze(0);function Hs(t){const e=hs(t);return $s()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ks}function Ds(t,e,s,n){void 0===e&&(e=!1),void 0===s&&(s=!1);const i=t.getBoundingClientRect(),r=Ls(t);let o=ze(1);e&&(n?ps(n)&&(o=Ms(n)):o=Ms(t));const a=function(t,e,s){return void 0===e&&(e=!1),!!s&&e&&s===hs(t)}(r,s,n)?Hs(r):ze(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,h=i.width/o.x,u=i.height/o.y;if(r&&n){const t=hs(r),e=ps(n)?hs(n):n;let s=t,i=Ns(s);for(;i&&e!==s;){const t=Ms(i),e=i.getBoundingClientRect(),n=Cs(i),r=e.left+(i.clientLeft+parseFloat(n.paddingLeft))*t.x,o=e.top+(i.clientTop+parseFloat(n.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=o,s=hs(i),i=Ns(s)}}return is({width:h,height:u,x:l,y:c})}function js(t,e){const s=Ts(t).scrollLeft;return e?e.left+s:Ds(us(t)).left+s}function Us(t,e){const s=t.getBoundingClientRect();return{x:s.left+e.scrollLeft-js(t,s),y:s.top+e.scrollTop}}function Bs(t,e,s){let n;if("viewport"===e||"layoutViewport"===e)n=function(t,e,s){void 0===s&&(s="viewport");const n="layoutViewport"===s,i=hs(t),r=us(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,h=0;if(o){const t=!$s()||"fixed"===e;n?t||(c=-o.offsetLeft,h=-o.offsetTop):(a=o.width,l=o.height,t&&(c=o.offsetLeft,h=o.offsetTop))}if(js(r)<=0){const t=r.ownerDocument,e=t.body,s=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(s.marginLeft)+parseFloat(s.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-n),o="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;o<=25&&(a-=o)}return{width:a,height:l,x:c,y:h}}(t,s,e);else if("document"===e)n=function(t){const e=Ts(t),s=t.ownerDocument.body,n=Ue(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Ue(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-e.scrollLeft+js(t);const o=-e.scrollTop;return"rtl"===Cs(s).direction&&(r+=Ue(t.clientWidth,s.clientWidth)-n),{width:n,height:i,x:r,y:o}}(us(t));else if(ps(e))n=function(t,e){const s=Ds(t,!0,"fixed"===e),n=s.top+t.clientTop,i=s.left+t.clientLeft,r=Ms(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:n*r.y}}(e,s);else{const s=Hs(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return is(n)}function Fs(t,e,s){const n=fs(e),i=us(e),r="fixed"===s,o=Ds(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ze(0);if((n||!r)&&(("body"!==cs(e)||gs(i))&&(a=Ts(e)),n)){const t=Ds(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}!n&&i&&(l.x=js(i));const c=!i||n||r?ze(0):Us(i,a);return{x:o.left+a.scrollLeft-l.x-c.x,y:o.top+a.scrollTop-l.y-c.y,width:o.width,height:o.height}}function zs(t){return"static"===Cs(t).position}function Ws(t,e){if(!fs(t)||"fixed"===Cs(t).position)return null;if(e)return e(t);let s=t.offsetParent;return us(t)===s&&(s=s.ownerDocument.body),s}function Is(t,e){const s=hs(t);if(bs(t))return s;if(!fs(t)){let e=xs(t);for(;e&&!Es(e);){if(ps(e)&&!zs(e))return e;e=xs(e)}return s}let n=Ws(t,e);for(;n&&ys(n)&&zs(n);)n=Ws(n,e);return n&&Es(n)&&zs(n)&&!Ss(n)?s:n||function(t){let e=xs(t);for(;fs(e)&&!Es(e);){if(Ss(e))return e;if(bs(e))return null;e=xs(e)}return null}(t)||s}const Vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:s,offsetParent:n,strategy:i}=t;const r="fixed"===i,o=us(n),a=!!e&&bs(e.floating);if(n===o||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=ze(1);const h=ze(0),u=fs(n);if((u||!r)&&(("body"!==cs(n)||gs(o))&&(l=Ts(n)),u)){const t=Ds(n);c=Ms(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}const d=!o||u||r?ze(0):Us(o,l);return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:s.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:us,getClippingRect:function(t){let{element:e,boundary:s,rootBoundary:n,strategy:i}=t;const r=[..."clippingAncestors"===s?bs(e)?[]:function(t,e){const s=e.get(t);if(s)return s;let n=Ps(t,[],!1).filter(t=>ps(t)&&"body"!==cs(t)),i=null;const r="fixed"===Cs(t).position;let o=r?xs(t):t;for(;ps(o)&&!Es(o);){const t=Cs(o),e=Ss(o),s=i?i.position:r?"fixed":"";e||"fixed"!==s&&("absolute"!==s||"static"!==t.position)?i=t:n=n.filter(t=>t!==o),o=xs(o)}return e.set(t,n),n}(e,this._c):[].concat(s),n],o=Bs(e,r[0],i);let a=o.top,l=o.right,c=o.bottom,h=o.left;for(let t=1;t<r.length;t++){const s=Bs(e,r[t],i);a=Ue(s.top,a),l=je(s.right,l),c=je(s.bottom,c),h=Ue(s.left,h)}return{width:l-h,height:c-a,x:h,y:a}},getOffsetParent:Is,getElementRects:async function(t){const e=this.getOffsetParent||Is,s=this.getDimensions,n=await s(t.floating);return{reference:Fs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:s}=Os(t);return{width:e,height:s}},getScale:Ms,isElement:ps,isRTL:function(t){return"rtl"===Cs(t).direction}};function qs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Gs(t,e,s,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Ls(t),h=i||r?[...c?Ps(c):[],...e?Ps(e):[]]:[];h.forEach(t=>{i&&t.addEventListener("scroll",s),r&&t.addEventListener("resize",s)});const u=c&&a?function(t,e,s){let n,i=null;const r=us(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:p}=c;if(s||e(),!d||!p)return;const f={rootMargin:-Fe(u)+"px "+-Fe(r.clientWidth-(h+d))+"px "+-Fe(r.clientHeight-(u+p))+"px "+-Fe(h)+"px",threshold:Ue(0,je(1,l))||1};let m=!0;function g(e){const s=e[0].intersectionRatio;if(!qs(c,t.getBoundingClientRect()))return a();if(s!==l){if(!m)return a();s?a(!1,s):n=setTimeout(()=>{a(!1,1e-7)},1e3)}m=!1}try{i=new IntersectionObserver(g,{...f,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(g,f)}i.observe(t)}const l=hs(t),c=()=>a(s);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}(c,s,r):null;let d,p=-1,f=null;o&&(f=new ResizeObserver(t=>{let[n]=t;n&&n.target===c&&f&&e&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),s()}),c&&!l&&f.observe(c),e&&f.observe(e));let m=l?Ds(t):null;return l&&function e(){const n=Ds(t);m&&!qs(m,n)&&s();m=n,d=requestAnimationFrame(e)}(),s(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",s),r&&t.removeEventListener("resize",s)}),null==u||u(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(d)}}const Ks=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var s,n;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await async function(t,e){const{placement:s,platform:n,elements:i}=t,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),o=Ve(s),a=qe(s),l="y"===Je(s),c=as.has(o)?-1:1,h=r&&l?-1:1,u=Ie(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*h,y:d*c}:{x:d*c,y:p*h}}(e,t);return o===(null==(s=a.offset)?void 0:s.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Js=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:s,y:n,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:e,y:s}=t;return{x:e,y:s}}},...c}=Ie(t,e),h={x:s,y:n},u=await r.detectOverflow(e,c),d=Je(i),p=Ge(d);let f=h[p],m=h[d];const g=(t,e)=>{return s=e+u["y"===t?"top":"left"],n=e,i=e-u["y"===t?"bottom":"right"],Ue(s,je(n,i));var s,n,i};o&&(f=g(p,f)),a&&(m=g(d,m));const y=l.fn({...e,[p]:f,[d]:m});return{...y,data:{x:y.x-s,y:y.y-n,enabled:{[p]:o,[d]:a}}}}}},Zs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var s,n;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Ie(t,e);if(null!=(s=r.arrow)&&s.alignmentOffset)return{};const y=Ve(i),b=Je(a),_=Ve(a)===a,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),A=d||(_||!m?[ns(a)]:function(t){const e=ns(t);return[Ye(t),e,Ye(e)]}(a)),w="none"!==f;!d&&w&&A.push(...ss(a,m,f,v));const S=[a,...A],$=await l.detectOverflow(e,g),E=[];let C=(null==(n=r.flip)?void 0:n.overflows)||[];if(h&&E.push($[y]),u){const t=function(t,e,s){void 0===s&&(s=!1);const n=qe(t),i=Ze(t),r=Ke(i);let o="x"===i?n===(s?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=ns(o)),[o,ns(o)]}(i,o,v);E.push($[t[0]],$[t[1]])}if(C=[...C,{placement:i,overflows:E}],!E.every(t=>t<=0)){var T,x;const t=((null==(T=r.flip)?void 0:T.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&b!==Je(e))||C.every(t=>Je(t.placement)!==b||t.overflows[0]>0))return{data:{index:t,overflows:C},reset:{placement:e}}}let s=null==(x=C.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:x.placement;if(!s)switch(p){case"bestFit":{var R;const t=null==(R=C.filter(t=>{if(w){const e=Je(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:R[0];t&&(s=t);break}case"initialPlacement":s=a}if(i!==s)return{reset:{placement:s}}}return{}}}},Ys=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:s,rects:n,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Ie(t,e),l=await i.detectOverflow(e,a),c=Ve(s),h=qe(s),u="y"===Je(s),{width:d,height:p}=n.floating;let f,m;"top"===c||"bottom"===c?(f=c,m=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(m=c,f="end"===h?"top":"bottom");const g=p-l.top-l.bottom,y=d-l.left-l.right,b=je(p-l[f],g),_=je(d-l[m],y),v=e.middlewareData.shift,A=!v;let w=b,S=_;null!=v&&v.enabled.x&&(S=y),null!=v&&v.enabled.y&&(w=g),A&&!h&&(u?S=d-2*Ue(l.left,l.right):w=p-2*Ue(l.top,l.bottom)),await o({...e,availableWidth:S,availableHeight:w});const $=await i.getDimensions(r.floating);return d!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}},Qs=(t,e,s)=>{const n=new Map,i=null!=s?s:{},r={...Vs,...i.platform,_c:n};return(async(t,e,s)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:o}=s,a=o.detectOverflow?o:{...o,detectOverflow:os},l=await(null==o.isRTL?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=rs(c,n,l),d=n,p=0;const f={};for(let s=0;s<r.length;s++){const m=r[s];if(!m)continue;const{name:g,fn:y}=m,{x:b,y:_,data:v,reset:A}=await y({x:h,y:u,initialPlacement:n,placement:d,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});h=null!=b?b:h,u=null!=_?_:u,f[g]={...f[g],...v},A&&p<50&&(p++,"object"==typeof A&&(A.placement&&(d=A.placement),A.rects&&(c=!0===A.rects?await o.getElementRects({reference:t,floating:e,strategy:i}):A.rects),({x:h,y:u}=rs(c,d,l))),s=-1)}return{x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})},Xs=["block-start","block-end","inline-start","inline-end"],tn=["start","center","end"];function en(t="block-end",e="start",s=!1){if(!Xs.includes(t))throw new TypeError(`Unknown placement side: ${t}`);if(!tn.includes(e))throw new TypeError(`Unknown placement alignment: ${e}`);const n="block-start"===t?"top":"block-end"===t?"bottom":"inline-start"===t?s?"right":"left":s?"left":"right";return"center"===e?n:`${n}-${e}`}function sn(t,e=!1){const s=String(t).split("-")[0];return"top"===s?"block-start":"bottom"===s?"block-end":"left"===s?e?"inline-end":"inline-start":e?"inline-start":"inline-end"}function nn(t,e=document.body){if("number"==typeof t)return Number.isFinite(t)?t:0;if("string"!=typeof t||""===t.trim())return 0;const s=document.createElement("span");s.style.cssText="position:absolute;visibility:hidden;pointer-events:none;block-size:0;padding:0;border:0",s.style.inlineSize=t,(e?.isConnected?e:document.body).append(s);const n=parseFloat(getComputedStyle(s).width)||0;return s.remove(),n}function rn(t,e,s={}){if(!(t instanceof Element&&e instanceof HTMLElement))throw new TypeError("Anchored positioning needs a reference element and a floating element");const n={side:"block-end",align:"start",offset:"var(--sf-space-1\\/4)",alignmentOffset:0,padding:"var(--sf-space-1\\/2)",flip:!0,shift:!0,matchWidth:!1,fitHeight:!0,autoUpdate:!0,onPosition:null,...s},i=["position","left","top","right","bottom","margin","max-height","max-width",...n.matchWidth?["width"]:[]].map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]),r={maxHeight:e.style.getPropertyValue("max-height")},o=getComputedStyle(e),a=(t,e)=>{const s=parseFloat(t);return Number.isFinite(s)?String(t).trim().endsWith("%")?s/100*e:s:1/0},l=a(o.maxHeight,document.documentElement.clientHeight),c=a(o.maxWidth,document.documentElement.clientWidth),h={side:n.side,stopped:!1};let u=null,d=!1;const p=async()=>{const s="rtl"===getComputedStyle(t).direction;const i=nn(n.offset,t.parentElement),o=nn(n.padding,t.parentElement);n.fitHeight&&(e.style.maxHeight=r.maxHeight||"");const a=t.getBoundingClientRect(),u=document.documentElement.clientWidth,d={top:o,bottom:o,left:Math.min(o,Math.max(0,a.left)),right:Math.min(o,Math.max(0,u-a.right))},p=[Ks({mainAxis:i,alignmentAxis:nn(n.alignmentOffset,t.parentElement)})];n.flip&&p.push(Zs({padding:o,crossAxis:!1})),n.shift&&p.push(Js({padding:d,crossAxis:!1})),p.push(Ys({padding:d,apply({availableWidth:t,availableHeight:e,rects:s,elements:i}){if(h.stopped)return;const r=u-d.left-d.right;n.matchWidth&&(i.floating.style.width=`${Math.max(0,Math.min(s.reference.width,r))}px`),i.floating.style.maxWidth=`${Math.max(0,Math.min(t,r,c))}px`,n.fitHeight&&(i.floating.style.maxHeight=`${Math.max(0,Math.min(e,l))}px`)}}));const f=await Qs(t,e,{strategy:"fixed",placement:en(n.side,n.align,s),middleware:p});return h.stopped||(Object.assign(e.style,{position:"fixed",left:`${f.x}px`,top:`${f.y}px`,right:"auto",bottom:"auto",margin:"0"}),h.side=sn(f.placement,s),e.dataset.sfSide=h.side,n.onPosition?.({side:h.side,placement:f.placement,x:f.x,y:f.y})),f};h.update=()=>h.stopped?Promise.resolve(null):u?(d=!0,u):(u=p().finally(()=>{u=null,d&&!h.stopped&&(d=!1,h.update())}),u);const f=n.autoUpdate?Gs(t,e,h.update):null;return h.stop=()=>{h.stopped=!0,f?.(),delete e.dataset.sfSide;for(const[t,s,n]of i)s?e.style.setProperty(t,s,n):e.style.removeProperty(t)},n.autoUpdate||h.update(),h}const on=Object.freeze({anchor:rn,logicalSide:sn,physicalPlacement:en,resolveLength:nn});"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Position||(globalThis.SF.Position=on));const an=on,ln=Object.freeze({compact:"low",normal:"",comfortable:"high",spacious:"highest"}),cn=Object.freeze({"":"normal",default:"normal",low:"compact",high:"comfortable",highest:"spacious"});function hn({spacing:t,tightness:e}={}){const s=[],n=null!=t,i=t=>String(t??"").trim().toLowerCase(),r=i(e);let o;if(n){const n=i(t);o=Object.hasOwn(ln,n)?n:"normal",Object.hasOwn(ln,n)||s.push("invalid-spacing"),null!=e&&Object.hasOwn(cn,r)&&cn[r]!==o&&s.push("spacing-overrides-tightness")}else o=Object.hasOwn(cn,r)?cn[r]:"normal",Object.hasOwn(cn,r)||s.push("invalid-tightness");return{spacing:o,tightness:ln[o],diagnostics:s}}const un=t=>Object.freeze({__esModule:!0,...t}),dn=Object.freeze({lit:un(e),"lit/directive.js":un(s),"lit/directive-helpers.js":un(n),"lit/directives/ref.js":un(i),"lit/directives/keyed.js":un(r),"lit/directives/unsafe-html.js":un(o),"lit/directives/repeat.js":un(a),"smart-base":un(c),"page-language":un(l),position:un(h),"control-spacing":un(u)}),pn=window.SF=window.SF||{};pn.__internal.runtimeModules=dn,pn.runtimeModule||(pn.runtimeModule=t=>dn[t]?Promise.resolve(dn[t]):Promise.reject(new Error(`SF runtime: no shared module "${t}"`))),"function"==typeof pn.__internal.runtimeArrived&&pn.__internal.runtimeArrived(dn);try{window.dispatchEvent(new CustomEvent("sf-runtime-ready",{detail:{modules:Object.keys(dn)}}))}catch(t){console.warn("sf-runtime-ready dispatch failed",t)}})();