@keenmate/web-multiselect 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +172 -208
- package/component-variables.manifest.json +5 -30
- package/custom-elements.json +86 -103
- package/dist/index.d.ts +28 -0
- package/dist/multiselect.js +859 -804
- package/dist/multiselect.umd.js +11 -11
- package/dist/style.css +1 -1
- package/docs/examples.md +69 -0
- package/docs/theming.md +7 -7
- package/docs/usage.md +4 -0
- package/package.json +5 -3
- package/src/css/base.css +10 -0
- package/src/css/options.css +9 -4
- package/src/css/variables.css +969 -964
- package/vscode.css-custom-data.json +5 -125
- package/vscode.html-custom-data.json +6 -1
- package/web-types.json +33 -84
package/dist/multiselect.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(k,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(k=typeof globalThis<"u"?globalThis:k||self,S(k.MultiSelect={}))})(this,function(k){"use strict";var Sn=Object.defineProperty;var Mo=k=>{throw TypeError(k)};var Tn=(k,S,D)=>S in k?Sn(k,S,{enumerable:!0,configurable:!0,writable:!0,value:D}):k[S]=D;var p=(k,S,D)=>Tn(k,typeof S!="symbol"?S+"":S,D),hs=(k,S,D)=>S.has(k)||Mo("Cannot "+D);var h=(k,S,D)=>(hs(k,S,"read from private field"),D?D.call(k):S.get(k)),z=(k,S,D)=>S.has(k)?Mo("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(k):S.set(k,D),M=(k,S,D,L)=>(hs(k,S,"write to private field"),L?L.call(k,D):S.set(k,D),D),b=(k,S,D)=>(hs(k,S,"access private method"),D);var fe,lt,Se,ct,Te,dt,Bt,Ie,ge,Pe,Oe,Re,Be,He,Fe,Ke,We,Ht,ce,je,O,Lo,Eo,Ao,ee,zo,No,us,ms,pt,ps,$o,R,Q,C,be,ht,ut,mt,Ue,Ge,Le,y,Ft,ve,Kt,fs,gs,bs,vs,Vo,Do,Ro,ft,ws,Bo,Ho,Fo,ys,Ko,Wo,xs,_s;function S(s,e={}){const t=new Set(s),o=e.shouldNullOnInvalid?null:e.default??null;return{values:s,fromAttribute(i){return i===null?e.default??o:t.has(i)?i:o},validate(i){return typeof i=="string"&&t.has(i)},toAttribute(i){return i==null?null:String(i)}}}function D(s={}){const e=o=>(s.min==null||o>=s.min)&&(s.max==null||o<=s.max),t=s.default;return{fromAttribute(o){if(o===null)return t;const i=Number.parseInt(o,10);return Number.isNaN(i)||!e(i)?t:i},validate(o){return typeof o=="number"&&Number.isInteger(o)&&e(o)},toAttribute(o){return o==null?null:String(o)}}}function L(s={}){const e=s.isNullable===!0,t=s.default??(e?null:""),o=i=>s.shouldTrim?i.trim():i;return{fromAttribute(i){if(i===null)return t;const r=o(i);return!s.isEmptyAllowed&&r===""?t:r},validate(i){return i===null?e:typeof i=="string"&&(s.isEmptyAllowed===!0||i!=="")},toAttribute(i){return i==null?null:String(i)}}}const jo=new Set(["","true","1","yes","on"]),Uo=new Set(["false","0","no","off"]);function W(s="presence"){const e=t=>{const o=t.trim().toLowerCase();return jo.has(o)?!0:Uo.has(o)?!1:null};return{fromAttribute(t){switch(s){case"presence":return t!==null;case"default-true":return t===null?!0:e(t)??!0;case"default-false":return t===null?!1:e(t)??!1;case"tristate":return t===null?null:e(t)}},validate(t){return s==="tristate"?t===!0||t===!1||t===null:typeof t=="boolean"},toAttribute(t){return s==="presence"?t?"":null:t==null?null:String(t)}}}function Go(s={}){const e=s.default;return{fromAttribute(t){if(t===null||t.trim()==="")return e;let o;try{o=JSON.parse(t)}catch{return e}return s.validate&&!s.validate(o)?e:o},validate:s.validate,toAttribute(t){return t==null?null:JSON.stringify(t)}}}function qo(s={}){const e=s.default??[],t=o=>Array.isArray(o)&&(!s.validateItem||o.every(s.validateItem));return{fromAttribute(o){if(o===null||o.trim()==="")return e;let i;try{i=JSON.parse(o)}catch{return e}return t(i)?i:e},validate:t,toAttribute(o){return Array.isArray(o)?JSON.stringify(o):null}}}function Xo(){return{validate(s){return s==null||typeof s=="function"}}}function Yo(s,e,t){const o=s.converter,i=o!=null&&o.fromAttribute?o.fromAttribute(e,t,s.attribute??s.configKey):e??s.default;return{configKey:s.configKey,field:s.field,value:i,on:s.on??"update"}}function Jo(s,e){const t=s.converter;return t!=null&&t.validate&&!t.validate(e)?null:{configKey:s.configKey,field:s.field,value:e,on:s.on??"update"}}function Qo(){const s=new Set;let e=!1;const t=()=>{e=!1;const o=[...s];s.clear();for(const i of o)i()};return{schedule(o){s.add(o),e||(e=!0,queueMicrotask(t))},flush(){if(s.size===0)return;e=!1;const o=[...s];s.clear();for(const i of o)i()},cancel(){s.clear(),e=!1}}}const ks={pointer:"fine",hasCoarsePointer:!1,canHover:!0,isTouchPrimary:!1,orientation:"landscape",viewportWidth:1024,viewportHeight:768,breakpoint:"desktop",os:"unknown",isApple:!1,isAndroid:!1};let gt=Ss({mobile:640,tablet:1024,desktop:1/0});const qe=new Set,Xe=new Set;let ye=null,bt=[],vt=!1;const Cs=30;let Ae,wt=0;function Ss(s){return Object.entries(s).sort((e,t)=>e[1]-t[1])}function Zo(s){for(const[t,o]of gt)if(s<=o)return t;const e=gt[gt.length-1];return e?e[0]:"desktop"}function Wt(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Ts(){return typeof navigator<"u"&&(navigator.maxTouchPoints??0)>1}function ei(){var o;if(typeof navigator>"u")return"unknown";const s=navigator.userAgentData,e=(o=s==null?void 0:s.platform)==null?void 0:o.toLowerCase();if(e){if(e.includes("android"))return"android";if(e.includes("ios"))return"ios";if(e.includes("mac"))return Ts()?"ios":"macos";if(e.includes("windows"))return"windows";if(e.includes("linux"))return"linux"}const t=navigator.userAgent??"";return/android/i.test(t)?"android":/iphone|ipod|ipad/i.test(t)?"ios":/macintosh|mac os x/i.test(t)?Ts()?"ios":"macos":/windows/i.test(t)?"windows":/linux/i.test(t)?"linux":"unknown"}let ti;function si(){return ti??(ti=ei())}function Ye(s){return Wt()&&window.matchMedia(s).matches}function jt(){if(!Wt())return{...ks};const s=Ye("(any-pointer: coarse)"),e=Ye("(pointer: coarse)"),t=Ye("(pointer: fine)"),o=Ye("(hover: hover)"),i=e?"coarse":t?"fine":"none",r=window.innerWidth,n=window.innerHeight,a=si();return{pointer:i,hasCoarsePointer:s,canHover:o,isTouchPrimary:e&&!o,orientation:Ye("(orientation: portrait)")?"portrait":"landscape",viewportWidth:r,viewportHeight:n,breakpoint:Zo(r),os:a,isApple:a==="ios"||a==="macos",isAndroid:a==="android"}}function oi(s,e){return s.pointer===e.pointer&&s.hasCoarsePointer===e.hasCoarsePointer&&s.canHover===e.canHover&&s.isTouchPrimary===e.isTouchPrimary&&s.orientation===e.orientation&&s.breakpoint===e.breakpoint}function ii(s,e){return s.viewportWidth===e.viewportWidth&&s.viewportHeight===e.viewportHeight}function yt(){const s=jt(),e=ye;if(ye=s,!e||!oi(e,s))for(const t of[...qe])t(s);Xe.size>0&&(!e||!ii(e,s))&&ri()}function Is(){const s=ye;if(s)for(const e of[...Xe])e(s)}function ri(){if(Ae!==void 0)return;const s=Date.now()-wt;s>=Cs?(wt=Date.now(),Is()):Ae=setTimeout(()=>{Ae=void 0,wt=Date.now(),Is()},Cs-s)}const xt=()=>yt(),Ps=()=>{if(typeof requestAnimationFrame=="function"){if(vt)return;vt=!0,requestAnimationFrame(()=>{vt=!1,yt()})}else yt()};function ni(s){typeof s.addEventListener=="function"?s.addEventListener("change",xt):typeof s.addListener=="function"&&s.addListener(xt)}function ai(s){typeof s.removeEventListener=="function"?s.removeEventListener("change",xt):typeof s.removeListener=="function"&&s.removeListener(xt)}function Os(){if(!Wt()){ye={...ks};return}bt=[window.matchMedia("(pointer: coarse)"),window.matchMedia("(pointer: fine)"),window.matchMedia("(any-pointer: coarse)"),window.matchMedia("(hover: hover)"),window.matchMedia("(orientation: portrait)")];for(const s of bt)ni(s);typeof window.addEventListener=="function"&&window.addEventListener("resize",Ps),ye=jt()}function Ms(){for(const s of bt)ai(s);bt=[],typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("resize",Ps),vt=!1,Ae!==void 0&&(clearTimeout(Ae),Ae=void 0),wt=0,ye=null}function _t(){return qe.size+Xe.size}function Je(){return ye??jt()}function Ls(s,e={}){const t=_t()===0;qe.add(s),t&&Os(),e.immediate!==!1&&s(Je());let o=!0;return()=>{o&&(o=!1,qe.delete(s),_t()===0&&Ms())}}function Es(s,e={}){const t=_t()===0;Xe.add(s),t&&Os(),e.immediate!==!1&&s(Je());let o=!0;return()=>{o&&(o=!1,Xe.delete(s),_t()===0&&Ms())}}function li(s){gt=Ss(s),qe.size>0&&yt()}const As=600;function zs(s){return s.isTouchPrimary?Math.min(s.viewportWidth,s.viewportHeight)<As?"mobile":"tablet":"desktop"}const ci=30;let oe=null;const Qe=new WeakMap;let Ut=0;function di(){return typeof ResizeObserver<"u"}function Ns(s){if(typeof s.getBoundingClientRect!="function")return{width:0,height:0};const e=s.getBoundingClientRect();return{width:e.width,height:e.height}}function hi(s,e){return!!s&&s.width===e.width&&s.height===e.height}function ui(s,e){if(hi(s.lastFired,e)||(s.pendingSize=e,s.timer!==void 0))return;const t=Date.now()-s.lastNotify;t>=s.throttleMs?(s.lastNotify=Date.now(),$s(s)):s.timer=setTimeout(()=>{s.timer=void 0,s.lastNotify=Date.now(),$s(s)},s.throttleMs-t)}function $s(s){const e=s.pendingSize;e&&(s.lastFired=e,s.cb(e,s.el))}function mi(s){for(const e of s){const t=Qe.get(e.target);if(!t)continue;const o=Ns(e.target);for(const i of[...t])ui(i,o)}}function pi(){return di()?(oe||(oe=new ResizeObserver(mi)),oe):null}function fi(s,e,t={}){const o={el:s,cb:e,throttleMs:t.throttleMs??ci,lastNotify:0};if(t.immediate!==!1){const n=Ns(s);o.lastFired=n,o.lastNotify=Date.now(),e(n,s)}const i=pi();if(i){let n=Qe.get(s);n||(Qe.set(s,n=new Set),Ut++,i.observe(s)),n.add(o)}let r=!0;return()=>{if(!r)return;r=!1,o.timer!==void 0&&(clearTimeout(o.timer),o.timer=void 0);const n=Qe.get(s);n&&(n.delete(o),n.size===0&&(Qe.delete(s),oe==null||oe.unobserve(s),Ut--,Ut===0&&oe&&(oe.disconnect(),oe=null)))}}const kt=new Map;function gi(s,e){let t=kt.get(s);t||kt.set(s,t=new Set),t.add(e)}function bi(s,e){var t;(t=kt.get(s))==null||t.delete(e)}function vi(s){return Array.from(kt.get(s)??[])}const Vs=new Map;function wi(s,e){Vs.set(s.toLowerCase(),e)}function yi(s){return Vs.get(s.toLowerCase())}function xi(s,e,t,o={}){return s.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:o.bubbles??!0,composed:o.composed??!0,cancelable:o.cancelable??!1}))}function _i(s){return s.split(/[-_]/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}function ki(s){return`on${_i(s)}`}function Ci(s){return s?s.map(e=>{const t=typeof e=="string"?{name:e}:e,o=t.property===!1?null:t.property??ki(t.name);return{name:t.name,property:o,bubbles:t.bubbles,composed:t.composed,cancelable:t.cancelable}}):[]}const Si=typeof HTMLElement<"u"?HTMLElement:class{},Ds=new WeakSet;let Ti=0;const Ii={trace(){},debug(){},info(){},warn(){},error(){}},Pi=new Proxy({},{get:()=>Ii}),Me=class Me extends Si{constructor(){super();z(this,O);z(this,fe,{});z(this,lt,new Map);z(this,Se,new Map);z(this,ct,new Map);z(this,Te,new Map);z(this,dt,Qo());z(this,Bt,()=>b(this,O,ps).call(this));z(this,Ie,null);z(this,ge,!1);z(this,Pe,[]);z(this,Oe,!1);z(this,Re,null);z(this,Be,!1);z(this,He);z(this,Fe);z(this,Ke);z(this,We);z(this,Ht);z(this,ce);z(this,je);const t=this.constructor,o=t.inputs??[],i=Ci(t.events);b(this,O,Ao).call(this,o,i);for(const r of o)h(this,lt).set(r.configKey,r),r.attribute&&h(this,Se).set(r.attribute,r);for(const r of i)h(this,ct).set(r.name,r);b(this,O,Lo).call(this,o),b(this,O,zo).call(this,o),b(this,O,No).call(this,i)}static get observedAttributes(){const t=(this.inputs??[]).filter(o=>o.attribute).map(o=>o.attribute);return t.includes("dir")?t:[...t,"dir"]}attributeChangedCallback(t,o,i){var a;if(h(this,Be))return;if(t==="dir"&&!h(this,Se).has("dir")){h(this,Oe)&&this.directionChanged(this.isRTL);return}const r=h(this,Se).get(t);if(!r||!h(this,Oe)&&((a=h(this,Re))!=null&&a.has(r.configKey)))return;let n;try{n=Yo(r,i,this)}catch(l){b(this,O,ee).call(this,`converter for "${r.configKey}" threw parsing attribute ${t}="${i}"; using default`,l),n=b(this,O,Eo).call(this,r)}b(this,O,ms).call(this,n)}connectedCallback(){gi(this.localName,this),h(this,Oe)||(M(this,Oe,!0),M(this,Re,null),M(this,ge,!0)),b(this,O,pt).call(this),this.connect(),this.environmentChanged!==Me.prototype.environmentChanged&&M(this,He,Ls(t=>this.environmentChanged(t))),this.viewportChanged!==Me.prototype.viewportChanged&&M(this,Fe,Es(t=>this.viewportChanged(t))),this.resized!==Me.prototype.resized&&M(this,Ke,fi(this,t=>this.resized(t),{immediate:!1}))}disconnectedCallback(){var t,o,i;bi(this.localName,this),(t=h(this,He))==null||t.call(this),M(this,He,void 0),(o=h(this,Fe))==null||o.call(this),M(this,Fe,void 0),(i=h(this,Ke))==null||i.call(this),M(this,Ke,void 0),this.disconnect()}setAttributes(t){for(const[o,i]of Object.entries(t)){const r=h(this,lt).get(o)??h(this,Se).get(o);r&&b(this,O,us).call(this,r,i)}b(this,O,pt).call(this)}batch(t){t(),b(this,O,pt).call(this)}flush(){b(this,O,pt).call(this)}whenSettled(){return!h(this,Ie)&&!h(this,ge)?Promise.resolve():new Promise(t=>h(this,Pe).push(t))}get config(){return h(this,fe)}get log(){if(h(this,je))return h(this,je);const t=yi(this.localName);if(!t)return Pi;const o=h(this,Ht)??M(this,Ht,`${this.localName}#${this.id||++Ti}`);return M(this,je,t.forInstance(o,()=>h(this,ce)))}enableLogging(t="debug"){M(this,ce,t)}disableLogging(){M(this,ce,void 0)}get isLoggingEnabled(){return h(this,ce)!=null&&h(this,ce)!=="silent"&&h(this,ce)!==5}reinit(){}update(t){}connect(){}disconnect(){}environmentChanged(t){}viewportChanged(t){}resized(t){}get isRTL(){return typeof getComputedStyle=="function"&&getComputedStyle(this).direction==="rtl"}directionChanged(t){}get internals(){if(h(this,We))return h(this,We);if(typeof this.attachInternals!="function")return null;try{return M(this,We,this.attachInternals())}catch{return null}}get form(){var t;return((t=this.internals)==null?void 0:t.form)??null}emit(t,o,i){const r=h(this,ct).get(t);return xi(this,t,o,{bubbles:(i==null?void 0:i.bubbles)??(r==null?void 0:r.bubbles),composed:(i==null?void 0:i.composed)??(r==null?void 0:r.composed),cancelable:(i==null?void 0:i.cancelable)??(r==null?void 0:r.cancelable)})}on(t,o,i){const r=o;return this.addEventListener(t,r,i),()=>this.removeEventListener(t,r,i)}async runHook(t,o,i){const r=h(this,fe)[t];if(typeof r!="function")return i.whenUnset;try{return await Promise.resolve(r(o))}catch(n){if(i.onError)return i.onError(n);throw n}}};fe=new WeakMap,lt=new WeakMap,Se=new WeakMap,ct=new WeakMap,Te=new WeakMap,dt=new WeakMap,Bt=new WeakMap,Ie=new WeakMap,ge=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Be=new WeakMap,He=new WeakMap,Fe=new WeakMap,Ke=new WeakMap,We=new WeakMap,Ht=new WeakMap,ce=new WeakMap,je=new WeakMap,O=new WeakSet,Lo=function(t){var o;for(const i of t){let r=i.default;if((o=i.converter)!=null&&o.fromAttribute)try{r=i.converter.fromAttribute(null,this,i.attribute??i.configKey)}catch(n){b(this,O,ee).call(this,`converter for "${i.configKey}" threw computing its default; using \`default\``,n),r=i.default}h(this,fe)[i.configKey]=r,i.field&&(this[i.field]=r)}},Eo=function(t){return{configKey:t.configKey,field:t.field,value:t.default,on:t.on??"update"}},Ao=function(t,o){var l;const i=this.constructor;if(Ds.has(i))return;Ds.add(i);const r=new Set,n=new Set;for(const c of t)r.has(c.configKey)&&b(this,O,ee).call(this,`invalid input table: duplicate configKey "${c.configKey}"`),r.add(c.configKey),c.attribute&&(n.has(c.attribute)&&b(this,O,ee).call(this,`invalid input table: duplicate attribute "${c.attribute}"`),n.add(c.attribute)),c.reflect&&!c.attribute&&b(this,O,ee).call(this,`invalid input table: "${c.configKey}" has reflect:true but no attribute to reflect to`),c.reflect&&!((l=c.converter)!=null&&l.toAttribute)&&b(this,O,ee).call(this,`invalid input table: "${c.configKey}" has reflect:true but its converter has no toAttribute`);const a=new Set;for(const c of o)a.has(c.name)&&b(this,O,ee).call(this,`invalid event table: duplicate event "${c.name}"`),a.add(c.name),/^[a-z][a-z0-9-]*$/.test(c.name)||b(this,O,ee).call(this,`invalid event table: event "${c.name}" should be lowercase kebab-case (e.g. "date-select")`),c.property&&r.has(c.property)&&b(this,O,ee).call(this,`invalid event table: event "${c.name}" property "${c.property}" collides with an input configKey`)},ee=function(t,...o){console.warn(`[BlissElement] <${this.localName??"unknown"}> ${t}`,...o)},zo=function(t){for(const o of t){const i=o.configKey,r=Object.prototype.hasOwnProperty.call(this,i),n=r?this[i]:void 0;r&&delete this[i],Object.defineProperty(this,i,{configurable:!0,enumerable:!0,get:()=>h(this,fe)[i],set:a=>b(this,O,us).call(this,o,a)}),r&&((h(this,Re)??M(this,Re,new Set)).add(i),this[i]=n)}},No=function(t){for(const o of t){const i=o.property;if(!i)continue;const r=o.name,n=Object.prototype.hasOwnProperty.call(this,i),a=n?this[i]:void 0;n&&delete this[i],Object.defineProperty(this,i,{configurable:!0,enumerable:!0,get:()=>h(this,Te).get(r)??null,set:l=>{const c=h(this,Te).get(r);if(c&&this.removeEventListener(r,c),typeof l=="function"){const d=l;h(this,Te).set(r,d),this.addEventListener(r,d)}else h(this,Te).delete(r)}}),n&&(this[i]=a)}},us=function(t,o){var r;const i=Jo(t,o);if(!i){b(this,O,ee).call(this,`rejected invalid value for property "${t.configKey}"; keeping previous value`,o);return}if(b(this,O,ms).call(this,i),t.reflect&&t.attribute&&((r=t.converter)!=null&&r.toAttribute)){const n=t.converter.toAttribute(i.value);M(this,Be,!0);try{n===null?this.removeAttribute(t.attribute):this.setAttribute(t.attribute,n)}finally{M(this,Be,!1)}}},ms=function(t){h(this,fe)[t.configKey]=t.value,t.field&&(this[t.field]=t.value),t.on!=="none"&&(t.on==="reinit"&&M(this,ge,!0),(h(this,Ie)??M(this,Ie,{}))[t.configKey]=t.value,h(this,dt).schedule(h(this,Bt)))},pt=function(){h(this,dt).cancel(),b(this,O,ps).call(this)},ps=function(){if(!this.isConnected)return;const t=h(this,ge),o=h(this,Ie);M(this,ge,!1),M(this,Ie,null),t?this.reinit():o&&Object.keys(o).length>0&&this.update(o),b(this,O,$o).call(this)},$o=function(){if(h(this,Pe).length===0)return;const t=h(this,Pe);M(this,Pe,[]);for(const o of t)o()},p(Me,"inputs"),p(Me,"events");let Gt=Me;function Rs(s,e,t){typeof customElements>"u"||customElements.get(s)||customElements.define(s,e,t)}function Oi(s){return{enableLogging:e=>s.enableLogging(e),disableLogging:()=>s.disableLogging(),setLogLevel:e=>s.setLogLevel(e),setCategoryLevel:(e,t)=>s.setCategoryLevel(e,t),getCategories:()=>[...s.LOGGING_CATEGORIES]}}function Mi(s,e,t){const{config:o,logging:i,shouldAutoDefine:r=!0}=t;i&&wi(s,i);const n={version:()=>o.version,config:o,...i?{logging:Oi(i)}:{},register:()=>Rs(s,e),getInstances:()=>vi(s)};return typeof window<"u"&&((window.components??(window.components={}))[s]=n),r&&Rs(s,e),n}const Bs=new Map,Hs=new WeakMap;let Ct;function Li(s){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in s))return!1;if(Ct===void 0)try{new CSSStyleSheet().replaceSync(""),Ct=!0}catch{Ct=!1}return Ct}function Ei(s,...e){if(typeof document>"u")return;let t=Hs.get(s);t||Hs.set(s,t=new Set);const o=e.filter(r=>r&&!t.has(r));if(o.length===0)return;for(const r of o)t.add(r);if(Li(s)){const r=o.map(n=>{let a=Bs.get(n);return a||(a=new CSSStyleSheet,a.replaceSync(n),Bs.set(n,a)),a});s.adoptedStyleSheets=[...s.adoptedStyleSheets,...r];return}const i=s.head??s;for(const r of o){const n=document.createElement("style");n.textContent=r,i.appendChild(n)}}function Ai(s,e={}){const t=e.position??"last",o=s.head??s;let i=null;const r=()=>typeof document>"u"?null:(i||(i=document.createElement("style"),e.className&&(i.className=e.className)),i.parentNode!==o&&(t==="first"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i)),i),n=()=>{i==null||i.remove()};return{set(a){if(!a){n();return}const l=r();l&&(l.textContent=a)},clear:n,destroy(){i==null||i.remove(),i=null}}}function Fs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zi(s,e){const t=new Set,o=new RegExp(`var\\(\\s*(${Fs(e)}[a-z0-9-]+)`,"gi");let i;for(;i=o.exec(s);)i[1]&&t.add(i[1]);return t}function Ni(s,e){const t=new Set,o=new RegExp(`(${Fs(e)}[a-z0-9-]+)\\s*:`,"gi");let i;for(;i=o.exec(s);)i[1]&&t.add(i[1]);return[...t]}function $i(s,e,t={}){const o=t.minScore??3,i=t.limit??3,r=new Set(s.split("-").filter(Boolean));return[...e].map(n=>({k:n,score:n.split("-").filter(a=>r.has(a)).length})).filter(n=>n.score>=o).sort((n,a)=>a.score-n.score).slice(0,i).map(n=>n.k)}function Vi(s,e){if(e.consumed.size===0)return[];const t=[];for(const o of Ni(s,e.prefix))e.consumed.has(o)||t.push({name:o,suggestions:$i(o,e.consumed,{minScore:e.minScore})});return t}const Di={mobile:"fullscreen",tablet:"floating",desktop:"floating"};function Ri(s,e,t={}){if(s!=="auto")return s;const o=zs(e);return t[o]??Di[o]}function qt(s){return{presentation:s,isFullscreen:s==="fullscreen",isModal:s==="modal"}}let Ze=0,St=null;function Bi(){if(typeof document>"u")return()=>{};Ze===0&&(St=document.body.style.overflow,document.body.style.overflow="hidden"),Ze++;let s=!1;return()=>{s||(s=!0,Ze=Math.max(0,Ze-1),Ze===0&&St!==null&&(document.body.style.overflow=St,St=null))}}function Hi(s){const e=typeof window<"u"?window.visualViewport:null;if(!e)return()=>{};let t=!1;const o=()=>{t=!1,s.style.height=`${e.height}px`,s.style.top=`${e.offsetTop}px`},i=()=>{t||(t=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o())};return e.addEventListener("resize",i),e.addEventListener("scroll",i),i(),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),s.style.height="",s.style.top=""}}const Xt="km-overlay-activated",Fi=Symbol("km-overlay-all-groups"),Tt=new Set,et=new Map;let It=!1;function Yt(){return typeof document<"u"}function Ki(s,e){return e===Fi||s===e}function Ks(s){const e=s.detail,t=e==null?void 0:e.source,o=e==null?void 0:e.group;for(const i of Array.from(Tt))i.id!==t&&Ki(i.group,o)&&i.dismiss()}function Wi(){It||!Yt()||(document.addEventListener(Xt,Ks),It=!0)}function ji(){It&&Tt.size===0&&Yt()&&(document.removeEventListener(Xt,Ks),It=!1)}function Ui(s,e){Yt()&&document.dispatchEvent(new CustomEvent(Xt,{detail:{source:s,group:e}}))}function Gi(s,e){const t={id:{},group:e,dismiss:s};return Tt.add(t),Wi(),{activate(){et.set(t.group,t),Ui(t.id,t.group)},deactivate(){et.get(t.group)===t&&et.delete(t.group)},dispose(){Tt.delete(t),et.get(t.group)===t&&et.delete(t.group),ji()}}}const q={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},Ws=["trace","debug","info","warn","error"],Pt=()=>{};let qi="km-log";function js(s){const t=console[s];return typeof t=="function"?t.bind(console):Pt}function Xi(s){if(s==="debug"&&(s="log"),typeof console>"u")return Pt;const e=console;return e[s]!==void 0?js(s):e.log!==void 0?js("log"):Pt}const Yi=s=>Xi(s);function tt(s){let e=s;const t=q;if(typeof e=="string"&&t[e.toUpperCase()]!==void 0&&(e=t[e.toUpperCase()]),typeof e=="number"&&e>=0&&e<=q.SILENT)return e;throw new TypeError(`setLevel() called with an invalid level: ${String(s)}`)}let he;const Ot={};class Us{constructor(e,t){p(this,"name");p(this,"levels",q);p(this,"methodFactory");p(this,"trace");p(this,"debug");p(this,"info");p(this,"warn");p(this,"error");p(this,"log");p(this,"inheritedLevel");p(this,"defaultLevel",null);p(this,"userLevel",null);this.name=e,this.methodFactory=t,this.inheritedLevel=tt(he?he.getLevel():"WARN");const o=this.getPersistedLevel();o!=null&&(this.userLevel=tt(o)),this.replaceLoggingMethods()}storageKey(){return typeof this.name=="string"?`${qi}:${this.name}`:void 0}persist(e){const t=this.storageKey();if(typeof window>"u"||!t)return;const o=(Ws[e]??"silent").toUpperCase();try{window.localStorage[t]=o}catch{}}getPersistedLevel(){const e=this.storageKey();if(typeof window>"u"||!e)return;let t;try{t=window.localStorage[e]}catch{}if(!(t===void 0||q[t]===void 0))return t}clearPersisted(){const e=this.storageKey();if(!(typeof window>"u"||!e))try{window.localStorage.removeItem(e)}catch{}}replaceLoggingMethods(){const e=this.getLevel();Ws.forEach((t,o)=>{this[t]=o<e?Pt:this.methodFactory(t,e,this.name)}),this.log=this.debug}getLevel(){return this.userLevel!=null?this.userLevel:this.defaultLevel!=null?this.defaultLevel:this.inheritedLevel}setLevel(e,t){this.userLevel=tt(e),t!==!1&&this.persist(this.userLevel),this.replaceLoggingMethods()}setDefaultLevel(e){this.defaultLevel=tt(e),this.getPersistedLevel()||this.setLevel(e,!1)}resetLevel(){this.userLevel=null,this.clearPersisted(),this.replaceLoggingMethods()}enableAll(e){this.setLevel(q.TRACE,e)}disableAll(e){this.setLevel(q.SILENT,e)}rebuild(){if(he&&he!==this&&(this.inheritedLevel=tt(he.getLevel())),this.replaceLoggingMethods(),he===this)for(const e in Ot)Ot[e].rebuild()}}he=new Us(void 0,Yi);function Ji(s){if(typeof s!="string"||s==="")throw new TypeError("You must supply a non-empty name when creating a logger.");let e=Ot[s];return e||(e=Ot[s]=new Us(s,he.methodFactory)),e}const Qi=["INIT","DATA","UI"],Zi="debug",Gs=["#4c8bf5","#2ea043","#d29922","#a371f7","#db61a2","#e5534b","#3fb0ac","#8a6d3b"],qs=new WeakSet;function er(s,e,t){if(qs.has(s))return;qs.add(s);const o=s.methodFactory,i=`color:${t};font-weight:bold`;s.methodFactory=(r,n,a)=>{const l=o(r,n,a);return(...c)=>l(`%c[${e}]`,i,...c)},s.setLevel(s.getLevel(),!1)}function tr(s){return typeof s=="number"?s:q[s.toUpperCase()]??q.SILENT}const sr=[["trace",q.TRACE,"debug"],["debug",q.DEBUG,"debug"],["info",q.INFO,"info"],["warn",q.WARN,"warn"],["error",q.ERROR,"error"]];function or(s,e,t){const o=`color:${s.color};font-weight:bold`,i="color:#888",r={};for(const[n,a,l]of sr)r[n]=(...c)=>{const d=t(),u=Math.min(s.logger.getLevel(),d==null?q.SILENT:tr(d));if(a<u)return;(console[l]??console.log).bind(console)(`%c[${s.label}]%c ${e}`,o,i,...c)};return r}function ir(s,e=Qi){const t={},o={};e.forEach((r,n)=>{const a=`${s}:${r}`,l=Gs[n%Gs.length],c=Ji(a);er(c,a,l),t[r]=c,o[r]={label:a,color:l,logger:c}});const i=r=>{for(const n of e)t[n].setLevel(r,!1)};return{loggers:t,LOGGING_CATEGORIES:e,enableLogging(r=Zi){i(r)},disableLogging(){i("silent")},setLogLevel(r){i(r)},setCategoryLevel(r,n){var a;(a=t[r])==null||a.setLevel(n,!1)},forInstance(r,n){const a={};for(const l of e)a[l]=or(o[l],r,n);return a}}}const ue=Math.min,ie=Math.max,Mt=Math.round,Lt=Math.floor,re=s=>({x:s,y:s}),rr={left:"right",right:"left",bottom:"top",top:"bottom"};function Xs(s,e,t){return ie(s,ue(e,t))}function ze(s,e){return typeof s=="function"?s(e):s}function xe(s){return s.split("-")[0]}function Ne(s){return s.split("-")[1]}function Ys(s){return s==="x"?"y":"x"}function Jt(s){return s==="y"?"height":"width"}function ne(s){const e=s[0];return e==="t"||e==="b"?"y":"x"}function Qt(s){return Ys(ne(s))}function nr(s,e,t){t===void 0&&(t=!1);const o=Ne(s),i=Qt(s),r=Jt(i);let n=i==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(n=Et(n)),[n,Et(n)]}function ar(s){const e=Et(s);return[Zt(s),e,Zt(e)]}function Zt(s){return s.includes("start")?s.replace("start","end"):s.replace("end","start")}const Js=["left","right"],Qs=["right","left"],lr=["top","bottom"],cr=["bottom","top"];function dr(s,e,t){switch(s){case"top":case"bottom":return t?e?Qs:Js:e?Js:Qs;case"left":case"right":return e?lr:cr;default:return[]}}function hr(s,e,t,o){const i=Ne(s);let r=dr(xe(s),t==="start",o);return i&&(r=r.map(n=>n+"-"+i),e&&(r=r.concat(r.map(Zt)))),r}function Et(s){const e=xe(s);return rr[e]+s.slice(e.length)}function ur(s){var e,t,o,i;return{top:(e=s.top)!=null?e:0,right:(t=s.right)!=null?t:0,bottom:(o=s.bottom)!=null?o:0,left:(i=s.left)!=null?i:0}}function Zs(s){return typeof s!="number"?ur(s):{top:s,right:s,bottom:s,left:s}}function At(s){const{x:e,y:t,width:o,height:i}=s;return{width:o,height:i,top:t,left:e,right:e+o,bottom:t+i,x:e,y:t}}function eo(s,e,t){let{reference:o,floating:i}=s;const r=ne(e),n=Qt(e),a=Jt(n),l=xe(e),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,f=o[a]/2-i[a]/2;let m;switch(l){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-i.width,y:u};break;default:m={x:o.x,y:o.y}}const g=Ne(e);return g&&(m[n]+=f*(g==="end"?1:-1)*(t&&c?-1:1)),m}async function mr(s,e){var t;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:n,elements:a,strategy:l}=s,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=ze(e,s),g=Zs(m),x=a[f?u==="floating"?"reference":"floating":u],v=At(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(x)))==null||t?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),_=u==="floating"?{x:o,y:i,width:n.floating.width,height:n.floating.height}:n.reference,T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),N=await(r.isElement==null?void 0:r.isElement(T))&&await(r.getScale==null?void 0:r.getScale(T))||{x:1,y:1},V=At(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:T,strategy:l}):_);return{top:(v.top-V.top+g.top)/N.y,bottom:(V.bottom-v.bottom+g.bottom)/N.y,left:(v.left-V.left+g.left)/N.x,right:(V.right-v.right+g.right)/N.x}}const pr=50,fr=async(s,e,t)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:n}=t,a=n.detectOverflow?n:{...n,detectOverflow:mr},l=await(n.isRTL==null?void 0:n.isRTL(e));let c=await n.getElementRects({reference:s,floating:e,strategy:i}),{x:d,y:u}=eo(c,o,l),f=o,m=0;const g={};for(let w=0;w<r.length;w++){const x=r[w];if(!x)continue;const{name:v,fn:_}=x,{x:T,y:N,data:V,reset:F}=await _({x:d,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:s,floating:e}});d=T??d,u=N??u,g[v]={...g[v],...V},F&&m<pr&&(m++,typeof F=="object"&&(F.placement&&(f=F.placement),F.rects&&(c=F.rects===!0?await n.getElementRects({reference:s,floating:e,strategy:i}):F.rects),{x:d,y:u}=eo(c,f,l)),w=-1)}return{x:d,y:u,placement:f,strategy:i,middlewareData:g}},gr=s=>({name:"arrow",options:s,async fn(e){const{x:t,y:o,placement:i,rects:r,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=ze(s,e)||{};if(c==null)return{};const u=Zs(d),f={x:t,y:o},m=Qt(i),g=Jt(m),w=await n.getDimensions(c),x=m==="y",v=x?"top":"left",_=x?"bottom":"right",T=x?"clientHeight":"clientWidth",N=r.reference[g]+r.reference[m]-f[m]-r.floating[g],V=f[m]-r.reference[m],F=await(n.getOffsetParent==null?void 0:n.getOffsetParent(c));let G=F?F[T]:0;(!G||!await(n.isElement==null?void 0:n.isElement(F)))&&(G=a.floating[T]||r.floating[g]);const Y=N/2-V/2,B=G/2-w[g]/2-1,I=ue(u[v],B),E=ue(u[_],B),A=G-w[g]-E,K=G/2-w[g]/2+Y,P=Xs(I,K,A),j=!l.arrow&&Ne(i)!=null&&K!==P&&r.reference[g]/2-(K<I?I:E)-w[g]/2<0,de=j?K<I?K-I:K-A:0;return{[m]:f[m]+de,data:{[m]:P,centerOffset:K-P-de,...j&&{alignmentOffset:de}},reset:j}}}),br=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(e){var t,o;const{placement:i,middlewareData:r,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...x}=ze(s,e);if((t=r.arrow)!=null&&t.alignmentOffset)return{};const v=xe(i),_=ne(a),T=xe(a)===a,N=await(l.isRTL==null?void 0:l.isRTL(c.floating)),V=f||(T||!w?[Et(a)]:ar(a)),F=g!=="none";!f&&F&&V.push(...hr(a,w,g,N));const G=[a,...V],Y=await l.detectOverflow(e,x),B=[];let I=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&B.push(Y[v]),u){const P=nr(i,n,N);B.push(Y[P[0]],Y[P[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(P=>P<=0)){var E,A;const P=(((E=r.flip)==null?void 0:E.index)||0)+1,j=G[P];if(j&&(!(u==="alignment"?_!==ne(j):!1)||I.every(Z=>ne(Z.placement)===_?Z.overflows[0]>0:!0)))return{data:{index:P,overflows:I},reset:{placement:j}};let de=(A=I.filter(Ee=>Ee.overflows[0]<=0).sort((Ee,Z)=>Ee.overflows[1]-Z.overflows[1])[0])==null?void 0:A.placement;if(!de)switch(m){case"bestFit":{var K;const Ee=(K=I.filter(Z=>{if(F){const we=ne(Z.placement);return we===_||we==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(we=>we>0).reduce((we,Cn)=>we+Cn,0)]).sort((Z,we)=>Z[1]-we[1])[0])==null?void 0:K[0];Ee&&(de=Ee);break}case"initialPlacement":de=a;break}if(i!==de)return{reset:{placement:de}}}return{}}}},vr=new Set(["left","top"]);async function wr(s,e){const{placement:t,platform:o,elements:i}=s,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),n=xe(t),a=Ne(t),l=ne(t)==="y",c=vr.has(n)?-1:1,d=r&&l?-1:1,u=ze(e,s);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const yr=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(e){var t,o;const{x:i,y:r,placement:n,middlewareData:a}=e,l=await wr(e,s);return n===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:n}}}}},xr=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(e){const{x:t,y:o,placement:i,platform:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:_=>{let{x:T,y:N}=_;return{x:T,y:N}}},...c}=ze(s,e),d={x:t,y:o},u=await r.detectOverflow(e,c),f=ne(i),m=Ys(f);let g=d[m],w=d[f];const x=(_,T)=>Xs(T+u[_==="y"?"top":"left"],T,T-u[_==="y"?"bottom":"right"]);n&&(g=x(m,g)),a&&(w=x(f,w));const v=l.fn({...e,[m]:g,[f]:w});return{...v,data:{x:v.x-t,y:v.y-o,enabled:{[m]:n,[f]:a}}}}}},_r=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(e){const{placement:t,rects:o,platform:i,elements:r}=e,{apply:n=()=>{},...a}=ze(s,e),l=await i.detectOverflow(e,a),c=xe(t),d=Ne(t),u=ne(t)==="y",{width:f,height:m}=o.floating;let g,w;c==="top"||c==="bottom"?(g=c,w=d===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(w=c,g=d==="end"?"top":"bottom");const x=m-l.top-l.bottom,v=f-l.left-l.right,_=ue(m-l[g],x),T=ue(f-l[w],v),N=e.middlewareData.shift,V=!N;let F=_,G=T;N!=null&&N.enabled.x&&(G=v),N!=null&&N.enabled.y&&(F=x),V&&!d&&(u?G=f-2*ie(l.left,l.right):F=m-2*ie(l.top,l.bottom)),await n({...e,availableWidth:G,availableHeight:F});const Y=await i.getDimensions(r.floating);return f!==Y.width||m!==Y.height?{reset:{rects:!0}}:{}}}};function zt(){return typeof window<"u"}function $e(s){return to(s)?(s.nodeName||"").toLowerCase():"#document"}function X(s){var e;return(s==null||(e=s.ownerDocument)==null?void 0:e.defaultView)||window}function ae(s){var e;return(e=(to(s)?s.ownerDocument:s.document)||window.document)==null?void 0:e.documentElement}function to(s){return zt()?s instanceof Node||s instanceof X(s).Node:!1}function te(s){return zt()?s instanceof Element||s instanceof X(s).Element:!1}function me(s){return zt()?s instanceof HTMLElement||s instanceof X(s).HTMLElement:!1}function so(s){return!zt()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof X(s).ShadowRoot}function Nt(s){const{overflow:e,overflowX:t,overflowY:o,display:i}=se(s);return/auto|scroll|overlay|hidden|clip/.test(e+o+t)&&i!=="inline"&&i!=="contents"}function kr(s){return/^(table|td|th)$/.test($e(s))}function $t(s){try{if(s.matches(":popover-open"))return!0}catch{}try{return s.matches(":modal")}catch{return!1}}const Cr=/transform|translate|scale|rotate|perspective|filter/,Sr=/paint|layout|strict|content/,_e=s=>!!s&&s!=="none";let es;function ts(s){const e=te(s)?se(s):s;return _e(e.transform)||_e(e.translate)||_e(e.scale)||_e(e.rotate)||_e(e.perspective)||!ss()&&(_e(e.backdropFilter)||_e(e.filter))||Cr.test(e.willChange||"")||Sr.test(e.contain||"")}function Tr(s){let e=ke(s);for(;me(e)&&!st(e);){if(ts(e))return e;if($t(e))return null;e=ke(e)}return null}function ss(){return es==null&&(es=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),es}function st(s){return/^(html|body|#document)$/.test($e(s))}function se(s){return X(s).getComputedStyle(s)}function Vt(s){return te(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function ke(s){if($e(s)==="html")return s;const e=s.assignedSlot||s.parentNode||so(s)&&s.host||ae(s);return so(e)?e.host:e}function oo(s){const e=ke(s);return st(e)?(s.ownerDocument||s).body:me(e)&&Nt(e)?e:oo(e)}function ot(s,e,t){var o;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=oo(s),r=i===((o=s.ownerDocument)==null?void 0:o.body),n=X(i);if(r){const a=os(n);return e.concat(n,n.visualViewport||[],Nt(i)?i:[],a&&t?ot(a):[])}else return e.concat(i,ot(i,[],t))}function os(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function io(s){const e=se(s);let t=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=me(s),r=i?s.offsetWidth:t,n=i?s.offsetHeight:o,a=Mt(t)!==r||Mt(o)!==n;return a&&(t=r,o=n),{width:t,height:o,$:a}}function is(s){return te(s)?s:s.contextElement}function Ve(s){const e=is(s);if(!me(e))return re(1);const t=e.getBoundingClientRect(),{width:o,height:i,$:r}=io(e);let n=(r?Mt(t.width):t.width)/o,a=(r?Mt(t.height):t.height)/i;return(!n||!Number.isFinite(n))&&(n=1),(!a||!Number.isFinite(a))&&(a=1),{x:n,y:a}}const Ir=re(0);function ro(s){const e=X(s);return!ss()||!e.visualViewport?Ir:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Pr(s,e,t){return e===void 0&&(e=!1),!!t&&e&&t===X(s)}function Ce(s,e,t,o){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=s.getBoundingClientRect(),r=is(s);let n=re(1);e&&(o?te(o)&&(n=Ve(o)):n=Ve(s));const a=Pr(r,t,o)?ro(r):re(0);let l=(i.left+a.x)/n.x,c=(i.top+a.y)/n.y,d=i.width/n.x,u=i.height/n.y;if(r&&o){const f=X(r),m=te(o)?X(o):o;let g=f,w=os(g);for(;w&&m!==g;){const x=Ve(w),v=w.getBoundingClientRect(),_=se(w),T=v.left+(w.clientLeft+parseFloat(_.paddingLeft))*x.x,N=v.top+(w.clientTop+parseFloat(_.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=T,c+=N,g=X(w),w=os(g)}}return At({width:d,height:u,x:l,y:c})}function Dt(s,e){const t=Vt(s).scrollLeft;return e?e.left+t:Ce(ae(s)).left+t}function no(s,e){const t=s.getBoundingClientRect(),o=t.left+e.scrollLeft-Dt(s,t),i=t.top+e.scrollTop;return{x:o,y:i}}function Or(s){let{elements:e,rect:t,offsetParent:o,strategy:i}=s;const r=i==="fixed",n=ae(o),a=e?$t(e.floating):!1;if(o===n||a&&r)return t;let l={scrollLeft:0,scrollTop:0},c=re(1);const d=re(0),u=me(o);if((u||!r)&&(($e(o)!=="body"||Nt(n))&&(l=Vt(o)),u)){const m=Ce(o);c=Ve(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const f=n&&!u&&!r?no(n,l):re(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:t.y*c.y-l.scrollTop*c.y+d.y+f.y}}function Mr(s){return s.getClientRects?Array.from(s.getClientRects()):[]}function Lr(s){const e=Vt(s),t=s.ownerDocument.body,o=ie(s.scrollWidth,s.clientWidth,t.scrollWidth,t.clientWidth),i=ie(s.scrollHeight,s.clientHeight,t.scrollHeight,t.clientHeight);let r=-e.scrollLeft+Dt(s);const n=-e.scrollTop;return se(t).direction==="rtl"&&(r+=ie(s.clientWidth,t.clientWidth)-o),{width:o,height:i,x:r,y:n}}const Er=25;function Ar(s,e,t){t===void 0&&(t="viewport");const o=t==="layoutViewport",i=X(s),r=ae(s),n=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,d=0;if(n){const f=!ss()||e==="fixed";o?f||(c=-n.offsetLeft,d=-n.offsetTop):(a=n.width,l=n.height,f&&(c=n.offsetLeft,d=n.offsetTop))}if(Dt(r)<=0){const f=r.ownerDocument,m=f.body,g=getComputedStyle(m),w=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-w),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?x/2:x;v<=Er&&(a-=v)}return{width:a,height:l,x:c,y:d}}function zr(s,e){const t=Ce(s,!0,e==="fixed"),o=t.top+s.clientTop,i=t.left+s.clientLeft,r=Ve(s),n=s.clientWidth*r.x,a=s.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:n,height:a,x:l,y:c}}function ao(s,e,t){let o;if(e==="viewport"||e==="layoutViewport")o=Ar(s,t,e);else if(e==="document")o=Lr(ae(s));else if(te(e))o=zr(e,t);else{const i=ro(s);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return At(o)}function Nr(s,e){const t=e.get(s);if(t)return t;let o=ot(s,[],!1).filter(a=>te(a)&&$e(a)!=="body"),i=null;const r=se(s).position==="fixed";let n=r?ke(s):s;for(;te(n)&&!st(n);){const a=se(n),l=ts(n),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?o=o.filter(u=>u!==n):i=a,n=ke(n)}return e.set(s,o),o}function $r(s){let{element:e,boundary:t,rootBoundary:o,strategy:i}=s;const n=[...t==="clippingAncestors"?$t(e)?[]:Nr(e,this._c):[].concat(t),o],a=ao(e,n[0],i);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let f=1;f<n.length;f++){const m=ao(e,n[f],i);l=ie(m.top,l),c=ue(m.right,c),d=ue(m.bottom,d),u=ie(m.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function Vr(s){const{width:e,height:t}=io(s);return{width:e,height:t}}function Dr(s,e,t){const o=me(e),i=ae(e),r=t==="fixed",n=Ce(s,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((o||!r)&&(($e(e)!=="body"||Nt(i))&&(a=Vt(e)),o)){const f=Ce(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!o&&i&&(l.x=Dt(i));const c=i&&!o&&!r?no(i,a):re(0),d=n.left+a.scrollLeft-l.x-c.x,u=n.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:n.width,height:n.height}}function rs(s){return se(s).position==="static"}function lo(s,e){if(!me(s)||se(s).position==="fixed")return null;if(e)return e(s);let t=s.offsetParent;return ae(s)===t&&(t=t.ownerDocument.body),t}function co(s,e){const t=X(s);if($t(s))return t;if(!me(s)){let i=ke(s);for(;i&&!st(i);){if(te(i)&&!rs(i))return i;i=ke(i)}return t}let o=lo(s,e);for(;o&&kr(o)&&rs(o);)o=lo(o,e);return o&&st(o)&&rs(o)&&!ts(o)?t:o||Tr(s)||t}const Rr=async function(s){const e=this.getOffsetParent||co,t=this.getDimensions,o=await t(s.floating);return{reference:Dr(s.reference,await e(s.floating),s.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Br(s){return se(s).direction==="rtl"}const ho={convertOffsetParentRelativeRectToViewportRelativeRect:Or,getDocumentElement:ae,getClippingRect:$r,getOffsetParent:co,getElementRects:Rr,getClientRects:Mr,getDimensions:Vr,getScale:Ve,isElement:te,isRTL:Br};function uo(s,e){return s.x===e.x&&s.y===e.y&&s.width===e.width&&s.height===e.height}function Hr(s,e,t){let o=null,i;const r=ae(s);function n(){var d;clearTimeout(i),(d=o)==null||d.disconnect(),o=null}function a(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),n();const f=s.getBoundingClientRect(),{left:m,top:g,width:w,height:x}=f;if(d||e(),!w||!x)return;const v=Lt(g),_=Lt(r.clientWidth-(m+w)),T=Lt(r.clientHeight-(g+x)),N=Lt(m),F={rootMargin:-v+"px "+-_+"px "+-T+"px "+-N+"px",threshold:ie(0,ue(1,u))||1};let G=!0;function Y(B){const I=B[0].intersectionRatio;if(!uo(f,s.getBoundingClientRect()))return a();if(I!==u){if(!G)return a();I?a(!1,I):i=setTimeout(()=>{a(!1,1e-7)},1e3)}G=!1}try{o=new IntersectionObserver(Y,{...F,root:r.ownerDocument})}catch{o=new IntersectionObserver(Y,F)}o.observe(s)}const l=X(s),c=()=>a(t);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),n()}}function Fr(s,e,t,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:n=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=is(s),d=i||r?[...c?ot(c):[],...e?ot(e):[]]:[];d.forEach(v=>{i&&v.addEventListener("scroll",t),r&&v.addEventListener("resize",t)});const u=c&&a?Hr(c,t,r):null;let f=-1,m=null;n&&(m=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&m&&e&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var T;(T=m)==null||T.observe(e)})),t()}),c&&!l&&m.observe(c),e&&m.observe(e));let g,w=l?Ce(s):null;l&&x();function x(){const v=Ce(s);w&&!uo(w,v)&&t(),w=v,g=requestAnimationFrame(x)}return t(),()=>{var v;d.forEach(_=>{i&&_.removeEventListener("scroll",t),r&&_.removeEventListener("resize",t)}),u==null||u(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Kr=yr,Wr=xr,jr=br,ns=_r,Ur=gr,Gr=(s,e,t)=>{const o=new Map,i=t??{},r={...ho,...i.platform,_c:o};return fr(s,e,{...i,platform:r})};function as(s){const e=s.parentNode??null;return e instanceof ShadowRoot?e.host:e}function qr(s){if(s.transform!=="none"||s.perspective!=="none"||s.filter!=="none")return!0;const e=s.backdropFilter;return!!(e&&e!=="none"||s.willChange&&/\b(transform|filter|perspective)\b/.test(s.willChange))}function ls(s){let e=as(s);for(;e&&!(e===document.body||e===document.documentElement);){if(e instanceof Element&&qr(getComputedStyle(e)))return e;e=as(e)}return window}function Xr(s,e,t){let o=s;for(;o&&!(o===document.body||o===document.documentElement);){if(o instanceof Element){const i=o.getBoundingClientRect();if(Math.abs(i.x-e)<2&&Math.abs(i.y-t)<2)return o}o=as(o)}return null}function mo(s){const e=getComputedStyle(s),t=[];e.transform!=="none"&&t.push(`transform: ${e.transform}`),e.perspective!=="none"&&t.push(`perspective: ${e.perspective}`),e.filter!=="none"&&t.push(`filter: ${e.filter}`);const o=e.backdropFilter;o&&o!=="none"&&t.push(`backdrop-filter: ${o}`),e.willChange&&/\b(transform|filter|perspective)\b/.test(e.willChange)&&t.push(`will-change: ${e.willChange}`),e.contain&&/\b(paint|layout|strict|content)\b/.test(e.contain)&&t.push(`contain: ${e.contain}`);const i=e.containerType;return i&&i!=="normal"&&t.push(`container-type: ${i}`),t.join("; ")}function Yr(s){const e=s.id?`#${s.id}`:"",t=typeof s.className=="string"&&s.className?"."+s.className.split(/\s+/).filter(Boolean).slice(0,2).join("."):"";return`<${s.tagName.toLowerCase()}${e}${t}>`}function Jr(s){const e=s.tolerance??1.5;let t=0,o=0;if(s.offsetParent instanceof Element){const l=s.offsetParent.getBoundingClientRect(),c=getComputedStyle(s.offsetParent);t=l.x+(parseFloat(c.borderLeftWidth)||0),o=l.y+(parseFloat(c.borderTopWidth)||0)}const i=s.panel.getBoundingClientRect(),r=i.x-(t+s.expectedX),n=i.y-(o+s.expectedY);if(Math.abs(r)<e&&Math.abs(n)<e)return null;const a=Xr(s.reference,r,n);return{driftX:r,driftY:n,culprit:a,culpritDescription:a?Yr(a):"an ancestor element (could not auto-identify)",culpritCss:a?mo(a):""}}function Qr(s,e){var i;const t=(i=s.closest)==null?void 0:i.call(s,"[data-theme]"),o=t==null?void 0:t.getAttribute("data-theme");o!=null&&e.setAttribute("data-theme",o)}const Zr={top:"bottom",right:"left",bottom:"top",left:"right"};function en(s,e,t){if(!t)return;const o=e.split("-")[0],i=Zr[o];s.style.left=t.x!=null?`${t.x}px`:"",s.style.top=t.y!=null?`${t.y}px`:"",s.style.right="",s.style.bottom="",s.style[i]=`-${s.offsetWidth/2}px`}function po(s,e){const t=[Kr(s.offset??4)];if(s.matchWidth){const i=s.matchWidth;t.push(ns({apply({rects:r,elements:n}){const a=`${r.reference.width}px`;i==="exact"?n.floating.style.width=a:n.floating.style.minWidth=a}}))}e&&t.push(jr({...s.lockPlacement===!0?{fallbackStrategy:"initialPlacement"}:{},...s.flipPadding!=null?{padding:s.flipPadding}:{}}));const o=s.shift??8;if(o!==!1&&t.push(Wr({padding:o})),s.maxHeight){const i=typeof s.maxHeight=="object"?s.maxHeight.padding:void 0;t.push(ns({padding:i,apply({availableHeight:r,elements:n}){n.floating.style.maxHeight=`${Math.max(0,r)}px`}}))}if(s.maxWidth){const i=typeof s.maxWidth=="object"?s.maxWidth.padding:void 0;t.push(ns({padding:i,apply({availableWidth:r,elements:n}){n.floating.style.maxWidth=`${Math.max(0,r)}px`}}))}return s.arrow&&t.push(Ur({element:s.arrow.element,padding:s.arrow.padding})),t}function it(s,e,t={}){const o=t.strategy??"fixed";t.inheritThemeFrom&&Qr(t.inheritThemeFrom,s),s.style.position=o,s.style.left="0",s.style.top="0";let i=t.placement??"bottom-start",r=t.flip??!0,n=po(t,r);const a=t.lockPlacement==="freeze";let l=!1;const c=!!t.fixedContainingBlock&&!t.platform,d=t.platform??(c?{...ho,getOffsetParent:()=>ls(s)}:void 0),u=()=>{var m;(m=t.beforeCompute)==null||m.call(t),Gr(e,s,{placement:i,strategy:o,middleware:n,...d?{platform:d}:{}}).then(({x:g,y:w,placement:x,middlewareData:v})=>{var _,T;if(s.style.left=`${g}px`,s.style.top=`${w}px`,t.arrow&&en(t.arrow.element,x,v.arrow),a&&!l&&(l=!0,i=x,r=!1,n=po(t,!1)),(_=t.onPlaced)==null||_.call(t,x),(T=t.onComputed)==null||T.call(t,{x:g,y:w,placement:x}),t.onDrift&&e instanceof Element){const N=c?ls(s):window,V=Jr({panel:s,reference:e,expectedX:g,expectedY:w,offsetParent:N});V&&t.onDrift(V)}})};let f;return t.autoUpdate??!0?f=Fr(e,s,u,t.autoUpdateOptions):u(),{update:u,destroy(){f==null||f(),f=void 0}}}function tn(s){return typeof s=="number"?{show:s,hide:s}:{show:(s==null?void 0:s.show)??0,hide:(s==null?void 0:s.hide)??0}}function sn(s){const e=s.container??document.body,t=s.placement??"top",o=s.visibleClass??"is-visible",i=tn(s.delay),r=document.createElement("div");r.setAttribute("role","tooltip"),s.cssClass&&(r.className=s.cssClass),typeof s.content=="string"?r.textContent=s.content:r.append(s.content);let n,a=!1,l,c,d;const u={getBoundingClientRect:()=>d??s.trigger.getBoundingClientRect(),contextElement:s.trigger},f=_=>{d=new DOMRect(_.clientX,_.clientY,0,0),n==null||n.update()},m=()=>{l&&clearTimeout(l),c&&clearTimeout(c),l=c=void 0},g=()=>{var T;if(m(),a)return;(T=s.onBeforeShow)==null||T.call(s),a=!0,e.append(r);const _=s.followCursor?u:s.trigger;n=it(r,_,{placement:t,strategy:s.strategy,offset:s.offset??8,inheritThemeFrom:s.inheritThemeFrom??s.trigger}),s.followCursor&&s.trigger.addEventListener("mousemove",f),r.classList.add(o)},w=()=>{m(),a&&(a=!1,r.classList.remove(o),s.followCursor&&s.trigger.removeEventListener("mousemove",f),n==null||n.destroy(),n=void 0,r.remove())},x=()=>{m(),i.show>0?l=setTimeout(g,i.show):g()},v=()=>{m(),i.hide>0?c=setTimeout(w,i.hide):w()};return s.trigger.addEventListener("mouseenter",x),s.trigger.addEventListener("mouseleave",v),s.trigger.addEventListener("focusin",x),s.trigger.addEventListener("focusout",v),{element:r,get isVisible(){return a},show:g,hide:w,destroy(){s.trigger.removeEventListener("mouseenter",x),s.trigger.removeEventListener("mouseleave",v),s.trigger.removeEventListener("focusin",x),s.trigger.removeEventListener("focusout",v),w()}}}function on(s){const e=s.container??document.body;let t,o=!1;const i=s.inheritThemeFrom??(s.reference instanceof HTMLElement?s.reference:void 0);return{get isOpen(){return o},open(){o||(o=!0,e.append(s.panel),t=it(s.panel,s.reference,{placement:s.placement??"bottom-start",strategy:s.strategy,offset:s.offset,matchWidth:s.matchWidth,lockPlacement:s.lockPlacement,...s.flip!==void 0?{flip:s.flip}:{},...s.shift!==void 0?{shift:s.shift}:{},...s.autoUpdate!==void 0?{autoUpdate:s.autoUpdate}:{},...s.beforeCompute?{beforeCompute:s.beforeCompute}:{},...s.platform?{platform:s.platform}:{},...i?{inheritThemeFrom:i}:{},...s.onPlaced?{onPlaced:s.onPlaced}:{}}))},close(){o&&(o=!1,t==null||t.destroy(),t=void 0,s.panel.remove())},update(){t==null||t.update()},destroy(){this.close()}}}const fo=["INIT","DATA","UI","INTERACTION"],le=ir("MULTISELECT",fo),rt=le.loggers.INIT,U=le.loggers.DATA,J=le.loggers.UI,H=le.loggers.INTERACTION,rn=fo.map(s=>`MULTISELECT:${s}`);function nn(){le.enableLogging()}function an(){le.disableLogging()}function ln(s){le.setLogLevel(s)}function cn(s,e){const t=s.includes(":")?s.split(":").pop():s;le.setCategoryLevel(t,e)}class go{constructor(e){p(this,"container");p(this,"wrapper");p(this,"viewport");p(this,"itemHeight");p(this,"items");p(this,"renderItem");p(this,"bufferSize");p(this,"onVisibleRangeChange");p(this,"onScroll");p(this,"scrollTop",0);p(this,"viewportHeight",0);p(this,"visibleStart",0);p(this,"visibleEnd",0);p(this,"scrollHandler");p(this,"resizeObserver");this.container=e.container,this.itemHeight=e.itemHeight,this.items=e.items,this.renderItem=e.renderItem,this.bufferSize=e.bufferSize??10,this.onVisibleRangeChange=e.onVisibleRangeChange,this.onScroll=e.onScroll,this.scrollHandler=this.handleScroll.bind(this),this.init()}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.style.position="relative",this.wrapper.style.width="100%",this.wrapper.style.height=`${this.items.length*this.itemHeight}px`,this.wrapper.className="ms__virtual-scroll-wrapper",this.viewport=document.createElement("div"),this.viewport.style.position="absolute",this.viewport.style.top="0",this.viewport.style.left="0",this.viewport.style.right="0",this.viewport.style.width="100%",this.viewport.className="ms__virtual-scroll-viewport",this.wrapper.appendChild(this.viewport),this.container.appendChild(this.wrapper),this.container.addEventListener("scroll",this.scrollHandler),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>{this.updateViewportHeight(),this.render()}),this.resizeObserver.observe(this.container)),this.updateViewportHeight(),this.render()}updateViewportHeight(){const e=this.container.clientHeight;e>0&&(this.viewportHeight=e)}handleScroll(){this.scrollTop=this.container.scrollTop,this.onScroll&&this.onScroll(this.scrollTop),this.render()}calculateVisibleRange(){const e=Math.floor(this.scrollTop/this.itemHeight),t=Math.ceil((this.scrollTop+this.viewportHeight)/this.itemHeight),o=Math.max(0,e-this.bufferSize),i=Math.min(this.items.length,t+this.bufferSize);return{start:o,end:i}}render(){const{start:e,end:t}=this.calculateVisibleRange();if(e===this.visibleStart&&t===this.visibleEnd)return;this.visibleStart=e,this.visibleEnd=t;let o="";for(let i=e;i<t;i++){const r=this.items[i],n=this.renderItem(r,i),a=i*this.itemHeight;o+=`<div class="ms__virtual-item" style="position: absolute; top: ${a}px; left: 0; right: 0; height: ${this.itemHeight}px;" data-index="${i}">`,o+=n,o+="</div>"}this.viewport.innerHTML=o,this.onVisibleRangeChange&&this.onVisibleRangeChange(e,t)}setItems(e){const t=e!==this.items||e.length!==this.items.length;this.items=e,this.wrapper.style.height=`${e.length*this.itemHeight}px`,this.updateViewportHeight(),t&&(this.scrollTop=0,this.container.scrollTop=0),this.visibleStart=-1,this.visibleEnd=-1,this.render()}scrollToIndex(e,t="start"){if(e<0||e>=this.items.length)return;this.updateViewportHeight();const o=e*this.itemHeight,i=o+this.itemHeight,r=Math.max(0,this.items.length*this.itemHeight-this.viewportHeight);let n;if(t==="center")n=o-(this.viewportHeight-this.itemHeight)/2;else if(t==="nearest"){const a=this.container.scrollTop,l=a+this.viewportHeight;if(o>=a&&i<=l)return;n=o<a?o:i-this.viewportHeight}else n=o;n=Math.max(0,Math.min(n,r)),this.container.scrollTop=n,this.scrollTop=n,this.render()}getVisibleRange(){return{start:this.visibleStart,end:this.visibleEnd}}getItemCount(){return this.items.length}setItemHeight(e){this.itemHeight=e,this.wrapper.style.height=`${this.items.length*e}px`,this.visibleStart=-1,this.visibleEnd=-1,this.render()}setBufferSize(e){this.bufferSize=e,this.visibleStart=-1,this.visibleEnd=-1,this.render()}refresh(){this.visibleStart=-1,this.visibleEnd=-1,this.render()}destroy(){this.container.removeEventListener("scroll",this.scrollHandler),this.resizeObserver&&this.resizeObserver.disconnect(),this.container.innerHTML=""}}function bo(s){return{treeId:"",id:-1,path:"",pathSegment:"",parentPath:void 0,level:void 0,children:{},hasChildren:!1,isSelectable:!0,data:void 0,...s}}const nt=s=>!s||typeof s=="string"&&s.trim()==="";function dn(s,e="."){if(!s||typeof s!="string")return null;const t=s.lastIndexOf(e);return t===-1?"":s.substring(0,t)}function vo(s,e,t="."){return nt(e)?s:s.startsWith(e+t)?s.substring(e.length+t.length):s}function wo(s,e=0,t=1,o="."){return s.split(o).slice(e,e+t).join(o)}function hn(s,e){return s.split(e).length}function pe(s,e){return s[e]}function un(s={}){const e=s.idMember,t=s.pathMember,o=s.getPathCallback,i=s.parentPathMember,r=s.levelMember,n=s.hasChildrenMember,a=s.isSelectableMember,l=s.getIsSelectableCallback,c=s.treeId||"multiselect-tree",d=s.orderMember,u=s.getDisplayValueCallback,f=nt(i),m=nt(r),g=nt(n),w=nt(a),x="x",v=s.treePathSeparator||".",_=bo();let T=0,N=null;const V=B=>o?o(B):t?pe(B,t):void 0,F={treePathSeparator:v,root:_,get tree(){return Object.values(_.children)},get flatNodes(){if(N)return N;const B=[],I=s.isSorted??!1,E=s.sortCallback;function A(K){let P=Object.values(K.children);I&&E&&P.length>0&&(P=E(P));for(const j of P)B.push(j),j.hasChildren&&A(j)}return A(_),N=B,B},insertArray(B){B=B||[],_.children={},T=0,N=null;const I=[];let E=B.map((A,K)=>{const P=bo();P.treeId=c,P.id=e?pe(A,e):void 0;const j=V(A);return j==null||j===""||typeof j!="string"?(I.push(`index ${K}`),null):(P.path=j,(P.id===void 0||P.id===-1)&&(P.id=j),f?P.parentPath=dn(P.path,v):P.parentPath=pe(A,i),P.pathSegment=wo(vo(P.path,P.parentPath??"",v),0,1,v),m?P.level=hn(P.path,v):P.level=pe(A,r),g||(P.hasChildren=pe(A,n)),P.data=A,P)}).filter(A=>A!==null);s.isSorted||(s.sortCallback?E=s.sortCallback(E):E=Y(E));for(const A of E)G(A.parentPath??"",A);if(l||!w)for(const A of E)if(l)A.isSelectable=l(A)!==!1;else{const K=pe(A.data,a);A.isSelectable=K==null?!0:!!K}I.length>0&&console.warn(`[ltree ${c}] ${I.length} option(s) had an invalid path and were skipped (pathMember="${t}"). Offending: ${I.slice(0,5).join(", ")}`+(I.length>5?", …":""))},getNodeByPath(B,I){let E=I||_;if(B){const A=B.split(v);for(let K=0;K<A.length;K++){const P=x+A[K];if(!E.children.hasOwnProperty(P))return null;E=E.children[P]}}return E}};function G(B,I){const E=F.getNodeByPath(B);if(!E)return`Node: ${I.path} - Could not find parent node: ${B}`;m&&(I.level=(E.level||0)+1);const A=x+wo(vo(I.path,B,v),0,1,v);return E.children.hasOwnProperty(A)||(E.children[A]=I,g&&!E.hasChildren&&(E.hasChildren=!0),T=Math.max(T,I.level||0)),null}function Y(B){return B.sort((I,E)=>{const A=I.level||0,K=E.level||0;if(A!==K)return A-K;if(I.parentPath!==E.parentPath)return I.parentPath?E.parentPath?I.parentPath.localeCompare(E.parentPath):1:-1;if(d&&I.data&&E.data){const P=pe(I.data,d)??0,j=pe(E.data,d)??0;if(P!==j)return P-j}return u?u(I).localeCompare(u(E)):I.path.localeCompare(E.path)})}return F}function yo(s,e){const t=new Map,o=new Map,i=new Set,r=l=>String(e(l.data)),n=l=>{t.set(r(l),l);const c=[];for(const u of Object.values(l.children))c.push(...n(u));let d;return c.length>0?d=c:l.isSelectable!==!1?(d=[r(l)],i.add(l.path)):d=[],o.set(l.path,d),d},a=s.tree;for(const l of a)n(l);return{nodeByValue:t,atomsUnder:o,atomPaths:i,roots:a}}function cs(s,e,t){const o=s.atomsUnder.get(e.path);if(!o||o.length===0)return"unchecked";let i=0;for(const r of o)t.has(r)&&i++;return i===0?"unchecked":i===o.length?"checked":"indeterminate"}function at(s,e){const t=new Set;for(const o of e){const i=s.nodeByValue.get(String(o));if(i)for(const r of s.atomsUnder.get(i.path)??[])t.add(r)}return t}function mn(s,e,t){const o=s.atomsUnder.get(e.path)??[],i=new Set(t),r=cs(s,e,t),n=[],a=[];if(r==="checked")for(const l of o)i.delete(l)&&a.push(l);else for(const l of o)i.has(l)||(i.add(l),n.push(l));return{checkedAtoms:i,addedAtoms:n,removedAtoms:a}}function ds(s,e,t,o){const i=a=>String(o(a.data)),r=[],n=a=>{const l=cs(s,a,e);if(l==="unchecked")return;const c=a.isSelectable!==!1,d=Object.values(a.children);if(t==="leaves"){s.atomPaths.has(a.path)&&l==="checked"&&r.push(i(a));for(const u of d)n(u);return}if(t==="all"){l==="checked"&&c&&r.push(i(a));for(const u of d)n(u);return}if(l==="checked"&&c){r.push(i(a));return}for(const u of d)n(u)};for(const a of s.roots)n(a);return r}class xo{constructor(e,t={}){p(this,"element");p(this,"instanceId");p(this,"options");z(this,R,!1);p(this,"selectedValues",new Set);p(this,"selectedOptions",new Map);p(this,"allOptions",[]);p(this,"filteredOptions",[]);p(this,"tree",null);p(this,"treeNodes",[]);p(this,"cascadeIndex",null);p(this,"cascadeCheckedAtoms",new Set);p(this,"hiddenInputs",[]);p(this,"focusedIndex",-1);p(this,"keyboardController",null);p(this,"matchingIndices",new Set);p(this,"searchTerm","");p(this,"addNewFocused",!1);p(this,"addNewPending",!1);p(this,"isLoading",!1);p(this,"searchDebounceTimer");p(this,"searchAbortController");p(this,"showSelectedPopover",!1);p(this,"selectedPopoverPlacement",null);p(this,"dropdownPlacement",null);p(this,"isRTL",!1);p(this,"effectiveBadgesPosition","bottom");p(this,"justClosedViaClick",!1);p(this,"justOpenedViaClick",!1);p(this,"positioningDriftWarned",!1);p(this,"fullscreenContainingBlockWarned",!1);p(this,"presentationMode","floating");p(this,"fullscreenHeader",null);p(this,"fullscreenSearchInput",null);p(this,"fullscreenSearchClear",null);p(this,"fullscreenModeToggle",null);p(this,"fullscreenNav",null);p(this,"fullscreenNavCount",null);p(this,"fullscreenNavPrev",null);p(this,"fullscreenNavNext",null);p(this,"bodyScrollUnlock",null);p(this,"overflowXClamp",null);p(this,"keyboardInsetCleanup",null);p(this,"overlayHistoryActive",!1);p(this,"onOverlayPopstate",()=>this.handleOverlayPopstate());p(this,"dropdownCleanup",null);p(this,"hintCleanup",null);p(this,"selectedPopoverCleanup",null);p(this,"tooltips",new Map);p(this,"labelRevealTrigger",null);p(this,"labelRevealPanel",null);p(this,"labelRevealPopover",null);p(this,"messageEl",null);p(this,"messageCleanup",null);p(this,"messageTimer",null);p(this,"onDropdownScroll",()=>{this.hideOptionTooltips(),this.hideLabelReveal()});p(this,"virtualScroll",null);p(this,"optionsContainer",null);p(this,"selectedPopoverVirtualScroll",null);p(this,"selectedPopoverContainer",null);p(this,"input");p(this,"inputWrapper");p(this,"dropdown");p(this,"dropdownInner");p(this,"badgesContainer");p(this,"counter");p(this,"clearButton");p(this,"hint");p(this,"selectedPopover");p(this,"documentKeydownHandler",null);p(this,"documentClickHandler",null);p(this,"overlayCoord",null);this.element=e,this.instanceId=`MS-${Math.random().toString(36).slice(2,11)}`,this.options={searchHint:e.dataset.searchHint||"",searchPlaceholder:e.dataset.searchPlaceholder||void 0,selectPlaceholder:e.dataset.selectPlaceholder||"Pick an option...",noDataPlaceholder:e.dataset.noDataPlaceholder||void 0,dropdownMinWidth:e.dataset.dropdownMinWidth||void 0,dropdownMaxWidth:e.dataset.dropdownMaxWidth||void 0,badgesDisplayMode:e.dataset.badgesDisplayMode||"badges",badgesPosition:e.dataset.badgesPosition||"bottom",badgesThresholdMode:e.dataset.badgesThresholdMode||"count",maxHeight:e.dataset.maxHeight||"20rem",emptyMessage:e.dataset.emptyMessage||"No results found",addNewText:e.dataset.addNewText||void 0,addNewPendingText:e.dataset.addNewPendingText||void 0,loadingMessage:e.dataset.loadingMessage||"Loading...",searchInputMode:e.dataset.searchInputMode||"normal",searchMode:e.dataset.searchMode||"filter",badgesThreshold:e.dataset.badgesThreshold?parseInt(e.dataset.badgesThreshold):void 0,minSearchLength:parseInt(e.dataset.minSearchLength||"0")||0,searchDebounce:parseInt(e.dataset.searchDebounce||"0")||0,isMultipleEnabled:e.dataset.multiple!=="false",isGroupsAllowed:e.dataset.allowGroups!=="false",isCheckboxesShown:e.dataset.showCheckboxes!=="false",isActionsSticky:e.dataset.stickyActions!=="false",isCloseOnSelect:e.dataset.closeOnSelect==="true",isPlacementLocked:e.dataset.lockPlacement!=="false",isSearchEnabled:e.dataset.enableSearch!=="false",isAddNewAllowed:e.dataset.allowAddNew==="true",isCounterShown:e.dataset.showCounter==="true",isSelectedPopoverEnabled:e.dataset.enableSelectedPopover!=="false",isSearchModeToggleShown:e.dataset.showSearchModeToggle==="true",isKeepOptionsOnSearch:e.dataset.keepOptionsOnSearch!=="false",shouldKeepSearchOnClose:e.dataset.keepSearchOnClose!=="false",options:[],container:void 0,...t},this.init()}extractField(e,t){if(Array.isArray(e)&&e.length===2){if(t.tupleSkip)return typeof t.fallback=="function"?t.fallback():t.fallback;if(t.tupleIndex!==void 0){const i=e[t.tupleIndex];return t.transform?t.transform(i):i}}if(t.member&&e[t.member]!==void 0){const i=e[t.member];return t.transform?t.transform(i):i}return t.callback?t.callback(e):typeof t.fallback=="function"?t.fallback():t.fallback}getItemValue(e){return this.extractField(e,{tupleIndex:0,member:this.options.valueMember,callback:this.options.getValueCallback,fallback:"[N/A]"})}getItemDisplayValue(e){return this.extractField(e,{tupleIndex:1,member:this.options.displayValueMember,callback:this.options.getDisplayValueCallback,transform:String,fallback:"[N/A]"})}getItemBadgeDisplayValue(e){if(this.options.getBadgeDisplayCallback)return this.options.getBadgeDisplayCallback(e);if(this.options.isBadgeFullTitleShown){const t=this.getItemFullTitle(e);if(t)return t}return this.getItemDisplayValue(e)}getItemFullTitle(e){return this.extractField(e,{tupleSkip:!0,member:this.options.fullTitleMember,callback:this.options.getFullTitleCallback,transform:String,fallback:void 0})}getItemSearchValue(e){return this.extractField(e,{member:this.options.searchValueMember,callback:this.options.getSearchValueCallback,transform:String,fallback:()=>this.getItemDisplayValue(e)})}getItemIcon(e){return this.extractField(e,{tupleSkip:!0,member:this.options.iconMember,callback:this.options.getIconCallback,transform:String,fallback:void 0})}getItemSubtitle(e){return this.extractField(e,{tupleSkip:!0,member:this.options.subtitleMember,callback:this.options.getSubtitleCallback,transform:String,fallback:void 0})}getItemGroup(e){return this.extractField(e,{tupleSkip:!0,member:this.options.groupMember,callback:this.options.getGroupCallback,transform:String,fallback:void 0})}getItemDisabled(e){return this.extractField(e,{tupleSkip:!0,member:this.options.disabledMember,callback:this.options.getDisabledCallback,transform:Boolean,fallback:!1})}isIndexSelectable(e){if(!this.isTreeMode())return!0;const t=this.treeNodes[e];return t?t.isSelectable!==!1:!0}isOptionSelectable(e){if(!this.isTreeMode())return!0;const t=this.filteredOptions.indexOf(e);if(t>=0)return this.isIndexSelectable(t);const o=String(this.getItemValue(e)),i=this.treeNodes.find(r=>String(this.getItemValue(r.data))===o);return i?i.isSelectable!==!1:!0}init(){this.parseOptions(),this.buildHTML(),this.attachEvents(),this.parseInitialSelection(),rt.debug(`Initialized [${this.instanceId}] with options:`,{placeholder:this.options.searchPlaceholder,totalOptions:this.allOptions.length,isCloseOnSelect:this.options.isCloseOnSelect,dataAttribute:this.element.dataset.closeOnSelect})}parseOptions(){const e=this.element.dataset.options;if(e)try{this.allOptions=JSON.parse(e)}catch(t){U.error(`[${this.instanceId}] Failed to parse data-options:`,t),this.allOptions=[]}else this.options.options&&(this.allOptions=this.options.options);this.filteredOptions=[...this.allOptions],this.isTreeMode()&&this.buildTree()}isTreeMode(){return this.options.isTreeEnabled===!1?!1:!!(this.options.isTreeEnabled||this.options.pathMember||this.options.getPathCallback)}buildTree(){this.tree=un({idMember:this.options.valueMember,pathMember:this.options.pathMember,getPathCallback:this.options.getPathCallback,parentPathMember:this.options.parentPathMember,levelMember:this.options.levelMember,hasChildrenMember:this.options.hasChildrenMember,isSelectableMember:this.options.isSelectableMember,getIsSelectableCallback:this.options.getIsSelectableCallback,treePathSeparator:this.options.treePathSeparator,treeId:this.instanceId,getDisplayValueCallback:e=>this.getItemDisplayValue(e.data)}),this.tree.insertArray(this.allOptions),this.cascadeIndex=this.isCascadeMode()?yo(this.tree,e=>String(this.getItemValue(e))):null,this.rebuildTreeVisible()}isCascadeMode(){return this.isTreeMode()&&this.options.isMultipleEnabled!==!1&&this.options.checkboxMode==="cascade"}cascadePolicy(){return this.options.cascadeSelectPolicy??"rolled-up"}refreshCascadeAtoms(){this.isCascadeMode()&&this.cascadeIndex&&(this.cascadeCheckedAtoms=at(this.cascadeIndex,this.selectedValues))}toggleTreeCascade(e){const t=this.cascadeIndex,o=at(t,this.selectedValues),{checkedAtoms:i}=mn(t,e,o);this.commitCascadeAtoms(i)}commitCascadeAtoms(e){var l;const t=this.cascadeIndex,o=ds(t,e,this.cascadePolicy(),c=>String(this.getItemValue(c))),i=new Set(o),r=[],n=[];for(const[c,d]of this.selectedOptions)i.has(c)||n.push(d);const a=new Map;for(const c of o){const u=((l=t.nodeByValue.get(c))==null?void 0:l.data)??this.selectedOptions.get(c);u!==void 0&&(a.set(c,u),this.selectedValues.has(c)||r.push(u))}this.selectedValues=i,this.selectedOptions=a,this.cascadeCheckedAtoms=e,this.commit({added:r,removed:n})}counterSelection(){if(this.isCascadeMode()&&this.cascadeIndex){const e=ds(this.cascadeIndex,this.cascadeCheckedAtoms,"rolled-up",o=>String(this.getItemValue(o))),t=[];for(const o of e){const i=this.cascadeIndex.nodeByValue.get(o),r=(i==null?void 0:i.data)??this.selectedOptions.get(o);r!==void 0&&t.push(r)}return t}return Array.from(this.selectedOptions.values())}buildCounterTooltip(e){const o=e.slice(0,12).map(i=>this.getItemBadgeDisplayValue(i));return e.length>12&&o.push(`…and ${e.length-12} more`),o.join(`
|
|
2
|
-
`)}rebuildTreeVisible(){if(!this.tree){this.treeNodes=[];return}const e=this.tree.flatNodes,t=this.options.isSearchEnabled?(this.searchTerm||"").trim().toLowerCase():"";let o;if(!t)o=e;else{const i=this.tree.treePathSeparator,r=new Set;for(const n of e)if(this.getItemSearchValue(n.data).toLowerCase().includes(t)){const l=n.path.split(i);for(let c=1;c<=l.length;c++)r.add(l.slice(0,c).join(i))}o=e.filter(n=>r.has(n.path))}this.treeNodes=o,this.filteredOptions=o.map(i=>i.data)}resetVisibleToAll(){this.isTreeMode()?this.rebuildTreeVisible():this.filteredOptions=[...this.allOptions]}rebuildTreeVisibleFromMatches(e){if(!this.tree){this.treeNodes=[],this.filteredOptions=[];return}const t=this.tree.flatNodes,o=this.tree.treePathSeparator,i=new Set((e||[]).map(a=>String(this.getItemValue(a)))),r=new Set;for(const a of t)if(i.has(String(this.getItemValue(a.data)))){const l=a.path.split(o);for(let c=1;c<=l.length;c++)r.add(l.slice(0,c).join(o))}const n=t.filter(a=>r.has(a.path));this.treeNodes=n,this.filteredOptions=n.map(a=>a.data)}rebuildTreeVisibleForNavigate(){if(this.matchingIndices.clear(),!this.tree)return this.treeNodes=[],this.filteredOptions=[],-1;const e=this.tree.flatNodes;this.treeNodes=e,this.filteredOptions=e.map(i=>i.data);const t=(this.searchTerm||"").trim().toLowerCase();if(!t)return-1;let o=-1;return e.forEach((i,r)=>{this.getItemSearchValue(i.data).toLowerCase().includes(t)&&(this.matchingIndices.add(r),o===-1&&(o=r))}),o}detectRTL(){const e=this.element.getRootNode(),t=e instanceof ShadowRoot?e.host:this.element,o=t.getAttribute("dir")==="rtl",i=t.closest('[dir="rtl"]')!==null;this.isRTL=o||i,rt.debug(`[${this.instanceId}] RTL Debug:`,{isShadowRoot:e instanceof ShadowRoot,elementDir:t.getAttribute("dir"),hasElementDir:o,hasAncestorDir:i,isRTL:this.isRTL}),this.effectiveBadgesPosition=this.options.badgesPosition||"bottom",this.isRTL&&(this.effectiveBadgesPosition==="left"?this.effectiveBadgesPosition="right":this.effectiveBadgesPosition==="right"&&(this.effectiveBadgesPosition="left"))}refreshDirection(){if(!this.element)return;const e=this.isRTL;this.detectRTL(),this.element.classList.toggle("ms--rtl",this.isRTL);const t=this.isRTL?"rtl":"ltr";this.dropdown&&(this.dropdown.dir=t),this.hint&&(this.hint.dir=t),this.selectedPopover&&(this.selectedPopover.dir=t),e!==this.isRTL&&this.renderBadges()}buildHTML(){const e=this.options.container||document.body;this.detectRTL(),this.element.classList.add("ms"),this.isRTL&&(this.element.classList.add("ms--rtl"),rt.debug(`[${this.instanceId}] Added ms--rtl class to element`)),(!this.options.isCheckboxesShown||!this.options.isMultipleEnabled)&&this.element.classList.add("ms--no-checkboxes"),this.options.isSelectedPopoverEnabled||this.element.classList.add("ms--no-selected-popover");const t=document.createElement("div");t.className="ms__input-wrapper",this.inputWrapper=t,this.input=document.createElement("input"),this.input.type="text",this.input.className="ms__input",this.input.placeholder=this.getPlaceholderText(),this.input.autocomplete="off",this.options.searchInputMode==="readonly"?this.input.readOnly=!0:this.options.searchInputMode==="hidden"&&(this.input.style.display="none");const o=document.createElement("span");o.className="ms__toggle",o.addEventListener("mousedown",n=>{n.preventDefault(),n.stopPropagation(),h(this,R)?(this.justClosedViaClick=!0,this.close(),setTimeout(()=>{this.justClosedViaClick=!1},0)):(this.open(),this.presentationMode!=="fullscreen"&&this.input.focus())}),this.counter=document.createElement("span"),this.counter.className="ms__counter",this.counter.style.display="none",this.clearButton=document.createElement("button"),this.clearButton.type="button",this.clearButton.className="ms__input-clear",this.clearButton.tabIndex=-1,this.clearButton.setAttribute("aria-label","Clear selection"),this.clearButton.style.display="none",this.clearButton.addEventListener("mousedown",n=>n.preventDefault()),this.clearButton.addEventListener("click",n=>{n.stopPropagation(),this.clearClick()}),t.appendChild(this.input),t.appendChild(this.counter),t.appendChild(this.clearButton),t.appendChild(o),this.badgesContainer=document.createElement("div"),this.badgesContainer.className="ms__badges";const i=document.createElement("div");i.className="ms__wrapper",(this.effectiveBadgesPosition==="left"||this.effectiveBadgesPosition==="right")&&i.classList.add("ms__wrapper--inline"),i.appendChild(t),i.appendChild(this.badgesContainer),this.element.appendChild(i);const r=this.isRTL?"rtl":null;this.dropdown=document.createElement("div"),this.dropdown.className="ms__dropdown",r&&(this.dropdown.dir=r),this.dropdownInner=document.createElement("div"),this.dropdownInner.className="ms__dropdown-inner",this.dropdown.appendChild(this.dropdownInner),e.appendChild(this.dropdown),this.options.searchHint&&(this.hint=document.createElement("div"),this.hint.className="ms__hint",r&&(this.hint.dir=r),this.hint.textContent=this.options.searchHint,e.appendChild(this.hint)),this.selectedPopover=document.createElement("div"),this.selectedPopover.className="ms__selected-popover",r&&(this.selectedPopover.dir=r),e.appendChild(this.selectedPopover),this.renderDropdown()}shouldUseVirtualScroll(){if(!this.options.isVirtualScrollEnabled||this.options.isGroupsAllowed&&this.hasGroups())return!1;const e=this.options.virtualScrollThreshold??100;return this.filteredOptions.length>=e}hasGroups(){return this.filteredOptions.some(e=>{const t=this.getItemGroup(e);return t&&t.trim()!==""})}renderDropdown(e){var a;if(this.destroyAllActionButtonTooltips(),this.hideLabelReveal(),this.refreshCascadeAtoms(),this.shouldUseVirtualScroll()){this.dropdown.classList.add("ms__dropdown--virtual"),this.renderDropdownVirtual();return}this.dropdown.classList.remove("ms__dropdown--virtual"),this.virtualScroll&&(this.virtualScroll.destroy(),this.virtualScroll=null,this.optionsContainer=null);let t="";if(this.isLoading){t+='<div class="ms__loader">',t+='<div class="pa-loader pa-loader--sm"></div>',t+=`<div class="ms__loading-text">${this.options.loadingMessage}</div>`,t+="</div>",this.dropdownInner.innerHTML=t;return}const o=this.renderActionsHTML(),i=this.options.actionsPosition==="bottom";if(i||(t+=o),this.options.isVirtualScrollEnabled){const l=this.scaledOptionHeight();t+=`<div class="ms__options ms__options--fixed-height" style="--ms-option-height: ${l}px;">`}else t+='<div class="ms__options">';if(this.filteredOptions.length===0)t+=this.renderEmptyStateHTML();else if(this.isTreeMode())this.treeNodes.forEach((l,c)=>{t+=this.renderTreeNode(l,c)});else if(this.options.isGroupsAllowed){const l=this.groupOptions(this.filteredOptions),c=new Map;this.filteredOptions.forEach((d,u)=>c.set(d,u)),Object.keys(l).forEach(d=>{if(t+='<div class="ms__group">',d!=="__ungrouped__"){const u=` data-group="${this.escapeHtml(d)}"`;if(this.options.renderGroupLabelContentCallback){const f=this.options.renderGroupLabelContentCallback(d);if(f instanceof HTMLElement){const m=document.createElement("div");m.className="ms__group-label",m.dataset.group=d,m.appendChild(f),t+=m.outerHTML}else t+=`<div class="ms__group-label"${u}>${f}</div>`}else t+=`<div class="ms__group-label"${u}>${d}</div>`}l[d].forEach(u=>{t+=this.renderOption(u,c.get(u)??-1)}),t+="</div>"})}else this.filteredOptions.forEach((l,c)=>{t+=this.renderOption(l,c)});t+="</div>",i&&(t+=o);let r=0,n=0;if(e!=null&&e.preserveScroll&&(r=this.dropdownInner.scrollTop,n=((a=this.dropdownInner.querySelector(".ms__options"))==null?void 0:a.scrollTop)??0),this.dropdownInner.innerHTML=t,e!=null&&e.preserveScroll){this.dropdownInner.scrollTop=r;const l=this.dropdownInner.querySelector(".ms__options");l&&(l.scrollTop=n)}this.attachActionButtonTooltips(),this.attachOptionTooltips(),this.markTruncatedOptions(),this.applyEdgeOptionRadii()}applyEdgeOptionRadii(){const e=this.dropdownInner.querySelector(".ms__options");if(!e)return;const t=e.scrollHeight>e.clientHeight+1?e:this.dropdownInner,o=t.offsetWidth-t.clientWidth<=0,i="var(--ms-dropdown-inner-border-radius)",r=Array.from(e.querySelectorAll(".ms__option, .ms__group-label"));r.forEach(l=>{l.style.borderStartStartRadius="",l.style.borderStartEndRadius="",l.style.borderEndStartRadius="",l.style.borderEndEndRadius=""});const n=r[0];n&&(n.style.borderStartStartRadius=i,o&&(n.style.borderStartEndRadius=i));let a;for(let l=r.length-1;l>=0;l--)if(r[l].classList.contains("ms__option")){a=r[l];break}a&&(a.style.borderEndStartRadius=i,o&&(a.style.borderEndEndRadius=i))}renderDropdownVirtual(){if(this.destroyAllActionButtonTooltips(),!this.virtualScroll){let o="";const i=this.renderActionsHTML(),r=this.options.actionsPosition==="bottom";r||(o+=i),o+='<div class="ms__options ms__options--virtual" style="overflow-y: auto; position: relative;"></div>',r&&(o+=i),this.dropdownInner.innerHTML=o,this.optionsContainer=this.dropdownInner.querySelector(".ms__options")}if(this.applyVirtualOptionsSizing(this.optionsContainer),this.filteredOptions.length===0){this.virtualScroll&&(this.virtualScroll.destroy(),this.virtualScroll=null),this.optionsContainer.innerHTML=this.renderEmptyStateHTML();return}const e=this.scaledOptionHeight(),t=this.options.virtualScrollBuffer??10;requestAnimationFrame(()=>{this.optionsContainer&&(this.virtualScroll?(this.virtualScroll.setItemHeight(e),this.virtualScroll.setItems(this.filteredOptions)):this.virtualScroll=new go({container:this.optionsContainer,itemHeight:e,items:this.filteredOptions,renderItem:(o,i)=>this.isTreeMode()?this.renderTreeNode(this.treeNodes[i],i):this.renderOption(o,i),bufferSize:t,onVisibleRangeChange:()=>{this.attachOptionTooltips(),this.markTruncatedOptions(),this.applyEdgeOptionRadii()}}),this.attachActionButtonTooltips())})}getBuiltInActionDisabled(e){return e==="select-all"?!this.filteredOptions.some(t=>!this.getItemDisabled(t)&&!this.selectedValues.has(String(this.getItemValue(t)))):e==="clear-all"?this.selectedValues.size===0:!1}renderActionsHTML(){const e=this.options.actionButtons;if(!this.options.isMultipleEnabled||!e||e.length===0)return"";const t=this.options.actionsPosition==="bottom"?"bottom":"top",o=this.options.actionsAlign??"stretch",i=` ms__actions--${t}`,r=this.options.isActionsSticky?" ms__actions--sticky":"",n=this.options.actionsLayout==="wrap"?" ms__actions--wrap":"",a=` ms__actions--align-${o}`,l=new Map;if(e.forEach((d,u)=>{if(!(d.getIsVisibleCallback?d.getIsVisibleCallback(this):d.isVisible??!0))return;let m;d.getIsDisabledCallback?m=d.getIsDisabledCallback(this):d.isDisabled!==void 0?m=d.isDisabled:m=this.getBuiltInActionDisabled(d.action);const g=m?" disabled":"",w=d.getTextCallback?d.getTextCallback(this):d.text;let x="";if(d.getClassCallback){const T=this.classSuffix(d.getClassCallback(this));T&&(x=` ${T}`)}else d.cssClass&&(x=` ${d.cssClass}`);const v=Math.max(1,Math.floor(d.row??1)),_=`<button type="button"${g} class="ms__action-btn${x}" data-action="${d.action}" data-button-index="${u}">${w}</button>`;l.has(v)||l.set(v,[]),l.get(v).push(_)}),l.size===0)return"";const c=Array.from(l.keys()).sort((d,u)=>d-u).map(d=>`<div class="ms__actions-row" data-row="${d}">${l.get(d).join("")}</div>`).join("");return`<div class="ms__actions${i}${r}${n}${a}">${c}</div>`}renderOption(e,t){const o=this.getItemValue(e),i=this.getItemDisplayValue(e),r=this.getItemIcon(e),n=this.getItemSubtitle(e),a=this.getItemDisabled(e),l=this.selectedValues.has(String(o)),c=t===this.focusedIndex,d=this.matchingIndices.has(t),u=["ms__option"];l&&u.push("ms__option--selected"),c&&u.push("ms__option--focused"),d&&u.push("ms__option--matched"),a&&u.push("ms__option--disabled");const f=this.options.checkboxAlign&&this.options.checkboxAlign!=="center"?` data-checkbox-align="${this.options.checkboxAlign}"`:"";let m=`<div class="${u.join(" ")}" data-value="${o}" data-index="${t}"${f}>`;if(this.options.isCheckboxesShown&&this.options.isMultipleEnabled&&(m+=`<input type="checkbox" class="ms__checkbox" ${l?"checked":""} ${a?"disabled":""}>`),m+='<div class="ms__option-content">',this.options.renderOptionContentCallback){const g={index:t,isSelected:l,isFocused:c,isMatched:d,isDisabled:a,...qt(this.presentationMode),isTreeNode:!1};m+=this.toHtml(this.options.renderOptionContentCallback(e,g))}else r&&(m+=`<span class="ms__option-icon">${r}</span>`),m+='<div class="ms__option-text">',m+=`<div class="ms__option-title">${this.highlightMatch(i,this.searchTerm)}</div>`,n&&(m+=`<div class="ms__option-subtitle">${n}</div>`),m+="</div>";return m+=this.renderOptionInfoButton(),m+="</div>",m+="</div>",m}renderOptionInfoButton(){return this.presentationMode!=="fullscreen"?"":'<button type="button" class="ms__option-info" tabindex="-1" aria-label="Show full label"></button>'}renderTreeNode(e,t){const o=e.data,i=this.getItemValue(o),r=this.getItemDisplayValue(o),n=this.getItemIcon(o),a=this.getItemSubtitle(o),l=this.getItemDisabled(o),c=this.isCascadeMode()&&this.cascadeIndex,d=c?cs(this.cascadeIndex,e,this.cascadeCheckedAtoms):null,u=c?d==="checked":this.selectedValues.has(String(i)),f=d==="indeterminate",m=t===this.focusedIndex,g=this.matchingIndices.has(t),w=e.isSelectable!==!1,x=e.level??1,v=Math.max(0,x-1),_=["ms__option","ms__option--tree"];_.push(e.hasChildren?"ms__option--tree-branch":"ms__option--tree-leaf"),u&&_.push("ms__option--selected"),f&&_.push("ms__option--indeterminate"),m&&_.push("ms__option--focused"),g&&_.push("ms__option--matched"),l&&_.push("ms__option--disabled"),w||_.push("ms__option--tree-unselectable");const T=this.options.checkboxAlign&&this.options.checkboxAlign!=="center"?` data-checkbox-align="${this.options.checkboxAlign}"`:"",N=w?"":' data-selectable="false"';let V=`<div class="${_.join(" ")}" data-value="${i}" data-index="${t}" data-path="${e.path}" data-level="${x}" style="--ms-tree-depth: ${v};"${T}${N}>`;if(this.options.isCheckboxesShown&&this.options.isMultipleEnabled&&w&&(V+=`<input type="checkbox" class="${f?"ms__checkbox ms__checkbox--indeterminate":"ms__checkbox"}" ${u?"checked":""}${f?' aria-checked="mixed"':""} ${l?"disabled":""}>`),V+='<div class="ms__option-content">',this.options.renderOptionContentCallback){const F={index:t,isSelected:u,isFocused:m,isMatched:g,isDisabled:l,...qt(this.presentationMode),isTreeNode:!0,isBranch:e.hasChildren,isLeaf:!e.hasChildren,childCount:Object.keys(e.children).length,level:x,depth:v,path:e.path,isSelectable:w,isIndeterminate:f};V+=this.toHtml(this.options.renderOptionContentCallback(o,F))}else n&&(V+=`<span class="ms__option-icon">${n}</span>`),V+='<div class="ms__option-text">',V+=`<div class="ms__option-title">${this.highlightMatch(r,this.searchTerm)}</div>`,a&&(V+=`<div class="ms__option-subtitle">${a}</div>`),V+="</div>";return V+=this.renderOptionInfoButton(),V+="</div>",V+="</div>",V}renderEmptyStateHTML(){if(this.isAddNewPromptShown()){const e=(this.searchTerm||"").trim();return this.addNewPending?`<div class="ms__add-new ms__add-new--loading" aria-busy="true"><span class="ms__add-new-spinner" aria-hidden="true"></span><span class="ms__add-new-text">${this.getAddNewPendingText(e)}</span></div>`:`<div class="ms__add-new${this.addNewFocused?" ms__add-new--focused":""}" role="button" data-action="add-new"><span class="ms__add-new-icon" aria-hidden="true"></span><span class="ms__add-new-text">${this.getAddNewText(e)}</span></div>`}return`<div class="ms__empty">${this.options.emptyMessage}</div>`}isAddNewPromptShown(){return!!this.options.isAddNewAllowed&&this.filteredOptions.length===0&&!!(this.searchTerm||"").trim()}getAddNewText(e){return this.options.getAddNewTextCallback?this.escapeHtml(this.options.getAddNewTextCallback(e)):(this.options.addNewText??'Add "{value}"').replace(/\{value\}/g,this.escapeHtml(e))}getAddNewPendingText(e){return(this.options.addNewPendingText??'Adding "{value}"…').replace(/\{value\}/g,this.escapeHtml(e))}escapeHtml(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}highlightMatch(e,t){if(!t)return e;const o=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return e.replace(o,"<mark>$1</mark>")}groupOptions(e){const t={};return e.forEach(o=>{const i=this.getItemGroup(o)||"__ungrouped__";t[i]||(t[i]=[]),t[i].push(o)}),t}get isSearchUsable(){return!!this.options.isSearchEnabled&&this.options.searchInputMode!=="readonly"&&this.options.searchInputMode!=="hidden"}getPlaceholderText(){return this.options.noDataPlaceholder&&this.allOptions.length===0?this.options.noDataPlaceholder:this.isSearchUsable?this.getSearchPlaceholder():this.options.selectPlaceholder||this.getSearchPlaceholder()}getSearchPlaceholder(){return this.options.searchPlaceholder?this.options.searchPlaceholder:this.options.isSearchModeToggleShown?(this.options.searchMode||"filter")==="navigate"?"Search…":"Filter…":"Search..."}refreshSearchPlaceholder(){const e=this.getPlaceholderText();this.input&&(this.input.placeholder=e),this.fullscreenSearchInput&&(this.fullscreenSearchInput.placeholder=e)}renderBadges(){this.updateClearButton(),this.destroyAllBadgeTooltips();const e=Array.from(this.selectedOptions.values()),t=this.selectedValues.size;if(!this.options.isMultipleEnabled){this.badgesContainer.innerHTML="",this.counter.style.display="none";let r;e[0]&&(this.options.renderSelectedContentCallback?r=this.options.renderSelectedContentCallback(e[0]):r=this.getItemDisplayValue(e[0])),!h(this,R)&&t>0&&e.length>0?this.input.value=r:h(this,R)||(this.input.value="");return}let o=this.options.badgesDisplayMode;if(this.options.badgesThreshold!==null&&t>this.options.badgesThreshold&&o!=="none"&&(o=this.options.badgesThresholdMode||"count"),!h(this,R))if(t>0&&o==="count"){const r=this.options.getCounterCallback?this.options.getCounterCallback(t):`${t} selected`;this.input.placeholder=r}else this.input.placeholder=this.getPlaceholderText();if(this.options.isCounterShown&&t>0){const r=this.counterSelection(),n=r.length;this.counter.textContent=`[${n}]`,this.counter.title=this.buildCounterTooltip(r),this.counter.style.display=n>0?"":"none"}else this.counter.title="",this.counter.style.display="none";if(o==="none"){this.badgesContainer.innerHTML="";return}if(o==="badges")this.badgesContainer.className=`ms__badges ms__badges--${this.effectiveBadgesPosition}`,this.badgesContainer.innerHTML=e.map(r=>this.renderBadgeHTML(r,{displayMode:"badges",isInPopover:!1})).join("");else if(o==="partial"){this.badgesContainer.className=`ms__badges ms__badges--${this.effectiveBadgesPosition}`;const r=this.options.badgesMaxVisible||3,n=e.slice(0,r),a=t-r,l=n.map(d=>this.renderBadgeHTML(d,{displayMode:"partial",isInPopover:!1})).join("");let c="";a>0&&(c=`
|
|
1
|
+
(function(k,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(k=typeof globalThis<"u"?globalThis:k||self,S(k.MultiSelect={}))})(this,function(k){"use strict";var In=Object.defineProperty;var Eo=k=>{throw TypeError(k)};var Pn=(k,S,D)=>S in k?In(k,S,{enumerable:!0,configurable:!0,writable:!0,value:D}):k[S]=D;var p=(k,S,D)=>Pn(k,typeof S!="symbol"?S+"":S,D),ms=(k,S,D)=>S.has(k)||Eo("Cannot "+D);var h=(k,S,D)=>(ms(k,S,"read from private field"),D?D.call(k):S.get(k)),A=(k,S,D)=>S.has(k)?Eo("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(k):S.set(k,D),O=(k,S,D,L)=>(ms(k,S,"write to private field"),L?L.call(k,D):S.set(k,D),D),b=(k,S,D)=>(ms(k,S,"access private method"),D);var fe,ct,Se,dt,Te,ht,Ht,Ie,ge,Pe,Oe,Re,Be,He,Fe,Ke,We,Ft,ce,je,M,Ao,zo,No,ee,$o,Vo,ps,fs,ft,gs,Do,R,Q,C,be,Ue,ut,mt,pt,Ge,qe,Le,w,bs,Kt,ve,Wt,vs,ws,ys,jt,Ro,Bo,Ho,gt,xs,Fo,Ko,Wo,_s,jo,Uo,ks,Cs;function S(s,e={}){const t=new Set(s),o=e.shouldNullOnInvalid?null:e.default??null;return{values:s,fromAttribute(i){return i===null?e.default??o:t.has(i)?i:o},validate(i){return typeof i=="string"&&t.has(i)},toAttribute(i){return i==null?null:String(i)}}}function D(s={}){const e=o=>(s.min==null||o>=s.min)&&(s.max==null||o<=s.max),t=s.default;return{fromAttribute(o){if(o===null)return t;const i=Number.parseInt(o,10);return Number.isNaN(i)||!e(i)?t:i},validate(o){return typeof o=="number"&&Number.isInteger(o)&&e(o)},toAttribute(o){return o==null?null:String(o)}}}function L(s={}){const e=s.isNullable===!0,t=s.default??(e?null:""),o=i=>s.shouldTrim?i.trim():i;return{fromAttribute(i){if(i===null)return t;const r=o(i);return!s.isEmptyAllowed&&r===""?t:r},validate(i){return i===null?e:typeof i=="string"&&(s.isEmptyAllowed===!0||i!=="")},toAttribute(i){return i==null?null:String(i)}}}const Go=new Set(["","true","1","yes","on"]),qo=new Set(["false","0","no","off"]);function W(s="presence"){const e=t=>{const o=t.trim().toLowerCase();return Go.has(o)?!0:qo.has(o)?!1:null};return{fromAttribute(t){switch(s){case"presence":return t!==null;case"default-true":return t===null?!0:e(t)??!0;case"default-false":return t===null?!1:e(t)??!1;case"tristate":return t===null?null:e(t)}},validate(t){return s==="tristate"?t===!0||t===!1||t===null:typeof t=="boolean"},toAttribute(t){return s==="presence"?t?"":null:t==null?null:String(t)}}}function Xo(s={}){const e=s.default;return{fromAttribute(t){if(t===null||t.trim()==="")return e;let o;try{o=JSON.parse(t)}catch{return e}return s.validate&&!s.validate(o)?e:o},validate:s.validate,toAttribute(t){return t==null?null:JSON.stringify(t)}}}function Yo(s={}){const e=s.default??[],t=o=>Array.isArray(o)&&(!s.validateItem||o.every(s.validateItem));return{fromAttribute(o){if(o===null||o.trim()==="")return e;let i;try{i=JSON.parse(o)}catch{return e}return t(i)?i:e},validate:t,toAttribute(o){return Array.isArray(o)?JSON.stringify(o):null}}}function Jo(){return{validate(s){return s==null||typeof s=="function"}}}function Qo(s,e,t){const o=s.converter,i=o!=null&&o.fromAttribute?o.fromAttribute(e,t,s.attribute??s.configKey):e??s.default;return{configKey:s.configKey,field:s.field,value:i,on:s.on??"update"}}function Zo(s,e){const t=s.converter;return t!=null&&t.validate&&!t.validate(e)?null:{configKey:s.configKey,field:s.field,value:e,on:s.on??"update"}}function ei(){const s=new Set;let e=!1;const t=()=>{e=!1;const o=[...s];s.clear();for(const i of o)i()};return{schedule(o){s.add(o),e||(e=!0,queueMicrotask(t))},flush(){if(s.size===0)return;e=!1;const o=[...s];s.clear();for(const i of o)i()},cancel(){s.clear(),e=!1}}}const Ss={pointer:"fine",hasCoarsePointer:!1,canHover:!0,isTouchPrimary:!1,orientation:"landscape",viewportWidth:1024,viewportHeight:768,breakpoint:"desktop",os:"unknown",isApple:!1,isAndroid:!1};let bt=Is({mobile:640,tablet:1024,desktop:1/0});const Xe=new Set,Ye=new Set;let ye=null,vt=[],wt=!1;const Ts=30;let Ae,yt=0;function Is(s){return Object.entries(s).sort((e,t)=>e[1]-t[1])}function ti(s){for(const[t,o]of bt)if(s<=o)return t;const e=bt[bt.length-1];return e?e[0]:"desktop"}function Ut(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Ps(){return typeof navigator<"u"&&(navigator.maxTouchPoints??0)>1}function si(){var o;if(typeof navigator>"u")return"unknown";const s=navigator.userAgentData,e=(o=s==null?void 0:s.platform)==null?void 0:o.toLowerCase();if(e){if(e.includes("android"))return"android";if(e.includes("ios"))return"ios";if(e.includes("mac"))return Ps()?"ios":"macos";if(e.includes("windows"))return"windows";if(e.includes("linux"))return"linux"}const t=navigator.userAgent??"";return/android/i.test(t)?"android":/iphone|ipod|ipad/i.test(t)?"ios":/macintosh|mac os x/i.test(t)?Ps()?"ios":"macos":/windows/i.test(t)?"windows":/linux/i.test(t)?"linux":"unknown"}let oi;function ii(){return oi??(oi=si())}function Je(s){return Ut()&&window.matchMedia(s).matches}function Gt(){if(!Ut())return{...Ss};const s=Je("(any-pointer: coarse)"),e=Je("(pointer: coarse)"),t=Je("(pointer: fine)"),o=Je("(hover: hover)"),i=e?"coarse":t?"fine":"none",r=window.innerWidth,n=window.innerHeight,a=ii();return{pointer:i,hasCoarsePointer:s,canHover:o,isTouchPrimary:e&&!o,orientation:Je("(orientation: portrait)")?"portrait":"landscape",viewportWidth:r,viewportHeight:n,breakpoint:ti(r),os:a,isApple:a==="ios"||a==="macos",isAndroid:a==="android"}}function ri(s,e){return s.pointer===e.pointer&&s.hasCoarsePointer===e.hasCoarsePointer&&s.canHover===e.canHover&&s.isTouchPrimary===e.isTouchPrimary&&s.orientation===e.orientation&&s.breakpoint===e.breakpoint}function ni(s,e){return s.viewportWidth===e.viewportWidth&&s.viewportHeight===e.viewportHeight}function xt(){const s=Gt(),e=ye;if(ye=s,!e||!ri(e,s))for(const t of[...Xe])t(s);Ye.size>0&&(!e||!ni(e,s))&&ai()}function Os(){const s=ye;if(s)for(const e of[...Ye])e(s)}function ai(){if(Ae!==void 0)return;const s=Date.now()-yt;s>=Ts?(yt=Date.now(),Os()):Ae=setTimeout(()=>{Ae=void 0,yt=Date.now(),Os()},Ts-s)}const _t=()=>xt(),Ms=()=>{if(typeof requestAnimationFrame=="function"){if(wt)return;wt=!0,requestAnimationFrame(()=>{wt=!1,xt()})}else xt()};function li(s){typeof s.addEventListener=="function"?s.addEventListener("change",_t):typeof s.addListener=="function"&&s.addListener(_t)}function ci(s){typeof s.removeEventListener=="function"?s.removeEventListener("change",_t):typeof s.removeListener=="function"&&s.removeListener(_t)}function Ls(){if(!Ut()){ye={...Ss};return}vt=[window.matchMedia("(pointer: coarse)"),window.matchMedia("(pointer: fine)"),window.matchMedia("(any-pointer: coarse)"),window.matchMedia("(hover: hover)"),window.matchMedia("(orientation: portrait)")];for(const s of vt)li(s);typeof window.addEventListener=="function"&&window.addEventListener("resize",Ms),ye=Gt()}function Es(){for(const s of vt)ci(s);vt=[],typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("resize",Ms),wt=!1,Ae!==void 0&&(clearTimeout(Ae),Ae=void 0),yt=0,ye=null}function kt(){return Xe.size+Ye.size}function Qe(){return ye??Gt()}function As(s,e={}){const t=kt()===0;Xe.add(s),t&&Ls(),e.immediate!==!1&&s(Qe());let o=!0;return()=>{o&&(o=!1,Xe.delete(s),kt()===0&&Es())}}function zs(s,e={}){const t=kt()===0;Ye.add(s),t&&Ls(),e.immediate!==!1&&s(Qe());let o=!0;return()=>{o&&(o=!1,Ye.delete(s),kt()===0&&Es())}}function di(s){bt=Is(s),Xe.size>0&&xt()}const Ns=600;function $s(s){return s.isTouchPrimary?Math.min(s.viewportWidth,s.viewportHeight)<Ns?"mobile":"tablet":"desktop"}const hi=30;let oe=null;const Ze=new WeakMap;let qt=0;function ui(){return typeof ResizeObserver<"u"}function Vs(s){if(typeof s.getBoundingClientRect!="function")return{width:0,height:0};const e=s.getBoundingClientRect();return{width:e.width,height:e.height}}function mi(s,e){return!!s&&s.width===e.width&&s.height===e.height}function pi(s,e){if(mi(s.lastFired,e)||(s.pendingSize=e,s.timer!==void 0))return;const t=Date.now()-s.lastNotify;t>=s.throttleMs?(s.lastNotify=Date.now(),Ds(s)):s.timer=setTimeout(()=>{s.timer=void 0,s.lastNotify=Date.now(),Ds(s)},s.throttleMs-t)}function Ds(s){const e=s.pendingSize;e&&(s.lastFired=e,s.cb(e,s.el))}function fi(s){for(const e of s){const t=Ze.get(e.target);if(!t)continue;const o=Vs(e.target);for(const i of[...t])pi(i,o)}}function gi(){return ui()?(oe||(oe=new ResizeObserver(fi)),oe):null}function bi(s,e,t={}){const o={el:s,cb:e,throttleMs:t.throttleMs??hi,lastNotify:0};if(t.immediate!==!1){const n=Vs(s);o.lastFired=n,o.lastNotify=Date.now(),e(n,s)}const i=gi();if(i){let n=Ze.get(s);n||(Ze.set(s,n=new Set),qt++,i.observe(s)),n.add(o)}let r=!0;return()=>{if(!r)return;r=!1,o.timer!==void 0&&(clearTimeout(o.timer),o.timer=void 0);const n=Ze.get(s);n&&(n.delete(o),n.size===0&&(Ze.delete(s),oe==null||oe.unobserve(s),qt--,qt===0&&oe&&(oe.disconnect(),oe=null)))}}const Ct=new Map;function vi(s,e){let t=Ct.get(s);t||Ct.set(s,t=new Set),t.add(e)}function wi(s,e){var t;(t=Ct.get(s))==null||t.delete(e)}function yi(s){return Array.from(Ct.get(s)??[])}const Rs=new Map;function xi(s,e){Rs.set(s.toLowerCase(),e)}function _i(s){return Rs.get(s.toLowerCase())}function ki(s,e,t,o={}){return s.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:o.bubbles??!0,composed:o.composed??!0,cancelable:o.cancelable??!1}))}function Ci(s){return s.split(/[-_]/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}function Si(s){return`on${Ci(s)}`}function Ti(s){return s?s.map(e=>{const t=typeof e=="string"?{name:e}:e,o=t.property===!1?null:t.property??Si(t.name);return{name:t.name,property:o,bubbles:t.bubbles,composed:t.composed,cancelable:t.cancelable}}):[]}const Ii=typeof HTMLElement<"u"?HTMLElement:class{},Bs=new WeakSet;let Pi=0;const Oi={trace(){},debug(){},info(){},warn(){},error(){}},Mi=new Proxy({},{get:()=>Oi}),Me=class Me extends Ii{constructor(){super();A(this,M);A(this,fe,{});A(this,ct,new Map);A(this,Se,new Map);A(this,dt,new Map);A(this,Te,new Map);A(this,ht,ei());A(this,Ht,()=>b(this,M,gs).call(this));A(this,Ie,null);A(this,ge,!1);A(this,Pe,[]);A(this,Oe,!1);A(this,Re,null);A(this,Be,!1);A(this,He);A(this,Fe);A(this,Ke);A(this,We);A(this,Ft);A(this,ce);A(this,je);const t=this.constructor,o=t.inputs??[],i=Ti(t.events);b(this,M,No).call(this,o,i);for(const r of o)h(this,ct).set(r.configKey,r),r.attribute&&h(this,Se).set(r.attribute,r);for(const r of i)h(this,dt).set(r.name,r);b(this,M,Ao).call(this,o),b(this,M,$o).call(this,o),b(this,M,Vo).call(this,i)}static get observedAttributes(){const t=(this.inputs??[]).filter(o=>o.attribute).map(o=>o.attribute);return t.includes("dir")?t:[...t,"dir"]}attributeChangedCallback(t,o,i){var a;if(h(this,Be))return;if(t==="dir"&&!h(this,Se).has("dir")){h(this,Oe)&&this.directionChanged(this.isRTL);return}const r=h(this,Se).get(t);if(!r||!h(this,Oe)&&((a=h(this,Re))!=null&&a.has(r.configKey)))return;let n;try{n=Qo(r,i,this)}catch(l){b(this,M,ee).call(this,`converter for "${r.configKey}" threw parsing attribute ${t}="${i}"; using default`,l),n=b(this,M,zo).call(this,r)}b(this,M,fs).call(this,n)}connectedCallback(){vi(this.localName,this),h(this,Oe)||(O(this,Oe,!0),O(this,Re,null),O(this,ge,!0)),b(this,M,ft).call(this),this.connect(),this.environmentChanged!==Me.prototype.environmentChanged&&O(this,He,As(t=>this.environmentChanged(t))),this.viewportChanged!==Me.prototype.viewportChanged&&O(this,Fe,zs(t=>this.viewportChanged(t))),this.resized!==Me.prototype.resized&&O(this,Ke,bi(this,t=>this.resized(t),{immediate:!1}))}disconnectedCallback(){var t,o,i;wi(this.localName,this),(t=h(this,He))==null||t.call(this),O(this,He,void 0),(o=h(this,Fe))==null||o.call(this),O(this,Fe,void 0),(i=h(this,Ke))==null||i.call(this),O(this,Ke,void 0),this.disconnect()}setAttributes(t){for(const[o,i]of Object.entries(t)){const r=h(this,ct).get(o)??h(this,Se).get(o);r&&b(this,M,ps).call(this,r,i)}b(this,M,ft).call(this)}batch(t){t(),b(this,M,ft).call(this)}flush(){b(this,M,ft).call(this)}whenSettled(){return!h(this,Ie)&&!h(this,ge)?Promise.resolve():new Promise(t=>h(this,Pe).push(t))}get config(){return h(this,fe)}get log(){if(h(this,je))return h(this,je);const t=_i(this.localName);if(!t)return Mi;const o=h(this,Ft)??O(this,Ft,`${this.localName}#${this.id||++Pi}`);return O(this,je,t.forInstance(o,()=>h(this,ce)))}enableLogging(t="debug"){O(this,ce,t)}disableLogging(){O(this,ce,void 0)}get isLoggingEnabled(){return h(this,ce)!=null&&h(this,ce)!=="silent"&&h(this,ce)!==5}reinit(){}update(t){}connect(){}disconnect(){}environmentChanged(t){}viewportChanged(t){}resized(t){}get isRTL(){return typeof getComputedStyle=="function"&&getComputedStyle(this).direction==="rtl"}directionChanged(t){}get internals(){if(h(this,We))return h(this,We);if(typeof this.attachInternals!="function")return null;try{return O(this,We,this.attachInternals())}catch{return null}}get form(){var t;return((t=this.internals)==null?void 0:t.form)??null}emit(t,o,i){const r=h(this,dt).get(t);return ki(this,t,o,{bubbles:(i==null?void 0:i.bubbles)??(r==null?void 0:r.bubbles),composed:(i==null?void 0:i.composed)??(r==null?void 0:r.composed),cancelable:(i==null?void 0:i.cancelable)??(r==null?void 0:r.cancelable)})}on(t,o,i){const r=o;return this.addEventListener(t,r,i),()=>this.removeEventListener(t,r,i)}async runHook(t,o,i){const r=h(this,fe)[t];if(typeof r!="function")return i.whenUnset;try{return await Promise.resolve(r(o))}catch(n){if(i.onError)return i.onError(n);throw n}}};fe=new WeakMap,ct=new WeakMap,Se=new WeakMap,dt=new WeakMap,Te=new WeakMap,ht=new WeakMap,Ht=new WeakMap,Ie=new WeakMap,ge=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Be=new WeakMap,He=new WeakMap,Fe=new WeakMap,Ke=new WeakMap,We=new WeakMap,Ft=new WeakMap,ce=new WeakMap,je=new WeakMap,M=new WeakSet,Ao=function(t){var o;for(const i of t){let r=i.default;if((o=i.converter)!=null&&o.fromAttribute)try{r=i.converter.fromAttribute(null,this,i.attribute??i.configKey)}catch(n){b(this,M,ee).call(this,`converter for "${i.configKey}" threw computing its default; using \`default\``,n),r=i.default}h(this,fe)[i.configKey]=r,i.field&&(this[i.field]=r)}},zo=function(t){return{configKey:t.configKey,field:t.field,value:t.default,on:t.on??"update"}},No=function(t,o){var l;const i=this.constructor;if(Bs.has(i))return;Bs.add(i);const r=new Set,n=new Set;for(const c of t)r.has(c.configKey)&&b(this,M,ee).call(this,`invalid input table: duplicate configKey "${c.configKey}"`),r.add(c.configKey),c.attribute&&(n.has(c.attribute)&&b(this,M,ee).call(this,`invalid input table: duplicate attribute "${c.attribute}"`),n.add(c.attribute)),c.reflect&&!c.attribute&&b(this,M,ee).call(this,`invalid input table: "${c.configKey}" has reflect:true but no attribute to reflect to`),c.reflect&&!((l=c.converter)!=null&&l.toAttribute)&&b(this,M,ee).call(this,`invalid input table: "${c.configKey}" has reflect:true but its converter has no toAttribute`);const a=new Set;for(const c of o)a.has(c.name)&&b(this,M,ee).call(this,`invalid event table: duplicate event "${c.name}"`),a.add(c.name),/^[a-z][a-z0-9-]*$/.test(c.name)||b(this,M,ee).call(this,`invalid event table: event "${c.name}" should be lowercase kebab-case (e.g. "date-select")`),c.property&&r.has(c.property)&&b(this,M,ee).call(this,`invalid event table: event "${c.name}" property "${c.property}" collides with an input configKey`)},ee=function(t,...o){console.warn(`[BlissElement] <${this.localName??"unknown"}> ${t}`,...o)},$o=function(t){for(const o of t){const i=o.configKey,r=Object.prototype.hasOwnProperty.call(this,i),n=r?this[i]:void 0;r&&delete this[i],Object.defineProperty(this,i,{configurable:!0,enumerable:!0,get:()=>h(this,fe)[i],set:a=>b(this,M,ps).call(this,o,a)}),r&&((h(this,Re)??O(this,Re,new Set)).add(i),this[i]=n)}},Vo=function(t){for(const o of t){const i=o.property;if(!i)continue;const r=o.name,n=Object.prototype.hasOwnProperty.call(this,i),a=n?this[i]:void 0;n&&delete this[i],Object.defineProperty(this,i,{configurable:!0,enumerable:!0,get:()=>h(this,Te).get(r)??null,set:l=>{const c=h(this,Te).get(r);if(c&&this.removeEventListener(r,c),typeof l=="function"){const d=l;h(this,Te).set(r,d),this.addEventListener(r,d)}else h(this,Te).delete(r)}}),n&&(this[i]=a)}},ps=function(t,o){var r;const i=Zo(t,o);if(!i){b(this,M,ee).call(this,`rejected invalid value for property "${t.configKey}"; keeping previous value`,o);return}if(b(this,M,fs).call(this,i),t.reflect&&t.attribute&&((r=t.converter)!=null&&r.toAttribute)){const n=t.converter.toAttribute(i.value);O(this,Be,!0);try{n===null?this.removeAttribute(t.attribute):this.setAttribute(t.attribute,n)}finally{O(this,Be,!1)}}},fs=function(t){h(this,fe)[t.configKey]=t.value,t.field&&(this[t.field]=t.value),t.on!=="none"&&(t.on==="reinit"&&O(this,ge,!0),(h(this,Ie)??O(this,Ie,{}))[t.configKey]=t.value,h(this,ht).schedule(h(this,Ht)))},ft=function(){h(this,ht).cancel(),b(this,M,gs).call(this)},gs=function(){if(!this.isConnected)return;const t=h(this,ge),o=h(this,Ie);O(this,ge,!1),O(this,Ie,null),t?this.reinit():o&&Object.keys(o).length>0&&this.update(o),b(this,M,Do).call(this)},Do=function(){if(h(this,Pe).length===0)return;const t=h(this,Pe);O(this,Pe,[]);for(const o of t)o()},p(Me,"inputs"),p(Me,"events");let Xt=Me;function Hs(s,e,t){typeof customElements>"u"||customElements.get(s)||customElements.define(s,e,t)}function Li(s){return{enableLogging:e=>s.enableLogging(e),disableLogging:()=>s.disableLogging(),setLogLevel:e=>s.setLogLevel(e),setCategoryLevel:(e,t)=>s.setCategoryLevel(e,t),getCategories:()=>[...s.LOGGING_CATEGORIES]}}function Ei(s,e,t){const{config:o,logging:i,shouldAutoDefine:r=!0}=t;i&&xi(s,i);const n={version:()=>o.version,config:o,...i?{logging:Li(i)}:{},register:()=>Hs(s,e),getInstances:()=>yi(s)};return typeof window<"u"&&((window.components??(window.components={}))[s]=n),r&&Hs(s,e),n}const Fs=new Map,Ks=new WeakMap;let St;function Ai(s){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in s))return!1;if(St===void 0)try{new CSSStyleSheet().replaceSync(""),St=!0}catch{St=!1}return St}function zi(s,...e){if(typeof document>"u")return;let t=Ks.get(s);t||Ks.set(s,t=new Set);const o=e.filter(r=>r&&!t.has(r));if(o.length===0)return;for(const r of o)t.add(r);if(Ai(s)){const r=o.map(n=>{let a=Fs.get(n);return a||(a=new CSSStyleSheet,a.replaceSync(n),Fs.set(n,a)),a});s.adoptedStyleSheets=[...s.adoptedStyleSheets,...r];return}const i=s.head??s;for(const r of o){const n=document.createElement("style");n.textContent=r,i.appendChild(n)}}function Ni(s,e={}){const t=e.position??"last",o=s.head??s;let i=null;const r=()=>typeof document>"u"?null:(i||(i=document.createElement("style"),e.className&&(i.className=e.className)),i.parentNode!==o&&(t==="first"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i)),i),n=()=>{i==null||i.remove()};return{set(a){if(!a){n();return}const l=r();l&&(l.textContent=a)},clear:n,destroy(){i==null||i.remove(),i=null}}}function Ws(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $i(s,e){const t=new Set,o=new RegExp(`var\\(\\s*(${Ws(e)}[a-z0-9-]+)`,"gi");let i;for(;i=o.exec(s);)i[1]&&t.add(i[1]);return t}function Vi(s,e){const t=new Set,o=new RegExp(`(${Ws(e)}[a-z0-9-]+)\\s*:`,"gi");let i;for(;i=o.exec(s);)i[1]&&t.add(i[1]);return[...t]}function Di(s,e,t={}){const o=t.minScore??3,i=t.limit??3,r=new Set(s.split("-").filter(Boolean));return[...e].map(n=>({k:n,score:n.split("-").filter(a=>r.has(a)).length})).filter(n=>n.score>=o).sort((n,a)=>a.score-n.score).slice(0,i).map(n=>n.k)}function Ri(s,e){if(e.consumed.size===0)return[];const t=[];for(const o of Vi(s,e.prefix))e.consumed.has(o)||t.push({name:o,suggestions:Di(o,e.consumed,{minScore:e.minScore})});return t}const Bi={mobile:"fullscreen",tablet:"floating",desktop:"floating"};function Hi(s,e,t={}){if(s!=="auto")return s;const o=$s(e);return t[o]??Bi[o]}function Yt(s){return{presentation:s,isFullscreen:s==="fullscreen",isModal:s==="modal"}}let et=0,Tt=null;function Fi(){if(typeof document>"u")return()=>{};et===0&&(Tt=document.body.style.overflow,document.body.style.overflow="hidden"),et++;let s=!1;return()=>{s||(s=!0,et=Math.max(0,et-1),et===0&&Tt!==null&&(document.body.style.overflow=Tt,Tt=null))}}function Ki(s){const e=typeof window<"u"?window.visualViewport:null;if(!e)return()=>{};let t=!1;const o=()=>{t=!1,s.style.height=`${e.height}px`,s.style.top=`${e.offsetTop}px`},i=()=>{t||(t=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o())};return e.addEventListener("resize",i),e.addEventListener("scroll",i),i(),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),s.style.height="",s.style.top=""}}const Jt="km-overlay-activated",Wi=Symbol("km-overlay-all-groups"),It=new Set,tt=new Map;let Pt=!1;function Qt(){return typeof document<"u"}function ji(s,e){return e===Wi||s===e}function js(s){const e=s.detail,t=e==null?void 0:e.source,o=e==null?void 0:e.group;for(const i of Array.from(It))i.id!==t&&ji(i.group,o)&&i.dismiss()}function Ui(){Pt||!Qt()||(document.addEventListener(Jt,js),Pt=!0)}function Gi(){Pt&&It.size===0&&Qt()&&(document.removeEventListener(Jt,js),Pt=!1)}function qi(s,e){Qt()&&document.dispatchEvent(new CustomEvent(Jt,{detail:{source:s,group:e}}))}function Xi(s,e){const t={id:{},group:e,dismiss:s};return It.add(t),Ui(),{activate(){tt.set(t.group,t),qi(t.id,t.group)},deactivate(){tt.get(t.group)===t&&tt.delete(t.group)},dispose(){It.delete(t),tt.get(t.group)===t&&tt.delete(t.group),Gi()}}}const q={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},Us=["trace","debug","info","warn","error"],Ot=()=>{};let Yi="km-log";function Gs(s){const t=console[s];return typeof t=="function"?t.bind(console):Ot}function Ji(s){if(s==="debug"&&(s="log"),typeof console>"u")return Ot;const e=console;return e[s]!==void 0?Gs(s):e.log!==void 0?Gs("log"):Ot}const Qi=s=>Ji(s);function st(s){let e=s;const t=q;if(typeof e=="string"&&t[e.toUpperCase()]!==void 0&&(e=t[e.toUpperCase()]),typeof e=="number"&&e>=0&&e<=q.SILENT)return e;throw new TypeError(`setLevel() called with an invalid level: ${String(s)}`)}let he;const Mt={};class qs{constructor(e,t){p(this,"name");p(this,"levels",q);p(this,"methodFactory");p(this,"trace");p(this,"debug");p(this,"info");p(this,"warn");p(this,"error");p(this,"log");p(this,"inheritedLevel");p(this,"defaultLevel",null);p(this,"userLevel",null);this.name=e,this.methodFactory=t,this.inheritedLevel=st(he?he.getLevel():"WARN");const o=this.getPersistedLevel();o!=null&&(this.userLevel=st(o)),this.replaceLoggingMethods()}storageKey(){return typeof this.name=="string"?`${Yi}:${this.name}`:void 0}persist(e){const t=this.storageKey();if(typeof window>"u"||!t)return;const o=(Us[e]??"silent").toUpperCase();try{window.localStorage[t]=o}catch{}}getPersistedLevel(){const e=this.storageKey();if(typeof window>"u"||!e)return;let t;try{t=window.localStorage[e]}catch{}if(!(t===void 0||q[t]===void 0))return t}clearPersisted(){const e=this.storageKey();if(!(typeof window>"u"||!e))try{window.localStorage.removeItem(e)}catch{}}replaceLoggingMethods(){const e=this.getLevel();Us.forEach((t,o)=>{this[t]=o<e?Ot:this.methodFactory(t,e,this.name)}),this.log=this.debug}getLevel(){return this.userLevel!=null?this.userLevel:this.defaultLevel!=null?this.defaultLevel:this.inheritedLevel}setLevel(e,t){this.userLevel=st(e),t!==!1&&this.persist(this.userLevel),this.replaceLoggingMethods()}setDefaultLevel(e){this.defaultLevel=st(e),this.getPersistedLevel()||this.setLevel(e,!1)}resetLevel(){this.userLevel=null,this.clearPersisted(),this.replaceLoggingMethods()}enableAll(e){this.setLevel(q.TRACE,e)}disableAll(e){this.setLevel(q.SILENT,e)}rebuild(){if(he&&he!==this&&(this.inheritedLevel=st(he.getLevel())),this.replaceLoggingMethods(),he===this)for(const e in Mt)Mt[e].rebuild()}}he=new qs(void 0,Qi);function Zi(s){if(typeof s!="string"||s==="")throw new TypeError("You must supply a non-empty name when creating a logger.");let e=Mt[s];return e||(e=Mt[s]=new qs(s,he.methodFactory)),e}const er=["INIT","DATA","UI"],tr="debug",Xs=["#4c8bf5","#2ea043","#d29922","#a371f7","#db61a2","#e5534b","#3fb0ac","#8a6d3b"],Ys=new WeakSet;function sr(s,e,t){if(Ys.has(s))return;Ys.add(s);const o=s.methodFactory,i=`color:${t};font-weight:bold`;s.methodFactory=(r,n,a)=>{const l=o(r,n,a);return(...c)=>l(`%c[${e}]`,i,...c)},s.setLevel(s.getLevel(),!1)}function or(s){return typeof s=="number"?s:q[s.toUpperCase()]??q.SILENT}const ir=[["trace",q.TRACE,"debug"],["debug",q.DEBUG,"debug"],["info",q.INFO,"info"],["warn",q.WARN,"warn"],["error",q.ERROR,"error"]];function rr(s,e,t){const o=`color:${s.color};font-weight:bold`,i="color:#888",r={};for(const[n,a,l]of ir)r[n]=(...c)=>{const d=t(),u=Math.min(s.logger.getLevel(),d==null?q.SILENT:or(d));if(a<u)return;(console[l]??console.log).bind(console)(`%c[${s.label}]%c ${e}`,o,i,...c)};return r}function nr(s,e=er){const t={},o={};e.forEach((r,n)=>{const a=`${s}:${r}`,l=Xs[n%Xs.length],c=Zi(a);sr(c,a,l),t[r]=c,o[r]={label:a,color:l,logger:c}});const i=r=>{for(const n of e)t[n].setLevel(r,!1)};return{loggers:t,LOGGING_CATEGORIES:e,enableLogging(r=tr){i(r)},disableLogging(){i("silent")},setLogLevel(r){i(r)},setCategoryLevel(r,n){var a;(a=t[r])==null||a.setLevel(n,!1)},forInstance(r,n){const a={};for(const l of e)a[l]=rr(o[l],r,n);return a}}}const ue=Math.min,ie=Math.max,Lt=Math.round,Et=Math.floor,re=s=>({x:s,y:s}),ar={left:"right",right:"left",bottom:"top",top:"bottom"};function Js(s,e,t){return ie(s,ue(e,t))}function ze(s,e){return typeof s=="function"?s(e):s}function xe(s){return s.split("-")[0]}function Ne(s){return s.split("-")[1]}function Qs(s){return s==="x"?"y":"x"}function Zt(s){return s==="y"?"height":"width"}function ne(s){const e=s[0];return e==="t"||e==="b"?"y":"x"}function es(s){return Qs(ne(s))}function lr(s,e,t){t===void 0&&(t=!1);const o=Ne(s),i=es(s),r=Zt(i);let n=i==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(n=At(n)),[n,At(n)]}function cr(s){const e=At(s);return[ts(s),e,ts(e)]}function ts(s){return s.includes("start")?s.replace("start","end"):s.replace("end","start")}const Zs=["left","right"],eo=["right","left"],dr=["top","bottom"],hr=["bottom","top"];function ur(s,e,t){switch(s){case"top":case"bottom":return t?e?eo:Zs:e?Zs:eo;case"left":case"right":return e?dr:hr;default:return[]}}function mr(s,e,t,o){const i=Ne(s);let r=ur(xe(s),t==="start",o);return i&&(r=r.map(n=>n+"-"+i),e&&(r=r.concat(r.map(ts)))),r}function At(s){const e=xe(s);return ar[e]+s.slice(e.length)}function pr(s){var e,t,o,i;return{top:(e=s.top)!=null?e:0,right:(t=s.right)!=null?t:0,bottom:(o=s.bottom)!=null?o:0,left:(i=s.left)!=null?i:0}}function to(s){return typeof s!="number"?pr(s):{top:s,right:s,bottom:s,left:s}}function zt(s){const{x:e,y:t,width:o,height:i}=s;return{width:o,height:i,top:t,left:e,right:e+o,bottom:t+i,x:e,y:t}}function so(s,e,t){let{reference:o,floating:i}=s;const r=ne(e),n=es(e),a=Zt(n),l=xe(e),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,f=o[a]/2-i[a]/2;let m;switch(l){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-i.width,y:u};break;default:m={x:o.x,y:o.y}}const g=Ne(e);return g&&(m[n]+=f*(g==="end"?1:-1)*(t&&c?-1:1)),m}async function fr(s,e){var t;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:n,elements:a,strategy:l}=s,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=ze(e,s),g=to(m),x=a[f?u==="floating"?"reference":"floating":u],v=zt(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(x)))==null||t?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),_=u==="floating"?{x:o,y:i,width:n.floating.width,height:n.floating.height}:n.reference,T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),N=await(r.isElement==null?void 0:r.isElement(T))&&await(r.getScale==null?void 0:r.getScale(T))||{x:1,y:1},V=zt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:T,strategy:l}):_);return{top:(v.top-V.top+g.top)/N.y,bottom:(V.bottom-v.bottom+g.bottom)/N.y,left:(v.left-V.left+g.left)/N.x,right:(V.right-v.right+g.right)/N.x}}const gr=50,br=async(s,e,t)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:n}=t,a=n.detectOverflow?n:{...n,detectOverflow:fr},l=await(n.isRTL==null?void 0:n.isRTL(e));let c=await n.getElementRects({reference:s,floating:e,strategy:i}),{x:d,y:u}=so(c,o,l),f=o,m=0;const g={};for(let y=0;y<r.length;y++){const x=r[y];if(!x)continue;const{name:v,fn:_}=x,{x:T,y:N,data:V,reset:F}=await _({x:d,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:s,floating:e}});d=T??d,u=N??u,g[v]={...g[v],...V},F&&m<gr&&(m++,typeof F=="object"&&(F.placement&&(f=F.placement),F.rects&&(c=F.rects===!0?await n.getElementRects({reference:s,floating:e,strategy:i}):F.rects),{x:d,y:u}=so(c,f,l)),y=-1)}return{x:d,y:u,placement:f,strategy:i,middlewareData:g}},vr=s=>({name:"arrow",options:s,async fn(e){const{x:t,y:o,placement:i,rects:r,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=ze(s,e)||{};if(c==null)return{};const u=to(d),f={x:t,y:o},m=es(i),g=Zt(m),y=await n.getDimensions(c),x=m==="y",v=x?"top":"left",_=x?"bottom":"right",T=x?"clientHeight":"clientWidth",N=r.reference[g]+r.reference[m]-f[m]-r.floating[g],V=f[m]-r.reference[m],F=await(n.getOffsetParent==null?void 0:n.getOffsetParent(c));let G=F?F[T]:0;(!G||!await(n.isElement==null?void 0:n.isElement(F)))&&(G=a.floating[T]||r.floating[g]);const Y=N/2-V/2,B=G/2-y[g]/2-1,I=ue(u[v],B),E=ue(u[_],B),z=G-y[g]-E,K=G/2-y[g]/2+Y,P=Js(I,K,z),j=!l.arrow&&Ne(i)!=null&&K!==P&&r.reference[g]/2-(K<I?I:E)-y[g]/2<0,de=j?K<I?K-I:K-z:0;return{[m]:f[m]+de,data:{[m]:P,centerOffset:K-P-de,...j&&{alignmentOffset:de}},reset:j}}}),wr=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(e){var t,o;const{placement:i,middlewareData:r,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...x}=ze(s,e);if((t=r.arrow)!=null&&t.alignmentOffset)return{};const v=xe(i),_=ne(a),T=xe(a)===a,N=await(l.isRTL==null?void 0:l.isRTL(c.floating)),V=f||(T||!y?[At(a)]:cr(a)),F=g!=="none";!f&&F&&V.push(...mr(a,y,g,N));const G=[a,...V],Y=await l.detectOverflow(e,x),B=[];let I=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&B.push(Y[v]),u){const P=lr(i,n,N);B.push(Y[P[0]],Y[P[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(P=>P<=0)){var E,z;const P=(((E=r.flip)==null?void 0:E.index)||0)+1,j=G[P];if(j&&(!(u==="alignment"?_!==ne(j):!1)||I.every(Z=>ne(Z.placement)===_?Z.overflows[0]>0:!0)))return{data:{index:P,overflows:I},reset:{placement:j}};let de=(z=I.filter(Ee=>Ee.overflows[0]<=0).sort((Ee,Z)=>Ee.overflows[1]-Z.overflows[1])[0])==null?void 0:z.placement;if(!de)switch(m){case"bestFit":{var K;const Ee=(K=I.filter(Z=>{if(F){const we=ne(Z.placement);return we===_||we==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(we=>we>0).reduce((we,Tn)=>we+Tn,0)]).sort((Z,we)=>Z[1]-we[1])[0])==null?void 0:K[0];Ee&&(de=Ee);break}case"initialPlacement":de=a;break}if(i!==de)return{reset:{placement:de}}}return{}}}},yr=new Set(["left","top"]);async function xr(s,e){const{placement:t,platform:o,elements:i}=s,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),n=xe(t),a=Ne(t),l=ne(t)==="y",c=yr.has(n)?-1:1,d=r&&l?-1:1,u=ze(e,s);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const _r=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(e){var t,o;const{x:i,y:r,placement:n,middlewareData:a}=e,l=await xr(e,s);return n===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:n}}}}},kr=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(e){const{x:t,y:o,placement:i,platform:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:_=>{let{x:T,y:N}=_;return{x:T,y:N}}},...c}=ze(s,e),d={x:t,y:o},u=await r.detectOverflow(e,c),f=ne(i),m=Qs(f);let g=d[m],y=d[f];const x=(_,T)=>Js(T+u[_==="y"?"top":"left"],T,T-u[_==="y"?"bottom":"right"]);n&&(g=x(m,g)),a&&(y=x(f,y));const v=l.fn({...e,[m]:g,[f]:y});return{...v,data:{x:v.x-t,y:v.y-o,enabled:{[m]:n,[f]:a}}}}}},Cr=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(e){const{placement:t,rects:o,platform:i,elements:r}=e,{apply:n=()=>{},...a}=ze(s,e),l=await i.detectOverflow(e,a),c=xe(t),d=Ne(t),u=ne(t)==="y",{width:f,height:m}=o.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=d===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(y=c,g=d==="end"?"top":"bottom");const x=m-l.top-l.bottom,v=f-l.left-l.right,_=ue(m-l[g],x),T=ue(f-l[y],v),N=e.middlewareData.shift,V=!N;let F=_,G=T;N!=null&&N.enabled.x&&(G=v),N!=null&&N.enabled.y&&(F=x),V&&!d&&(u?G=f-2*ie(l.left,l.right):F=m-2*ie(l.top,l.bottom)),await n({...e,availableWidth:G,availableHeight:F});const Y=await i.getDimensions(r.floating);return f!==Y.width||m!==Y.height?{reset:{rects:!0}}:{}}}};function Nt(){return typeof window<"u"}function $e(s){return oo(s)?(s.nodeName||"").toLowerCase():"#document"}function X(s){var e;return(s==null||(e=s.ownerDocument)==null?void 0:e.defaultView)||window}function ae(s){var e;return(e=(oo(s)?s.ownerDocument:s.document)||window.document)==null?void 0:e.documentElement}function oo(s){return Nt()?s instanceof Node||s instanceof X(s).Node:!1}function te(s){return Nt()?s instanceof Element||s instanceof X(s).Element:!1}function me(s){return Nt()?s instanceof HTMLElement||s instanceof X(s).HTMLElement:!1}function io(s){return!Nt()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof X(s).ShadowRoot}function $t(s){const{overflow:e,overflowX:t,overflowY:o,display:i}=se(s);return/auto|scroll|overlay|hidden|clip/.test(e+o+t)&&i!=="inline"&&i!=="contents"}function Sr(s){return/^(table|td|th)$/.test($e(s))}function Vt(s){try{if(s.matches(":popover-open"))return!0}catch{}try{return s.matches(":modal")}catch{return!1}}const Tr=/transform|translate|scale|rotate|perspective|filter/,Ir=/paint|layout|strict|content/,_e=s=>!!s&&s!=="none";let ss;function os(s){const e=te(s)?se(s):s;return _e(e.transform)||_e(e.translate)||_e(e.scale)||_e(e.rotate)||_e(e.perspective)||!is()&&(_e(e.backdropFilter)||_e(e.filter))||Tr.test(e.willChange||"")||Ir.test(e.contain||"")}function Pr(s){let e=ke(s);for(;me(e)&&!ot(e);){if(os(e))return e;if(Vt(e))return null;e=ke(e)}return null}function is(){return ss==null&&(ss=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ss}function ot(s){return/^(html|body|#document)$/.test($e(s))}function se(s){return X(s).getComputedStyle(s)}function Dt(s){return te(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function ke(s){if($e(s)==="html")return s;const e=s.assignedSlot||s.parentNode||io(s)&&s.host||ae(s);return io(e)?e.host:e}function ro(s){const e=ke(s);return ot(e)?(s.ownerDocument||s).body:me(e)&&$t(e)?e:ro(e)}function it(s,e,t){var o;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=ro(s),r=i===((o=s.ownerDocument)==null?void 0:o.body),n=X(i);if(r){const a=rs(n);return e.concat(n,n.visualViewport||[],$t(i)?i:[],a&&t?it(a):[])}else return e.concat(i,it(i,[],t))}function rs(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function no(s){const e=se(s);let t=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=me(s),r=i?s.offsetWidth:t,n=i?s.offsetHeight:o,a=Lt(t)!==r||Lt(o)!==n;return a&&(t=r,o=n),{width:t,height:o,$:a}}function ns(s){return te(s)?s:s.contextElement}function Ve(s){const e=ns(s);if(!me(e))return re(1);const t=e.getBoundingClientRect(),{width:o,height:i,$:r}=no(e);let n=(r?Lt(t.width):t.width)/o,a=(r?Lt(t.height):t.height)/i;return(!n||!Number.isFinite(n))&&(n=1),(!a||!Number.isFinite(a))&&(a=1),{x:n,y:a}}const Or=re(0);function ao(s){const e=X(s);return!is()||!e.visualViewport?Or:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Mr(s,e,t){return e===void 0&&(e=!1),!!t&&e&&t===X(s)}function Ce(s,e,t,o){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=s.getBoundingClientRect(),r=ns(s);let n=re(1);e&&(o?te(o)&&(n=Ve(o)):n=Ve(s));const a=Mr(r,t,o)?ao(r):re(0);let l=(i.left+a.x)/n.x,c=(i.top+a.y)/n.y,d=i.width/n.x,u=i.height/n.y;if(r&&o){const f=X(r),m=te(o)?X(o):o;let g=f,y=rs(g);for(;y&&m!==g;){const x=Ve(y),v=y.getBoundingClientRect(),_=se(y),T=v.left+(y.clientLeft+parseFloat(_.paddingLeft))*x.x,N=v.top+(y.clientTop+parseFloat(_.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=T,c+=N,g=X(y),y=rs(g)}}return zt({width:d,height:u,x:l,y:c})}function Rt(s,e){const t=Dt(s).scrollLeft;return e?e.left+t:Ce(ae(s)).left+t}function lo(s,e){const t=s.getBoundingClientRect(),o=t.left+e.scrollLeft-Rt(s,t),i=t.top+e.scrollTop;return{x:o,y:i}}function Lr(s){let{elements:e,rect:t,offsetParent:o,strategy:i}=s;const r=i==="fixed",n=ae(o),a=e?Vt(e.floating):!1;if(o===n||a&&r)return t;let l={scrollLeft:0,scrollTop:0},c=re(1);const d=re(0),u=me(o);if((u||!r)&&(($e(o)!=="body"||$t(n))&&(l=Dt(o)),u)){const m=Ce(o);c=Ve(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const f=n&&!u&&!r?lo(n,l):re(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:t.y*c.y-l.scrollTop*c.y+d.y+f.y}}function Er(s){return s.getClientRects?Array.from(s.getClientRects()):[]}function Ar(s){const e=Dt(s),t=s.ownerDocument.body,o=ie(s.scrollWidth,s.clientWidth,t.scrollWidth,t.clientWidth),i=ie(s.scrollHeight,s.clientHeight,t.scrollHeight,t.clientHeight);let r=-e.scrollLeft+Rt(s);const n=-e.scrollTop;return se(t).direction==="rtl"&&(r+=ie(s.clientWidth,t.clientWidth)-o),{width:o,height:i,x:r,y:n}}const zr=25;function Nr(s,e,t){t===void 0&&(t="viewport");const o=t==="layoutViewport",i=X(s),r=ae(s),n=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,d=0;if(n){const f=!is()||e==="fixed";o?f||(c=-n.offsetLeft,d=-n.offsetTop):(a=n.width,l=n.height,f&&(c=n.offsetLeft,d=n.offsetTop))}if(Rt(r)<=0){const f=r.ownerDocument,m=f.body,g=getComputedStyle(m),y=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-y),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?x/2:x;v<=zr&&(a-=v)}return{width:a,height:l,x:c,y:d}}function $r(s,e){const t=Ce(s,!0,e==="fixed"),o=t.top+s.clientTop,i=t.left+s.clientLeft,r=Ve(s),n=s.clientWidth*r.x,a=s.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:n,height:a,x:l,y:c}}function co(s,e,t){let o;if(e==="viewport"||e==="layoutViewport")o=Nr(s,t,e);else if(e==="document")o=Ar(ae(s));else if(te(e))o=$r(e,t);else{const i=ao(s);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return zt(o)}function Vr(s,e){const t=e.get(s);if(t)return t;let o=it(s,[],!1).filter(a=>te(a)&&$e(a)!=="body"),i=null;const r=se(s).position==="fixed";let n=r?ke(s):s;for(;te(n)&&!ot(n);){const a=se(n),l=os(n),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?o=o.filter(u=>u!==n):i=a,n=ke(n)}return e.set(s,o),o}function Dr(s){let{element:e,boundary:t,rootBoundary:o,strategy:i}=s;const n=[...t==="clippingAncestors"?Vt(e)?[]:Vr(e,this._c):[].concat(t),o],a=co(e,n[0],i);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let f=1;f<n.length;f++){const m=co(e,n[f],i);l=ie(m.top,l),c=ue(m.right,c),d=ue(m.bottom,d),u=ie(m.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function Rr(s){const{width:e,height:t}=no(s);return{width:e,height:t}}function Br(s,e,t){const o=me(e),i=ae(e),r=t==="fixed",n=Ce(s,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((o||!r)&&(($e(e)!=="body"||$t(i))&&(a=Dt(e)),o)){const f=Ce(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!o&&i&&(l.x=Rt(i));const c=i&&!o&&!r?lo(i,a):re(0),d=n.left+a.scrollLeft-l.x-c.x,u=n.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:n.width,height:n.height}}function as(s){return se(s).position==="static"}function ho(s,e){if(!me(s)||se(s).position==="fixed")return null;if(e)return e(s);let t=s.offsetParent;return ae(s)===t&&(t=t.ownerDocument.body),t}function uo(s,e){const t=X(s);if(Vt(s))return t;if(!me(s)){let i=ke(s);for(;i&&!ot(i);){if(te(i)&&!as(i))return i;i=ke(i)}return t}let o=ho(s,e);for(;o&&Sr(o)&&as(o);)o=ho(o,e);return o&&ot(o)&&as(o)&&!os(o)?t:o||Pr(s)||t}const Hr=async function(s){const e=this.getOffsetParent||uo,t=this.getDimensions,o=await t(s.floating);return{reference:Br(s.reference,await e(s.floating),s.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Fr(s){return se(s).direction==="rtl"}const mo={convertOffsetParentRelativeRectToViewportRelativeRect:Lr,getDocumentElement:ae,getClippingRect:Dr,getOffsetParent:uo,getElementRects:Hr,getClientRects:Er,getDimensions:Rr,getScale:Ve,isElement:te,isRTL:Fr};function po(s,e){return s.x===e.x&&s.y===e.y&&s.width===e.width&&s.height===e.height}function Kr(s,e,t){let o=null,i;const r=ae(s);function n(){var d;clearTimeout(i),(d=o)==null||d.disconnect(),o=null}function a(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),n();const f=s.getBoundingClientRect(),{left:m,top:g,width:y,height:x}=f;if(d||e(),!y||!x)return;const v=Et(g),_=Et(r.clientWidth-(m+y)),T=Et(r.clientHeight-(g+x)),N=Et(m),F={rootMargin:-v+"px "+-_+"px "+-T+"px "+-N+"px",threshold:ie(0,ue(1,u))||1};let G=!0;function Y(B){const I=B[0].intersectionRatio;if(!po(f,s.getBoundingClientRect()))return a();if(I!==u){if(!G)return a();I?a(!1,I):i=setTimeout(()=>{a(!1,1e-7)},1e3)}G=!1}try{o=new IntersectionObserver(Y,{...F,root:r.ownerDocument})}catch{o=new IntersectionObserver(Y,F)}o.observe(s)}const l=X(s),c=()=>a(t);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),n()}}function Wr(s,e,t,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:n=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=ns(s),d=i||r?[...c?it(c):[],...e?it(e):[]]:[];d.forEach(v=>{i&&v.addEventListener("scroll",t),r&&v.addEventListener("resize",t)});const u=c&&a?Kr(c,t,r):null;let f=-1,m=null;n&&(m=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&m&&e&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var T;(T=m)==null||T.observe(e)})),t()}),c&&!l&&m.observe(c),e&&m.observe(e));let g,y=l?Ce(s):null;l&&x();function x(){const v=Ce(s);y&&!po(y,v)&&t(),y=v,g=requestAnimationFrame(x)}return t(),()=>{var v;d.forEach(_=>{i&&_.removeEventListener("scroll",t),r&&_.removeEventListener("resize",t)}),u==null||u(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const jr=_r,Ur=kr,Gr=wr,ls=Cr,qr=vr,Xr=(s,e,t)=>{const o=new Map,i=t??{},r={...mo,...i.platform,_c:o};return br(s,e,{...i,platform:r})};function cs(s){const e=s.parentNode??null;return e instanceof ShadowRoot?e.host:e}function Yr(s){if(s.transform!=="none"||s.perspective!=="none"||s.filter!=="none")return!0;const e=s.backdropFilter;return!!(e&&e!=="none"||s.willChange&&/\b(transform|filter|perspective)\b/.test(s.willChange))}function ds(s){let e=cs(s);for(;e&&!(e===document.body||e===document.documentElement);){if(e instanceof Element&&Yr(getComputedStyle(e)))return e;e=cs(e)}return window}function Jr(s,e,t){let o=s;for(;o&&!(o===document.body||o===document.documentElement);){if(o instanceof Element){const i=o.getBoundingClientRect();if(Math.abs(i.x-e)<2&&Math.abs(i.y-t)<2)return o}o=cs(o)}return null}function fo(s){const e=getComputedStyle(s),t=[];e.transform!=="none"&&t.push(`transform: ${e.transform}`),e.perspective!=="none"&&t.push(`perspective: ${e.perspective}`),e.filter!=="none"&&t.push(`filter: ${e.filter}`);const o=e.backdropFilter;o&&o!=="none"&&t.push(`backdrop-filter: ${o}`),e.willChange&&/\b(transform|filter|perspective)\b/.test(e.willChange)&&t.push(`will-change: ${e.willChange}`),e.contain&&/\b(paint|layout|strict|content)\b/.test(e.contain)&&t.push(`contain: ${e.contain}`);const i=e.containerType;return i&&i!=="normal"&&t.push(`container-type: ${i}`),t.join("; ")}function Qr(s){const e=s.id?`#${s.id}`:"",t=typeof s.className=="string"&&s.className?"."+s.className.split(/\s+/).filter(Boolean).slice(0,2).join("."):"";return`<${s.tagName.toLowerCase()}${e}${t}>`}function Zr(s){const e=s.tolerance??1.5;let t=0,o=0;if(s.offsetParent instanceof Element){const l=s.offsetParent.getBoundingClientRect(),c=getComputedStyle(s.offsetParent);t=l.x+(parseFloat(c.borderLeftWidth)||0),o=l.y+(parseFloat(c.borderTopWidth)||0)}const i=s.panel.getBoundingClientRect(),r=i.x-(t+s.expectedX),n=i.y-(o+s.expectedY);if(Math.abs(r)<e&&Math.abs(n)<e)return null;const a=Jr(s.reference,r,n);return{driftX:r,driftY:n,culprit:a,culpritDescription:a?Qr(a):"an ancestor element (could not auto-identify)",culpritCss:a?fo(a):""}}function en(s,e){var i;const t=(i=s.closest)==null?void 0:i.call(s,"[data-theme]"),o=t==null?void 0:t.getAttribute("data-theme");o!=null&&e.setAttribute("data-theme",o)}const tn={top:"bottom",right:"left",bottom:"top",left:"right"};function sn(s,e,t){if(!t)return;const o=e.split("-")[0],i=tn[o];s.style.left=t.x!=null?`${t.x}px`:"",s.style.top=t.y!=null?`${t.y}px`:"",s.style.right="",s.style.bottom="",s.style[i]=`-${s.offsetWidth/2}px`}function go(s,e){const t=[jr(s.offset??4)];if(s.matchWidth){const i=s.matchWidth;t.push(ls({apply({rects:r,elements:n}){const a=`${r.reference.width}px`;i==="exact"?n.floating.style.width=a:n.floating.style.minWidth=a}}))}e&&t.push(Gr({...s.lockPlacement===!0?{fallbackStrategy:"initialPlacement"}:{},...s.flipPadding!=null?{padding:s.flipPadding}:{}}));const o=s.shift??8;if(o!==!1&&t.push(Ur({padding:o})),s.maxHeight){const i=typeof s.maxHeight=="object"?s.maxHeight.padding:void 0;t.push(ls({padding:i,apply({availableHeight:r,elements:n}){n.floating.style.maxHeight=`${Math.max(0,r)}px`}}))}if(s.maxWidth){const i=typeof s.maxWidth=="object"?s.maxWidth.padding:void 0;t.push(ls({padding:i,apply({availableWidth:r,elements:n}){n.floating.style.maxWidth=`${Math.max(0,r)}px`}}))}return s.arrow&&t.push(qr({element:s.arrow.element,padding:s.arrow.padding})),t}function rt(s,e,t={}){const o=t.strategy??"fixed";t.inheritThemeFrom&&en(t.inheritThemeFrom,s),s.style.position=o,s.style.left="0",s.style.top="0";let i=t.placement??"bottom-start",r=t.flip??!0,n=go(t,r);const a=t.lockPlacement==="freeze";let l=!1;const c=!!t.fixedContainingBlock&&!t.platform,d=t.platform??(c?{...mo,getOffsetParent:()=>ds(s)}:void 0),u=()=>{var m;(m=t.beforeCompute)==null||m.call(t),Xr(e,s,{placement:i,strategy:o,middleware:n,...d?{platform:d}:{}}).then(({x:g,y,placement:x,middlewareData:v})=>{var _,T;if(s.style.left=`${g}px`,s.style.top=`${y}px`,t.arrow&&sn(t.arrow.element,x,v.arrow),a&&!l&&(l=!0,i=x,r=!1,n=go(t,!1)),(_=t.onPlaced)==null||_.call(t,x),(T=t.onComputed)==null||T.call(t,{x:g,y,placement:x}),t.onDrift&&e instanceof Element){const N=c?ds(s):window,V=Zr({panel:s,reference:e,expectedX:g,expectedY:y,offsetParent:N});V&&t.onDrift(V)}})};let f;return t.autoUpdate??!0?f=Wr(e,s,u,t.autoUpdateOptions):u(),{update:u,destroy(){f==null||f(),f=void 0}}}function on(s){return typeof s=="number"?{show:s,hide:s}:{show:(s==null?void 0:s.show)??0,hide:(s==null?void 0:s.hide)??0}}function rn(s){const e=s.container??document.body,t=s.placement??"top",o=s.visibleClass??"is-visible",i=on(s.delay),r=document.createElement("div");r.setAttribute("role","tooltip"),s.cssClass&&(r.className=s.cssClass),typeof s.content=="string"?r.textContent=s.content:r.append(s.content);let n,a=!1,l,c,d;const u={getBoundingClientRect:()=>d??s.trigger.getBoundingClientRect(),contextElement:s.trigger},f=_=>{d=new DOMRect(_.clientX,_.clientY,0,0),n==null||n.update()},m=()=>{l&&clearTimeout(l),c&&clearTimeout(c),l=c=void 0},g=()=>{var T;if(m(),a)return;(T=s.onBeforeShow)==null||T.call(s),a=!0,e.append(r);const _=s.followCursor?u:s.trigger;n=rt(r,_,{placement:t,strategy:s.strategy,offset:s.offset??8,inheritThemeFrom:s.inheritThemeFrom??s.trigger}),s.followCursor&&s.trigger.addEventListener("mousemove",f),r.classList.add(o)},y=()=>{m(),a&&(a=!1,r.classList.remove(o),s.followCursor&&s.trigger.removeEventListener("mousemove",f),n==null||n.destroy(),n=void 0,r.remove())},x=()=>{m(),i.show>0?l=setTimeout(g,i.show):g()},v=()=>{m(),i.hide>0?c=setTimeout(y,i.hide):y()};return s.trigger.addEventListener("mouseenter",x),s.trigger.addEventListener("mouseleave",v),s.trigger.addEventListener("focusin",x),s.trigger.addEventListener("focusout",v),{element:r,get isVisible(){return a},show:g,hide:y,destroy(){s.trigger.removeEventListener("mouseenter",x),s.trigger.removeEventListener("mouseleave",v),s.trigger.removeEventListener("focusin",x),s.trigger.removeEventListener("focusout",v),y()}}}function nn(s){const e=s.container??document.body;let t,o=!1;const i=s.inheritThemeFrom??(s.reference instanceof HTMLElement?s.reference:void 0);return{get isOpen(){return o},open(){o||(o=!0,e.append(s.panel),t=rt(s.panel,s.reference,{placement:s.placement??"bottom-start",strategy:s.strategy,offset:s.offset,matchWidth:s.matchWidth,lockPlacement:s.lockPlacement,...s.flip!==void 0?{flip:s.flip}:{},...s.shift!==void 0?{shift:s.shift}:{},...s.autoUpdate!==void 0?{autoUpdate:s.autoUpdate}:{},...s.beforeCompute?{beforeCompute:s.beforeCompute}:{},...s.platform?{platform:s.platform}:{},...i?{inheritThemeFrom:i}:{},...s.onPlaced?{onPlaced:s.onPlaced}:{}}))},close(){o&&(o=!1,t==null||t.destroy(),t=void 0,s.panel.remove())},update(){t==null||t.update()},destroy(){this.close()}}}const bo=["INIT","DATA","UI","INTERACTION"],le=nr("MULTISELECT",bo),nt=le.loggers.INIT,U=le.loggers.DATA,J=le.loggers.UI,H=le.loggers.INTERACTION,an=bo.map(s=>`MULTISELECT:${s}`);function ln(){le.enableLogging()}function cn(){le.disableLogging()}function dn(s){le.setLogLevel(s)}function hn(s,e){const t=s.includes(":")?s.split(":").pop():s;le.setCategoryLevel(t,e)}class vo{constructor(e){p(this,"container");p(this,"wrapper");p(this,"viewport");p(this,"itemHeight");p(this,"items");p(this,"renderItem");p(this,"bufferSize");p(this,"onVisibleRangeChange");p(this,"onScroll");p(this,"scrollTop",0);p(this,"viewportHeight",0);p(this,"visibleStart",0);p(this,"visibleEnd",0);p(this,"scrollHandler");p(this,"resizeObserver");this.container=e.container,this.itemHeight=e.itemHeight,this.items=e.items,this.renderItem=e.renderItem,this.bufferSize=e.bufferSize??10,this.onVisibleRangeChange=e.onVisibleRangeChange,this.onScroll=e.onScroll,this.scrollHandler=this.handleScroll.bind(this),this.init()}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.style.position="relative",this.wrapper.style.width="100%",this.wrapper.style.height=`${this.items.length*this.itemHeight}px`,this.wrapper.className="ms__virtual-scroll-wrapper",this.viewport=document.createElement("div"),this.viewport.style.position="absolute",this.viewport.style.top="0",this.viewport.style.left="0",this.viewport.style.right="0",this.viewport.style.width="100%",this.viewport.className="ms__virtual-scroll-viewport",this.wrapper.appendChild(this.viewport),this.container.appendChild(this.wrapper),this.container.addEventListener("scroll",this.scrollHandler),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>{this.updateViewportHeight(),this.render()}),this.resizeObserver.observe(this.container)),this.updateViewportHeight(),this.render()}updateViewportHeight(){const e=this.container.clientHeight;e>0&&(this.viewportHeight=e)}handleScroll(){this.scrollTop=this.container.scrollTop,this.onScroll&&this.onScroll(this.scrollTop),this.render()}calculateVisibleRange(){const e=Math.floor(this.scrollTop/this.itemHeight),t=Math.ceil((this.scrollTop+this.viewportHeight)/this.itemHeight),o=Math.max(0,e-this.bufferSize),i=Math.min(this.items.length,t+this.bufferSize);return{start:o,end:i}}render(){const{start:e,end:t}=this.calculateVisibleRange();if(e===this.visibleStart&&t===this.visibleEnd)return;this.visibleStart=e,this.visibleEnd=t;let o="";for(let i=e;i<t;i++){const r=this.items[i],n=this.renderItem(r,i),a=i*this.itemHeight;o+=`<div class="ms__virtual-item" style="position: absolute; top: ${a}px; left: 0; right: 0; height: ${this.itemHeight}px;" data-index="${i}">`,o+=n,o+="</div>"}this.viewport.innerHTML=o,this.onVisibleRangeChange&&this.onVisibleRangeChange(e,t)}setItems(e){const t=e!==this.items||e.length!==this.items.length;this.items=e,this.wrapper.style.height=`${e.length*this.itemHeight}px`,this.updateViewportHeight(),t&&(this.scrollTop=0,this.container.scrollTop=0),this.visibleStart=-1,this.visibleEnd=-1,this.render()}scrollToIndex(e,t="start"){if(e<0||e>=this.items.length)return;this.updateViewportHeight();const o=e*this.itemHeight,i=o+this.itemHeight,r=Math.max(0,this.items.length*this.itemHeight-this.viewportHeight);let n;if(t==="center")n=o-(this.viewportHeight-this.itemHeight)/2;else if(t==="nearest"){const a=this.container.scrollTop,l=a+this.viewportHeight;if(o>=a&&i<=l)return;n=o<a?o:i-this.viewportHeight}else n=o;n=Math.max(0,Math.min(n,r)),this.container.scrollTop=n,this.scrollTop=n,this.render()}getVisibleRange(){return{start:this.visibleStart,end:this.visibleEnd}}getItemCount(){return this.items.length}setItemHeight(e){this.itemHeight=e,this.wrapper.style.height=`${this.items.length*e}px`,this.visibleStart=-1,this.visibleEnd=-1,this.render()}setBufferSize(e){this.bufferSize=e,this.visibleStart=-1,this.visibleEnd=-1,this.render()}refresh(){this.visibleStart=-1,this.visibleEnd=-1,this.render()}destroy(){this.container.removeEventListener("scroll",this.scrollHandler),this.resizeObserver&&this.resizeObserver.disconnect(),this.container.innerHTML=""}}function wo(s){return{treeId:"",id:-1,path:"",pathSegment:"",parentPath:void 0,level:void 0,children:{},hasChildren:!1,isSelectable:!0,data:void 0,...s}}const at=s=>!s||typeof s=="string"&&s.trim()==="";function un(s,e="."){if(!s||typeof s!="string")return null;const t=s.lastIndexOf(e);return t===-1?"":s.substring(0,t)}function yo(s,e,t="."){return at(e)?s:s.startsWith(e+t)?s.substring(e.length+t.length):s}function xo(s,e=0,t=1,o="."){return s.split(o).slice(e,e+t).join(o)}function mn(s,e){return s.split(e).length}function pe(s,e){return s[e]}function pn(s={}){const e=s.idMember,t=s.pathMember,o=s.getPathCallback,i=s.parentPathMember,r=s.levelMember,n=s.hasChildrenMember,a=s.isSelectableMember,l=s.getIsSelectableCallback,c=s.treeId||"multiselect-tree",d=s.orderMember,u=s.getDisplayValueCallback,f=at(i),m=at(r),g=at(n),y=at(a),x="x",v=s.treePathSeparator||".",_=wo();let T=0,N=null;const V=B=>o?o(B):t?pe(B,t):void 0,F={treePathSeparator:v,root:_,get tree(){return Object.values(_.children)},get flatNodes(){if(N)return N;const B=[],I=s.isSorted??!1,E=s.sortCallback;function z(K){let P=Object.values(K.children);I&&E&&P.length>0&&(P=E(P));for(const j of P)B.push(j),j.hasChildren&&z(j)}return z(_),N=B,B},insertArray(B){B=B||[],_.children={},T=0,N=null;const I=[];let E=B.map((z,K)=>{const P=wo();P.treeId=c,P.id=e?pe(z,e):void 0;const j=V(z);return j==null||j===""||typeof j!="string"?(I.push(`index ${K}`),null):(P.path=j,(P.id===void 0||P.id===-1)&&(P.id=j),f?P.parentPath=un(P.path,v):P.parentPath=pe(z,i),P.pathSegment=xo(yo(P.path,P.parentPath??"",v),0,1,v),m?P.level=mn(P.path,v):P.level=pe(z,r),g||(P.hasChildren=pe(z,n)),P.data=z,P)}).filter(z=>z!==null);s.isSorted||(s.sortCallback?E=s.sortCallback(E):E=Y(E));for(const z of E)G(z.parentPath??"",z);if(l||!y)for(const z of E)if(l)z.isSelectable=l(z)!==!1;else{const K=pe(z.data,a);z.isSelectable=K==null?!0:!!K}I.length>0&&console.warn(`[ltree ${c}] ${I.length} option(s) had an invalid path and were skipped (pathMember="${t}"). Offending: ${I.slice(0,5).join(", ")}`+(I.length>5?", …":""))},getNodeByPath(B,I){let E=I||_;if(B){const z=B.split(v);for(let K=0;K<z.length;K++){const P=x+z[K];if(!E.children.hasOwnProperty(P))return null;E=E.children[P]}}return E}};function G(B,I){const E=F.getNodeByPath(B);if(!E)return`Node: ${I.path} - Could not find parent node: ${B}`;m&&(I.level=(E.level||0)+1);const z=x+xo(yo(I.path,B,v),0,1,v);return E.children.hasOwnProperty(z)||(E.children[z]=I,g&&!E.hasChildren&&(E.hasChildren=!0),T=Math.max(T,I.level||0)),null}function Y(B){return B.sort((I,E)=>{const z=I.level||0,K=E.level||0;if(z!==K)return z-K;if(I.parentPath!==E.parentPath)return I.parentPath?E.parentPath?I.parentPath.localeCompare(E.parentPath):1:-1;if(d&&I.data&&E.data){const P=pe(I.data,d)??0,j=pe(E.data,d)??0;if(P!==j)return P-j}return u?u(I).localeCompare(u(E)):I.path.localeCompare(E.path)})}return F}function _o(s,e){const t=new Map,o=new Map,i=new Set,r=l=>String(e(l.data)),n=l=>{t.set(r(l),l);const c=[];for(const u of Object.values(l.children))c.push(...n(u));let d;return c.length>0?d=c:l.isSelectable!==!1?(d=[r(l)],i.add(l.path)):d=[],o.set(l.path,d),d},a=s.tree;for(const l of a)n(l);return{nodeByValue:t,atomsUnder:o,atomPaths:i,roots:a}}function hs(s,e,t){const o=s.atomsUnder.get(e.path);if(!o||o.length===0)return"unchecked";let i=0;for(const r of o)t.has(r)&&i++;return i===0?"unchecked":i===o.length?"checked":"indeterminate"}function lt(s,e){const t=new Set;for(const o of e){const i=s.nodeByValue.get(String(o));if(i)for(const r of s.atomsUnder.get(i.path)??[])t.add(r)}return t}function fn(s,e,t){const o=s.atomsUnder.get(e.path)??[],i=new Set(t),r=hs(s,e,t),n=[],a=[];if(r==="checked")for(const l of o)i.delete(l)&&a.push(l);else for(const l of o)i.has(l)||(i.add(l),n.push(l));return{checkedAtoms:i,addedAtoms:n,removedAtoms:a}}function us(s,e,t,o){const i=a=>String(o(a.data)),r=[],n=a=>{const l=hs(s,a,e);if(l==="unchecked")return;const c=a.isSelectable!==!1,d=Object.values(a.children);if(t==="leaves"){s.atomPaths.has(a.path)&&l==="checked"&&r.push(i(a));for(const u of d)n(u);return}if(t==="all"){l==="checked"&&c&&r.push(i(a));for(const u of d)n(u);return}if(l==="checked"&&c){r.push(i(a));return}for(const u of d)n(u)};for(const a of s.roots)n(a);return r}class ko{constructor(e,t={}){p(this,"element");p(this,"instanceId");p(this,"options");A(this,R,!1);p(this,"selectedValues",new Set);p(this,"selectedOptions",new Map);p(this,"allOptions",[]);p(this,"filteredOptions",[]);p(this,"tree",null);p(this,"treeNodes",[]);p(this,"cascadeIndex",null);p(this,"cascadeCheckedAtoms",new Set);p(this,"hiddenInputs",[]);p(this,"focusedIndex",-1);p(this,"keyboardController",null);p(this,"matchingIndices",new Set);p(this,"searchTerm","");p(this,"addNewFocused",!1);p(this,"addNewPending",!1);p(this,"isLoading",!1);p(this,"searchDebounceTimer");p(this,"searchAbortController");p(this,"showSelectedPopover",!1);p(this,"selectedPopoverPlacement",null);p(this,"dropdownPlacement",null);p(this,"isRTL",!1);p(this,"effectiveBadgesPosition","bottom");p(this,"justClosedViaClick",!1);p(this,"justOpenedViaClick",!1);p(this,"positioningDriftWarned",!1);p(this,"fullscreenContainingBlockWarned",!1);p(this,"presentationMode","floating");p(this,"fullscreenHeader",null);p(this,"fullscreenSearchInput",null);p(this,"fullscreenSearchClear",null);p(this,"fullscreenModeToggle",null);p(this,"fullscreenNav",null);p(this,"fullscreenNavCount",null);p(this,"fullscreenNavPrev",null);p(this,"fullscreenNavNext",null);p(this,"bodyScrollUnlock",null);p(this,"overflowXClamp",null);p(this,"keyboardInsetCleanup",null);p(this,"overlayHistoryActive",!1);p(this,"onOverlayPopstate",()=>this.handleOverlayPopstate());p(this,"dropdownCleanup",null);p(this,"hintCleanup",null);p(this,"selectedPopoverCleanup",null);p(this,"tooltips",new Map);p(this,"labelRevealTrigger",null);p(this,"labelRevealPanel",null);p(this,"labelRevealPopover",null);p(this,"messageEl",null);p(this,"messageCleanup",null);p(this,"messageTimer",null);p(this,"onDropdownScroll",()=>{this.hideOptionTooltips(),this.hideLabelReveal()});p(this,"virtualScroll",null);p(this,"optionsContainer",null);p(this,"selectedPopoverVirtualScroll",null);p(this,"selectedPopoverContainer",null);p(this,"input");p(this,"inputWrapper");p(this,"dropdown");p(this,"dropdownInner");p(this,"badgesContainer");p(this,"counter");p(this,"clearButton");p(this,"hint");p(this,"selectedPopover");p(this,"documentKeydownHandler",null);p(this,"documentClickHandler",null);p(this,"overlayCoord",null);this.element=e,this.instanceId=`MS-${Math.random().toString(36).slice(2,11)}`,this.options={searchHint:e.dataset.searchHint||"",searchPlaceholder:e.dataset.searchPlaceholder||void 0,selectPlaceholder:e.dataset.selectPlaceholder||"Pick an option...",noDataPlaceholder:e.dataset.noDataPlaceholder||void 0,dropdownMinWidth:e.dataset.dropdownMinWidth||void 0,dropdownMaxWidth:e.dataset.dropdownMaxWidth||void 0,badgesDisplayMode:e.dataset.badgesDisplayMode||"badges",badgesPosition:e.dataset.badgesPosition||"bottom",badgesThresholdMode:e.dataset.badgesThresholdMode||"count",maxHeight:e.dataset.maxHeight||"20rem",emptyMessage:e.dataset.emptyMessage||"No results found",addNewText:e.dataset.addNewText||void 0,addNewPendingText:e.dataset.addNewPendingText||void 0,loadingMessage:e.dataset.loadingMessage||"Loading...",searchInputMode:e.dataset.searchInputMode||"normal",searchMode:e.dataset.searchMode||"filter",badgesThreshold:e.dataset.badgesThreshold?parseInt(e.dataset.badgesThreshold):void 0,minSearchLength:parseInt(e.dataset.minSearchLength||"0")||0,searchDebounce:parseInt(e.dataset.searchDebounce||"0")||0,isMultipleEnabled:e.dataset.multiple!=="false",isGroupsAllowed:e.dataset.allowGroups!=="false",isCheckboxesShown:e.dataset.showCheckboxes!=="false",isActionsSticky:e.dataset.stickyActions!=="false",isCloseOnSelect:e.dataset.closeOnSelect==="true",isPlacementLocked:e.dataset.lockPlacement!=="false",isSearchEnabled:e.dataset.enableSearch!=="false",isAddNewAllowed:e.dataset.allowAddNew==="true",isCounterShown:e.dataset.showCounter==="true",isSelectedPopoverEnabled:e.dataset.enableSelectedPopover!=="false",isSearchModeToggleShown:e.dataset.showSearchModeToggle==="true",isKeepOptionsOnSearch:e.dataset.keepOptionsOnSearch!=="false",shouldKeepSearchOnClose:e.dataset.keepSearchOnClose!=="false",options:[],container:void 0,...t},this.init()}extractField(e,t){if(Array.isArray(e)&&e.length===2){if(t.tupleSkip)return typeof t.fallback=="function"?t.fallback():t.fallback;if(t.tupleIndex!==void 0){const i=e[t.tupleIndex];return t.transform?t.transform(i):i}}if(t.member&&e[t.member]!==void 0){const i=e[t.member];return t.transform?t.transform(i):i}return t.callback?t.callback(e):typeof t.fallback=="function"?t.fallback():t.fallback}getItemValue(e){return this.extractField(e,{tupleIndex:0,member:this.options.valueMember,callback:this.options.getValueCallback,fallback:"[N/A]"})}getItemDisplayValue(e){return this.extractField(e,{tupleIndex:1,member:this.options.displayValueMember,callback:this.options.getDisplayValueCallback,transform:String,fallback:"[N/A]"})}getItemBadgeDisplayValue(e){if(this.options.getBadgeDisplayCallback)return this.options.getBadgeDisplayCallback(e);if(this.options.isBadgeFullTitleShown){const t=this.getItemFullTitle(e);if(t)return t}return this.getItemDisplayValue(e)}getItemFullTitle(e){return this.extractField(e,{tupleSkip:!0,member:this.options.fullTitleMember,callback:this.options.getFullTitleCallback,transform:String,fallback:void 0})}getItemSearchValue(e){return this.extractField(e,{member:this.options.searchValueMember,callback:this.options.getSearchValueCallback,transform:String,fallback:()=>this.getItemDisplayValue(e)})}getItemIcon(e){return this.extractField(e,{tupleSkip:!0,member:this.options.iconMember,callback:this.options.getIconCallback,transform:String,fallback:void 0})}getItemSubtitle(e){return this.extractField(e,{tupleSkip:!0,member:this.options.subtitleMember,callback:this.options.getSubtitleCallback,transform:String,fallback:void 0})}getItemGroup(e){return this.extractField(e,{tupleSkip:!0,member:this.options.groupMember,callback:this.options.getGroupCallback,transform:String,fallback:void 0})}getItemDisabled(e){return this.extractField(e,{tupleSkip:!0,member:this.options.disabledMember,callback:this.options.getDisabledCallback,transform:Boolean,fallback:!1})}isIndexSelectable(e){if(!this.isTreeMode())return!0;const t=this.treeNodes[e];return t?t.isSelectable!==!1:!0}isOptionSelectable(e){if(!this.isTreeMode())return!0;const t=this.filteredOptions.indexOf(e);if(t>=0)return this.isIndexSelectable(t);const o=String(this.getItemValue(e)),i=this.treeNodes.find(r=>String(this.getItemValue(r.data))===o);return i?i.isSelectable!==!1:!0}init(){this.parseOptions(),this.buildHTML(),this.attachEvents(),this.parseInitialSelection(),nt.debug(`Initialized [${this.instanceId}] with options:`,{placeholder:this.options.searchPlaceholder,totalOptions:this.allOptions.length,isCloseOnSelect:this.options.isCloseOnSelect,dataAttribute:this.element.dataset.closeOnSelect})}parseOptions(){const e=this.element.dataset.options;if(e)try{this.allOptions=JSON.parse(e)}catch(t){U.error(`[${this.instanceId}] Failed to parse data-options:`,t),this.allOptions=[]}else this.options.options&&(this.allOptions=this.options.options);this.filteredOptions=[...this.allOptions],this.isTreeMode()&&this.buildTree()}isTreeMode(){return this.options.isTreeEnabled===!1?!1:!!(this.options.isTreeEnabled||this.options.pathMember||this.options.getPathCallback)}buildTree(){this.tree=pn({idMember:this.options.valueMember,pathMember:this.options.pathMember,getPathCallback:this.options.getPathCallback,parentPathMember:this.options.parentPathMember,levelMember:this.options.levelMember,hasChildrenMember:this.options.hasChildrenMember,isSelectableMember:this.options.isSelectableMember,getIsSelectableCallback:this.options.getIsSelectableCallback,treePathSeparator:this.options.treePathSeparator,treeId:this.instanceId,getDisplayValueCallback:e=>this.getItemDisplayValue(e.data)}),this.tree.insertArray(this.allOptions),this.cascadeIndex=this.isCascadeMode()?_o(this.tree,e=>String(this.getItemValue(e))):null,this.rebuildTreeVisible()}isCascadeMode(){return this.isTreeMode()&&this.options.isMultipleEnabled!==!1&&this.options.checkboxMode==="cascade"}cascadePolicy(){return this.options.cascadeSelectPolicy??"rolled-up"}refreshCascadeAtoms(){this.isCascadeMode()&&this.cascadeIndex&&(this.cascadeCheckedAtoms=lt(this.cascadeIndex,this.selectedValues))}toggleTreeCascade(e){const t=this.cascadeIndex,o=lt(t,this.selectedValues),{checkedAtoms:i}=fn(t,e,o);this.commitCascadeAtoms(i)}commitCascadeAtoms(e){var l;const t=this.cascadeIndex,o=us(t,e,this.cascadePolicy(),c=>String(this.getItemValue(c))),i=new Set(o),r=[],n=[];for(const[c,d]of this.selectedOptions)i.has(c)||n.push(d);const a=new Map;for(const c of o){const u=((l=t.nodeByValue.get(c))==null?void 0:l.data)??this.selectedOptions.get(c);u!==void 0&&(a.set(c,u),this.selectedValues.has(c)||r.push(u))}this.selectedValues=i,this.selectedOptions=a,this.cascadeCheckedAtoms=e,this.commit({added:r,removed:n})}counterSelection(){if(this.isCascadeMode()&&this.cascadeIndex){const e=us(this.cascadeIndex,this.cascadeCheckedAtoms,"rolled-up",o=>String(this.getItemValue(o))),t=[];for(const o of e){const i=this.cascadeIndex.nodeByValue.get(o),r=(i==null?void 0:i.data)??this.selectedOptions.get(o);r!==void 0&&t.push(r)}return t}return Array.from(this.selectedOptions.values())}buildCounterTooltip(e){const o=e.slice(0,12).map(i=>this.getItemBadgeDisplayValue(i));return e.length>12&&o.push(`…and ${e.length-12} more`),o.join(`
|
|
2
|
+
`)}rebuildTreeVisible(){if(!this.tree){this.treeNodes=[];return}const e=this.tree.flatNodes,t=this.options.isSearchEnabled?(this.searchTerm||"").trim().toLowerCase():"";let o;if(!t)o=e;else{const i=this.tree.treePathSeparator,r=new Set;for(const n of e)if(this.getItemSearchValue(n.data).toLowerCase().includes(t)){const l=n.path.split(i);for(let c=1;c<=l.length;c++)r.add(l.slice(0,c).join(i))}o=e.filter(n=>r.has(n.path))}this.treeNodes=o,this.filteredOptions=o.map(i=>i.data)}resetVisibleToAll(){this.isTreeMode()?this.rebuildTreeVisible():this.filteredOptions=[...this.allOptions]}rebuildTreeVisibleFromMatches(e){if(!this.tree){this.treeNodes=[],this.filteredOptions=[];return}const t=this.tree.flatNodes,o=this.tree.treePathSeparator,i=new Set((e||[]).map(a=>String(this.getItemValue(a)))),r=new Set;for(const a of t)if(i.has(String(this.getItemValue(a.data)))){const l=a.path.split(o);for(let c=1;c<=l.length;c++)r.add(l.slice(0,c).join(o))}const n=t.filter(a=>r.has(a.path));this.treeNodes=n,this.filteredOptions=n.map(a=>a.data)}rebuildTreeVisibleForNavigate(){if(this.matchingIndices.clear(),!this.tree)return this.treeNodes=[],this.filteredOptions=[],-1;const e=this.tree.flatNodes;this.treeNodes=e,this.filteredOptions=e.map(i=>i.data);const t=(this.searchTerm||"").trim().toLowerCase();if(!t)return-1;let o=-1;return e.forEach((i,r)=>{this.getItemSearchValue(i.data).toLowerCase().includes(t)&&(this.matchingIndices.add(r),o===-1&&(o=r))}),o}detectRTL(){const e=this.element.getRootNode(),t=e instanceof ShadowRoot?e.host:this.element,o=t.getAttribute("dir")==="rtl",i=t.closest('[dir="rtl"]')!==null;this.isRTL=o||i,nt.debug(`[${this.instanceId}] RTL Debug:`,{isShadowRoot:e instanceof ShadowRoot,elementDir:t.getAttribute("dir"),hasElementDir:o,hasAncestorDir:i,isRTL:this.isRTL}),this.effectiveBadgesPosition=this.options.badgesPosition||"bottom",this.isRTL&&(this.effectiveBadgesPosition==="left"?this.effectiveBadgesPosition="right":this.effectiveBadgesPosition==="right"&&(this.effectiveBadgesPosition="left"))}refreshDirection(){if(!this.element)return;const e=this.isRTL;this.detectRTL(),this.element.classList.toggle("ms--rtl",this.isRTL);const t=this.isRTL?"rtl":"ltr";this.dropdown&&(this.dropdown.dir=t),this.hint&&(this.hint.dir=t),this.selectedPopover&&(this.selectedPopover.dir=t),e!==this.isRTL&&this.renderBadges()}buildHTML(){const e=this.options.container||document.body;this.detectRTL(),this.element.classList.add("ms"),this.isRTL&&(this.element.classList.add("ms--rtl"),nt.debug(`[${this.instanceId}] Added ms--rtl class to element`)),(!this.options.isCheckboxesShown||!this.options.isMultipleEnabled)&&this.element.classList.add("ms--no-checkboxes"),this.options.isSelectedPopoverEnabled||this.element.classList.add("ms--no-selected-popover");const t=document.createElement("div");t.className="ms__input-wrapper",this.inputWrapper=t,this.input=document.createElement("input"),this.input.type="text",this.input.className="ms__input",this.input.placeholder=this.getPlaceholderText(),this.input.autocomplete="off",this.options.searchInputMode==="readonly"?this.input.readOnly=!0:this.options.searchInputMode==="hidden"&&(this.input.style.display="none");const o=document.createElement("span");o.className="ms__toggle",o.addEventListener("mousedown",n=>{n.preventDefault(),n.stopPropagation(),h(this,R)?(this.justClosedViaClick=!0,this.close(),setTimeout(()=>{this.justClosedViaClick=!1},0)):(this.open(),this.presentationMode!=="fullscreen"&&this.input.focus())}),this.counter=document.createElement("span"),this.counter.className="ms__counter",this.counter.style.display="none",this.clearButton=document.createElement("button"),this.clearButton.type="button",this.clearButton.className="ms__input-clear",this.clearButton.tabIndex=-1,this.clearButton.setAttribute("aria-label","Clear selection"),this.clearButton.style.display="none",this.clearButton.addEventListener("mousedown",n=>n.preventDefault()),this.clearButton.addEventListener("click",n=>{n.stopPropagation(),this.clearClick()}),t.appendChild(this.input),t.appendChild(this.counter),t.appendChild(this.clearButton),t.appendChild(o),this.badgesContainer=document.createElement("div"),this.badgesContainer.className="ms__badges";const i=document.createElement("div");i.className="ms__wrapper",(this.effectiveBadgesPosition==="left"||this.effectiveBadgesPosition==="right")&&i.classList.add("ms__wrapper--inline"),i.appendChild(t),i.appendChild(this.badgesContainer),this.element.appendChild(i);const r=this.isRTL?"rtl":null;this.dropdown=document.createElement("div"),this.dropdown.className="ms__dropdown",r&&(this.dropdown.dir=r),this.dropdownInner=document.createElement("div"),this.dropdownInner.className="ms__dropdown-inner",this.dropdown.appendChild(this.dropdownInner),e.appendChild(this.dropdown),this.options.searchHint&&(this.hint=document.createElement("div"),this.hint.className="ms__hint",r&&(this.hint.dir=r),this.hint.textContent=this.options.searchHint,e.appendChild(this.hint)),this.selectedPopover=document.createElement("div"),this.selectedPopover.className="ms__selected-popover",r&&(this.selectedPopover.dir=r),e.appendChild(this.selectedPopover),this.renderDropdown()}shouldUseVirtualScroll(){if(!this.options.isVirtualScrollEnabled||this.options.isGroupsAllowed&&this.hasGroups())return!1;const e=this.options.virtualScrollThreshold??100;return this.filteredOptions.length>=e}hasGroups(){return this.filteredOptions.some(e=>{const t=this.getItemGroup(e);return t&&t.trim()!==""})}renderDropdown(e){var a;if(this.destroyAllActionButtonTooltips(),this.hideLabelReveal(),this.refreshCascadeAtoms(),this.shouldUseVirtualScroll()){this.dropdown.classList.add("ms__dropdown--virtual"),this.renderDropdownVirtual();return}this.dropdown.classList.remove("ms__dropdown--virtual"),this.virtualScroll&&(this.virtualScroll.destroy(),this.virtualScroll=null,this.optionsContainer=null);let t="";if(this.isLoading){t+='<div class="ms__loader">',t+='<div class="pa-loader pa-loader--sm"></div>',t+=`<div class="ms__loading-text">${this.options.loadingMessage}</div>`,t+="</div>",this.dropdownInner.innerHTML=t;return}const o=this.renderActionsHTML(),i=this.options.actionsPosition==="bottom";if(i||(t+=o),this.options.isVirtualScrollEnabled){const l=this.scaledOptionHeight();t+=`<div class="ms__options ms__options--fixed-height" style="--ms-option-height: ${l}px;">`}else t+='<div class="ms__options">';if(this.filteredOptions.length===0)t+=this.renderEmptyStateHTML();else if(this.isTreeMode())this.treeNodes.forEach((l,c)=>{t+=this.renderTreeNode(l,c)});else if(this.options.isGroupsAllowed){const l=this.groupOptions(this.filteredOptions),c=new Map;this.filteredOptions.forEach((d,u)=>c.set(d,u)),Object.keys(l).forEach(d=>{if(t+='<div class="ms__group">',d!=="__ungrouped__"){const u=` data-group="${this.escapeHtml(d)}"`;if(this.options.renderGroupLabelContentCallback){const f=this.options.renderGroupLabelContentCallback(d);if(f instanceof HTMLElement){const m=document.createElement("div");m.className="ms__group-label",m.dataset.group=d,m.appendChild(f),t+=m.outerHTML}else t+=`<div class="ms__group-label"${u}>${f}</div>`}else t+=`<div class="ms__group-label"${u}>${d}</div>`}l[d].forEach(u=>{t+=this.renderOption(u,c.get(u)??-1)}),t+="</div>"})}else this.filteredOptions.forEach((l,c)=>{t+=this.renderOption(l,c)});t+="</div>",i&&(t+=o);let r=0,n=0;if(e!=null&&e.preserveScroll&&(r=this.dropdownInner.scrollTop,n=((a=this.dropdownInner.querySelector(".ms__options"))==null?void 0:a.scrollTop)??0),this.dropdownInner.innerHTML=t,e!=null&&e.preserveScroll){this.dropdownInner.scrollTop=r;const l=this.dropdownInner.querySelector(".ms__options");l&&(l.scrollTop=n)}this.attachActionButtonTooltips(),this.attachOptionTooltips(),this.markTruncatedOptions(),this.applyEdgeOptionRadii()}applyEdgeOptionRadii(){const e=this.dropdownInner.querySelector(".ms__options");if(!e)return;const t=e.scrollHeight>e.clientHeight+1?e:this.dropdownInner,o=t.offsetWidth-t.clientWidth<=0,i="var(--ms-dropdown-inner-border-radius)",r=Array.from(e.querySelectorAll(".ms__option, .ms__group-label"));r.forEach(l=>{l.style.borderStartStartRadius="",l.style.borderStartEndRadius="",l.style.borderEndStartRadius="",l.style.borderEndEndRadius=""});const n=r[0];n&&(n.style.borderStartStartRadius=i,o&&(n.style.borderStartEndRadius=i));let a;for(let l=r.length-1;l>=0;l--)if(r[l].classList.contains("ms__option")){a=r[l];break}a&&(a.style.borderEndStartRadius=i,o&&(a.style.borderEndEndRadius=i))}renderDropdownVirtual(){if(this.destroyAllActionButtonTooltips(),!this.virtualScroll){let o="";const i=this.renderActionsHTML(),r=this.options.actionsPosition==="bottom";r||(o+=i),o+='<div class="ms__options ms__options--virtual" style="overflow-y: auto; position: relative;"></div>',r&&(o+=i),this.dropdownInner.innerHTML=o,this.optionsContainer=this.dropdownInner.querySelector(".ms__options")}if(this.applyVirtualOptionsSizing(this.optionsContainer),this.filteredOptions.length===0){this.virtualScroll&&(this.virtualScroll.destroy(),this.virtualScroll=null),this.optionsContainer.innerHTML=this.renderEmptyStateHTML();return}const e=this.scaledOptionHeight(),t=this.options.virtualScrollBuffer??10;requestAnimationFrame(()=>{this.optionsContainer&&(this.virtualScroll?(this.virtualScroll.setItemHeight(e),this.virtualScroll.setItems(this.filteredOptions)):this.virtualScroll=new vo({container:this.optionsContainer,itemHeight:e,items:this.filteredOptions,renderItem:(o,i)=>this.isTreeMode()?this.renderTreeNode(this.treeNodes[i],i):this.renderOption(o,i),bufferSize:t,onVisibleRangeChange:()=>{this.attachOptionTooltips(),this.markTruncatedOptions(),this.applyEdgeOptionRadii()}}),this.attachActionButtonTooltips())})}getBuiltInActionDisabled(e){return e==="select-all"?!this.filteredOptions.some(t=>!this.getItemDisabled(t)&&!this.selectedValues.has(String(this.getItemValue(t)))):e==="clear-all"?this.selectedValues.size===0:!1}renderActionsHTML(){const e=this.options.actionButtons;if(!this.options.isMultipleEnabled||!e||e.length===0)return"";const t=this.options.actionsPosition==="bottom"?"bottom":"top",o=this.options.actionsAlign??"stretch",i=` ms__actions--${t}`,r=this.options.isActionsSticky?" ms__actions--sticky":"",n=this.options.actionsLayout==="wrap"?" ms__actions--wrap":"",a=` ms__actions--align-${o}`,l=new Map;if(e.forEach((d,u)=>{if(!(d.getIsVisibleCallback?d.getIsVisibleCallback(this):d.isVisible??!0))return;let m;d.getIsDisabledCallback?m=d.getIsDisabledCallback(this):d.isDisabled!==void 0?m=d.isDisabled:m=this.getBuiltInActionDisabled(d.action);const g=m?" disabled":"",y=d.getTextCallback?d.getTextCallback(this):d.text;let x="";if(d.getClassCallback){const T=this.classSuffix(d.getClassCallback(this));T&&(x=` ${T}`)}else d.cssClass&&(x=` ${d.cssClass}`);const v=Math.max(1,Math.floor(d.row??1)),_=`<button type="button"${g} class="ms__action-btn${x}" data-action="${d.action}" data-button-index="${u}">${y}</button>`;l.has(v)||l.set(v,[]),l.get(v).push(_)}),l.size===0)return"";const c=Array.from(l.keys()).sort((d,u)=>d-u).map(d=>`<div class="ms__actions-row" data-row="${d}">${l.get(d).join("")}</div>`).join("");return`<div class="ms__actions${i}${r}${n}${a}">${c}</div>`}renderOption(e,t){const o=this.getItemValue(e),i=this.getItemDisplayValue(e),r=this.getItemIcon(e),n=this.getItemSubtitle(e),a=this.getItemDisabled(e),l=this.selectedValues.has(String(o)),c=t===this.focusedIndex,d=this.matchingIndices.has(t),u=["ms__option"];l&&u.push("ms__option--selected"),c&&u.push("ms__option--focused"),d&&u.push("ms__option--matched"),a&&u.push("ms__option--disabled");const f=this.options.checkboxAlign&&this.options.checkboxAlign!=="center"?` data-checkbox-align="${this.options.checkboxAlign}"`:"";let m=`<div class="${u.join(" ")}" data-value="${o}" data-index="${t}"${f}>`;if(this.options.isCheckboxesShown&&this.options.isMultipleEnabled&&(m+=`<input type="checkbox" class="ms__checkbox" ${l?"checked":""} ${a?"disabled":""}>`),m+='<div class="ms__option-content">',this.options.renderOptionContentCallback){const g={index:t,isSelected:l,isFocused:c,isMatched:d,isDisabled:a,...Yt(this.presentationMode),isTreeNode:!1};m+=this.toHtml(this.options.renderOptionContentCallback(e,g))}else r&&(m+=`<span class="ms__option-icon">${r}</span>`),m+='<div class="ms__option-text">',m+=`<div class="ms__option-title">${this.highlightMatch(i,this.searchTerm)}</div>`,n&&(m+=`<div class="ms__option-subtitle">${n}</div>`),m+="</div>";return m+=this.renderOptionInfoButton(),m+="</div>",m+="</div>",m}renderOptionInfoButton(){return this.presentationMode!=="fullscreen"?"":'<button type="button" class="ms__option-info" tabindex="-1" aria-label="Show full label"></button>'}renderTreeNode(e,t){const o=e.data,i=this.getItemValue(o),r=this.getItemDisplayValue(o),n=this.getItemIcon(o),a=this.getItemSubtitle(o),l=this.getItemDisabled(o),c=this.isCascadeMode()&&this.cascadeIndex,d=c?hs(this.cascadeIndex,e,this.cascadeCheckedAtoms):null,u=c?d==="checked":this.selectedValues.has(String(i)),f=d==="indeterminate",m=t===this.focusedIndex,g=this.matchingIndices.has(t),y=e.isSelectable!==!1,x=e.level??1,v=Math.max(0,x-1),_=["ms__option","ms__option--tree"];_.push(e.hasChildren?"ms__option--tree-branch":"ms__option--tree-leaf"),u&&_.push("ms__option--selected"),f&&_.push("ms__option--indeterminate"),m&&_.push("ms__option--focused"),g&&_.push("ms__option--matched"),l&&_.push("ms__option--disabled"),y||_.push("ms__option--tree-unselectable");const T=this.options.checkboxAlign&&this.options.checkboxAlign!=="center"?` data-checkbox-align="${this.options.checkboxAlign}"`:"",N=y?"":' data-selectable="false"';let V=`<div class="${_.join(" ")}" data-value="${i}" data-index="${t}" data-path="${e.path}" data-level="${x}" style="--ms-tree-depth: ${v};"${T}${N}>`;if(this.options.isCheckboxesShown&&this.options.isMultipleEnabled&&y&&(V+=`<input type="checkbox" class="${f?"ms__checkbox ms__checkbox--indeterminate":"ms__checkbox"}" ${u?"checked":""}${f?' aria-checked="mixed"':""} ${l?"disabled":""}>`),V+='<div class="ms__option-content">',this.options.renderOptionContentCallback){const F={index:t,isSelected:u,isFocused:m,isMatched:g,isDisabled:l,...Yt(this.presentationMode),isTreeNode:!0,isBranch:e.hasChildren,isLeaf:!e.hasChildren,childCount:Object.keys(e.children).length,level:x,depth:v,path:e.path,isSelectable:y,isIndeterminate:f};V+=this.toHtml(this.options.renderOptionContentCallback(o,F))}else n&&(V+=`<span class="ms__option-icon">${n}</span>`),V+='<div class="ms__option-text">',V+=`<div class="ms__option-title">${this.highlightMatch(r,this.searchTerm)}</div>`,a&&(V+=`<div class="ms__option-subtitle">${a}</div>`),V+="</div>";return V+=this.renderOptionInfoButton(),V+="</div>",V+="</div>",V}renderEmptyStateHTML(){if(this.isAddNewPromptShown()){const e=(this.searchTerm||"").trim();return this.addNewPending?`<div class="ms__add-new ms__add-new--loading" aria-busy="true"><span class="ms__add-new-spinner" aria-hidden="true"></span><span class="ms__add-new-text">${this.getAddNewPendingText(e)}</span></div>`:`<div class="ms__add-new${this.addNewFocused?" ms__add-new--focused":""}" role="button" data-action="add-new"><span class="ms__add-new-icon" aria-hidden="true"></span><span class="ms__add-new-text">${this.getAddNewText(e)}</span></div>`}return`<div class="ms__empty">${this.options.emptyMessage}</div>`}isAddNewPromptShown(){return!!this.options.isAddNewAllowed&&this.filteredOptions.length===0&&!!(this.searchTerm||"").trim()}getAddNewText(e){return this.options.getAddNewTextCallback?this.escapeHtml(this.options.getAddNewTextCallback(e)):(this.options.addNewText??'Add "{value}"').replace(/\{value\}/g,this.escapeHtml(e))}getAddNewPendingText(e){return(this.options.addNewPendingText??'Adding "{value}"…').replace(/\{value\}/g,this.escapeHtml(e))}escapeHtml(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}highlightMatch(e,t){if(!t)return e;const o=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return e.replace(o,"<mark>$1</mark>")}groupOptions(e){const t={};return e.forEach(o=>{const i=this.getItemGroup(o)||"__ungrouped__";t[i]||(t[i]=[]),t[i].push(o)}),t}get isSearchUsable(){return!!this.options.isSearchEnabled&&this.options.searchInputMode!=="readonly"&&this.options.searchInputMode!=="hidden"}getPlaceholderText(){return this.options.noDataPlaceholder&&this.allOptions.length===0?this.options.noDataPlaceholder:this.isSearchUsable?this.getSearchPlaceholder():this.options.selectPlaceholder||this.getSearchPlaceholder()}getSearchPlaceholder(){return this.options.searchPlaceholder?this.options.searchPlaceholder:this.options.isSearchModeToggleShown?(this.options.searchMode||"filter")==="navigate"?"Search…":"Filter…":"Search..."}refreshSearchPlaceholder(){const e=this.getPlaceholderText();this.input&&(this.input.placeholder=e),this.fullscreenSearchInput&&(this.fullscreenSearchInput.placeholder=e)}renderBadges(){this.updateClearButton(),this.destroyAllBadgeTooltips();const e=Array.from(this.selectedOptions.values()),t=this.selectedValues.size;if(!this.options.isMultipleEnabled){this.badgesContainer.innerHTML="",this.counter.style.display="none";let r;e[0]&&(this.options.renderSelectedContentCallback?r=this.options.renderSelectedContentCallback(e[0]):r=this.getItemDisplayValue(e[0])),!h(this,R)&&t>0&&e.length>0?this.input.value=r:h(this,R)||(this.input.value="");return}let o=this.options.badgesDisplayMode;if(this.options.badgesThreshold!==null&&t>this.options.badgesThreshold&&o!=="none"&&(o=this.options.badgesThresholdMode||"count"),!h(this,R))if(t>0&&o==="count"){const r=this.options.getCounterCallback?this.options.getCounterCallback(t):`${t} selected`;this.input.placeholder=r}else this.input.placeholder=this.getPlaceholderText();if(this.options.isCounterShown&&t>0){const r=this.counterSelection(),n=r.length;this.counter.textContent=`[${n}]`,this.counter.title=this.buildCounterTooltip(r),this.counter.style.display=n>0?"":"none"}else this.counter.title="",this.counter.style.display="none";if(o==="none"){this.badgesContainer.innerHTML="";return}if(o==="badges")this.badgesContainer.className=`ms__badges ms__badges--${this.effectiveBadgesPosition}`,this.badgesContainer.innerHTML=e.map(r=>this.renderBadgeHTML(r,{displayMode:"badges",isInPopover:!1})).join("");else if(o==="partial"){this.badgesContainer.className=`ms__badges ms__badges--${this.effectiveBadgesPosition}`;const r=this.options.badgesMaxVisible||3,n=e.slice(0,r),a=t-r,l=n.map(d=>this.renderBadgeHTML(d,{displayMode:"partial",isInPopover:!1})).join("");let c="";a>0&&(c=`
|
|
3
3
|
<div class="ms__badge ms__badge--counter ms__badge--more" data-action="show-selected">
|
|
4
4
|
<span class="ms__badge-text">${this.options.getCounterCallback?this.options.getCounterCallback(t,a):`+${a} more`}</span>
|
|
5
5
|
<button type="button" class="ms__badge-remove" data-action="remove-hidden" aria-label="Remove ${a} hidden items"></button>
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<span class="ms__badge-text">${r}</span>
|
|
15
15
|
<button type="button" class="ms__badge-remove" data-action="clear-count" aria-label="Clear all selections"></button>
|
|
16
16
|
</div>
|
|
17
|
-
`}else this.badgesContainer.innerHTML="";this.attachBadgeTooltips()}attachEvents(){this.input.addEventListener("mousedown",e=>{e.stopPropagation(),h(this,R)?(this.justClosedViaClick=!0,this.close(),setTimeout(()=>{this.justClosedViaClick=!1},0)):(this.presentationMode==="fullscreen"&&e.preventDefault(),this.open())}),this.input.addEventListener("focus",()=>{!h(this,R)&&!this.justClosedViaClick&&this.open()}),this.input.addEventListener("input",e=>{const t=e.target.value;this.options.isSearchEnabled&&!h(this,R)&&this.open(),this.handleSearch(t)}),this.input.addEventListener("keydown",e=>this.handleKeydown(e)),this.documentClickHandler=e=>this.handleClickOutside(e),setTimeout(()=>{document.addEventListener("click",this.documentClickHandler)},0),this.overlayCoord=Gi(()=>this.close(),this.options.overlayGroup||void 0),this.documentKeydownHandler=e=>{e.key==="Escape"&&this.showSelectedPopover&&(e.preventDefault(),this.hideSelectedPopover())},document.addEventListener("keydown",this.documentKeydownHandler),this.dropdown.addEventListener("mousedown",e=>{if(this.presentationMode!=="fullscreen")return;e.target.closest(".ms__option")&&e.preventDefault()}),this.dropdown.addEventListener("touchmove",e=>{var t;this.presentationMode==="fullscreen"&&e.target.closest(".ms__options")&&((t=this.fullscreenSearchInput)==null||t.blur())},{passive:!0}),this.dropdown.addEventListener("click",e=>this.handleDropdownClick(e)),this.dropdownInner.addEventListener("wheel",e=>{if(this.virtualScroll)return;const t=e.currentTarget,o=t.scrollTop===0,i=t.scrollTop+t.clientHeight>=t.scrollHeight;(e.deltaY<0&&o||e.deltaY>0&&i)&&e.preventDefault(),e.stopPropagation()},{passive:!1}),this.badgesContainer.addEventListener("mousedown",e=>{e.target.closest('[data-action="show-selected"]')&&!this.showSelectedPopover&&e.stopPropagation()}),this.badgesContainer.addEventListener("click",e=>this.handleBadgeClick(e)),this.counter.addEventListener("mousedown",e=>{this.showSelectedPopover||e.stopPropagation()}),this.counter.addEventListener("click",e=>{e.stopPropagation(),this.toggleSelectedPopover()}),this.selectedPopover.addEventListener("click",e=>this.handleSelectedPopoverClick(e))}async handleSearch(e){if(this.searchTerm=e,this.addNewFocused=!1,!this.options.isSearchEnabled)return;let t=e;if(this.options.beforeSearchCallback){const o=this.options.beforeSearchCallback(e);if(o===null){U.debug(`[${this.instanceId}] beforeSearchCallback blocked search for term:`,e),this.abortInFlightSearch(),this.matchingIndices.clear(),this.isTreeMode()?(this.searchTerm="",this.rebuildTreeVisible()):this.filteredOptions=[...this.allOptions],this.renderDropdown();return}t=o,t!==e&&U.debug(`[${this.instanceId}] beforeSearchCallback transformed: "${e}" -> "${t}"`)}if(this.options.searchCallback){if(t.length<this.options.minSearchLength){this.abortInFlightSearch(),this.isLoading=!1,this.options.isKeepOptionsOnSearch?(this.isTreeMode()?this.rebuildTreeVisibleFromMatches(this.allOptions):this.filteredOptions=[...this.allOptions],U.debug(`[${this.instanceId}] Search term below minimum, showing ${this.allOptions.length} initial options`)):(this.filteredOptions=[],this.isTreeMode()&&(this.treeNodes=[])),this.matchingIndices.clear(),this.renderDropdown();return}this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=void 0);const o=this.options.searchDebounce||0;o>0?this.searchDebounceTimer=setTimeout(()=>{this.searchDebounceTimer=void 0,this.searchTerm===e&&this.performAsyncSearch(e,t)},o):await this.performAsyncSearch(e,t)}else{if(this.isTreeMode()){if((this.options.searchMode||"filter")==="navigate"){const o=this.rebuildTreeVisibleForNavigate();this.searchTerm.trim()?o>=0&&(this.focusedIndex=o):this.focusedIndex=-1,this.renderDropdown(),this.focusedIndex>=0&&this.scrollToFocused(),this.updateFullscreenNav();return}this.rebuildTreeVisible(),this.matchingIndices.clear(),this.focusedIndex=this.searchTerm.trim()&&this.filteredOptions.length>0?0:-1,this.renderDropdown();return}if(!t)this.filteredOptions=[...this.allOptions],this.matchingIndices.clear(),this.focusedIndex=-1;else{const o=this.options.searchMode||"filter",i=t.toLowerCase();if(o==="filter")this.filteredOptions=this.allOptions.filter(r=>this.getItemSearchValue(r).toLowerCase().includes(i)),this.matchingIndices.clear(),this.focusedIndex=this.filteredOptions.length>0?0:-1,U.debug(`[${this.instanceId}] Filter mode: ${this.filteredOptions.length} matches for "${t}"`);else{this.filteredOptions=[...this.allOptions],this.matchingIndices.clear();let r=-1;this.allOptions.forEach((n,a)=>{this.getItemSearchValue(n).toLowerCase().includes(i)&&(this.matchingIndices.add(a),r===-1&&(r=a))}),r>=0?(this.focusedIndex=r,U.debug(`[${this.instanceId}] Navigate mode: ${this.matchingIndices.size} matches, jumped to index ${r}`)):U.debug(`[${this.instanceId}] Navigate mode: No matches found, keeping previous focus`)}}this.renderDropdown(),this.options.searchMode==="navigate"&&this.focusedIndex>=0&&this.scrollToFocused(),this.updateFullscreenNav()}}abortInFlightSearch(){this.searchAbortController&&(this.searchAbortController.abort(),this.searchAbortController=void 0)}async performAsyncSearch(e,t){this.abortInFlightSearch();const o=new AbortController;this.searchAbortController=o,this.isLoading=!0,this.renderDropdown(),U.debug(`[${this.instanceId}] Loading data for search term:`,t);try{const i=await this.options.searchCallback(t,o.signal);if(o.signal.aborted||this.searchTerm!==e)return;const r=i||[];this.isTreeMode()?this.rebuildTreeVisibleFromMatches(r):this.filteredOptions=[...r],this.isLoading=!1,this.matchingIndices.clear(),this.focusedIndex=this.options.isSearchEnabled&&this.filteredOptions.length>0?0:-1,this.renderDropdown(),U.debug(`[${this.instanceId}] Loaded ${r.length} results`)}catch(i){if(o.signal.aborted)return;U.error(`[${this.instanceId}] Error loading data:`,i),this.isLoading=!1,this.options.isKeepOptionsOnSearch?this.isTreeMode()?this.rebuildTreeVisibleFromMatches(this.allOptions):this.filteredOptions=[...this.allOptions]:(this.filteredOptions=[],this.isTreeMode()&&(this.treeNodes=[])),this.matchingIndices.clear(),this.renderDropdown()}finally{this.searchAbortController===o&&(this.searchAbortController=void 0)}}handleKeydown(e){var t;if(!(this.options.keydownCallback&&this.options.keydownCallback({event:e,key:e.key,isOpen:h(this,R),presentation:this.presentationMode,searchTerm:this.searchTerm,focusedIndex:this.focusedIndex,focusedOption:(this.focusedIndex>=0?this.filteredOptions[this.focusedIndex]:null)??null,filteredOptions:this.filteredOptions,selectedValues:[...this.selectedValues],controller:this.getKeyboardController()})===!0)){if(!h(this,R)){(e.key==="Enter"||e.key==="ArrowDown")&&(e.preventDefault(),this.open());return}if(!this.options.isSearchEnabled){const o=e.key.length===1||e.key==="Backspace"||e.key==="Delete",i=["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Enter","Escape","Tab"].includes(e.key);if(o&&!i){e.preventDefault();return}}switch(e.key){case"ArrowDown":e.preventDefault(),this.isAddNewPromptShown()?this.focusAddNewPrompt():e.ctrlKey||e.metaKey?this.focusNextMatch():this.focusNext();break;case"ArrowUp":e.preventDefault(),this.isAddNewPromptShown()?this.focusAddNewPrompt():e.ctrlKey||e.metaKey?this.focusPreviousMatch():this.focusPrevious();break;case"Enter":e.preventDefault(),this.focusedIndex>=0?this.toggleOption(this.filteredOptions[this.focusedIndex]):this.options.isAddNewAllowed&&this.filteredOptions.length===0&&(this.searchTerm||"").trim()&&this.handleAddNew((this.searchTerm||"").trim()),this.presentationMode==="fullscreen"&&((t=this.fullscreenSearchInput)==null||t.blur());break;case"Escape":e.preventDefault(),this.showSelectedPopover?this.hideSelectedPopover():this.input.value?this.clearSearch():this.close();break;case"Tab":this.close();break;case"PageUp":e.preventDefault(),this.focusPageUp();break;case"PageDown":e.preventDefault(),this.focusPageDown();break;case"Home":case"End":{const o=e.target instanceof HTMLInputElement?e.target:null;let i;if(!o)i=!0;else if(o.selectionStart!==o.selectionEnd)i=!1;else{const r=o.selectionStart??0;i=e.key==="Home"?r===0:r===o.value.length}i&&(e.preventDefault(),e.key==="Home"?this.focusFirst():this.focusLast());break}}}}handleDropdownClick(e){var r,n;H.debug(`[${this.instanceId}] Dropdown clicked`,{target:e.target.className}),e.stopPropagation();const t=e.target.closest(".ms__option-info");if(t){e.preventDefault(),this.toggleLabelReveal(t);return}this.hideLabelReveal();const o=e.target.closest("[data-action]");if(o){e.preventDefault();const a=o.dataset.action;if(H.debug(`[${this.instanceId}] Action button clicked:`,a),a==="select-all")this.selectAll();else if(a==="clear-all")this.clearAll();else if(a==="add-new"){const l=(this.searchTerm||"").trim();l&&this.handleAddNew(l)}else if(a==="custom"){const l=parseInt(o.dataset.buttonIndex||"-1"),c=(r=this.options.actionButtons)==null?void 0:r[l];c!=null&&c.onClick&&c.onClick(this)}return}const i=e.target.closest(".ms__option");if(i&&!i.classList.contains("ms__option--disabled")){e.preventDefault();const a=i.dataset.value,l=this.filteredOptions.findIndex(c=>String(this.getItemValue(c))===a);H.debug(`[${this.instanceId}] Option clicked:`,{value:a,optionIndex:l,closeOnSelect:this.options.isCloseOnSelect,placeholder:this.options.searchPlaceholder}),l>=0&&(this.focusedIndex=l,this.toggleOption(this.filteredOptions[l]),h(this,R)&&this.presentationMode!=="fullscreen"?this.input.focus():this.presentationMode==="fullscreen"&&((n=this.fullscreenSearchInput)==null||n.blur()))}}handleBadgeClick(e){var n;if(e.target.closest('[data-action="clear-count"]')){e.preventDefault(),e.stopPropagation(),H.debug(`[${this.instanceId}] Clear count button clicked`),this.clearAll();return}if(e.target.closest('[data-action="show-selected"]')){e.preventDefault(),e.stopPropagation(),this.toggleSelectedPopover();return}const i=e.target.closest('.ms__badge-remove, [data-action="remove"]');if(i){if(e.preventDefault(),e.stopPropagation(),i.dataset.action==="remove-hidden"){H.debug(`[${this.instanceId}] Remove hidden items button clicked`);const c=this.options.badgesMaxVisible||3;Array.from(this.selectedOptions.values()).slice(c).forEach(f=>this.interactiveDeselect(f));return}const a=i.dataset.value??((n=i.closest("[data-value]"))==null?void 0:n.dataset.value)??"",l=this.selectedOptions.get(a);l&&this.interactiveDeselect(l);return}if(e.target.closest(".ms__badge--more")&&!e.target.closest(".ms__badge-remove")){e.preventDefault(),e.stopPropagation(),H.debug(`[${this.instanceId}] '+X more' badge clicked, showing popover`),this.toggleSelectedPopover();return}}handleClickOutside(e){var i;const t=e.composedPath();if(this.showSelectedPopover&&!t.some(n=>n instanceof Node&&(this.selectedPopover.contains(n)||this.counter.contains(n)||n.closest&&n.closest('[data-action="show-selected"]')))){J.debug(`[${this.instanceId}] Closing selected popover due to click outside`),this.hideSelectedPopover();return}if(!h(this,R)||this.justOpenedViaClick)return;const o=t.some(r=>r instanceof Node&&(this.element.contains(r)||this.dropdown.contains(r)||this.hint&&this.hint.contains(r)));H.debug(`[${this.instanceId}] handleClickOutside`,{target:e.target.className,targetTag:e.target.tagName,clickedInside:o,pathLength:t.length,firstInPath:(i=t[0])==null?void 0:i.tagName,elementContains:t.some(r=>r instanceof Node&&this.element.contains(r)),dropdownContains:t.some(r=>r instanceof Node&&this.dropdown.contains(r)),isConnected:this.dropdown.isConnected}),o||(H.warn(`[${this.instanceId}] Closing dropdown due to click outside`),this.close())}focusBy(e,t=1){const o=this.filteredOptions.length;if(o===0)return;const i=e(this.focusedIndex,o);if(i<0)return;const r=this.resolveSelectableIndex(i,t,o);r<0||(this.focusedIndex=r,this.renderDropdown(),this.scrollToFocused(),this.updateFullscreenNav())}resolveSelectableIndex(e,t,o){if(!this.isTreeMode())return e;let i=e;for(;i>=0&&i<o&&!this.isIndexSelectable(i);)i+=t;if(i<0||i>=o)for(i=e-t;i>=0&&i<o&&!this.isIndexSelectable(i);)i-=t;return i>=0&&i<o?i:-1}focusNext(){this.focusBy((e,t)=>Math.min(t-1,e+1),1)}focusPrevious(){this.focusBy(e=>Math.max(0,e-1),-1)}focusFirst(){this.focusBy(()=>0,1)}focusLast(){this.focusBy((e,t)=>t-1,-1)}focusPageUp(){this.focusBy(e=>Math.max(0,e-10),-1)}focusPageDown(){this.focusBy((e,t)=>Math.min(t-1,e+10),1)}focusAddNewPrompt(){this.addNewFocused||(this.addNewFocused=!0,this.renderDropdown())}focusNextMatch(){if(this.matchingIndices.size===0)return;const e=Array.from(this.matchingIndices).sort((i,r)=>i-r),t=e.findIndex(i=>i===this.focusedIndex),o=(t+1)%e.length;this.focusBy(()=>e[o]),H.debug(`[${this.instanceId}] Jumped to next match: index ${this.focusedIndex} (${t+1} of ${e.length})`)}focusPreviousMatch(){if(this.matchingIndices.size===0)return;const e=Array.from(this.matchingIndices).sort((i,r)=>i-r),t=e.findIndex(i=>i===this.focusedIndex),o=t<=0?e.length-1:t-1;this.focusBy(()=>e[o]),H.debug(`[${this.instanceId}] Jumped to previous match: index ${this.focusedIndex} (${t+1} of ${e.length})`)}getKeyboardController(){return this.keyboardController?this.keyboardController:(this.keyboardController={focusNext:()=>this.focusNext(),focusPrevious:()=>this.focusPrevious(),focusFirst:()=>this.focusFirst(),focusLast:()=>this.focusLast(),focusPageUp:()=>this.focusPageUp(),focusPageDown:()=>this.focusPageDown(),focusNextMatch:()=>this.focusNextMatch(),focusPreviousMatch:()=>this.focusPreviousMatch(),focusIndex:e=>this.focusBy(()=>e,1),toggleFocused:()=>{this.focusedIndex>=0&&this.toggleOption(this.filteredOptions[this.focusedIndex])},toggleValue:e=>{const t=this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},selectValue:e=>{if(this.selectedValues.has(String(e)))return;const t=this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},deselectValue:e=>{if(!this.selectedValues.has(String(e)))return;const t=this.selectedOptions.get(String(e))??this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},open:()=>this.open(),close:()=>this.close(),setSearch:e=>{this.input.value=e,this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=e),this.handleSearch(e)},clearSearch:()=>this.clearSearch()},this.keyboardController)}clearSearch(){this.input.value="",this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.searchTerm="",this.resetVisibleToAll(),this.matchingIndices.clear(),this.focusedIndex=-1,this.renderDropdown(),this.updateFullscreenNav(),this.updateFullscreenSearchClear()}search(e){const t=e??"";this.input.value=t,this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=t),this.handleSearch(t),this.updateFullscreenSearchClear()}scrollToFocused(){if(this.virtualScroll&&this.focusedIndex>=0){this.virtualScroll.scrollToIndex(this.focusedIndex,"nearest");return}const e=this.dropdown.querySelector(".ms__option--focused");e&&this.applyScrollIntoView(e)}applyScrollIntoView(e,t){this.presentationMode==="fullscreen"?e.scrollIntoView({block:(t==null?void 0:t.block)??"center",behavior:"auto"}):e.scrollIntoView({block:(t==null?void 0:t.block)??"nearest",behavior:"smooth"})}scrollToIndex(e,t){const o=(t==null?void 0:t.block)??"start";return h(this,R)?e<0||e>=this.filteredOptions.length?(H.debug(`[${this.instanceId}] scrollToIndex(${e}) → false (out of range, ${this.filteredOptions.length} options)`),!1):(H.debug(`[${this.instanceId}] scrollToIndex(${e}, block=${o}) — virtual=${!!this.virtualScroll}, mode=${this.presentationMode}`),this.scrollToRenderedIndex(e,{block:o}),!0):(H.debug(`[${this.instanceId}] scrollToIndex(${e}) → false (closed)`),!1)}scrollToValue(e,t){const o=this.filteredOptions.findIndex(i=>String(this.getItemValue(i))===String(e));return H.debug(`[${this.instanceId}] scrollToValue(${String(e)}) → index ${o} of ${this.filteredOptions.length}`),o<0?!1:this.scrollToIndex(o,t)}scrollToGroup(e,t){const o=(t==null?void 0:t.block)??"start";if(!h(this,R)||this.isTreeMode())return H.debug(`[${this.instanceId}] scrollToGroup(${e}) → false (${this.isTreeMode()?"tree mode":"closed"})`),!1;if(!this.virtualScroll){const r=this.dropdown.querySelector(`.ms__group-label[data-group="${CSS.escape(e)}"]`);if(r)return H.debug(`[${this.instanceId}] scrollToGroup(${e}) — header found, scrolling label into view (block=${o})`),this.applyScrollIntoView(r,{block:o}),!0}const i=this.filteredOptions.findIndex(r=>(this.getItemGroup(r)||"")===e);return H.debug(`[${this.instanceId}] scrollToGroup(${e}) — no header (virtual=${!!this.virtualScroll}), first member index ${i}`),i<0?!1:this.scrollToIndex(i,{block:o})}scrollToRenderedIndex(e,t,o=!1){if(!h(this,R)||e<0||e>=this.filteredOptions.length)return;if(this.virtualScroll){const r=(t==null?void 0:t.block)==="center"?"center":(t==null?void 0:t.block)==="nearest"?"nearest":"start";this.virtualScroll.scrollToIndex(e,r),H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) via virtual (block=${r})`);return}const i=this.dropdown.querySelector(`.ms__option[data-index="${e}"]`);if(i){this.applyScrollIntoView(i,t),H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) via DOM scrollIntoView`);return}o||(H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) not rendered yet — deferring one frame`),requestAnimationFrame(()=>this.scrollToRenderedIndex(e,t,!0)))}toggleOption(e){if(this.getItemDisabled(e)){H.debug(`[${this.instanceId}] toggleOption ignored — option is disabled`);return}if(!this.isOptionSelectable(e)){H.debug(`[${this.instanceId}] toggleOption ignored — node is not selectable`);return}const t=this.getItemValue(e),o=String(t);if(H.debug(`[${this.instanceId}] toggleOption called`,{value:t,multiple:this.options.isMultipleEnabled}),this.isCascadeMode()&&this.cascadeIndex){const n=this.cascadeIndex.nodeByValue.get(o);if(n){this.toggleTreeCascade(n),this.options.isCloseOnSelect&&this.close();return}}(this.selectedValues.has(o)?this.interactiveDeselect(e):this.interactiveSelect(e))&&(this.options.isMultipleEnabled?this.options.isCloseOnSelect&&this.close():this.close())}interactiveSelect(e){var o,i;const t=(i=(o=this.options).beforeSelectCallback)==null?void 0:i.call(o,e,this.getSelected());return t===!1||typeof t=="string"?(typeof t=="string"&&this.showMessage(t,{variant:"warning"}),H.debug(`[${this.instanceId}] Selection blocked by beforeSelectCallback`),!1):(this.options.isMultipleEnabled||(this.selectedValues.clear(),this.selectedOptions.clear()),this.selectOption(e),!0)}interactiveDeselect(e){var o,i;const t=(i=(o=this.options).beforeDeselectCallback)==null?void 0:i.call(o,e,this.getSelected());return t===!1||typeof t=="string"?(typeof t=="string"&&this.showMessage(t,{variant:"warning"}),H.debug(`[${this.instanceId}] Deselection blocked by beforeDeselectCallback`),!1):(this.deselectOption(e),!0)}async handleAddNew(e){var t,o;try{let i;if(this.options.addNewCallback){U.debug(`[${this.instanceId}] Adding new option:`,e),this.addNewFocused=!1,this.addNewPending=!0,this.renderDropdown();let r;try{r=await this.options.addNewCallback(e)}finally{this.addNewPending=!1}if(r==null){U.debug(`[${this.instanceId}] addNewCallback canceled creation for:`,e),this.renderDropdown();return}i=r,this.allOptions.push(i),this.searchTerm="",this.input.value="",this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.matchingIndices.clear(),this.focusedIndex=-1,this.addNewFocused=!1,this.resetVisibleToAll(),this.selectOption(i),this.updateFullscreenSearchClear()}(o=(t=this.options).onAddNew)==null||o.call(t,{value:e,option:i}),i&&this.options.isCloseOnSelect&&this.close()}catch(i){this.addNewPending=!1,U.error(`[${this.instanceId}] Error adding new option:`,i),this.renderDropdown()}}selectOption(e){const t=this.getItemValue(e),o=String(t);this.selectedValues.add(o),this.selectedOptions.set(o,e),this.commit({added:[e]})}deselectOption(e){const t=this.getItemValue(e),o=String(t);if(this.isCascadeMode()&&this.cascadeIndex){const i=this.cascadeIndex.nodeByValue.get(o);if(i){const r=this.cascadeIndex.atomsUnder.get(i.path)??[],n=new Set(at(this.cascadeIndex,this.selectedValues));for(const a of r)n.delete(a);this.commitCascadeAtoms(n);return}}this.selectedValues.delete(o),this.selectedOptions.delete(o),this.commit({removed:[e]})}selectAll(){if(this.isCascadeMode()&&this.cascadeIndex){const t=this.cascadeIndex,o=new Set(at(t,this.selectedValues));for(const i of this.treeNodes)t.atomPaths.has(i.path)&&(this.getItemDisabled(i.data)||o.add(String(this.getItemValue(i.data))));this.commitCascadeAtoms(o);return}const e=[];this.filteredOptions.forEach((t,o)=>{if(this.getItemDisabled(t)||!this.isIndexSelectable(o))return;const i=String(this.getItemValue(t));this.selectedValues.has(i)||(this.selectedValues.add(i),this.selectedOptions.set(i,t),e.push(t))}),this.commit({added:e})}clearAll(){const e=Array.from(this.selectedOptions.values());this.selectedValues.clear(),this.selectedOptions.clear(),this.commit({removed:e})}clearClick(){H.debug(`[${this.instanceId}] input clear (✕) clicked`),this.clearAll(),(this.searchTerm||this.input.value)&&this.clearSearch(),this.showSelectedPopover&&this.hideSelectedPopover(),this.justClosedViaClick=!0,this.input.focus(),setTimeout(()=>{this.justClosedViaClick=!1},0)}updateClearButton(){if(!this.clearButton)return;const e=!this.element.classList.contains("ms--disabled"),t=!!this.options.isClearShown&&this.selectedValues.size>0&&e;this.clearButton.style.display=t?"":"none"}commit(e){this.renderDropdown({preserveScroll:!0}),this.renderBadges(),this.updateHiddenInput();const t=e.added??[],o=e.removed??[];this.options.onSelect&&t.forEach(i=>this.options.onSelect(i)),this.options.onDeselect&&o.forEach(i=>this.options.onDeselect(i)),(t.length>0||o.length>0)&&this.options.onChange&&this.options.onChange(this.getSelected())}open(){var e;J.debug(`[${this.instanceId}] open() called`,{isOpen:h(this,R)}),!h(this,R)&&(this.justOpenedViaClick=!0,setTimeout(()=>{this.justOpenedViaClick=!1},0),this.hideMessage(),M(this,R,!0),this.element.classList.add("ms--open"),this.dropdown.classList.add("ms__dropdown--visible"),J.info(`[${this.instanceId}] Dropdown opened`),this.input.placeholder=this.getPlaceholderText(),!this.options.isMultipleEnabled&&this.options.isSearchEnabled&&(this.input.value=this.searchTerm),this.options.searchCallback&&this.options.isKeepOptionsOnSearch&&!this.searchTerm&&(this.filteredOptions=[...this.allOptions],J.debug(`[${this.instanceId}] Showing ${this.allOptions.length} initial options on open`)),this.presentationMode==="fullscreen"&&this.enterFullscreen(),this.renderDropdown(),this.presentationMode!=="fullscreen"&&this.positionDropdown(),this.dropdown.addEventListener("scroll",this.onDropdownScroll,!0),this.hint&&this.presentationMode==="floating"&&(this.hint.classList.add("ms__hint--visible"),this.positionHint()),(e=this.overlayCoord)==null||e.activate())}close(){var e;J.debug(`[${this.instanceId}] close() called`,{isOpen:h(this,R)}),h(this,R)&&(M(this,R,!1),this.element.classList.remove("ms--open"),this.dropdown.classList.remove("ms__dropdown--visible"),this.hint&&this.hint.classList.remove("ms__hint--visible"),this.options.shouldKeepSearchOnClose||(this.searchTerm="",(this.options.isMultipleEnabled||this.options.isSearchEnabled)&&(this.input.value=""),this.resetVisibleToAll()),this.focusedIndex=-1,this.dropdown.removeEventListener("scroll",this.onDropdownScroll,!0),this.destroyAllOptionTooltips(),this.hideLabelReveal(),this.hideMessage(),this.renderBadges(),this.dropdownCleanup&&(this.dropdownCleanup(),this.dropdownCleanup=null),this.hintCleanup&&(this.hintCleanup(),this.hintCleanup=null),this.exitFullscreen(),this.dropdownPlacement=null,(e=this.overlayCoord)==null||e.deactivate(),J.debug(`[${this.instanceId}] Dropdown closed`))}toggle(){h(this,R)?this.close():this.open()}get isOpen(){return h(this,R)}set isOpen(e){e?this.open():this.close()}anchorFloatingPanel(e,t){var r;const o=((r=t.isLocked)==null?void 0:r.call(t))??!0,i=it(e,this.inputWrapper,{strategy:"fixed",placement:"bottom-start",offset:4,shift:8,lockPlacement:o?"freeze":!1,fixedContainingBlock:!0,maxWidth:{padding:8},onDrift:n=>this.warnDrift(n),beforeCompute:()=>{(this.options.hostElement??this.element).style.setProperty("--ms-input-current-width",`${this.inputWrapper.offsetWidth}px`),this.options.dropdownMinWidth&&(e.style.minWidth=this.options.dropdownMinWidth)},onPlaced:n=>{var a;if(t.getPlacement()||t.setPlacement(n),t.applyMaxWidth&&this.options.dropdownMaxWidth){const l=e.style.maxWidth;e.style.maxWidth=l?`min(${this.options.dropdownMaxWidth}, ${l})`:this.options.dropdownMaxWidth}(a=t.afterPosition)==null||a.call(t)}});return()=>i.destroy()}warnDrift(e){this.positioningDriftWarned||(this.positioningDriftWarned=!0,console.warn(`[@keenmate/web-multiselect] Dropdown panel rendered ${e.driftX.toFixed(0)}px / ${e.driftY.toFixed(0)}px away from where the library positioned it. Most likely culprit: ${e.culpritDescription}`+(e.culpritCss?` (has ${e.culpritCss})`:"")+".\nAn ancestor of <web-multiselect> establishes a fixed-positioning containing block that the library's heuristic doesn't recognize. Fix on your side: replace the property with `transform: translateZ(0)` on that ancestor, OR move the trigger out of that ancestor's subtree. If neither is acceptable, please file an issue at https://github.com/keenmate/web-multiselect/issues with the ancestor's computed CSS."))}warnFullscreenContainingBlock(){if(this.fullscreenContainingBlockWarned||typeof window>"u")return;const e=ls(this.dropdown);if(e===window)return;this.fullscreenContainingBlockWarned=!0;const t=e,o=t.id?`#${t.id}`:"",i=t.classList.length?`.${Array.from(t.classList).join(".")}`:"",r=`<${t.tagName.toLowerCase()}${o}${i}>`,n=mo(t);console.warn(`[@keenmate/web-multiselect] Fullscreen overlay is anchored to an ancestor ${r}`+(n?` (has ${n})`:"")+` instead of the viewport, so it may not cover the screen (offset, clipped, or mis-sized).
|
|
18
|
-
An ancestor of <web-multiselect> establishes a fixed-positioning containing block (transform / perspective / filter / backdrop-filter / will-change). Fix on your side: move the component out of that ancestor's subtree, OR remove/replace that property. If neither is acceptable, please file an issue at https://github.com/keenmate/web-multiselect/issues with the ancestor's computed CSS.`)}positionDropdown(){this.presentationMode!=="fullscreen"&&(this.dropdownCleanup=this.anchorFloatingPanel(this.dropdown,{getPlacement:()=>this.dropdownPlacement,setPlacement:e=>{this.dropdownPlacement=e,J.debug(`[${this.instanceId}] Locked dropdown placement:`,e)},isLocked:()=>!!this.options.isPlacementLocked,applyMaxWidth:!0,afterPosition:()=>{this.hint&&h(this,R)&&this.positionHint()}}))}setPresentation(e){e!==this.presentationMode&&(this.presentationMode=e,h(this,R)?e==="fullscreen"?(this.dropdownCleanup&&(this.dropdownCleanup(),this.dropdownCleanup=null),this.hintCleanup&&(this.hintCleanup(),this.hintCleanup=null),this.hint&&this.hint.classList.remove("ms__hint--visible"),this.dropdownPlacement=null,this.enterFullscreen(),this.renderDropdown()):(this.exitFullscreen(),this.renderDropdown(),this.positionDropdown(),this.hint&&(this.hint.classList.add("ms__hint--visible"),this.positionHint())):this.showSelectedPopover&&(e==="fullscreen"?(this.selectedPopoverCleanup&&(this.selectedPopoverCleanup(),this.selectedPopoverCleanup=null),this.selectedPopoverPlacement=null,this.clearFloatingInlineGeometry(this.selectedPopover),this.selectedPopover.classList.add("ms__selected-popover--fullscreen"),this.lockBodyScroll()):(this.selectedPopover.classList.remove("ms__selected-popover--fullscreen"),this.unlockBodyScroll(),this.positionSelectedPopover())))}lockBodyScroll(){this.bodyScrollUnlock||(this.bodyScrollUnlock=Bi())}unlockBodyScroll(){this.bodyScrollUnlock&&(this.bodyScrollUnlock(),this.bodyScrollUnlock=null)}clampDocumentOverflowX(){if(this.overflowXClamp||typeof document>"u")return;const e=document.documentElement;this.overflowXClamp={html:e.style.overflowX},e.style.overflowX="hidden"}releaseDocumentOverflowX(){!this.overflowXClamp||typeof document>"u"||(document.documentElement.style.overflowX=this.overflowXClamp.html,this.overflowXClamp=null)}observeKeyboardInset(){this.keyboardInsetCleanup=Hi(this.dropdown)}unobserveKeyboardInset(){this.keyboardInsetCleanup&&(this.keyboardInsetCleanup(),this.keyboardInsetCleanup=null)}fullscreenScale(){if(this.presentationMode!=="fullscreen"||typeof getComputedStyle!="function")return 1;const e=this.options.hostElement??this.element,t=getComputedStyle(e),o=parseFloat(t.getPropertyValue("--ms-rem"))||10;return(parseFloat(t.getPropertyValue("--ms-fullscreen-rem"))||o*1.2)/o}scaledOptionHeight(){return Math.round((this.options.optionHeight??50)*this.fullscreenScale())}applyVirtualOptionsSizing(e){if(e.style.setProperty("--ms-option-height",`${this.scaledOptionHeight()}px`),this.presentationMode==="fullscreen")e.style.flex="1 1 0",e.style.minHeight="0",e.style.height="",e.style.maxHeight="";else{const t=this.options.maxHeight||"20rem";e.style.flex="",e.style.minHeight="",e.style.height=t,e.style.maxHeight=t}}scaledBadgeHeight(){const e=this.options.badgeHeight??36;return this.presentationMode!=="fullscreen"?e:Math.round(e*this.fullscreenScale()*1.2)}clearFloatingInlineGeometry(e){e.style.position="",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.transform="",e.style.maxWidth="",e.style.minWidth="",e.style.width=""}enterFullscreen(){var e;this.clearFloatingInlineGeometry(this.dropdown),this.dropdown.classList.add("ms__dropdown--fullscreen"),this.warnFullscreenContainingBlock(),this.buildFullscreenHeader(),this.lockBodyScroll(),this.clampDocumentOverflowX(),this.pushOverlayHistory(),this.observeKeyboardInset(),this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=this.searchTerm),this.updateFullscreenSearchClear(),this.options.fullscreenAutofocus?(e=this.fullscreenSearchInput)==null||e.focus():this.input.blur()}exitFullscreen(){this.unobserveKeyboardInset(),this.popOverlayHistory(),this.dropdown.classList.remove("ms__dropdown--fullscreen"),this.fullscreenHeader&&(this.fullscreenHeader.remove(),this.fullscreenHeader=null,this.fullscreenSearchInput=null,this.fullscreenSearchClear=null,this.fullscreenModeToggle=null,this.fullscreenNav=null,this.fullscreenNavCount=null,this.fullscreenNavPrev=null,this.fullscreenNavNext=null),this.unlockBodyScroll(),this.releaseDocumentOverflowX()}pushOverlayHistory(){this.overlayHistoryActive||typeof history>"u"||typeof window>"u"||(this.overlayHistoryActive=!0,history.pushState({msOverlay:this.instanceId},""),window.addEventListener("popstate",this.onOverlayPopstate))}handleOverlayPopstate(){this.overlayHistoryActive&&(this.overlayHistoryActive=!1,window.removeEventListener("popstate",this.onOverlayPopstate),h(this,R)?this.close():this.showSelectedPopover&&this.hideSelectedPopover())}popOverlayHistory(){this.overlayHistoryActive&&(this.overlayHistoryActive=!1,window.removeEventListener("popstate",this.onOverlayPopstate),history.back())}buildFullscreenHeader(){if(this.fullscreenHeader)return;const e=document.createElement("div");if(e.className="ms__fullscreen-header",this.options.isSearchEnabled&&this.options.searchInputMode!=="hidden"){const o=document.createElement("div");if(o.className="ms__fullscreen-search-wrapper",this.options.isSearchModeToggleShown){const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-mode-toggle",r.addEventListener("mousedown",n=>n.preventDefault()),r.addEventListener("click",()=>this.toggleSearchModeLive()),o.appendChild(r),this.fullscreenModeToggle=r}const i=document.createElement("input");if(i.type="text",i.className="ms__fullscreen-search",i.placeholder=this.getPlaceholderText(),i.autocomplete="off",this.options.searchInputMode==="readonly"&&(i.readOnly=!0),i.addEventListener("input",r=>{const n=r.target.value;this.input.value=n,this.handleSearch(n),this.updateFullscreenSearchClear()}),i.addEventListener("keydown",r=>this.handleKeydown(r)),o.appendChild(i),this.fullscreenSearchInput=i,this.options.searchInputMode!=="readonly"){const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-search-clear",r.setAttribute("aria-label","Clear search"),r.addEventListener("mousedown",n=>n.preventDefault()),r.addEventListener("click",()=>this.clearFullscreenSearch()),o.appendChild(r),this.fullscreenSearchClear=r}e.appendChild(o)}const t=document.createElement("button");t.type="button",t.className="ms__fullscreen-close",t.setAttribute("aria-label","Close"),t.addEventListener("click",()=>this.close()),e.appendChild(t),this.dropdown.insertBefore(e,this.dropdownInner),this.fullscreenHeader=e,this.options.isSearchEnabled&&(this.options.searchMode||"filter")==="navigate"&&this.ensureFullscreenNav(),this.updateFullscreenModeToggle(),this.updateFullscreenNav(),this.updateFullscreenSearchClear()}ensureFullscreenNav(){if(this.fullscreenNav||!this.fullscreenHeader)return;const e=document.createElement("div");e.className="ms__fullscreen-nav";const t=document.createElement("span");t.className="ms__fullscreen-nav-count",e.appendChild(t);const o=document.createElement("div");o.className="ms__fullscreen-nav-controls";const i=document.createElement("button");i.type="button",i.className="ms__fullscreen-nav-btn ms__fullscreen-nav-btn--prev",i.setAttribute("aria-label","Previous match"),i.addEventListener("click",()=>this.focusPreviousMatch());const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-nav-btn ms__fullscreen-nav-btn--next",r.setAttribute("aria-label","Next match"),r.addEventListener("click",()=>this.focusNextMatch()),o.appendChild(i),o.appendChild(r),e.appendChild(o),this.fullscreenHeader.appendChild(e),this.fullscreenNav=e,this.fullscreenNavCount=t,this.fullscreenNavPrev=i,this.fullscreenNavNext=r}removeFullscreenNav(){this.fullscreenNav&&(this.fullscreenNav.remove(),this.fullscreenNav=null,this.fullscreenNavCount=null,this.fullscreenNavPrev=null,this.fullscreenNavNext=null)}toggleSearchModeLive(){const e=(this.options.searchMode||"filter")==="navigate"?"filter":"navigate";this.setSearchModeLive(e)}setSearchModeLive(e){var t;(this.options.searchMode||"filter")!==e&&(this.options.searchMode=e,e==="navigate"?this.ensureFullscreenNav():this.removeFullscreenNav(),this.updateFullscreenModeToggle(),this.refreshSearchPlaceholder(),this.handleSearch(this.searchTerm),(t=this.fullscreenSearchInput)==null||t.focus())}updateFullscreenModeToggle(){if(!this.fullscreenModeToggle)return;const e=this.options.searchMode||"filter";this.fullscreenModeToggle.dataset.mode=e;const t=e==="navigate"?"filter":"navigate";this.fullscreenModeToggle.setAttribute("aria-label",`Switch to ${t} mode`),this.fullscreenModeToggle.setAttribute("title",`Switch to ${t} mode`),this.fullscreenModeToggle.setAttribute("aria-pressed",String(e==="navigate"))}updateFullscreenNav(){if(!this.fullscreenNav)return;const e=this.matchingIndices.size,t=!!this.searchTerm;if(this.fullscreenNav.style.display=t?"":"none",this.fullscreenNavCount)if(e===0)this.fullscreenNavCount.textContent=this.options.emptyMessage||"No matches";else{const r=Array.from(this.matchingIndices).sort((n,a)=>n-a).indexOf(this.focusedIndex);this.fullscreenNavCount.textContent=r>=0?`${r+1} of ${e}`:`${e} match${e===1?"":"es"}`}const o=e===0;this.fullscreenNavPrev&&(this.fullscreenNavPrev.disabled=o),this.fullscreenNavNext&&(this.fullscreenNavNext.disabled=o)}updateFullscreenSearchClear(){if(!this.fullscreenSearchClear)return;const e=!!(this.fullscreenSearchInput&&this.fullscreenSearchInput.value);this.fullscreenSearchClear.style.display=e?"":"none"}clearFullscreenSearch(){var e;this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.input.value="",this.handleSearch(""),this.updateFullscreenSearchClear(),(e=this.fullscreenSearchInput)==null||e.focus()}positionHint(){if(!this.hint)return;this.hintCleanup&&this.hintCleanup();let e="top-start";this.dropdownPlacement&&(this.dropdownPlacement.startsWith("bottom")?e=this.dropdownPlacement.replace("bottom","top"):this.dropdownPlacement.startsWith("top")&&(e=this.dropdownPlacement.replace("top","bottom")));const t=it(this.hint,this.inputWrapper,{strategy:"fixed",placement:e,offset:4,shift:8,flip:!1});this.hintCleanup=()=>t.destroy()}parseInitialSelection(){const e=this.element.dataset.initialValues;if(e)try{JSON.parse(e).forEach(o=>{this.selectedValues.add(String(o))}),this.reconcileSelectedOptions(),this.renderBadges()}catch(t){U.error(`[${this.instanceId}] Failed to parse initial values:`,t)}}reconcileSelectedOptions(){this.selectedValues.size===0||this.allOptions.length===0||this.selectedValues.forEach(e=>{if(this.selectedOptions.has(e))return;const t=this.allOptions.find(o=>String(this.getItemValue(o))===e);t&&this.selectedOptions.set(e,t)})}toggleSelectedPopover(){this.showSelectedPopover?this.hideSelectedPopover():this.showPopover()}showPopover(){if(J.debug(`[${this.instanceId}] showPopover() called`),!this.options.isSelectedPopoverEnabled){J.debug(`[${this.instanceId}] showPopover() suppressed (isSelectedPopoverEnabled=false)`);return}h(this,R)&&this.close(),this.hideMessage(),this.showSelectedPopover=!0,this.renderSelectedPopover(),this.selectedPopover.classList.add("ms__selected-popover--visible");const e=this.options.virtualScrollThreshold??100;this.selectedValues.size>=e&&this.selectedPopover.classList.add("ms__selected-popover--virtual"),this.presentationMode==="fullscreen"?(this.selectedPopover.classList.add("ms__selected-popover--fullscreen"),this.lockBodyScroll(),this.clampDocumentOverflowX(),this.pushOverlayHistory()):this.positionSelectedPopover()}hideSelectedPopover(){var e;J.debug(`[${this.instanceId}] hideSelectedPopover() called`),this.showSelectedPopover=!1,this.selectedPopover.classList.remove("ms__selected-popover--visible"),this.selectedPopover.classList.remove("ms__selected-popover--virtual"),this.selectedPopover.classList.remove("ms__selected-popover--fullscreen"),this.unlockBodyScroll(),this.releaseDocumentOverflowX(),this.popOverlayHistory(),this.hideMessage(),this.selectedPopoverPlacement=null,this.selectedPopoverVirtualScroll&&(this.selectedPopoverVirtualScroll.destroy(),this.selectedPopoverVirtualScroll=null,this.selectedPopoverContainer=null),this.selectedPopoverCleanup&&(this.selectedPopoverCleanup(),this.selectedPopoverCleanup=null);for(const t of Array.from(this.tooltips.keys()))t.startsWith("popover-")&&((e=this.tooltips.get(t))==null||e.destroy(),this.tooltips.delete(t))}renderSelectedPopover(){const e=Array.from(this.selectedOptions.values()),t=this.selectedValues.size,o=this.options.virtualScrollThreshold??100;if(t>=o){this.renderSelectedPopoverVirtual(e,t);return}this.selectedPopover.innerHTML=`
|
|
17
|
+
`}else this.badgesContainer.innerHTML="";this.attachBadgeTooltips()}attachEvents(){this.input.addEventListener("mousedown",e=>{e.stopPropagation(),h(this,R)?(this.justClosedViaClick=!0,this.close(),setTimeout(()=>{this.justClosedViaClick=!1},0)):(this.presentationMode==="fullscreen"&&e.preventDefault(),this.open())}),this.input.addEventListener("focus",()=>{!h(this,R)&&!this.justClosedViaClick&&this.open()}),this.input.addEventListener("input",e=>{const t=e.target.value;this.options.isSearchEnabled&&!h(this,R)&&this.open(),this.handleSearch(t)}),this.input.addEventListener("keydown",e=>this.handleKeydown(e)),this.documentClickHandler=e=>this.handleClickOutside(e),setTimeout(()=>{document.addEventListener("click",this.documentClickHandler)},0),this.overlayCoord=Xi(()=>this.close(),this.options.overlayGroup||void 0),this.documentKeydownHandler=e=>{e.key==="Escape"&&this.showSelectedPopover&&(e.preventDefault(),this.hideSelectedPopover())},document.addEventListener("keydown",this.documentKeydownHandler),this.dropdown.addEventListener("mousedown",e=>{if(this.presentationMode!=="fullscreen")return;e.target.closest(".ms__option")&&e.preventDefault()}),this.dropdown.addEventListener("touchmove",e=>{var t;this.presentationMode==="fullscreen"&&e.target.closest(".ms__options")&&((t=this.fullscreenSearchInput)==null||t.blur())},{passive:!0}),this.dropdown.addEventListener("click",e=>this.handleDropdownClick(e)),this.dropdownInner.addEventListener("wheel",e=>{if(this.virtualScroll)return;const t=e.currentTarget,o=t.scrollTop===0,i=t.scrollTop+t.clientHeight>=t.scrollHeight;(e.deltaY<0&&o||e.deltaY>0&&i)&&e.preventDefault(),e.stopPropagation()},{passive:!1}),this.badgesContainer.addEventListener("mousedown",e=>{e.target.closest('[data-action="show-selected"]')&&!this.showSelectedPopover&&e.stopPropagation()}),this.badgesContainer.addEventListener("click",e=>this.handleBadgeClick(e)),this.counter.addEventListener("mousedown",e=>{this.showSelectedPopover||e.stopPropagation()}),this.counter.addEventListener("click",e=>{e.stopPropagation(),this.toggleSelectedPopover()}),this.selectedPopover.addEventListener("click",e=>this.handleSelectedPopoverClick(e))}async handleSearch(e){if(this.searchTerm=e,this.addNewFocused=!1,!this.options.isSearchEnabled)return;let t=e;if(this.options.beforeSearchCallback){const o=this.options.beforeSearchCallback(e);if(o===null){U.debug(`[${this.instanceId}] beforeSearchCallback blocked search for term:`,e),this.abortInFlightSearch(),this.matchingIndices.clear(),this.isTreeMode()?(this.searchTerm="",this.rebuildTreeVisible()):this.filteredOptions=[...this.allOptions],this.renderDropdown();return}t=o,t!==e&&U.debug(`[${this.instanceId}] beforeSearchCallback transformed: "${e}" -> "${t}"`)}if(this.options.searchCallback){if(t.length<this.options.minSearchLength){this.abortInFlightSearch(),this.isLoading=!1,this.options.isKeepOptionsOnSearch?(this.isTreeMode()?this.rebuildTreeVisibleFromMatches(this.allOptions):this.filteredOptions=[...this.allOptions],U.debug(`[${this.instanceId}] Search term below minimum, showing ${this.allOptions.length} initial options`)):(this.filteredOptions=[],this.isTreeMode()&&(this.treeNodes=[])),this.matchingIndices.clear(),this.renderDropdown();return}this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=void 0);const o=this.options.searchDebounce||0;o>0?this.searchDebounceTimer=setTimeout(()=>{this.searchDebounceTimer=void 0,this.searchTerm===e&&this.performAsyncSearch(e,t)},o):await this.performAsyncSearch(e,t)}else{if(this.isTreeMode()){if((this.options.searchMode||"filter")==="navigate"){const o=this.rebuildTreeVisibleForNavigate();this.searchTerm.trim()?o>=0&&(this.focusedIndex=o):this.focusedIndex=-1,this.renderDropdown(),this.focusedIndex>=0&&this.scrollToFocused(),this.updateFullscreenNav();return}this.rebuildTreeVisible(),this.matchingIndices.clear(),this.focusedIndex=this.searchTerm.trim()&&this.filteredOptions.length>0?0:-1,this.renderDropdown();return}if(!t)this.filteredOptions=[...this.allOptions],this.matchingIndices.clear(),this.focusedIndex=-1;else{const o=this.options.searchMode||"filter",i=t.toLowerCase();if(o==="filter")this.filteredOptions=this.allOptions.filter(r=>this.getItemSearchValue(r).toLowerCase().includes(i)),this.matchingIndices.clear(),this.focusedIndex=this.filteredOptions.length>0?0:-1,U.debug(`[${this.instanceId}] Filter mode: ${this.filteredOptions.length} matches for "${t}"`);else{this.filteredOptions=[...this.allOptions],this.matchingIndices.clear();let r=-1;this.allOptions.forEach((n,a)=>{this.getItemSearchValue(n).toLowerCase().includes(i)&&(this.matchingIndices.add(a),r===-1&&(r=a))}),r>=0?(this.focusedIndex=r,U.debug(`[${this.instanceId}] Navigate mode: ${this.matchingIndices.size} matches, jumped to index ${r}`)):U.debug(`[${this.instanceId}] Navigate mode: No matches found, keeping previous focus`)}}this.renderDropdown(),this.options.searchMode==="navigate"&&this.focusedIndex>=0&&this.scrollToFocused(),this.updateFullscreenNav()}}abortInFlightSearch(){this.searchAbortController&&(this.searchAbortController.abort(),this.searchAbortController=void 0)}async performAsyncSearch(e,t){this.abortInFlightSearch();const o=new AbortController;this.searchAbortController=o,this.isLoading=!0,this.renderDropdown(),U.debug(`[${this.instanceId}] Loading data for search term:`,t);try{const i=await this.options.searchCallback(t,o.signal);if(o.signal.aborted||this.searchTerm!==e)return;const r=i||[];this.isTreeMode()?this.rebuildTreeVisibleFromMatches(r):this.filteredOptions=[...r],this.isLoading=!1,this.matchingIndices.clear(),this.focusedIndex=this.options.isSearchEnabled&&this.filteredOptions.length>0?0:-1,this.renderDropdown(),U.debug(`[${this.instanceId}] Loaded ${r.length} results`)}catch(i){if(o.signal.aborted)return;U.error(`[${this.instanceId}] Error loading data:`,i),this.isLoading=!1,this.options.isKeepOptionsOnSearch?this.isTreeMode()?this.rebuildTreeVisibleFromMatches(this.allOptions):this.filteredOptions=[...this.allOptions]:(this.filteredOptions=[],this.isTreeMode()&&(this.treeNodes=[])),this.matchingIndices.clear(),this.renderDropdown()}finally{this.searchAbortController===o&&(this.searchAbortController=void 0)}}handleKeydown(e){var t;if(!(this.options.keydownCallback&&this.options.keydownCallback({event:e,key:e.key,isOpen:h(this,R),presentation:this.presentationMode,searchTerm:this.searchTerm,focusedIndex:this.focusedIndex,focusedOption:(this.focusedIndex>=0?this.filteredOptions[this.focusedIndex]:null)??null,filteredOptions:this.filteredOptions,selectedValues:[...this.selectedValues],controller:this.getKeyboardController()})===!0)){if(!h(this,R)){(e.key==="Enter"||e.key==="ArrowDown")&&(e.preventDefault(),this.open());return}if(!this.options.isSearchEnabled){const o=e.key.length===1||e.key==="Backspace"||e.key==="Delete",i=["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Enter","Escape","Tab"].includes(e.key);if(o&&!i){e.preventDefault();return}}switch(e.key){case"ArrowDown":e.preventDefault(),this.isAddNewPromptShown()?this.focusAddNewPrompt():e.ctrlKey||e.metaKey?this.focusNextMatch():this.focusNext();break;case"ArrowUp":e.preventDefault(),this.isAddNewPromptShown()?this.focusAddNewPrompt():e.ctrlKey||e.metaKey?this.focusPreviousMatch():this.focusPrevious();break;case"Enter":e.preventDefault(),this.focusedIndex>=0?this.toggleOption(this.filteredOptions[this.focusedIndex]):this.options.isAddNewAllowed&&this.filteredOptions.length===0&&(this.searchTerm||"").trim()&&this.handleAddNew((this.searchTerm||"").trim()),this.presentationMode==="fullscreen"&&((t=this.fullscreenSearchInput)==null||t.blur());break;case"Escape":e.preventDefault(),this.showSelectedPopover?this.hideSelectedPopover():this.input.value?this.clearSearch():this.close();break;case"Tab":this.close();break;case"PageUp":e.preventDefault(),this.focusPageUp();break;case"PageDown":e.preventDefault(),this.focusPageDown();break;case"Home":case"End":{const o=e.target instanceof HTMLInputElement?e.target:null;let i;if(!o)i=!0;else if(o.selectionStart!==o.selectionEnd)i=!1;else{const r=o.selectionStart??0;i=e.key==="Home"?r===0:r===o.value.length}i&&(e.preventDefault(),e.key==="Home"?this.focusFirst():this.focusLast());break}}}}handleDropdownClick(e){var r,n;H.debug(`[${this.instanceId}] Dropdown clicked`,{target:e.target.className}),e.stopPropagation();const t=e.target.closest(".ms__option-info");if(t){e.preventDefault(),this.toggleLabelReveal(t);return}this.hideLabelReveal();const o=e.target.closest("[data-action]");if(o){e.preventDefault();const a=o.dataset.action;if(H.debug(`[${this.instanceId}] Action button clicked:`,a),a==="select-all")this.selectAll();else if(a==="clear-all")this.clearAll();else if(a==="add-new"){const l=(this.searchTerm||"").trim();l&&this.handleAddNew(l)}else if(a==="custom"){const l=parseInt(o.dataset.buttonIndex||"-1"),c=(r=this.options.actionButtons)==null?void 0:r[l];c!=null&&c.onClick&&c.onClick(this)}return}const i=e.target.closest(".ms__option");if(i&&!i.classList.contains("ms__option--disabled")){e.preventDefault();const a=i.dataset.value,l=this.filteredOptions.findIndex(c=>String(this.getItemValue(c))===a);H.debug(`[${this.instanceId}] Option clicked:`,{value:a,optionIndex:l,closeOnSelect:this.options.isCloseOnSelect,placeholder:this.options.searchPlaceholder}),l>=0&&(this.focusedIndex=l,this.toggleOption(this.filteredOptions[l]),h(this,R)&&this.presentationMode!=="fullscreen"?this.input.focus():this.presentationMode==="fullscreen"&&((n=this.fullscreenSearchInput)==null||n.blur()))}}handleBadgeClick(e){var n;if(e.target.closest('[data-action="clear-count"]')){e.preventDefault(),e.stopPropagation(),H.debug(`[${this.instanceId}] Clear count button clicked`),this.clearAll();return}if(e.target.closest('[data-action="show-selected"]')){e.preventDefault(),e.stopPropagation(),this.toggleSelectedPopover();return}const i=e.target.closest('.ms__badge-remove, [data-action="remove"]');if(i){if(e.preventDefault(),e.stopPropagation(),i.dataset.action==="remove-hidden"){H.debug(`[${this.instanceId}] Remove hidden items button clicked`);const c=this.options.badgesMaxVisible||3;Array.from(this.selectedOptions.values()).slice(c).forEach(f=>this.interactiveDeselect(f));return}const a=i.dataset.value??((n=i.closest("[data-value]"))==null?void 0:n.dataset.value)??"",l=this.selectedOptions.get(a);l&&this.interactiveDeselect(l);return}if(e.target.closest(".ms__badge--more")&&!e.target.closest(".ms__badge-remove")){e.preventDefault(),e.stopPropagation(),H.debug(`[${this.instanceId}] '+X more' badge clicked, showing popover`),this.toggleSelectedPopover();return}}handleClickOutside(e){var i;const t=e.composedPath();if(this.showSelectedPopover&&!t.some(n=>n instanceof Node&&(this.selectedPopover.contains(n)||this.counter.contains(n)||n.closest&&n.closest('[data-action="show-selected"]')))){J.debug(`[${this.instanceId}] Closing selected popover due to click outside`),this.hideSelectedPopover();return}if(!h(this,R)||this.justOpenedViaClick)return;const o=t.some(r=>r instanceof Node&&(this.element.contains(r)||this.dropdown.contains(r)||this.hint&&this.hint.contains(r)));H.debug(`[${this.instanceId}] handleClickOutside`,{target:e.target.className,targetTag:e.target.tagName,clickedInside:o,pathLength:t.length,firstInPath:(i=t[0])==null?void 0:i.tagName,elementContains:t.some(r=>r instanceof Node&&this.element.contains(r)),dropdownContains:t.some(r=>r instanceof Node&&this.dropdown.contains(r)),isConnected:this.dropdown.isConnected}),o||(H.warn(`[${this.instanceId}] Closing dropdown due to click outside`),this.close())}focusBy(e,t=1){const o=this.filteredOptions.length;if(o===0)return;const i=e(this.focusedIndex,o);if(i<0)return;const r=this.resolveSelectableIndex(i,t,o);r<0||(this.focusedIndex=r,this.renderDropdown(),this.scrollToFocused(),this.updateFullscreenNav())}resolveSelectableIndex(e,t,o){if(!this.isTreeMode())return e;let i=e;for(;i>=0&&i<o&&!this.isIndexSelectable(i);)i+=t;if(i<0||i>=o)for(i=e-t;i>=0&&i<o&&!this.isIndexSelectable(i);)i-=t;return i>=0&&i<o?i:-1}focusNext(){this.focusBy((e,t)=>Math.min(t-1,e+1),1)}focusPrevious(){this.focusBy(e=>Math.max(0,e-1),-1)}focusFirst(){this.focusBy(()=>0,1)}focusLast(){this.focusBy((e,t)=>t-1,-1)}focusPageUp(){this.focusBy(e=>Math.max(0,e-10),-1)}focusPageDown(){this.focusBy((e,t)=>Math.min(t-1,e+10),1)}focusAddNewPrompt(){this.addNewFocused||(this.addNewFocused=!0,this.renderDropdown())}focusNextMatch(){if(this.matchingIndices.size===0)return;const e=Array.from(this.matchingIndices).sort((i,r)=>i-r),t=e.findIndex(i=>i===this.focusedIndex),o=(t+1)%e.length;this.focusBy(()=>e[o]),H.debug(`[${this.instanceId}] Jumped to next match: index ${this.focusedIndex} (${t+1} of ${e.length})`)}focusPreviousMatch(){if(this.matchingIndices.size===0)return;const e=Array.from(this.matchingIndices).sort((i,r)=>i-r),t=e.findIndex(i=>i===this.focusedIndex),o=t<=0?e.length-1:t-1;this.focusBy(()=>e[o]),H.debug(`[${this.instanceId}] Jumped to previous match: index ${this.focusedIndex} (${t+1} of ${e.length})`)}getKeyboardController(){return this.keyboardController?this.keyboardController:(this.keyboardController={focusNext:()=>this.focusNext(),focusPrevious:()=>this.focusPrevious(),focusFirst:()=>this.focusFirst(),focusLast:()=>this.focusLast(),focusPageUp:()=>this.focusPageUp(),focusPageDown:()=>this.focusPageDown(),focusNextMatch:()=>this.focusNextMatch(),focusPreviousMatch:()=>this.focusPreviousMatch(),focusIndex:e=>this.focusBy(()=>e,1),toggleFocused:()=>{this.focusedIndex>=0&&this.toggleOption(this.filteredOptions[this.focusedIndex])},toggleValue:e=>{const t=this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},selectValue:e=>{if(this.selectedValues.has(String(e)))return;const t=this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},deselectValue:e=>{if(!this.selectedValues.has(String(e)))return;const t=this.selectedOptions.get(String(e))??this.allOptions.find(o=>String(this.getItemValue(o))===String(e));t&&this.toggleOption(t)},open:()=>this.open(),close:()=>this.close(),setSearch:e=>{this.input.value=e,this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=e),this.handleSearch(e)},clearSearch:()=>this.clearSearch()},this.keyboardController)}clearSearch(){this.input.value="",this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.searchTerm="",this.resetVisibleToAll(),this.matchingIndices.clear(),this.focusedIndex=-1,this.renderDropdown(),this.updateFullscreenNav(),this.updateFullscreenSearchClear()}search(e){const t=e??"";this.input.value=t,this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=t),this.handleSearch(t),this.updateFullscreenSearchClear()}scrollToFocused(){if(this.virtualScroll&&this.focusedIndex>=0){this.virtualScroll.scrollToIndex(this.focusedIndex,"nearest");return}const e=this.dropdown.querySelector(".ms__option--focused");e&&this.applyScrollIntoView(e)}applyScrollIntoView(e,t){this.presentationMode==="fullscreen"?e.scrollIntoView({block:(t==null?void 0:t.block)??"center",behavior:"auto"}):e.scrollIntoView({block:(t==null?void 0:t.block)??"nearest",behavior:"smooth"})}scrollToIndex(e,t){const o=(t==null?void 0:t.block)??"start";return h(this,R)?e<0||e>=this.filteredOptions.length?(H.debug(`[${this.instanceId}] scrollToIndex(${e}) → false (out of range, ${this.filteredOptions.length} options)`),!1):(H.debug(`[${this.instanceId}] scrollToIndex(${e}, block=${o}) — virtual=${!!this.virtualScroll}, mode=${this.presentationMode}`),this.armClickGuard(),this.scrollToRenderedIndex(e,{block:o}),!0):(H.debug(`[${this.instanceId}] scrollToIndex(${e}) → false (closed)`),!1)}scrollToValue(e,t){const o=this.filteredOptions.findIndex(i=>String(this.getItemValue(i))===String(e));return H.debug(`[${this.instanceId}] scrollToValue(${String(e)}) → index ${o} of ${this.filteredOptions.length}`),o<0?!1:this.scrollToIndex(o,t)}scrollToGroup(e,t){const o=(t==null?void 0:t.block)??"start";if(!h(this,R)||this.isTreeMode())return H.debug(`[${this.instanceId}] scrollToGroup(${e}) → false (${this.isTreeMode()?"tree mode":"closed"})`),!1;if(this.armClickGuard(),!this.virtualScroll){const r=this.dropdown.querySelector(`.ms__group-label[data-group="${CSS.escape(e)}"]`);if(r)return H.debug(`[${this.instanceId}] scrollToGroup(${e}) — header found, scrolling label into view (block=${o})`),this.applyScrollIntoView(r,{block:o}),!0}const i=this.filteredOptions.findIndex(r=>(this.getItemGroup(r)||"")===e);return H.debug(`[${this.instanceId}] scrollToGroup(${e}) — no header (virtual=${!!this.virtualScroll}), first member index ${i}`),i<0?!1:this.scrollToIndex(i,{block:o})}scrollToRenderedIndex(e,t,o=!1){if(!h(this,R)||e<0||e>=this.filteredOptions.length)return;if(this.virtualScroll){const r=(t==null?void 0:t.block)==="center"?"center":(t==null?void 0:t.block)==="nearest"?"nearest":"start";this.virtualScroll.scrollToIndex(e,r),H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) via virtual (block=${r})`);return}const i=this.dropdown.querySelector(`.ms__option[data-index="${e}"]`);if(i){this.applyScrollIntoView(i,t),H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) via DOM scrollIntoView`);return}o||(H.debug(`[${this.instanceId}] scrollToRenderedIndex(${e}) not rendered yet — deferring one frame`),requestAnimationFrame(()=>this.scrollToRenderedIndex(e,t,!0)))}toggleOption(e){if(this.getItemDisabled(e)){H.debug(`[${this.instanceId}] toggleOption ignored — option is disabled`);return}if(!this.isOptionSelectable(e)){H.debug(`[${this.instanceId}] toggleOption ignored — node is not selectable`);return}const t=this.getItemValue(e),o=String(t);if(H.debug(`[${this.instanceId}] toggleOption called`,{value:t,multiple:this.options.isMultipleEnabled}),this.isCascadeMode()&&this.cascadeIndex){const n=this.cascadeIndex.nodeByValue.get(o);if(n){this.toggleTreeCascade(n),this.options.isCloseOnSelect&&this.close();return}}const i=this.selectedValues.has(o);if(i&&!this.options.isMultipleEnabled){this.close();return}(i?this.interactiveDeselect(e):this.interactiveSelect(e))&&(this.options.isMultipleEnabled?this.options.isCloseOnSelect&&this.close():this.close())}interactiveSelect(e){var o,i;const t=(i=(o=this.options).beforeSelectCallback)==null?void 0:i.call(o,e,this.getSelected());return t===!1||typeof t=="string"?(typeof t=="string"&&this.showMessage(t,{variant:"warning"}),H.debug(`[${this.instanceId}] Selection blocked by beforeSelectCallback`),!1):(this.options.isMultipleEnabled||(this.selectedValues.clear(),this.selectedOptions.clear()),this.selectOption(e),!0)}interactiveDeselect(e){var o,i;const t=(i=(o=this.options).beforeDeselectCallback)==null?void 0:i.call(o,e,this.getSelected());return t===!1||typeof t=="string"?(typeof t=="string"&&this.showMessage(t,{variant:"warning"}),H.debug(`[${this.instanceId}] Deselection blocked by beforeDeselectCallback`),!1):(this.deselectOption(e),!0)}async handleAddNew(e){var t,o;try{let i;if(this.options.addNewCallback){U.debug(`[${this.instanceId}] Adding new option:`,e),this.addNewFocused=!1,this.addNewPending=!0,this.renderDropdown();let r;try{r=await this.options.addNewCallback(e)}finally{this.addNewPending=!1}if(r==null){U.debug(`[${this.instanceId}] addNewCallback canceled creation for:`,e),this.renderDropdown();return}i=r,this.allOptions.push(i),this.searchTerm="",this.input.value="",this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.matchingIndices.clear(),this.focusedIndex=-1,this.addNewFocused=!1,this.resetVisibleToAll(),this.selectOption(i),this.updateFullscreenSearchClear()}(o=(t=this.options).onAddNew)==null||o.call(t,{value:e,option:i}),i&&this.options.isCloseOnSelect&&this.close()}catch(i){this.addNewPending=!1,U.error(`[${this.instanceId}] Error adding new option:`,i),this.renderDropdown()}}selectOption(e){const t=this.getItemValue(e),o=String(t);this.selectedValues.add(o),this.selectedOptions.set(o,e),this.commit({added:[e]})}deselectOption(e){const t=this.getItemValue(e),o=String(t);if(this.isCascadeMode()&&this.cascadeIndex){const i=this.cascadeIndex.nodeByValue.get(o);if(i){const r=this.cascadeIndex.atomsUnder.get(i.path)??[],n=new Set(lt(this.cascadeIndex,this.selectedValues));for(const a of r)n.delete(a);this.commitCascadeAtoms(n);return}}this.selectedValues.delete(o),this.selectedOptions.delete(o),this.commit({removed:[e]})}selectAll(){if(this.isCascadeMode()&&this.cascadeIndex){const t=this.cascadeIndex,o=new Set(lt(t,this.selectedValues));for(const i of this.treeNodes)t.atomPaths.has(i.path)&&(this.getItemDisabled(i.data)||o.add(String(this.getItemValue(i.data))));this.commitCascadeAtoms(o);return}const e=[];this.filteredOptions.forEach((t,o)=>{if(this.getItemDisabled(t)||!this.isIndexSelectable(o))return;const i=String(this.getItemValue(t));this.selectedValues.has(i)||(this.selectedValues.add(i),this.selectedOptions.set(i,t),e.push(t))}),this.commit({added:e})}clearAll(){const e=Array.from(this.selectedOptions.values());this.selectedValues.clear(),this.selectedOptions.clear(),this.commit({removed:e})}clearClick(){H.debug(`[${this.instanceId}] input clear (✕) clicked`),this.clearAll(),(this.searchTerm||this.input.value)&&this.clearSearch(),this.showSelectedPopover&&this.hideSelectedPopover(),this.justClosedViaClick=!0,this.input.focus(),setTimeout(()=>{this.justClosedViaClick=!1},0)}updateClearButton(){if(!this.clearButton)return;const e=!this.element.classList.contains("ms--disabled"),t=!!this.options.isClearShown&&this.selectedValues.size>0&&e;this.clearButton.style.display=t?"":"none"}commit(e){this.renderDropdown({preserveScroll:!0}),this.renderBadges(),this.updateHiddenInput();const t=e.added??[],o=e.removed??[];this.options.onSelect&&t.forEach(i=>this.options.onSelect(i)),this.options.onDeselect&&o.forEach(i=>this.options.onDeselect(i)),(t.length>0||o.length>0)&&this.options.onChange&&this.options.onChange(this.getSelected())}armClickGuard(){this.justOpenedViaClick=!0,setTimeout(()=>{this.justOpenedViaClick=!1},0)}open(){var e;J.debug(`[${this.instanceId}] open() called`,{isOpen:h(this,R)}),this.armClickGuard(),!h(this,R)&&(this.hideMessage(),O(this,R,!0),this.element.classList.add("ms--open"),this.dropdown.classList.add("ms__dropdown--visible"),J.info(`[${this.instanceId}] Dropdown opened`),this.input.placeholder=this.getPlaceholderText(),!this.options.isMultipleEnabled&&this.options.isSearchEnabled&&(this.input.value=this.searchTerm),this.options.searchCallback&&this.options.isKeepOptionsOnSearch&&!this.searchTerm&&(this.filteredOptions=[...this.allOptions],J.debug(`[${this.instanceId}] Showing ${this.allOptions.length} initial options on open`)),this.presentationMode==="fullscreen"&&this.enterFullscreen(),this.renderDropdown(),this.presentationMode!=="fullscreen"&&this.positionDropdown(),this.dropdown.addEventListener("scroll",this.onDropdownScroll,!0),this.hint&&this.presentationMode==="floating"&&(this.hint.classList.add("ms__hint--visible"),this.positionHint()),(e=this.overlayCoord)==null||e.activate())}close(){var e;J.debug(`[${this.instanceId}] close() called`,{isOpen:h(this,R)}),h(this,R)&&(O(this,R,!1),this.element.classList.remove("ms--open"),this.dropdown.classList.remove("ms__dropdown--visible"),this.hint&&this.hint.classList.remove("ms__hint--visible"),this.options.shouldKeepSearchOnClose||(this.searchTerm="",(this.options.isMultipleEnabled||this.options.isSearchEnabled)&&(this.input.value=""),this.resetVisibleToAll()),this.focusedIndex=-1,this.dropdown.removeEventListener("scroll",this.onDropdownScroll,!0),this.destroyAllOptionTooltips(),this.hideLabelReveal(),this.hideMessage(),this.renderBadges(),this.dropdownCleanup&&(this.dropdownCleanup(),this.dropdownCleanup=null),this.hintCleanup&&(this.hintCleanup(),this.hintCleanup=null),this.exitFullscreen(),this.dropdownPlacement=null,(e=this.overlayCoord)==null||e.deactivate(),J.debug(`[${this.instanceId}] Dropdown closed`))}toggle(){h(this,R)?this.close():this.open()}get isOpen(){return h(this,R)}set isOpen(e){e?this.open():this.close()}anchorFloatingPanel(e,t){var r;const o=((r=t.isLocked)==null?void 0:r.call(t))??!0,i=rt(e,this.inputWrapper,{strategy:"fixed",placement:"bottom-start",offset:4,shift:8,lockPlacement:o?"freeze":!1,fixedContainingBlock:!0,maxWidth:{padding:8},onDrift:n=>this.warnDrift(n),beforeCompute:()=>{(this.options.hostElement??this.element).style.setProperty("--ms-input-current-width",`${this.inputWrapper.offsetWidth}px`),this.options.dropdownMinWidth&&(e.style.minWidth=this.options.dropdownMinWidth)},onPlaced:n=>{var a;if(t.getPlacement()||t.setPlacement(n),t.applyMaxWidth&&this.options.dropdownMaxWidth){const l=e.style.maxWidth;e.style.maxWidth=l?`min(${this.options.dropdownMaxWidth}, ${l})`:this.options.dropdownMaxWidth}(a=t.afterPosition)==null||a.call(t)}});return()=>i.destroy()}warnDrift(e){this.positioningDriftWarned||(this.positioningDriftWarned=!0,console.warn(`[@keenmate/web-multiselect] Dropdown panel rendered ${e.driftX.toFixed(0)}px / ${e.driftY.toFixed(0)}px away from where the library positioned it. Most likely culprit: ${e.culpritDescription}`+(e.culpritCss?` (has ${e.culpritCss})`:"")+".\nAn ancestor of <web-multiselect> establishes a fixed-positioning containing block that the library's heuristic doesn't recognize. Fix on your side: replace the property with `transform: translateZ(0)` on that ancestor, OR move the trigger out of that ancestor's subtree. If neither is acceptable, please file an issue at https://github.com/keenmate/web-multiselect/issues with the ancestor's computed CSS."))}warnFullscreenContainingBlock(){if(this.fullscreenContainingBlockWarned||typeof window>"u")return;const e=ds(this.dropdown);if(e===window)return;this.fullscreenContainingBlockWarned=!0;const t=e,o=t.id?`#${t.id}`:"",i=t.classList.length?`.${Array.from(t.classList).join(".")}`:"",r=`<${t.tagName.toLowerCase()}${o}${i}>`,n=fo(t);console.warn(`[@keenmate/web-multiselect] Fullscreen overlay is anchored to an ancestor ${r}`+(n?` (has ${n})`:"")+` instead of the viewport, so it may not cover the screen (offset, clipped, or mis-sized).
|
|
18
|
+
An ancestor of <web-multiselect> establishes a fixed-positioning containing block (transform / perspective / filter / backdrop-filter / will-change). Fix on your side: move the component out of that ancestor's subtree, OR remove/replace that property. If neither is acceptable, please file an issue at https://github.com/keenmate/web-multiselect/issues with the ancestor's computed CSS.`)}positionDropdown(){this.presentationMode!=="fullscreen"&&(this.dropdownCleanup=this.anchorFloatingPanel(this.dropdown,{getPlacement:()=>this.dropdownPlacement,setPlacement:e=>{this.dropdownPlacement=e,J.debug(`[${this.instanceId}] Locked dropdown placement:`,e)},isLocked:()=>!!this.options.isPlacementLocked,applyMaxWidth:!0,afterPosition:()=>{this.hint&&h(this,R)&&this.positionHint()}}))}setPresentation(e){e!==this.presentationMode&&(this.presentationMode=e,h(this,R)?e==="fullscreen"?(this.dropdownCleanup&&(this.dropdownCleanup(),this.dropdownCleanup=null),this.hintCleanup&&(this.hintCleanup(),this.hintCleanup=null),this.hint&&this.hint.classList.remove("ms__hint--visible"),this.dropdownPlacement=null,this.enterFullscreen(),this.renderDropdown()):(this.exitFullscreen(),this.renderDropdown(),this.positionDropdown(),this.hint&&(this.hint.classList.add("ms__hint--visible"),this.positionHint())):this.showSelectedPopover&&(e==="fullscreen"?(this.selectedPopoverCleanup&&(this.selectedPopoverCleanup(),this.selectedPopoverCleanup=null),this.selectedPopoverPlacement=null,this.clearFloatingInlineGeometry(this.selectedPopover),this.selectedPopover.classList.add("ms__selected-popover--fullscreen"),this.lockBodyScroll()):(this.selectedPopover.classList.remove("ms__selected-popover--fullscreen"),this.unlockBodyScroll(),this.positionSelectedPopover())))}lockBodyScroll(){this.bodyScrollUnlock||(this.bodyScrollUnlock=Fi())}unlockBodyScroll(){this.bodyScrollUnlock&&(this.bodyScrollUnlock(),this.bodyScrollUnlock=null)}clampDocumentOverflowX(){if(this.overflowXClamp||typeof document>"u")return;const e=document.documentElement;this.overflowXClamp={html:e.style.overflowX},e.style.overflowX="hidden"}releaseDocumentOverflowX(){!this.overflowXClamp||typeof document>"u"||(document.documentElement.style.overflowX=this.overflowXClamp.html,this.overflowXClamp=null)}observeKeyboardInset(){this.keyboardInsetCleanup=Ki(this.dropdown)}unobserveKeyboardInset(){this.keyboardInsetCleanup&&(this.keyboardInsetCleanup(),this.keyboardInsetCleanup=null)}fullscreenScale(){if(this.presentationMode!=="fullscreen"||typeof getComputedStyle!="function")return 1;const e=this.options.hostElement??this.element,t=getComputedStyle(e),o=parseFloat(t.getPropertyValue("--ms-rem"))||10;return(parseFloat(t.getPropertyValue("--ms-fullscreen-rem"))||o*1.2)/o}scaledOptionHeight(){return Math.round((this.options.optionHeight??50)*this.fullscreenScale())}applyVirtualOptionsSizing(e){if(e.style.setProperty("--ms-option-height",`${this.scaledOptionHeight()}px`),this.presentationMode==="fullscreen")e.style.flex="1 1 0",e.style.minHeight="0",e.style.height="",e.style.maxHeight="";else{const t=this.options.maxHeight||"20rem";e.style.flex="",e.style.minHeight="",e.style.height=t,e.style.maxHeight=t}}scaledBadgeHeight(){const e=this.options.badgeHeight??36;return this.presentationMode!=="fullscreen"?e:Math.round(e*this.fullscreenScale()*1.2)}clearFloatingInlineGeometry(e){e.style.position="",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.transform="",e.style.maxWidth="",e.style.minWidth="",e.style.width=""}enterFullscreen(){var e;this.clearFloatingInlineGeometry(this.dropdown),this.dropdown.classList.add("ms__dropdown--fullscreen"),this.warnFullscreenContainingBlock(),this.buildFullscreenHeader(),this.lockBodyScroll(),this.clampDocumentOverflowX(),this.pushOverlayHistory(),this.observeKeyboardInset(),this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=this.searchTerm),this.updateFullscreenSearchClear(),this.options.fullscreenAutofocus?(e=this.fullscreenSearchInput)==null||e.focus():this.input.blur()}exitFullscreen(){this.unobserveKeyboardInset(),this.popOverlayHistory(),this.dropdown.classList.remove("ms__dropdown--fullscreen"),this.fullscreenHeader&&(this.fullscreenHeader.remove(),this.fullscreenHeader=null,this.fullscreenSearchInput=null,this.fullscreenSearchClear=null,this.fullscreenModeToggle=null,this.fullscreenNav=null,this.fullscreenNavCount=null,this.fullscreenNavPrev=null,this.fullscreenNavNext=null),this.unlockBodyScroll(),this.releaseDocumentOverflowX()}pushOverlayHistory(){this.overlayHistoryActive||typeof history>"u"||typeof window>"u"||(this.overlayHistoryActive=!0,history.pushState({msOverlay:this.instanceId},""),window.addEventListener("popstate",this.onOverlayPopstate))}handleOverlayPopstate(){this.overlayHistoryActive&&(this.overlayHistoryActive=!1,window.removeEventListener("popstate",this.onOverlayPopstate),h(this,R)?this.close():this.showSelectedPopover&&this.hideSelectedPopover())}popOverlayHistory(){this.overlayHistoryActive&&(this.overlayHistoryActive=!1,window.removeEventListener("popstate",this.onOverlayPopstate),history.back())}buildFullscreenHeader(){if(this.fullscreenHeader)return;const e=document.createElement("div");if(e.className="ms__fullscreen-header",this.options.isSearchEnabled&&this.options.searchInputMode!=="hidden"){const o=document.createElement("div");if(o.className="ms__fullscreen-search-wrapper",this.options.isSearchModeToggleShown){const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-mode-toggle",r.addEventListener("mousedown",n=>n.preventDefault()),r.addEventListener("click",()=>this.toggleSearchModeLive()),o.appendChild(r),this.fullscreenModeToggle=r}const i=document.createElement("input");if(i.type="text",i.className="ms__fullscreen-search",i.placeholder=this.getPlaceholderText(),i.autocomplete="off",this.options.searchInputMode==="readonly"&&(i.readOnly=!0),i.addEventListener("input",r=>{const n=r.target.value;this.input.value=n,this.handleSearch(n),this.updateFullscreenSearchClear()}),i.addEventListener("keydown",r=>this.handleKeydown(r)),o.appendChild(i),this.fullscreenSearchInput=i,this.options.searchInputMode!=="readonly"){const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-search-clear",r.setAttribute("aria-label","Clear search"),r.addEventListener("mousedown",n=>n.preventDefault()),r.addEventListener("click",()=>this.clearFullscreenSearch()),o.appendChild(r),this.fullscreenSearchClear=r}e.appendChild(o)}const t=document.createElement("button");t.type="button",t.className="ms__fullscreen-close",t.setAttribute("aria-label","Close"),t.addEventListener("click",()=>this.close()),e.appendChild(t),this.dropdown.insertBefore(e,this.dropdownInner),this.fullscreenHeader=e,this.options.isSearchEnabled&&(this.options.searchMode||"filter")==="navigate"&&this.ensureFullscreenNav(),this.updateFullscreenModeToggle(),this.updateFullscreenNav(),this.updateFullscreenSearchClear()}ensureFullscreenNav(){if(this.fullscreenNav||!this.fullscreenHeader)return;const e=document.createElement("div");e.className="ms__fullscreen-nav";const t=document.createElement("span");t.className="ms__fullscreen-nav-count",e.appendChild(t);const o=document.createElement("div");o.className="ms__fullscreen-nav-controls";const i=document.createElement("button");i.type="button",i.className="ms__fullscreen-nav-btn ms__fullscreen-nav-btn--prev",i.setAttribute("aria-label","Previous match"),i.addEventListener("click",()=>this.focusPreviousMatch());const r=document.createElement("button");r.type="button",r.className="ms__fullscreen-nav-btn ms__fullscreen-nav-btn--next",r.setAttribute("aria-label","Next match"),r.addEventListener("click",()=>this.focusNextMatch()),o.appendChild(i),o.appendChild(r),e.appendChild(o),this.fullscreenHeader.appendChild(e),this.fullscreenNav=e,this.fullscreenNavCount=t,this.fullscreenNavPrev=i,this.fullscreenNavNext=r}removeFullscreenNav(){this.fullscreenNav&&(this.fullscreenNav.remove(),this.fullscreenNav=null,this.fullscreenNavCount=null,this.fullscreenNavPrev=null,this.fullscreenNavNext=null)}toggleSearchModeLive(){const e=(this.options.searchMode||"filter")==="navigate"?"filter":"navigate";this.setSearchModeLive(e)}setSearchModeLive(e){var t;(this.options.searchMode||"filter")!==e&&(this.options.searchMode=e,e==="navigate"?this.ensureFullscreenNav():this.removeFullscreenNav(),this.updateFullscreenModeToggle(),this.refreshSearchPlaceholder(),this.handleSearch(this.searchTerm),(t=this.fullscreenSearchInput)==null||t.focus())}updateFullscreenModeToggle(){if(!this.fullscreenModeToggle)return;const e=this.options.searchMode||"filter";this.fullscreenModeToggle.dataset.mode=e;const t=e==="navigate"?"filter":"navigate";this.fullscreenModeToggle.setAttribute("aria-label",`Switch to ${t} mode`),this.fullscreenModeToggle.setAttribute("title",`Switch to ${t} mode`),this.fullscreenModeToggle.setAttribute("aria-pressed",String(e==="navigate"))}updateFullscreenNav(){if(!this.fullscreenNav)return;const e=this.matchingIndices.size,t=!!this.searchTerm;if(this.fullscreenNav.style.display=t?"":"none",this.fullscreenNavCount)if(e===0)this.fullscreenNavCount.textContent=this.options.emptyMessage||"No matches";else{const r=Array.from(this.matchingIndices).sort((n,a)=>n-a).indexOf(this.focusedIndex);this.fullscreenNavCount.textContent=r>=0?`${r+1} of ${e}`:`${e} match${e===1?"":"es"}`}const o=e===0;this.fullscreenNavPrev&&(this.fullscreenNavPrev.disabled=o),this.fullscreenNavNext&&(this.fullscreenNavNext.disabled=o)}updateFullscreenSearchClear(){if(!this.fullscreenSearchClear)return;const e=!!(this.fullscreenSearchInput&&this.fullscreenSearchInput.value);this.fullscreenSearchClear.style.display=e?"":"none"}clearFullscreenSearch(){var e;this.fullscreenSearchInput&&(this.fullscreenSearchInput.value=""),this.input.value="",this.handleSearch(""),this.updateFullscreenSearchClear(),(e=this.fullscreenSearchInput)==null||e.focus()}positionHint(){if(!this.hint)return;this.hintCleanup&&this.hintCleanup();let e="top-start";this.dropdownPlacement&&(this.dropdownPlacement.startsWith("bottom")?e=this.dropdownPlacement.replace("bottom","top"):this.dropdownPlacement.startsWith("top")&&(e=this.dropdownPlacement.replace("top","bottom")));const t=rt(this.hint,this.inputWrapper,{strategy:"fixed",placement:e,offset:4,shift:8,flip:!1});this.hintCleanup=()=>t.destroy()}parseInitialSelection(){const e=this.element.dataset.initialValues;if(e)try{JSON.parse(e).forEach(o=>{this.selectedValues.add(String(o))}),this.reconcileSelectedOptions(),this.renderBadges()}catch(t){U.error(`[${this.instanceId}] Failed to parse initial values:`,t)}}reconcileSelectedOptions(){this.selectedValues.size===0||this.allOptions.length===0||this.selectedValues.forEach(e=>{if(this.selectedOptions.has(e))return;const t=this.allOptions.find(o=>String(this.getItemValue(o))===e);t&&this.selectedOptions.set(e,t)})}toggleSelectedPopover(){this.showSelectedPopover?this.hideSelectedPopover():this.showPopover()}showPopover(){if(J.debug(`[${this.instanceId}] showPopover() called`),!this.options.isSelectedPopoverEnabled){J.debug(`[${this.instanceId}] showPopover() suppressed (isSelectedPopoverEnabled=false)`);return}h(this,R)&&this.close(),this.hideMessage(),this.showSelectedPopover=!0,this.renderSelectedPopover(),this.selectedPopover.classList.add("ms__selected-popover--visible");const e=this.options.virtualScrollThreshold??100;this.selectedValues.size>=e&&this.selectedPopover.classList.add("ms__selected-popover--virtual"),this.presentationMode==="fullscreen"?(this.selectedPopover.classList.add("ms__selected-popover--fullscreen"),this.lockBodyScroll(),this.clampDocumentOverflowX(),this.pushOverlayHistory()):this.positionSelectedPopover()}hideSelectedPopover(){var e;J.debug(`[${this.instanceId}] hideSelectedPopover() called`),this.showSelectedPopover=!1,this.selectedPopover.classList.remove("ms__selected-popover--visible"),this.selectedPopover.classList.remove("ms__selected-popover--virtual"),this.selectedPopover.classList.remove("ms__selected-popover--fullscreen"),this.unlockBodyScroll(),this.releaseDocumentOverflowX(),this.popOverlayHistory(),this.hideMessage(),this.selectedPopoverPlacement=null,this.selectedPopoverVirtualScroll&&(this.selectedPopoverVirtualScroll.destroy(),this.selectedPopoverVirtualScroll=null,this.selectedPopoverContainer=null),this.selectedPopoverCleanup&&(this.selectedPopoverCleanup(),this.selectedPopoverCleanup=null);for(const t of Array.from(this.tooltips.keys()))t.startsWith("popover-")&&((e=this.tooltips.get(t))==null||e.destroy(),this.tooltips.delete(t))}renderSelectedPopover(){const e=Array.from(this.selectedOptions.values()),t=this.selectedValues.size,o=this.options.virtualScrollThreshold??100;if(t>=o){this.renderSelectedPopoverVirtual(e,t);return}this.selectedPopover.innerHTML=`
|
|
19
19
|
<div class="ms__selected-popover-header">
|
|
20
20
|
<span>Selected Items (${t})</span>
|
|
21
21
|
<button type="button" class="ms__selected-popover-close" aria-label="Close"></button>
|
|
@@ -29,17 +29,17 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
29
29
|
<button type="button" class="ms__selected-popover-close" aria-label="Close"></button>
|
|
30
30
|
</div>
|
|
31
31
|
<div class="ms__selected-popover-body ms__selected-popover-body--virtual" style="${l} overflow-y: auto; position: relative; --ms-badge-height-virtual: ${a}px;"></div>
|
|
32
|
-
`;this.selectedPopover.innerHTML=c,this.selectedPopoverContainer=this.selectedPopover.querySelector(".ms__selected-popover-body")}if(!this.selectedPopoverContainer)return;const o=this.scaledBadgeHeight(),i=Math.round(4*this.fullscreenScale()),r=o+i,n=this.options.virtualScrollBuffer??10;requestAnimationFrame(()=>{this.selectedPopoverContainer&&(this.selectedPopoverVirtualScroll?this.selectedPopoverVirtualScroll.setItems(e):this.selectedPopoverVirtualScroll=new
|
|
32
|
+
`;this.selectedPopover.innerHTML=c,this.selectedPopoverContainer=this.selectedPopover.querySelector(".ms__selected-popover-body")}if(!this.selectedPopoverContainer)return;const o=this.scaledBadgeHeight(),i=Math.round(4*this.fullscreenScale()),r=o+i,n=this.options.virtualScrollBuffer??10;requestAnimationFrame(()=>{this.selectedPopoverContainer&&(this.selectedPopoverVirtualScroll?this.selectedPopoverVirtualScroll.setItems(e):this.selectedPopoverVirtualScroll=new vo({container:this.selectedPopoverContainer,itemHeight:r,items:e,renderItem:a=>this.renderBadgeHTML(a,{displayMode:this.options.badgesDisplayMode||"badges",isInPopover:!0}),bufferSize:n,onVisibleRangeChange:()=>{this.attachBadgeTooltips(this.selectedPopoverContainer)}}))})}toHtml(e){return e==null?"":typeof e=="string"?e:e.outerHTML}classSuffix(e){return(e==null?[]:Array.isArray(e)?e:[e]).filter(Boolean).join(" ")}renderBadgeHTML(e,t){const o=this.getItemValue(e),i={...t,...Yt(this.presentationMode)};if(!t.isInPopover&&this.options.renderBadgeCallback){const d=this.toHtml(this.options.renderBadgeCallback(e,i));if(d.trim()!==""){const u=this.options.getBadgeClassCallback;let f="ms__badge ms__badge--custom";if(u){const m=this.classSuffix(u(e));m&&(f+=" "+m)}return`<div class="${f}" data-value="${o}">${d}</div>`}}let r;const n=t.isInPopover?this.options.renderSelectedItemContentCallback:void 0;n?r=this.toHtml(n(e)):this.options.renderBadgeContentCallback?r=this.toHtml(this.options.renderBadgeContentCallback(e,i)):r=this.getItemBadgeDisplayValue(e);const a=t.isInPopover?this.options.getSelectedItemClassCallback||this.options.getBadgeClassCallback:this.options.getBadgeClassCallback;let l="ms__badge";if(a){const d=this.classSuffix(a(e));d&&(l+=" "+d)}const c=this.getItemBadgeDisplayValue(e);return`
|
|
33
33
|
<div class="${l}">
|
|
34
34
|
<span class="ms__badge-text">${r}</span>
|
|
35
35
|
<button type="button" class="ms__badge-remove" data-value="${o}" aria-label="Remove ${c}"></button>
|
|
36
36
|
</div>
|
|
37
|
-
`}handleSelectedPopoverClick(e){if(e.stopPropagation(),e.target.closest(".ms__selected-popover-close")){e.preventDefault(),this.hideSelectedPopover();return}const o=e.target.closest(".ms__badge-remove");if(o){e.preventDefault();const i=o.dataset.value,r=this.selectedOptions.get(i);r&&this.interactiveDeselect(r)&&(this.renderSelectedPopover(),this.selectedValues.size===0&&this.hideSelectedPopover())}}positionSelectedPopover(){this.presentationMode!=="fullscreen"&&(this.selectedPopoverCleanup=this.anchorFloatingPanel(this.selectedPopover,{getPlacement:()=>this.selectedPopoverPlacement,setPlacement:e=>{this.selectedPopoverPlacement=e,J.debug(`[${this.instanceId}] Locked popover placement:`,e)}}))}updateHiddenInput(){if(!this.options.formFieldId)return;this.hiddenInputs.forEach(i=>i.remove()),this.hiddenInputs=[];const e=this.options.valueFormat||"json",t=Array.from(this.selectedOptions.values()).map(i=>this.getItemValue(i)),o=this.options.hostElement||this.element;if(e==="array")t.forEach(i=>{const r=document.createElement("input");r.type="hidden",r.name=`${this.options.formFieldId}[]`,r.value=String(i),o.appendChild(r),this.hiddenInputs.push(r)});else{const i=document.createElement("input");i.type="hidden",i.name=this.options.formFieldId,i.id=this.options.formFieldId,i.value=this.getFormValue(),o.appendChild(i),this.hiddenInputs.push(i)}}getFormValue(){const e=Array.from(this.selectedOptions.values()).map(o=>this.getItemValue(o));return this.options.getValueFormatCallback?this.options.getValueFormatCallback(e):(this.options.valueFormat||"json")==="csv"?e.join(","):JSON.stringify(e)}getSelected(){return Array.from(this.selectedOptions.values())}setSelected(e,t={}){this.selectedValues=new Set(e.map(o=>String(o))),this.selectedOptions.clear(),e.forEach(o=>{const i=String(o),r=this.allOptions.find(n=>String(this.getItemValue(n))===i);r&&this.selectedOptions.set(i,r)}),this.renderDropdown(),this.renderBadges(),this.updateHiddenInput(),t.notify&&this.options.onChange&&this.options.onChange(this.getSelected())}updateOptions(e){var n;const t=!!this.hint,o="searchHint"in e?!!e.searchHint:t;if(t!==o)return!1;Object.assign(this.options,e);const i="pathMember"in e||"getPathCallback"in e||"parentPathMember"in e||"levelMember"in e||"hasChildrenMember"in e||"treePathSeparator"in e||"isTreeEnabled"in e||"isSelectableMember"in e||"getIsSelectableCallback"in e;if("options"in e&&e.options!==void 0?(this.allOptions=e.options,this.reconcileSelectedOptions(),this.isTreeMode()?this.buildTree():this.filteredOptions=this.searchTerm?this.filteredOptions:[...this.allOptions]):i&&(this.isTreeMode()?this.buildTree():this.filteredOptions=this.searchTerm?this.filteredOptions:[...this.allOptions]),("checkboxMode"in e||"cascadeSelectPolicy"in e)&&!i&&!("options"in e)&&this.isTreeMode()&&(this.cascadeIndex=this.isCascadeMode()?
|
|
37
|
+
`}handleSelectedPopoverClick(e){if(e.stopPropagation(),e.target.closest(".ms__selected-popover-close")){e.preventDefault(),this.hideSelectedPopover();return}const o=e.target.closest(".ms__badge-remove");if(o){e.preventDefault();const i=o.dataset.value,r=this.selectedOptions.get(i);r&&this.interactiveDeselect(r)&&(this.renderSelectedPopover(),this.selectedValues.size===0&&this.hideSelectedPopover())}}positionSelectedPopover(){this.presentationMode!=="fullscreen"&&(this.selectedPopoverCleanup=this.anchorFloatingPanel(this.selectedPopover,{getPlacement:()=>this.selectedPopoverPlacement,setPlacement:e=>{this.selectedPopoverPlacement=e,J.debug(`[${this.instanceId}] Locked popover placement:`,e)}}))}updateHiddenInput(){if(!this.options.formFieldId)return;this.hiddenInputs.forEach(i=>i.remove()),this.hiddenInputs=[];const e=this.options.valueFormat||"json",t=Array.from(this.selectedOptions.values()).map(i=>this.getItemValue(i)),o=this.options.hostElement||this.element;if(e==="array")t.forEach(i=>{const r=document.createElement("input");r.type="hidden",r.name=`${this.options.formFieldId}[]`,r.value=String(i),o.appendChild(r),this.hiddenInputs.push(r)});else{const i=document.createElement("input");i.type="hidden",i.name=this.options.formFieldId,i.id=this.options.formFieldId,i.value=this.getFormValue(),o.appendChild(i),this.hiddenInputs.push(i)}}getFormValue(){const e=Array.from(this.selectedOptions.values()).map(o=>this.getItemValue(o));return this.options.getValueFormatCallback?this.options.getValueFormatCallback(e):(this.options.valueFormat||"json")==="csv"?e.join(","):JSON.stringify(e)}getSelected(){return Array.from(this.selectedOptions.values())}setSelected(e,t={}){this.selectedValues=new Set(e.map(o=>String(o))),this.selectedOptions.clear(),e.forEach(o=>{const i=String(o),r=this.allOptions.find(n=>String(this.getItemValue(n))===i);r&&this.selectedOptions.set(i,r)}),this.renderDropdown(),this.renderBadges(),this.updateHiddenInput(),t.notify&&this.options.onChange&&this.options.onChange(this.getSelected())}updateOptions(e){var n;const t=!!this.hint,o="searchHint"in e?!!e.searchHint:t;if(t!==o)return!1;Object.assign(this.options,e);const i="pathMember"in e||"getPathCallback"in e||"parentPathMember"in e||"levelMember"in e||"hasChildrenMember"in e||"treePathSeparator"in e||"isTreeEnabled"in e||"isSelectableMember"in e||"getIsSelectableCallback"in e;if("options"in e&&e.options!==void 0?(this.allOptions=e.options,this.reconcileSelectedOptions(),this.isTreeMode()?this.buildTree():this.filteredOptions=this.searchTerm?this.filteredOptions:[...this.allOptions]):i&&(this.isTreeMode()?this.buildTree():this.filteredOptions=this.searchTerm?this.filteredOptions:[...this.allOptions]),("checkboxMode"in e||"cascadeSelectPolicy"in e)&&!i&&!("options"in e)&&this.isTreeMode()&&(this.cascadeIndex=this.isCascadeMode()?_o(this.tree,a=>String(this.getItemValue(a))):null,this.isCascadeMode()&&this.cascadeIndex)){this.cascadeCheckedAtoms=lt(this.cascadeIndex,this.selectedValues);const a=us(this.cascadeIndex,this.cascadeCheckedAtoms,this.cascadePolicy(),c=>String(this.getItemValue(c))),l=new Map;for(const c of a){const d=((n=this.cascadeIndex.nodeByValue.get(c))==null?void 0:n.data)??this.selectedOptions.get(c);d!==void 0&&l.set(c,d)}this.selectedValues=new Set(a),this.selectedOptions=l}if(this.element.classList.toggle("ms--no-checkboxes",!this.options.isCheckboxesShown||!this.options.isMultipleEnabled),this.element.classList.toggle("ms--no-selected-popover",!this.options.isSelectedPopoverEnabled),"badgesPosition"in e){this.effectiveBadgesPosition=this.options.badgesPosition||"bottom",this.isRTL&&(this.effectiveBadgesPosition==="left"?this.effectiveBadgesPosition="right":this.effectiveBadgesPosition==="right"&&(this.effectiveBadgesPosition="left"));const a=this.element.querySelector(".ms__wrapper");a==null||a.classList.toggle("ms__wrapper--inline",this.effectiveBadgesPosition==="left"||this.effectiveBadgesPosition==="right")}return h(this,R)||(this.input.placeholder=this.getPlaceholderText()),"searchInputMode"in e&&(this.input.readOnly=this.options.searchInputMode==="readonly",this.input.style.display=this.options.searchInputMode==="hidden"?"none":""),"searchHint"in e&&this.hint&&(this.hint.textContent=this.options.searchHint||""),this.renderDropdown(),this.renderBadges(),this.updateHiddenInput(),!0}get selectedItem(){return this.selectedOptions.size===0?null:Array.from(this.selectedOptions.values())[0]}get searchText(){return this.searchTerm}get selectedValue(){if(!this.options.valueMember&&!this.options.getValueCallback)return null;if(this.selectedOptions.size===0)return this.options.isMultipleEnabled?[]:null;const e=Array.from(this.selectedOptions.values()).map(t=>this.getItemValue(t));return this.options.isMultipleEnabled?e:e[0]??null}getValue(){if(this.selectedOptions.size===0)return this.options.isMultipleEnabled?[]:null;const e=Array.from(this.selectedOptions.values()).map(t=>this.getItemValue(t));return this.options.isMultipleEnabled?e:e[0]??null}spawnTooltip(e){var r;(r=this.tooltips.get(e.id))==null||r.destroy();const t=this.element.getRootNode(),o=t instanceof ShadowRoot?t:null,i=rn({trigger:e.trigger,container:this.options.container??o??document.body,content:e.content,placement:e.placement??this.options.badgeTooltipPlacement??"top",offset:e.offsetDistance??this.options.badgeTooltipOffset??8,delay:{show:e.showDelay??this.options.badgeTooltipDelay??100,hide:100},cssClass:e.cssClass??"ms__badge-tooltip",visibleClass:e.visibleClass??"ms__badge-tooltip--visible",followCursor:e.followCursor,onBeforeShow:e.onBeforeShow});this.tooltips.set(e.id,i)}destroyAllTooltips(){this.tooltips.forEach(e=>e.destroy()),this.tooltips.clear()}buildBadgeTooltipContent(e){if(this.options.getBadgeTooltipCallback)return this.options.getBadgeTooltipCallback(e);const t=this.getItemBadgeDisplayValue(e),o=this.getItemSubtitle(e);return o?`${t}
|
|
38
38
|
${o}`:t}buildRemoveButtonTooltipText(e,t){return t&&this.options.getRemoveButtonTooltipCallback?this.options.getRemoveButtonTooltipCallback(t):this.options.removeButtonTooltipText?this.options.removeButtonTooltipText.replace("{0}",e):`Remove ${e}`}attachBadgeTooltips(e){if(!this.options.isBadgeTooltipsEnabled)return;const t=!!e,o=e||this.badgesContainer,i=t?"popover-":"";if(o.querySelectorAll(".ms__badge:not(.ms__badge--more)").forEach(n=>{const a=n.querySelector(".ms__badge-remove");if(!a)return;const l=a.dataset.value,c=this.selectedOptions.get(l);if(!c)return;const d=`${i}${l}`,u=`${i}${l}-remove`,f=n.querySelector(".ms__badge-text");f&&this.spawnTooltip({id:d,trigger:f,content:this.buildBadgeTooltipContent(c)});const m=this.getItemBadgeDisplayValue(c);this.spawnTooltip({id:u,trigger:a,content:this.buildRemoveButtonTooltipText(m,c),onBeforeShow:()=>{var g;return(g=this.tooltips.get(d))==null?void 0:g.hide()}})}),!t){const n=this.badgesContainer.querySelector(".ms__badge--more"),a=n==null?void 0:n.querySelector(".ms__badge-remove");if(a&&a.dataset.action==="remove-hidden"){const l=this.options.badgesMaxVisible||3,c=this.selectedOptions.size-l;this.spawnTooltip({id:"more-badge-remove",trigger:a,content:this.buildRemoveButtonTooltipText(`${c} hidden items`)})}}}buildOptionTooltipContent(e){if(this.options.getOptionTooltipCallback)return this.options.getOptionTooltipCallback(e);const t=this.getItemDisplayValue(e),o=this.getItemSubtitle(e);return o?`${t}
|
|
39
|
-
${o}`:t}attachOptionTooltips(){if(this.destroyAllOptionTooltips(),!this.options.isOptionTooltipsEnabled)return;this.dropdown.querySelectorAll(".ms__option").forEach(t=>{const o=t,i=parseInt(o.dataset.index??"-1",10);if(i<0)return;const r=this.filteredOptions[i];if(!r)return;const n=this.buildOptionTooltipContent(r);n&&this.spawnTooltip({id:`option-${i}`,trigger:o,content:n,placement:this.options.optionTooltipPlacement??"top-start",offsetDistance:this.options.optionTooltipOffset??this.options.badgeTooltipOffset??8,showDelay:this.options.optionTooltipDelay??this.options.badgeTooltipDelay??100,cssClass:"ms__option-tooltip",visibleClass:"ms__option-tooltip--visible",followCursor:this.options.isOptionTooltipFollowCursor})})}markTruncatedOptions(){if(this.presentationMode!=="fullscreen")return;this.dropdown.querySelectorAll(".ms__option").forEach(t=>{const o=t,i=o.querySelector(".ms__option-title"),r=!!i&&i.scrollWidth>i.clientWidth+1;o.classList.toggle("ms__option--truncated",r)})}toggleLabelReveal(e){var d;if(this.labelRevealPopover&&this.labelRevealTrigger===e){this.hideLabelReveal();return}this.hideLabelReveal();const t=e.closest(".ms__option");if(!t)return;const o=parseInt(t.dataset.index??"-1",10);if(o<0)return;const i=this.isTreeMode()?(d=this.treeNodes[o])==null?void 0:d.data:this.filteredOptions[o];if(!i)return;const r=this.buildOptionTooltipContent(i);if(!r)return;const n=document.createElement("div");n.className="ms__option-tooltip ms__option-tooltip--fullscreen",typeof r=="string"?n.textContent=r:n.appendChild(r);const a=this.element.getRootNode(),l=a instanceof ShadowRoot?a:null,c=this.options.container??l??document.body;this.labelRevealTrigger=e,this.labelRevealPanel=n,this.labelRevealPopover=
|
|
40
|
-
`;function
|
|
41
|
-
`:e==="\\t"?" ":e==="\\r"?"\r":"\\")}function fn(s){let e;try{e=JSON.parse(s)}catch(t){return{options:[],error:`data-options is not valid JSON: ${t.message}`}}return Array.isArray(e)?{options:e}:{options:[],error:"data-options JSON must be an array"}}function gn(s,e,t){return{options:s.split(t).flatMap(i=>i.split(e)).map(i=>i.trim()).filter(i=>i.length>0).map(i=>[i,i])}}function bn(s,e,t){const o=vn(s,e,t).filter(n=>!(n.length===1&&n[0].trim()===""));if(o.length<2)return{options:[],error:"data-options CSV needs a header row and at least one data row"};const i=o[0].map(n=>n.trim());return{options:o.slice(1).map(n=>{const a={};return i.forEach((l,c)=>{a[l]=(n[c]??"").trim()}),a})}}function vn(s,e,t){const o=[];let i=[],r="",n=!1;for(let a=0;a<s.length;){const l=s[a];if(n){l==='"'?s[a+1]==='"'?(r+='"',a+=2):(n=!1,a+=1):(r+=l,a+=1);continue}l==='"'?(n=!0,a+=1):s.startsWith(e,a)?(i.push(r),r="",a+=e.length):s.startsWith(t,a)?(i.push(r),o.push(i),i=[],r="",a+=t.length):(l==="\r"||(r+=l),a+=1)}return i.push(r),o.push(i),o}const Io=`@layer variables,component,overrides;@layer variables{:host{display:block;--ms-rem: var(--base-rem, 10px);font-family:var(--ms-font-family, var(--base-font-family, inherit));--ms-accent-color: var(--base-accent-color, #3b82f6);--ms-accent-color-hover: var(--base-accent-color-hover, #2563eb);--ms-accent-color-active: var(--base-accent-color-active, #1d4ed8);--ms-accent-color-light: var(--base-accent-color-light, light-dark(#eff6ff, #1e3a5f));--ms-accent-color-light-hover: var(--base-accent-color-light-hover, light-dark(#e0f2fe, #264a73));--ms-text-color-1: var(--base-text-color-1, light-dark(#111827, #f5f5f5));--ms-text-color-2: var(--base-text-color-2, light-dark(#353b47, #d4d4d4));--ms-text-color-3: var(--base-text-color-3, light-dark(#6b7280, #a3a3a3));--ms-text-color-4: var(--base-text-color-4, light-dark(#a0a3a9, #737373));--ms-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--ms-text-primary: var(--ms-text-color-1);--ms-text-secondary: var(--ms-text-color-3);--ms-primary-bg: var(--base-hover-bg, color-mix(in srgb, var(--ms-text-color-1) 8%, var(--base-main-bg, light-dark(#ffffff, #1a1a1a))));--ms-primary-bg-hover: var(--base-active-bg, color-mix(in srgb, var(--ms-text-color-1) 14%, var(--base-main-bg, light-dark(#ffffff, #1a1a1a))));--ms-border-color: var(--base-border-color, light-dark(#cbd5e1, #52525b));--ms-border: var(--base-border, 1px solid var(--ms-border-color));--ms-input-bg: var(--base-input-bg, light-dark(#ffffff, #1a1a1a));--ms-input-color: var(--base-input-color, var(--ms-text-color-1));--ms-input-border: var(--base-input-border, 1px solid var(--ms-border-color));--ms-input-border-hover: var(--base-input-border-hover, 1px solid var(--ms-accent-color));--ms-input-border-focus: var(--base-input-border-focus, 1px solid var(--ms-accent-color));--ms-input-placeholder-color: var(--base-input-placeholder-color, var(--ms-text-color-4));--ms-toggle-icon-color: var(--ms-text-color-3);--ms-toggle-icon-color-open: var(--ms-text-color-3);--ms-toggle-icon-size: calc(1.6 * var(--ms-rem));--ms-toggle-rotate-closed: 90deg;--ms-toggle-rotate-open: -90deg;--ms-counter-badge-bg: var(--ms-accent-color);--ms-counter-badge-bg-hover: var(--ms-accent-color-hover);--ms-counter-badge-color: var(--ms-text-color-on-accent);--ms-hint-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-hint-color: var(--ms-text-color-4);--ms-hint-border-color: var(--ms-border-color);--ms-dropdown-bg: var(--base-dropdown-bg, var(--base-elevated-bg, light-dark(#ffffff, #1a1a1a)));--ms-dropdown-text-color: var(--ms-text-color-1);--ms-dropdown-border-color: var(--ms-border-color);--ms-dropdown-box-shadow-semantic: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-actions-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-actions-border-color: var(--ms-border-color);--ms-action-button-bg: transparent;--ms-action-button-bg-hover: var(--ms-primary-bg);--ms-action-button-border-color: var(--ms-border-color);--ms-action-button-border-color-hover: var(--ms-accent-color);--ms-action-button-color: var(--ms-text-color-1);--ms-group-border-color: var(--ms-border-color);--ms-option-text-color: var(--ms-text-color-1);--ms-option-bg: transparent;--ms-option-bg-hover: var(--ms-primary-bg);--ms-option-color-hover: inherit;--ms-option-bg-focused: var(--ms-primary-bg);--ms-option-color-focused: inherit;--ms-option-outline-color-focused: var(--ms-accent-color);--ms-option-bg-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-option-bg-matched: color-mix(in srgb, var(--ms-accent-color) 8%, transparent);--ms-option-color-matched: inherit;--ms-option-border-matched-color: color-mix(in srgb, var(--ms-accent-color) 40%, transparent);--ms-option-title-color: var(--ms-text-color-1);--ms-option-subtitle-color: var(--ms-text-color-3);--ms-option-mark-bg: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-option-mark-color: inherit;--ms-loading-color: var(--ms-text-color-3);--ms-badge-bg: var(--ms-accent-color-light);--ms-badge-bg-hover: color-mix(in srgb, var(--ms-badge-bg) 88%, var(--ms-badge-text-color) 12%);--ms-badge-bg-active: var(--ms-accent-color-light-hover);--ms-badge-text-bg-hover: color-mix(in srgb, var(--ms-badge-text-bg) 88%, var(--ms-badge-text-color) 12%);--ms-badge-text-color-hover: var(--ms-badge-text-color);--ms-badge-counter-border-color: var(--ms-border-color);--ms-badge-counter-text-bg: color-mix(in srgb, var(--ms-text-color-1) 10%, transparent);--ms-badge-counter-text-bg-hover: color-mix(in srgb, var(--ms-text-color-1) 16%, transparent);--ms-badge-counter-text-color: var(--ms-text-color-1);--ms-badge-counter-text-color-hover: var(--ms-text-color-1);--ms-badge-counter-remove-bg: color-mix(in srgb, var(--ms-text-color-1) 10%, transparent);--ms-badge-counter-remove-bg-hover: color-mix(in srgb, var(--ms-text-color-1) 16%, transparent);--ms-badge-counter-remove-color: var(--ms-text-color-3);--ms-badge-counter-remove-color-hover: var(--ms-text-color-1);--ms-counter-wrapper-border-color: var(--ms-border-color);--ms-tooltip-bg: var(--base-tooltip-bg, var(--base-inverse-bg, light-dark(#333333, #f5f5f5)));--ms-tooltip-text-color: var(--base-tooltip-text-color, light-dark(#ffffff, #1a1a1a));--ms-selected-popover-bg: var(--base-dropdown-bg, var(--base-elevated-bg, light-dark(#ffffff, #1a1a1a)));--ms-selected-popover-border-color: var(--ms-border-color);--ms-selected-popover-header-border-color: var(--ms-border-color);--ms-input-padding-h: calc(1.2 * var(--ms-rem));--ms-input-gap: calc(.6 * var(--ms-rem));--ms-input-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-border-width: 1px;--ms-input-border-radius: var(--ms-border-radius-md);--ms-input-text: var(--ms-text-color-1);--ms-input-bg-disabled: var(--base-input-bg-disabled, rgba(107, 114, 128, .05));--ms-toggle-color: var(--ms-text-color-3);--ms-transform-rotate-180: 180deg;--ms-input-clear-size: calc(2.4 * var(--ms-rem));--ms-input-clear-icon-size: calc(1.4 * var(--ms-rem));--ms-input-clear-color: var(--base-input-clear-color, var(--ms-text-secondary));--ms-input-clear-bg-hover: var(--base-input-clear-bg-hover, var(--ms-option-bg-matched, transparent));--ms-input-clear-border-radius: var(--ms-border-radius);--ms-counter-padding: calc(.2 * var(--ms-rem)) calc(.4 * var(--ms-rem));--ms-counter-bg: var(--ms-accent-color);--ms-counter-color: var(--ms-text-color-on-accent);--ms-counter-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-counter-font-weight: var(--base-font-weight-semibold, 600);--ms-counter-border-radius: var(--ms-border-radius-sm);--ms-counter-bg-hover: var(--ms-accent-color-hover);--ms-transform-scale-hover: 1.1;--ms-hint-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-hint-border: 1px solid var(--ms-hint-border-color);--ms-hint-border-radius: var(--ms-border-radius-lg);--ms-hint-box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ms-hint-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-dropdown-border: var(--base-dropdown-border, 1px solid var(--ms-dropdown-border-color));--ms-dropdown-border-radius: var(--ms-border-radius-lg);--ms-dropdown-inner-border-radius: max(0px, calc(var(--ms-dropdown-border-radius) - 1px));--ms-dropdown-box-shadow: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-input-current-width: auto;--ms-dropdown-width: var(--ms-input-current-width);--ms-options-max-height: calc(32 * var(--ms-rem));--ms-option-color: var(--ms-text-color-1);--ms-z-index-dropdown: 9999;--ms-z-index-sticky: 1;--ms-z-index-fullscreen: 10001;--ms-z-index-fullscreen-tooltip: 10002;--ms-fullscreen-rem: 12px;--ms-fullscreen-bg: var(--ms-dropdown-bg);--ms-fullscreen-text-color: var(--ms-dropdown-text-color);--ms-fullscreen-header-bg: var(--ms-dropdown-bg);--ms-fullscreen-header-border: 1px solid var(--ms-dropdown-border-color);--ms-fullscreen-header-gap: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding-v: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding-h: calc(1.2 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding: var(--ms-fullscreen-header-padding-v) var(--ms-fullscreen-header-padding-h);--ms-fullscreen-header-min-height: calc(5.6 * var(--ms-fullscreen-rem));--ms-fullscreen-title-font-size: calc(1.7 * var(--ms-fullscreen-rem));--ms-fullscreen-title-font-weight: var(--base-font-weight-semibold, 600);--ms-fullscreen-search-border: var(--ms-input-border);--ms-fullscreen-search-border-radius: var(--ms-input-border-radius);--ms-fullscreen-search-padding: calc(.8 * var(--ms-fullscreen-rem)) calc(1.2 * var(--ms-fullscreen-rem));--ms-fullscreen-search-font-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-icon-size: calc(1.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-inset: calc(.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-gutter: calc(3.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-search-clear-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-mode-toggle-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-mode-toggle-icon-size: calc(1.5 * var(--ms-fullscreen-rem));--ms-fullscreen-mode-toggle-gap: var(--ms-fullscreen-header-gap);--ms-fullscreen-mode-toggle-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-mode-toggle-bg: transparent;--ms-fullscreen-mode-toggle-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-close-size: calc(3.6 * var(--ms-fullscreen-rem));--ms-fullscreen-close-icon-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-close-color: var(--ms-dropdown-text-color);--ms-fullscreen-close-bg: transparent;--ms-fullscreen-close-border: none;--ms-fullscreen-close-border-radius: 50%;--ms-fullscreen-close-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-close-edge-nudge: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-icon-size: calc(1.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-color: var(--ms-accent-color);--ms-fullscreen-info-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-nav-gap: calc(.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-padding-top: calc(.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-count-font-size: calc(1.3 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-count-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-nav-btn-size: calc(3.2 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-btn-icon-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-btn-color: var(--ms-dropdown-text-color);--ms-fullscreen-nav-btn-bg: var(--ms-option-bg-matched, transparent);--ms-fullscreen-nav-btn-bg-hover: color-mix(in srgb, var(--ms-accent-color) 22%, transparent);--ms-fullscreen-nav-btn-icon: var(--ms-icon-chevron);--ms-icon-chevron: var(--base-icon-chevron, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>"));--ms-icon-info: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/><circle cx='12' cy='7.5' r='1.3' fill='black'/><path d='M12 11v6' stroke='black' stroke-width='2' stroke-linecap='round' fill='none'/></svg>");--ms-fullscreen-tree-base-indent: calc(.7 * var(--ms-fullscreen-rem));--ms-fullscreen-tree-indent: calc(1.2 * var(--ms-fullscreen-rem));--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem));--ms-actions-border-bottom: 1px solid var(--ms-actions-border-color);--ms-action-btn-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-action-btn-border: var(--ms-border);--ms-action-btn-border-radius: var(--ms-border-radius-sm);--ms-action-btn-bg: transparent;--ms-action-btn-color: inherit;--ms-action-btn-bg-hover: var(--ms-primary-bg);--ms-action-btn-border-color-hover: var(--ms-accent-color);--ms-transform-scale-active: .98;--ms-options-padding: 0;--ms-group-border-top: 1px solid var(--ms-group-border-color);--ms-group-margin-top: calc(.4 * var(--ms-rem));--ms-group-padding-top: calc(.4 * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-font-weight: var(--base-font-weight-semibold, 600);--ms-group-label-color: var(--ms-text-color-3);--ms-group-label-transform: uppercase;--ms-group-label-letter-spacing: .05em;--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-padding-h: calc(1.2 * var(--ms-rem));--ms-option-min-height: auto;--ms-option-outline-focused: 2px solid var(--ms-option-outline-color-focused);--ms-option-focus-outline-offset: -2px;--ms-option-border-matched: 3px solid var(--ms-option-border-matched-color);--ms-option-bg-focused-hover: var(--ms-primary-bg);--ms-option-bg-matched-hover: color-mix(in srgb, var(--ms-accent-color) 12%, transparent);--ms-option-bg-selected-focused: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-bg-selected-matched: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-disabled-bg: var(--base-disabled-bg, transparent);--ms-option-bg-disabled-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-disabled-opacity: .5;--ms-option-content-gap: calc(.8 * var(--ms-rem));--ms-option-icon-size: calc(2 * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-mark-font-weight: var(--base-font-weight-semibold, 600);--ms-option-title-white-space: normal;--ms-option-title-overflow: visible;--ms-option-title-text-overflow: clip;--ms-option-subtitle-margin-top: calc(.4 * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-subtitle-line-height: var(--base-line-height-tight, 1.25);--ms-checkbox-margin-top: 0;--ms-checkbox-margin-right: 0;--ms-checkbox-margin-bottom: 0;--ms-checkbox-margin-left: 0;--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-checkbox-scale: 1;--ms-checkbox-align: center;--ms-checkbox-bg: var(--ms-input-bg);--ms-checkbox-border-width: 1px;--ms-checkbox-border-color: var(--base-checkbox-border-color, #8f8f8f);--ms-checkbox-border: var(--ms-checkbox-border-width) solid var(--ms-checkbox-border-color);--ms-checkbox-border-radius: calc(.3 * var(--ms-rem));--ms-checkbox-checkmark-thickness: 2.5px;--ms-checkbox-checked-bg: var(--ms-accent-color);--ms-checkbox-checked-border: var(--ms-checkbox-border-width) solid var(--ms-accent-color);--ms-checkbox-checkmark-color: var(--ms-text-color-on-accent);--ms-checkbox-hover-border-color: var(--ms-accent-color);--ms-checkbox-disabled-bg: var(--ms-primary-bg);--ms-checkbox-disabled-border: var(--ms-checkbox-border-width) solid var(--ms-border-color);--ms-checkbox-checked-bg-hover: var(--ms-accent-color-hover);--ms-checkbox-checked-border-color-hover: var(--ms-accent-color-hover);--ms-state-min-height: calc(8 * var(--ms-rem));--ms-empty-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-empty-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-empty-color: var(--ms-text-color-3);--ms-add-new-padding: var(--ms-option-padding);--ms-add-new-gap: var(--ms-option-gap);--ms-add-new-font-size: var(--ms-empty-font-size);--ms-add-new-color: var(--ms-accent-color);--ms-add-new-color-hover: var(--ms-accent-color);--ms-add-new-bg-hover: var(--ms-option-bg-hover);--ms-add-new-icon-size: calc(1.6 * var(--ms-rem));--ms-loader-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-loader-gap: calc(.8 * var(--ms-rem));--ms-loading-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-loading-text-color: var(--ms-text-color-3);--ms-badges-gap: calc(.8 * var(--ms-rem));--ms-badges-margin-bottom: calc(.8 * var(--ms-rem));--ms-badges-margin-top: calc(.8 * var(--ms-rem));--ms-badges-margin-left: calc(.4 * var(--ms-rem));--ms-badges-margin-right: calc(.4 * var(--ms-rem));--ms-inline-align: center;--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(2.7 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-font-weight: var(--base-font-weight-semibold, 600);--ms-badge-border-radius: var(--ms-border-radius-sm);--ms-order-first: -1;--ms-badge-text-padding: 0 calc(.8 * var(--ms-rem));--ms-badge-text-bg: var(--ms-accent-color-light);--ms-badge-text-color: var(--ms-accent-color);--ms-badge-text-border: none;--ms-badge-remove-width: calc(2.7 * var(--ms-rem));--ms-badge-remove-bg: var(--ms-accent-color);--ms-badge-remove-color: var(--ms-text-color-on-accent);--ms-badge-remove-border: none;--ms-badge-remove-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-remove-bg-hover: var(--ms-accent-color-hover);--ms-badge-remove-box-shadow-focus: 0 0 0 2px color-mix(in srgb, var(--ms-accent-color) 50%, transparent);--ms-badge-remove-icon-size: calc(1.4 * var(--ms-rem));--ms-icon-remove: var(--base-icon-remove, var(--base-icon-close, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>")));--ms-icon-search-clear: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m13.5 8.5-5 5'/><path d='m8.5 8.5 5 5'/><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");--ms-icon-search: var(--base-icon-search, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>"));--ms-icon-filter: var(--base-icon-filter, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/></svg>"));--ms-icon-check: var(--base-icon-check, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"));--ms-icon-indeterminate: var(--base-icon-indeterminate, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/></svg>"));--ms-icon-add-new: var(--base-icon-plus, var(--base-icon-add, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='M12 5v14'/></svg>")));--ms-badge-counter-bg: transparent;--ms-badge-counter-border: 1px solid var(--ms-badge-counter-border-color);--ms-badge-counter-border-radius: var(--ms-border-radius-sm);--ms-more-badge-bg: var(--ms-accent-color-light);--ms-more-badge-hover-bg: var(--ms-badge-bg-hover);--ms-more-badge-active-bg: var(--ms-accent-color-light-hover);--ms-count-display-margin-bottom: calc(.8 * var(--ms-rem));--ms-count-display-margin-top: calc(.8 * var(--ms-rem));--ms-count-display-margin-left: calc(.8 * var(--ms-rem));--ms-count-display-margin-right: calc(.8 * var(--ms-rem));--ms-counter-wrapper-bg: transparent;--ms-counter-wrapper-border: var(--ms-border);--ms-counter-wrapper-border-radius: var(--ms-border-radius-sm);--ms-counter-wrapper-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-counter-wrapper-gap: calc(.4 * var(--ms-rem));--ms-counter-wrapper-bg-hover: var(--ms-primary-bg);--ms-counter-wrapper-border-color-hover: var(--ms-accent-color);--ms-count-text-bg: transparent;--ms-count-text-border: none;--ms-count-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-count-text-color: var(--ms-text-color-1);--ms-count-clear-size: calc(1.6 * var(--ms-rem));--ms-count-clear-bg: transparent;--ms-count-clear-color: var(--ms-text-color-3);--ms-count-clear-font-size: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-count-clear-border-radius: var(--ms-border-radius-sm);--ms-count-clear-bg-hover: var(--ms-accent-color);--ms-count-clear-color-hover: var(--ms-text-color-on-accent);--ms-count-clear-icon-size: calc(1.4 * var(--ms-rem));--ms-icon-clear: var(--base-icon-clear, var(--ms-icon-remove));--ms-tooltip-color: var(--ms-tooltip-text-color);--ms-tooltip-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tooltip-border-radius: var(--ms-border-radius-lg);--ms-tooltip-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-tooltip-max-width: calc(32 * var(--ms-rem));--ms-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ms-tooltip-z-index: 10000;--ms-option-tooltip-bg: var(--ms-tooltip-bg);--ms-option-tooltip-text-color: var(--ms-tooltip-text-color);--ms-option-tooltip-padding: var(--ms-tooltip-padding);--ms-option-tooltip-border-radius: var(--ms-tooltip-border-radius);--ms-option-tooltip-font-size: var(--ms-tooltip-font-size);--ms-option-tooltip-max-width: var(--ms-tooltip-max-width);--ms-option-tooltip-shadow: var(--ms-tooltip-shadow);--ms-option-tooltip-z-index: var(--ms-tooltip-z-index);--ms-message-bg: var(--ms-message-info-bg);--ms-message-color: var(--ms-message-info-color);--ms-message-border: 1px solid transparent;--ms-message-border-radius: var(--ms-border-radius-lg);--ms-message-padding: calc(1 * var(--ms-rem)) calc(1.4 * var(--ms-rem));--ms-message-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-message-font-weight: var(--base-font-weight-medium, 500);--ms-message-max-width: calc(40 * var(--ms-rem));--ms-message-shadow: 0 4px 16px rgb(0 0 0 / .18);--ms-message-fullscreen-offset: calc(2.4 * var(--ms-fullscreen-rem));--ms-message-z-index: var(--ms-z-index-fullscreen-tooltip);--ms-message-info-bg: var(--ms-tooltip-bg);--ms-message-info-color: var(--ms-tooltip-text-color);--ms-message-warning-bg: var(--base-warning-bg, #f59e0b);--ms-message-warning-color: var(--base-warning-color, #1a1a1a);--ms-message-error-bg: var(--base-danger-bg, #ef4444);--ms-message-error-color: var(--base-danger-color, #ffffff);--ms-message-success-bg: var(--base-success-bg, #10b981);--ms-message-success-color: var(--base-success-color, #ffffff);--ms-z-index-popover: 10000;--ms-selected-popover-width: var(--ms-input-current-width);--ms-selected-popover-max-height: calc(32 * var(--ms-rem));--ms-selected-popover-border: 1px solid var(--ms-selected-popover-border-color);--ms-selected-popover-border-radius: var(--ms-border-radius-lg);--ms-selected-popover-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-selected-popover-header-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-selected-popover-header-bg: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-selected-popover-header-border-bottom: 1px solid var(--ms-selected-popover-header-border-color);--ms-selected-popover-header-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-selected-popover-header-font-weight: var(--base-font-weight-semibold, 600);--ms-selected-popover-header-color: var(--ms-text-color-1);--ms-popover-close-size: calc(2.4 * var(--ms-rem));--ms-selected-popover-close-bg: transparent;--ms-selected-popover-close-color: var(--ms-text-color-3);--ms-selected-popover-close-font-size: calc(var(--base-font-size-xl, 2) * var(--ms-rem));--ms-selected-popover-close-border-radius: var(--ms-border-radius-sm);--ms-selected-popover-close-bg-hover: var(--ms-accent-color);--ms-selected-popover-close-color-hover: var(--ms-text-color-on-accent);--ms-selected-popover-close-icon-size: calc(1.4 * var(--ms-rem));--ms-selected-popover-body-gap: calc(.4 * var(--ms-rem));--ms-selected-popover-body-padding: calc(.8 * var(--ms-rem));--ms-selected-popover-body-max-height: calc(28.8 * var(--ms-rem));--ms-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--ms-rem));--ms-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-font-weight-normal: var(--base-font-weight-normal, 400);--ms-font-weight-medium: var(--base-font-weight-medium, 500);--ms-font-weight-semibold: var(--base-font-weight-semibold, 600);--ms-line-height-none: 1;--ms-line-height-tight: var(--base-line-height-tight, 1.25);--ms-line-height-normal: var(--base-line-height-normal, 1.5);--ms-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--ms-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--ms-rem));--ms-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--ms-rem));--ms-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--ms-rem));--ms-border-radius: var(--ms-border-radius-md);--ms-spacing-xs: calc(.4 * var(--ms-rem));--ms-spacing-sm: calc(.8 * var(--ms-rem));--ms-spacing-md: calc(1.2 * var(--ms-rem));--ms-spacing-lg: calc(1.6 * var(--ms-rem));--ms-transition-fast: .15s;--ms-transition-normal: .2s;--ms-easing-snappy: var(--base-ease-standard, cubic-bezier(.4, 0, .2, 1));--ms-placeholder-opacity: .6;--ms-disabled-input-opacity: .6;--ms-scrollbar-width: 8px;--ms-scrollbar-track-bg: transparent;--ms-scrollbar-thumb-bg: var(--ms-border-color);--ms-scrollbar-thumb-bg-hover: var(--ms-text-color-3);--ms-scrollbar-thumb-border-radius: 4px;--ms-debug-bg: var(--base-elevated-bg, light-dark(#f9fafb, #2b2b2b));--ms-debug-border-color: var(--ms-border-color);--ms-debug-text-color: var(--ms-text-color-1);--ms-debug-border-radius: var(--ms-border-radius-md);--ms-debug-summary-color: var(--ms-accent-color);--ms-debug-summary-bg-hover: var(--ms-primary-bg);--ms-debug-summary-outline-color: var(--ms-accent-color);--ms-debug-summary-border-radius: var(--ms-border-radius-sm);--ms-debug-stats-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-debug-stats-border-radius: var(--ms-border-radius-sm);--ms-debug-bullet-color: var(--ms-accent-color)}}@layer component{web-multiselect:not(:defined){display:block;min-height:calc(3.5 * var(--ms-rem));color:transparent!important;background:transparent}:host{-webkit-tap-highlight-color:transparent}.ms__wrapper{display:flex;flex-direction:column;align-items:stretch}.ms__wrapper--inline{flex-direction:row;align-items:var(--ms-inline-align, center)}.ms{position:relative;width:100%}}@layer component{.ms__input-wrapper{box-sizing:border-box;position:relative;display:flex;align-items:center;gap:var(--ms-input-gap);height:var(--ms-input-height);padding-inline:var(--ms-input-padding-h);background:var(--ms-input-bg);color:var(--ms-input-color);border:var(--ms-input-border);border-radius:var(--ms-input-border-radius);cursor:pointer;transition:border var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input-wrapper:hover:not(:focus-within){border:var(--ms-input-border-hover)}.ms__input-wrapper:focus-within{border:var(--ms-input-border-focus)}.ms__input{flex:1 1 auto;min-width:0;box-sizing:border-box;font-family:inherit;height:100%;padding:0;border:none;background:transparent;font-size:var(--ms-input-font-size);color:var(--ms-input-color);cursor:pointer;outline:none}.ms__input::placeholder{color:var(--ms-input-placeholder-color);opacity:0;transition:opacity var(--ms-transition-fast) var(--ms-easing-snappy)}:host([data-ready]) .ms__input::placeholder{opacity:var(--ms-placeholder-opacity)}.ms__toggle{flex:0 0 auto;display:block;width:var(--ms-toggle-icon-size);height:var(--ms-toggle-icon-size);color:var(--ms-toggle-icon-color);cursor:pointer}.ms__toggle:before{content:"";display:block;width:100%;height:100%;background-color:currentColor;-webkit-mask:var(--ms-icon-chevron) center / contain no-repeat;mask:var(--ms-icon-chevron) center / contain no-repeat;transform:rotate(var(--ms-toggle-rotate-closed, 90deg));transition:transform var(--ms-transition-fast) var(--ms-easing-snappy)}.ms--open .ms__toggle{color:var(--ms-toggle-icon-color-open)}.ms--open .ms__toggle:before{transform:rotate(var(--ms-toggle-rotate-open, -90deg))}.ms__counter{flex:0 0 auto;padding:var(--ms-counter-padding);background:var(--ms-counter-badge-bg);color:var(--ms-counter-badge-color);font-size:var(--ms-counter-font-size);font-weight:var(--ms-counter-font-weight);border-radius:var(--ms-counter-border-radius);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter:hover{background:var(--ms-counter-badge-bg-hover);transform:scale(var(--ms-transform-scale-hover))}.ms__input-clear{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-input-clear-size);height:var(--ms-input-clear-size);padding:0;color:var(--ms-input-clear-color);background:transparent;border:none;border-radius:var(--ms-input-clear-border-radius);cursor:pointer;transition:background var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input-clear:hover{background:var(--ms-input-clear-bg-hover)}.ms__input-clear:before{content:"";display:block;width:var(--ms-input-clear-icon-size);height:var(--ms-input-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-clear) center / contain no-repeat;mask:var(--ms-icon-clear) center / contain no-repeat}.ms__actions{display:flex;flex-direction:column;gap:var(--ms-actions-gap);padding:var(--ms-actions-padding)}.ms__actions--top{border-bottom:var(--ms-actions-border-bottom)}.ms__actions--bottom{flex-direction:column-reverse;border-top:var(--ms-actions-border-bottom)}.ms__actions-row{display:flex;flex-wrap:nowrap;gap:var(--ms-actions-gap)}.ms__actions--wrap .ms__actions-row{flex-wrap:wrap}.ms__actions--sticky{position:sticky;z-index:var(--ms-z-index-sticky);background:var(--ms-actions-bg)}.ms__actions--sticky.ms__actions--top{top:0}.ms__actions--sticky.ms__actions--bottom{bottom:0}.ms__actions--align-stretch .ms__action-btn{flex:1}.ms__actions--align-left .ms__actions-row{justify-content:flex-start}.ms__actions--align-right .ms__actions-row{justify-content:flex-end}.ms__actions--align-center .ms__actions-row{justify-content:center}.ms__actions--align-space-between .ms__actions-row{justify-content:space-between}.ms__action-btn{font-family:inherit;padding:var(--ms-action-btn-padding);font-size:var(--ms-action-btn-font-size);border:var(--ms-action-btn-border);border-radius:var(--ms-action-btn-border-radius);background:var(--ms-action-button-bg);color:var(--ms-action-button-color);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}@media (hover: hover){.ms__action-btn:hover{background:var(--ms-action-button-bg-hover);border-color:var(--ms-action-button-border-color-hover)}}.ms__action-btn:active{transform:scale(var(--ms-transform-scale-active))}.ms__action-btn:disabled,.ms__action-btn[disabled]{opacity:var(--ms-disabled-opacity);cursor:not-allowed;pointer-events:none}}@layer component{.ms__hint{display:none;position:fixed;z-index:var(--ms-z-index-popover);padding:var(--ms-hint-padding);background:var(--ms-hint-bg);border:var(--ms-hint-border);border-radius:var(--ms-hint-border-radius);box-shadow:var(--ms-hint-box-shadow);font-size:var(--ms-hint-font-size);color:var(--ms-hint-color);line-height:var(--ms-line-height-relaxed);max-width:100%}.ms__hint--visible{display:block}.ms__dropdown{display:none;position:fixed;box-sizing:border-box;font-family:inherit;z-index:var(--ms-z-index-dropdown);background:var(--ms-dropdown-bg);border:var(--ms-dropdown-border);border-radius:var(--ms-dropdown-border-radius);box-shadow:var(--ms-dropdown-box-shadow);width:var(--ms-dropdown-width);max-height:var(--ms-options-max-height);overflow:hidden;color:var(--ms-dropdown-text-color)}.ms__dropdown--visible{display:flex;flex-direction:column}.ms__dropdown--fullscreen,.ms__selected-popover--fullscreen{--ms-rem: var(--ms-fullscreen-rem);--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tree-base-indent: var(--ms-fullscreen-tree-base-indent);--ms-tree-indent: var(--ms-fullscreen-tree-indent)}.ms__selected-popover--fullscreen{--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(4.2 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-badge-text-padding: 0 calc(1.2 * var(--ms-rem));--ms-badge-remove-width: calc(3.6 * var(--ms-rem));--ms-badge-remove-icon-size: calc(1.2 * var(--ms-rem));--ms-badge-remove-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem))}.ms__dropdown--fullscreen{--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-action-btn-padding: calc(.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem))}.ms__dropdown--fullscreen{position:fixed;top:0;inset-inline-start:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border:none;border-radius:0;--ms-dropdown-inner-border-radius: 0;background:var(--ms-fullscreen-bg);color:var(--ms-fullscreen-text-color);z-index:var(--ms-z-index-fullscreen);box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.ms__dropdown--fullscreen .ms__dropdown-inner{display:flex;flex-direction:column;flex:1;min-height:0;max-height:none;overflow:hidden}.ms__dropdown--fullscreen .ms__options{flex:1 1 0;min-height:0;height:auto;max-height:none;overflow-y:auto;padding-bottom:var(--ms-option-gap)}.ms__dropdown--fullscreen .ms__actions{flex:0 0 auto}.ms__fullscreen-header,.ms__selected-popover--fullscreen .ms__selected-popover-header{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:var(--ms-fullscreen-header-gap);min-height:var(--ms-fullscreen-header-min-height);padding:var(--ms-fullscreen-header-padding);background:var(--ms-fullscreen-header-bg);border-bottom:var(--ms-fullscreen-header-border)}.ms__fullscreen-header{align-content:flex-start}.ms__fullscreen-header>.ms__fullscreen-search-wrapper{min-height:var(--ms-fullscreen-header-min-height)}.ms__fullscreen-nav{flex:0 0 100%;display:flex;align-items:center;justify-content:space-between;gap:var(--ms-fullscreen-nav-gap);padding-top:var(--ms-fullscreen-nav-padding-top)}.ms__fullscreen-nav-count{font-size:var(--ms-fullscreen-nav-count-font-size);color:var(--ms-fullscreen-nav-count-color)}.ms__fullscreen-nav-controls{display:flex;align-items:center;gap:var(--ms-fullscreen-nav-gap)}.ms__fullscreen-nav-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-nav-btn-size);height:var(--ms-fullscreen-nav-btn-size);padding:0;color:var(--ms-fullscreen-nav-btn-color);background:var(--ms-fullscreen-nav-btn-bg);border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-nav-btn:hover:not(:disabled){background:var(--ms-fullscreen-nav-btn-bg-hover)}.ms__fullscreen-nav-btn:disabled{opacity:.4;cursor:default}.ms__fullscreen-nav-btn:before{content:"";display:block;width:var(--ms-fullscreen-nav-btn-icon-size);height:var(--ms-fullscreen-nav-btn-icon-size);background-color:currentColor;-webkit-mask:var(--ms-fullscreen-nav-btn-icon) center / contain no-repeat;mask:var(--ms-fullscreen-nav-btn-icon) center / contain no-repeat;transform:rotate(-90deg)}.ms__fullscreen-nav-btn--next:before{transform:rotate(90deg)}.ms__fullscreen-header>.ms__fullscreen-search-wrapper,.ms__selected-popover--fullscreen .ms__selected-popover-header>span{flex:1 1 0;min-width:0}.ms__fullscreen-search-wrapper{position:relative;display:flex;align-items:center}.ms__selected-popover--fullscreen .ms__selected-popover-header{font-size:var(--ms-fullscreen-title-font-size);font-weight:var(--ms-fullscreen-title-font-weight);color:var(--ms-fullscreen-text-color)}.ms__fullscreen-search{flex:1 1 auto;min-width:0;font-family:inherit;font-size:var(--ms-fullscreen-search-font-size);color:inherit;background:transparent;border:var(--ms-fullscreen-search-border);border-radius:var(--ms-fullscreen-search-border-radius);padding:var(--ms-fullscreen-search-padding);padding-inline-end:var(--ms-fullscreen-search-clear-gutter)}.ms__fullscreen-search:focus{outline:none;border:var(--ms-input-border-focus)}.ms__fullscreen-search-clear{position:absolute;inset-inline-end:var(--ms-fullscreen-search-clear-inset);top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-search-clear-size);height:var(--ms-fullscreen-search-clear-size);padding:0;color:var(--ms-fullscreen-search-clear-color);background:transparent;border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-search-clear:hover{background:var(--ms-fullscreen-search-clear-bg-hover)}.ms__fullscreen-search-clear:before{content:"";display:block;width:var(--ms-fullscreen-search-clear-icon-size);height:var(--ms-fullscreen-search-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-search-clear) center / contain no-repeat;mask:var(--ms-icon-search-clear) center / contain no-repeat}.ms__fullscreen-mode-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-mode-toggle-size);height:var(--ms-fullscreen-mode-toggle-size);margin-inline-end:var(--ms-fullscreen-mode-toggle-gap);margin-inline-start:calc((var(--ms-fullscreen-close-size) - var(--ms-fullscreen-mode-toggle-size)) / 2 - var(--ms-fullscreen-close-edge-nudge));padding:0;color:var(--ms-fullscreen-mode-toggle-color);background:var(--ms-fullscreen-mode-toggle-bg);border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-mode-toggle:hover{background:var(--ms-fullscreen-mode-toggle-bg-hover)}.ms__fullscreen-mode-toggle:before{content:"";display:block;width:var(--ms-fullscreen-mode-toggle-icon-size);height:var(--ms-fullscreen-mode-toggle-icon-size);background-color:currentColor;-webkit-mask:var(--ms-fullscreen-mode-toggle-icon, var(--ms-icon-search)) center / contain no-repeat;mask:var(--ms-fullscreen-mode-toggle-icon, var(--ms-icon-search)) center / contain no-repeat}.ms__fullscreen-mode-toggle[data-mode=navigate]{--ms-fullscreen-mode-toggle-icon: var(--ms-icon-search)}.ms__fullscreen-mode-toggle[data-mode=filter]{--ms-fullscreen-mode-toggle-icon: var(--ms-icon-filter)}.ms__fullscreen-close,.ms__selected-popover--fullscreen .ms__selected-popover-close{flex:0 0 auto;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-close-size);height:var(--ms-fullscreen-close-size);margin-inline-end:calc(-1 * var(--ms-fullscreen-close-edge-nudge));padding:0;color:var(--ms-fullscreen-close-color);background:var(--ms-fullscreen-close-bg);border:var(--ms-fullscreen-close-border);border-radius:var(--ms-fullscreen-close-border-radius);cursor:pointer}.ms__fullscreen-close:after,.ms__selected-popover--fullscreen .ms__selected-popover-close:after{content:"";position:absolute;inset-block-start:calc(-1 * var(--ms-fullscreen-close-size));inset-block-end:calc(-1 * var(--ms-fullscreen-header-padding-v));inset-inline-end:calc(-1 * var(--ms-fullscreen-header-padding-h));inset-inline-start:calc(-1 * var(--ms-fullscreen-header-gap))}.ms__fullscreen-close:hover,.ms__selected-popover--fullscreen .ms__selected-popover-close:hover{background:var(--ms-fullscreen-close-bg-hover);color:var(--ms-fullscreen-close-color)}.ms__fullscreen-close:before,.ms__selected-popover--fullscreen .ms__selected-popover-close:before{content:"";display:block;width:var(--ms-fullscreen-close-icon-size);height:var(--ms-fullscreen-close-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__dropdown--fullscreen .ms__option-info{flex:0 0 auto;display:none;align-items:center;justify-content:center;width:var(--ms-fullscreen-info-size);height:var(--ms-fullscreen-info-size);margin-inline-start:var(--ms-option-gap);padding:0;color:var(--ms-fullscreen-info-color);background:transparent;border:none;border-radius:50%;cursor:pointer}.ms__dropdown--fullscreen .ms__option--truncated .ms__option-info{display:inline-flex}@media (hover: hover){.ms__dropdown--fullscreen .ms__option-info:hover{background:var(--ms-fullscreen-info-bg-hover)}}.ms__dropdown--fullscreen .ms__option-info:before{content:"";display:block;width:var(--ms-fullscreen-info-icon-size);height:var(--ms-fullscreen-info-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-info) center / contain no-repeat;mask:var(--ms-icon-info) center / contain no-repeat}.ms__dropdown-inner{flex:1;overflow-y:auto;border-radius:var(--ms-dropdown-inner-border-radius);overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__dropdown-inner::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__dropdown-inner::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__dropdown--virtual{max-height:none}.ms__dropdown--virtual .ms__dropdown-inner{overflow:hidden}.ms__badge-tooltip{position:fixed;z-index:var(--ms-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-tooltip-bg);color:var(--ms-tooltip-text-color);padding:var(--ms-tooltip-padding);border-radius:var(--ms-tooltip-border-radius);font-size:var(--ms-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-tooltip-shadow);pointer-events:none}.ms__badge-tooltip--visible{opacity:1;visibility:visible}.ms__option-tooltip{position:fixed;z-index:var(--ms-option-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-option-tooltip-bg);color:var(--ms-option-tooltip-text-color);padding:var(--ms-option-tooltip-padding);border-radius:var(--ms-option-tooltip-border-radius);font-size:var(--ms-option-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-option-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-option-tooltip-shadow);pointer-events:none}.ms__option-tooltip--visible{opacity:1;visibility:visible}.ms__option-tooltip--fullscreen{z-index:var(--ms-z-index-fullscreen-tooltip)}.ms__message{position:fixed;z-index:var(--ms-message-z-index);box-sizing:border-box;max-width:var(--ms-message-max-width);padding:var(--ms-message-padding);font-family:inherit;font-size:var(--ms-message-font-size);font-weight:var(--ms-message-font-weight);line-height:var(--ms-line-height-normal);color:var(--ms-message-color);background:var(--ms-message-bg);border:var(--ms-message-border);border-radius:var(--ms-message-border-radius);box-shadow:var(--ms-message-shadow);cursor:pointer;opacity:0;transition:opacity var(--ms-transition-normal) ease;-webkit-tap-highlight-color:transparent}.ms__message--visible{opacity:1}.ms__message--info{background:var(--ms-message-info-bg);color:var(--ms-message-info-color)}.ms__message--warning{background:var(--ms-message-warning-bg);color:var(--ms-message-warning-color)}.ms__message--error{background:var(--ms-message-error-bg);color:var(--ms-message-error-color)}.ms__message--success{background:var(--ms-message-success-bg);color:var(--ms-message-success-color)}.ms__message--fullscreen{left:50%;right:auto;bottom:calc(var(--ms-message-fullscreen-offset) + env(safe-area-inset-bottom));transform:translate(-50%);max-width:min(var(--ms-message-max-width),calc(100vw - 4 * var(--ms-fullscreen-rem)));padding:calc(1 * var(--ms-fullscreen-rem)) calc(1.4 * var(--ms-fullscreen-rem));font-size:calc(var(--base-font-size-sm, 1.4) * var(--ms-fullscreen-rem))}.ms__selected-popover{display:none;position:fixed;box-sizing:border-box;z-index:var(--ms-z-index-popover);background:var(--ms-selected-popover-bg);border:var(--ms-selected-popover-border);border-radius:var(--ms-selected-popover-border-radius);box-shadow:var(--ms-selected-popover-box-shadow);width:var(--ms-selected-popover-width);max-height:var(--ms-selected-popover-max-height);overflow:hidden}.ms__selected-popover--visible{display:flex;flex-direction:column}.ms__selected-popover--virtual{display:block;overflow:visible;max-height:none}.ms__selected-popover--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border:none;border-radius:0;overflow:hidden;background:var(--ms-fullscreen-bg);color:var(--ms-fullscreen-text-color);z-index:var(--ms-z-index-fullscreen);box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.ms__selected-popover--fullscreen .ms__selected-popover-body{flex:1 1 0;min-height:0;max-height:none}.ms__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ms-selected-popover-header-padding);background:var(--ms-selected-popover-header-bg);border-bottom:var(--ms-selected-popover-header-border-bottom);font-size:var(--ms-selected-popover-header-font-size);font-weight:var(--ms-selected-popover-header-font-weight);color:var(--ms-selected-popover-header-color)}.ms__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ms-popover-close-size);height:var(--ms-popover-close-size);padding:0;border:none;background:var(--ms-selected-popover-close-bg);color:var(--ms-selected-popover-close-color);font-size:var(--ms-selected-popover-close-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-selected-popover-close-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__selected-popover-close:hover{background:var(--ms-selected-popover-close-bg-hover);color:var(--ms-selected-popover-close-color-hover)}.ms__selected-popover-close:before{content:"";display:block;width:var(--ms-selected-popover-close-icon-size);height:var(--ms-selected-popover-close-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__selected-popover-body{display:flex;flex-direction:column;gap:var(--ms-selected-popover-body-gap);padding:var(--ms-selected-popover-body-padding);overflow-y:auto;max-height:var(--ms-selected-popover-body-max-height);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__selected-popover-body::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__selected-popover-body::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__selected-popover-body .ms__badge{width:100%;min-height:fit-content;line-height:var(--ms-line-height-relaxed);flex-shrink:0}.ms__selected-popover-body .ms__badge-text{flex:1;min-width:0;white-space:normal;word-wrap:break-word}.ms__selected-popover-body--virtual{display:block;max-height:none;padding:0}.ms__selected-popover-body--virtual .ms__badge{height:var(--ms-badge-height-virtual, 36px);min-height:var(--ms-badge-height-virtual, 36px);max-height:var(--ms-badge-height-virtual, 36px);margin-bottom:var(--ms-selected-popover-body-gap);overflow:hidden;box-sizing:border-box}.ms__selected-popover-body--virtual .ms__badge-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@layer component{.ms--disabled .ms__input-wrapper{opacity:var(--ms-disabled-input-opacity);background:var(--ms-input-bg-disabled);cursor:not-allowed}.ms--disabled .ms__input{cursor:not-allowed}.ms--no-checkboxes .ms__option{gap:0;padding-inline-start:var(--ms-option-padding-h)}.ms--no-checkboxes .ms__option-content{padding-inline-start:0}.ms--no-selected-popover .ms__counter,.ms--no-selected-popover .ms__badge[data-action=show-selected],.ms--no-selected-popover .ms__badge--counter,.ms--no-selected-popover .ms__badge--more{cursor:default}}@layer component{@keyframes ms-spin{to{transform:rotate(360deg)}}}@layer component{.ms__badges{display:flex;flex-wrap:wrap;gap:var(--ms-badges-gap);padding:0}.ms__badges:empty{display:none}.ms__badges--bottom{margin-top:var(--ms-badges-margin-bottom)}.ms__badges--top{margin-bottom:var(--ms-badges-margin-top);order:var(--ms-order-first)}.ms__badges--left{order:var(--ms-order-first);margin-right:var(--ms-badges-margin-left);justify-content:flex-end}.ms__badges--right{margin-left:var(--ms-badges-margin-right);justify-content:flex-start}.ms__badge{display:inline-flex;align-items:center;height:var(--ms-badge-height);font-size:var(--ms-badge-font-size);font-weight:var(--ms-badge-font-weight);line-height:var(--ms-line-height-none);border-radius:var(--ms-badge-border-radius);overflow:hidden;max-width:100%}.ms__badge--custom{display:block;height:auto;max-width:none;overflow:visible;border-radius:0;font-size:inherit;font-weight:inherit}.ms__badge-text{display:flex;align-items:center;box-sizing:border-box;height:100%;padding:var(--ms-badge-text-padding);background:var(--ms-badge-text-bg);color:var(--ms-badge-text-color);border:var(--ms-badge-text-border);border-inline-end:none;border-start-start-radius:var(--ms-badge-border-radius);border-end-start-radius:var(--ms-badge-border-radius);border-start-end-radius:0;border-end-end-radius:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ms-transition-normal) ease,color var(--ms-transition-normal) ease}.ms__badge:hover .ms__badge-text{background:var(--ms-badge-text-bg-hover, var(--ms-badge-text-bg));color:var(--ms-badge-text-color-hover, var(--ms-badge-text-color))}.ms__badge-remove{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;font-family:inherit;width:var(--ms-badge-remove-width);height:100%;flex-shrink:0;background:var(--ms-badge-remove-bg);color:var(--ms-badge-remove-color);border:var(--ms-badge-remove-border);border-inline-start:none;border-start-end-radius:var(--ms-badge-border-radius);border-end-end-radius:var(--ms-badge-border-radius);border-start-start-radius:0;border-end-start-radius:0;cursor:pointer;transition:background-color var(--ms-transition-normal) ease;font-size:var(--ms-badge-remove-font-size)}.ms__badge-remove:hover{background:var(--ms-badge-remove-bg-hover)}.ms__badge-remove:focus{outline:none}.ms__badge-remove:focus-visible{outline:none;box-shadow:var(--ms-badge-remove-box-shadow-focus)}.ms__badge-remove:before{content:"";display:block;width:var(--ms-badge-remove-icon-size);height:var(--ms-badge-remove-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__badge--counter{cursor:pointer}.ms__badge--counter .ms__badge-text{background:var(--ms-badge-counter-text-bg);color:var(--ms-badge-counter-text-color);border:var(--ms-badge-counter-border);border-inline-end:none}.ms__badge--counter .ms__badge-remove{background:var(--ms-badge-counter-remove-bg);color:var(--ms-badge-counter-remove-color);border:var(--ms-badge-counter-border);border-inline-start:none}.ms__badge--counter .ms__badge-remove:hover{background:var(--ms-badge-counter-remove-bg-hover);color:var(--ms-badge-counter-remove-color-hover, var(--ms-badge-counter-remove-color))}.ms__badge--counter:hover .ms__badge-text{background:var(--ms-badge-counter-text-bg-hover, var(--ms-badge-counter-text-bg));color:var(--ms-badge-counter-text-color-hover, var(--ms-badge-counter-text-color))}.ms__badge--more,.ms__badge[data-action=show-selected]{cursor:pointer}}@layer component{.ms__count-display{display:flex;align-items:center}.ms__count-display:empty{display:none}.ms__count-display--bottom{margin-top:var(--ms-count-display-margin-bottom)}.ms__count-display--top{margin-bottom:var(--ms-count-display-margin-top);order:var(--ms-order-first)}.ms__count-display--left{order:var(--ms-order-first);margin-right:var(--ms-count-display-margin-left);justify-content:flex-start}.ms__count-display--right{margin-left:var(--ms-count-display-margin-right);justify-content:flex-end}.ms__counter-wrapper{display:inline-flex;align-items:center;gap:var(--ms-counter-wrapper-gap);background:var(--ms-counter-wrapper-bg);border:var(--ms-counter-wrapper-border);border-radius:var(--ms-counter-wrapper-border-radius);padding:var(--ms-counter-wrapper-padding);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter-wrapper:hover{background:var(--ms-counter-wrapper-bg-hover);border-color:var(--ms-counter-wrapper-border-color-hover)}.ms__count-text{display:inline-flex;align-items:center;background:var(--ms-count-text-bg);border:var(--ms-count-text-border);padding:0;font-size:var(--ms-count-text-font-size);color:var(--ms-count-text-color);cursor:pointer;transition:color var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ms-count-clear-size);height:var(--ms-count-clear-size);padding:0;border:none;background:var(--ms-count-clear-bg);color:var(--ms-count-clear-color);font-size:var(--ms-count-clear-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-count-clear-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear:hover{background:var(--ms-count-clear-bg-hover);color:var(--ms-count-clear-color-hover)}.ms__count-clear:before{content:"";display:block;width:var(--ms-count-clear-icon-size);height:var(--ms-count-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-clear) center / contain no-repeat;mask:var(--ms-icon-clear) center / contain no-repeat}}@layer component{.ms__debug-info{margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:var(--ms-debug-bg);border:1px solid var(--ms-debug-border-color);border-radius:var(--ms-debug-border-radius);font-size:calc(1.2 * var(--ms-rem));color:var(--ms-debug-text-color)}.ms__debug-info details summary{cursor:pointer;font-weight:600;color:var(--ms-debug-summary-color);-webkit-user-select:none;user-select:none;padding:calc(.4 * var(--ms-rem));border-radius:var(--ms-debug-summary-border-radius)}.ms__debug-info details summary:hover{background-color:var(--ms-debug-summary-bg-hover)}.ms__debug-info details summary:focus{outline:2px solid var(--ms-debug-summary-outline-color);outline-offset:2px}.ms__debug-info .ms__debug-stats{display:flex;flex-direction:column;gap:calc(.4 * var(--ms-rem));margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:var(--ms-debug-stats-bg);border-radius:var(--ms-debug-stats-border-radius)}.ms__debug-info .ms__debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:calc(1 * var(--ms-rem))}.ms__debug-info .ms__debug-stats span:before{content:"•";margin-inline-end:calc(.4 * var(--ms-rem));color:var(--ms-debug-bullet-color)}}@layer component{.ms__options{padding:var(--ms-options-padding);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__options::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__options::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__options--virtual .ms__option,.ms__options--fixed-height .ms__option{height:var(--ms-option-height, 50px);min-height:var(--ms-option-height, 50px);max-height:var(--ms-option-height, 50px);overflow:hidden;box-sizing:border-box}.ms__group+.ms__group{border-top:var(--ms-group-border-top);margin-top:var(--ms-group-margin-top);padding-top:var(--ms-group-padding-top)}.ms__group-label{padding:var(--ms-group-label-padding);font-size:var(--ms-group-label-font-size);font-weight:var(--ms-group-label-font-weight);color:var(--ms-group-label-color);text-transform:var(--ms-group-label-transform);letter-spacing:var(--ms-group-label-letter-spacing)}.ms__option{display:flex;align-items:var(--ms-checkbox-align, center);gap:var(--ms-option-gap);padding:var(--ms-option-padding);position:relative;min-height:var(--ms-option-min-height, auto);color:var(--ms-option-text-color);background:var(--ms-option-bg);cursor:pointer;user-select:none;-webkit-user-select:none}@media (hover: hover){.ms__option:hover{background:var(--ms-option-bg-hover);color:var(--ms-option-color-hover, inherit)}}.ms__option--focused{background:var(--ms-option-bg-focused);color:var(--ms-option-color-focused, inherit);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--matched{background:var(--ms-option-bg-matched);color:var(--ms-option-color-matched, inherit)}.ms__option--matched:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;border-inline-start:var(--ms-option-border-matched);pointer-events:none}.ms__option--selected{background:var(--ms-option-bg-selected)}@media (hover: hover){.ms__option--selected:hover{background:var(--ms-option-bg-selected-hover, var(--ms-option-bg-selected))}}.ms__option--disabled{opacity:var(--ms-disabled-opacity);cursor:not-allowed;background:var(--ms-option-disabled-bg)}.ms__option--disabled:hover{background:var(--ms-option-disabled-bg)}@media (hover: hover){.ms__option--focused:hover{background:var(--ms-option-bg-focused-hover);color:var(--ms-option-color-focused-hover, var(--ms-option-color-focused, var(--ms-option-text-color)))}}.ms__option--matched:hover{background:var(--ms-option-bg-matched-hover);color:var(--ms-option-color-matched-hover, var(--ms-option-color-matched, var(--ms-option-text-color)))}.ms__option--selected.ms__option--focused{background:var(--ms-option-bg-selected-focused);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--selected.ms__option--matched{background:var(--ms-option-bg-selected-matched)}.ms__option--disabled.ms__option--selected{background:var(--ms-option-bg-disabled-selected)}.ms__option--disabled.ms__option--focused{outline:none}.ms__option[data-checkbox-align=top]{--ms-checkbox-align: flex-start;--ms-checkbox-margin-top: calc(.2 * var(--ms-rem))}.ms__option[data-checkbox-align=bottom]{--ms-checkbox-align: flex-end}.ms__checkbox{appearance:none;-webkit-appearance:none;-moz-appearance:none;flex-shrink:0;position:relative;margin-top:var(--ms-checkbox-margin-top);margin-inline-end:var(--ms-checkbox-margin-right);margin-bottom:var(--ms-checkbox-margin-bottom);margin-inline-start:var(--ms-checkbox-margin-left);width:var(--ms-checkbox-size);height:var(--ms-checkbox-size);transform:scale(var(--ms-checkbox-scale));transform-origin:top left;cursor:pointer;background:var(--ms-checkbox-bg);border:var(--ms-checkbox-border);border-radius:var(--ms-checkbox-border-radius);transition:background-color .15s ease,border-color .15s ease}.ms__checkbox:after{content:"";position:absolute;display:none;top:0;right:0;bottom:0;left:0;background-color:var(--ms-checkbox-checkmark-color);-webkit-mask:var(--ms-icon-check) no-repeat center / contain;mask:var(--ms-icon-check) no-repeat center / contain}.ms__checkbox:hover:not(:disabled){border-color:var(--ms-checkbox-hover-border-color)}.ms__checkbox:checked{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox:checked:after{display:block}.ms__checkbox--indeterminate{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox--indeterminate:after{display:block;-webkit-mask-image:var(--ms-icon-indeterminate);mask-image:var(--ms-icon-indeterminate)}.ms__checkbox--indeterminate:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:checked:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:focus-visible{outline:2px solid var(--ms-checkbox-checked-bg);outline-offset:2px}.ms__checkbox:disabled{cursor:not-allowed;background:var(--ms-checkbox-disabled-bg);border:var(--ms-checkbox-disabled-border);opacity:.6}.ms__checkbox:disabled:checked{background:var(--ms-checkbox-disabled-bg)}.ms__option--disabled .ms__checkbox{cursor:not-allowed}.ms__option-content{flex:1;display:flex;align-items:center;gap:var(--ms-option-content-gap);min-width:0}.ms__option-icon{flex-shrink:0;width:var(--ms-option-icon-size);height:var(--ms-option-icon-size);display:flex;align-items:center;justify-content:center;font-size:var(--ms-option-icon-font-size)}.ms__option-icon svg{width:100%;height:100%;fill:currentColor}.ms__option-text{flex:1;min-width:0}.ms__option-title{font-size:var(--ms-option-title-font-size);color:var(--ms-option-title-color);line-height:var(--ms-line-height-relaxed);white-space:var(--ms-option-title-white-space, normal);overflow:var(--ms-option-title-overflow, visible);text-overflow:var(--ms-option-title-text-overflow, clip)}@media (hover: hover){.ms__option:hover .ms__option-title{color:var(--ms-option-title-color-hover, var(--ms-option-title-color))}}.ms__option--selected .ms__option-title{color:var(--ms-option-title-color-selected, var(--ms-option-title-color))}@media (hover: hover){.ms__option--selected:hover .ms__option-title{color:var(--ms-option-title-color-selected-hover, var(--ms-option-title-color-selected, var(--ms-option-title-color)))}}.ms__option-title mark{background:var(--ms-option-mark-bg);color:var(--ms-option-mark-color);font-weight:var(--ms-option-mark-font-weight)}.ms__option-subtitle{margin-top:var(--ms-option-subtitle-margin-top);font-size:var(--ms-option-subtitle-font-size);color:var(--ms-option-subtitle-color);line-height:var(--ms-option-subtitle-line-height)}@media (hover: hover){.ms__option:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-hover, var(--ms-option-subtitle-color))}}.ms__option--selected .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color))}@media (hover: hover){.ms__option--selected:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected-hover, var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color)))}}.ms__empty{display:flex;align-items:center;justify-content:center;min-height:var(--ms-state-min-height);padding:var(--ms-empty-padding);text-align:center;font-size:var(--ms-empty-font-size);color:var(--ms-empty-color)}.ms__add-new{display:flex;align-items:center;gap:var(--ms-add-new-gap);padding:var(--ms-add-new-padding);font-size:var(--ms-add-new-font-size);color:var(--ms-add-new-color);cursor:pointer;user-select:none;-webkit-user-select:none}@media (hover: hover){.ms__add-new:hover{background:var(--ms-add-new-bg-hover);color:var(--ms-add-new-color-hover)}}.ms__add-new--focused{background:var(--ms-add-new-bg-hover);color:var(--ms-add-new-color-hover)}.ms__add-new--loading{cursor:default}.ms__add-new-spinner{flex-shrink:0;width:var(--ms-add-new-icon-size);height:var(--ms-add-new-icon-size);border-radius:50%;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;animation:ms-spin .6s linear infinite}@media (prefers-reduced-motion: reduce){.ms__add-new-spinner{animation-duration:1.5s}}.ms__add-new-icon{flex-shrink:0;width:var(--ms-add-new-icon-size);height:var(--ms-add-new-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-add-new) center / contain no-repeat;mask:var(--ms-icon-add-new) center / contain no-repeat}.ms__add-new-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ms__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--ms-state-min-height);padding:var(--ms-loader-padding);gap:var(--ms-loader-gap)}.ms__loading-text{font-size:var(--ms-loading-text-font-size);color:var(--ms-loading-color)}}@layer component{.ms--rtl .ms__badges{direction:rtl}.ms--rtl .ms__badges--right{margin-left:0;margin-right:var(--ms-badges-margin-right)}.ms--rtl .ms__badges--left{margin-right:0;margin-left:var(--ms-badges-margin-left)}.ms--rtl .ms__count-display{direction:rtl}.ms--rtl .ms__count-display--right{margin-left:0;margin-right:var(--ms-count-display-margin-right)}.ms--rtl .ms__count-display--left{margin-right:0;margin-left:var(--ms-count-display-margin-left)}}@layer component{.ms__option--tree{padding-inline-start:calc(var(--ms-tree-base-indent, .75rem) + var(--ms-tree-depth, 0) * var(--ms-tree-indent, 1.25rem))}.ms__option--tree-unselectable{cursor:default}.ms__option--tree-unselectable:hover{background:transparent}}@layer overrides{:host-context([data-theme="dark"]),:host-context([data-bs-theme="dark"]),:host-context(.dark){color-scheme:dark}:host-context([data-theme="light"]),:host-context([data-bs-theme="light"]),:host-context(.light){color-scheme:light}:host([data-theme="dark"]){color-scheme:dark}:host([data-theme="light"]){color-scheme:light}}`,Po=["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],$=()=>Xo(),wn=[{configKey:"searchHint",attribute:"search-hint",converter:L({isNullable:!0}),on:"update",description:"Small hint text shown beneath the search input."},{configKey:"searchPlaceholder",attribute:"search-placeholder",converter:L({isNullable:!0}),on:"update",description:'Placeholder text for the search input. When unset it defaults to "Search..."; if `show-search-mode-toggle` is on, the default instead becomes mode-aware ("Search…" in navigate, "Filter…" in filter). An explicit value always wins and stays fixed.'},{configKey:"selectPlaceholder",attribute:"select-placeholder",converter:L({default:"Pick an option..."}),on:"update",description:"Placeholder shown on the control when nothing is selected."},{configKey:"noDataPlaceholder",attribute:"no-data-placeholder",converter:L({isNullable:!0}),on:"update",description:"Text shown when there are no options at all."},{configKey:"dropdownMinWidth",attribute:"dropdown-min-width",converter:L({isNullable:!0}),on:"update",description:"Minimum width of the dropdown panel (any CSS length)."},{configKey:"dropdownMaxWidth",attribute:"dropdown-max-width",converter:L({isNullable:!0}),on:"update",description:"Maximum width of the dropdown panel (any CSS length)."},{configKey:"maxHeight",attribute:"max-height",converter:L({default:"20rem"}),on:"update",description:"Maximum height of the dropdown list before it scrolls."},{configKey:"emptyMessage",attribute:"empty-message",converter:L({default:"No results found"}),on:"update",description:"Message shown when a search yields no matches."},{configKey:"addNewText",attribute:"add-new-text",converter:L({isNullable:!0}),on:"update",description:'Template for the clickable "add new" prompt shown (when `allow-add-new` is on) in place of the empty message once a search yields no matches. `{value}` is replaced with the typed text. Default: `Add "{value}"`. A `getAddNewTextCallback` wins.'},{configKey:"addNewPendingText",attribute:"add-new-pending-text",converter:L({isNullable:!0}),on:"update",description:'Template for the pending prompt (spinner + text) shown while an async `addNewCallback` runs. `{value}` is replaced with the typed text. Default: `Adding "{value}"…`.'},{configKey:"loadingMessage",attribute:"loading-message",converter:L({default:"Loading..."}),on:"update",description:"Message shown while options are loading."},{configKey:"removeButtonTooltipText",attribute:"remove-button-tooltip-text",converter:L({isNullable:!0}),on:"update",description:"Tooltip text for a badge remove (×) button."},{configKey:"formFieldId",attribute:"name",converter:L({isNullable:!0}),on:"reinit",description:"HTML form field name/id used for the hidden input(s)."},{configKey:"dropdownWidth",attribute:"dropdown-width",converter:L({isNullable:!0}),on:"update",description:"Fixed dropdown width; mirrored to the `--ms-dropdown-width` CSS variable."},{configKey:"selectedPopoverWidth",attribute:"selected-popover-width",converter:L({isNullable:!0}),on:"update",description:"Selected-items popover width; mirrored to `--ms-selected-popover-width`."},{configKey:"valueMember",attribute:"value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name on an option object that holds its value."},{configKey:"displayValueMember",attribute:"display-value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option display label."},{configKey:"searchValueMember",attribute:"search-value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name searched against (falls back to the display value)."},{configKey:"iconMember",attribute:"icon-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option icon."},{configKey:"subtitleMember",attribute:"subtitle-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option subtitle."},{configKey:"fullTitleMember",attribute:"full-title-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option full/long title."},{configKey:"groupMember",attribute:"group-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name used to group options under headers."},{configKey:"disabledMember",attribute:"disabled-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that marks an option disabled."},{configKey:"pathMember",attribute:"path-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node materialized tree path."},{configKey:"parentPathMember",attribute:"parent-path-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node parent path."},{configKey:"levelMember",attribute:"level-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node depth level."},{configKey:"hasChildrenMember",attribute:"has-children-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name flagging that a node has children."},{configKey:"isSelectableMember",attribute:"is-selectable-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name marking whether a node can be selected."},{configKey:"treePathSeparator",attribute:"tree-path-separator",converter:L({default:"."}),reflect:!0,on:"reinit",description:"Separator between segments in a materialized tree path."},{configKey:"isTreeEnabled",converter:W("tristate"),on:"reinit",type:"boolean",description:"Force tree mode on/off. Property-only; when unset (null) tree mode auto-enables if a path source (path-member / getPathCallback) is present."},{configKey:"checkboxMode",attribute:"checkbox-mode",converter:S(["independent","cascade"],{default:"independent"}),reflect:!0,on:"update",description:"Tree checkbox interaction.\n- `independent` (default) — toggles only the clicked node.\n- `cascade` — checks a node whole subtree and shows a tristate (checked / indeterminate / unchecked) box on branches.\n\nTree + multiple only."},{configKey:"cascadeSelectPolicy",attribute:"cascade-select-policy",converter:S(["rolled-up","leaves","all"],{default:"rolled-up"}),reflect:!0,on:"update",description:"In `cascade` mode, which values a selection emits (badges / form / change):\n- `rolled-up` (default) — minimal cover: a fully-selected subtree collapses to its root; partially-selected branches emit their individually-checked descendants.\n- `leaves` — only the checked leaf-level nodes.\n- `all` — every fully-checked node (branches and leaves)."},{configKey:"badgesDisplayMode",attribute:"badges-display-mode",converter:S(["badges","count","compact","partial","none"],{default:"badges"}),on:"reinit",description:"How the current selection is shown in the control."},{configKey:"badgesPosition",attribute:"badges-position",converter:S(["top","bottom","left","right"],{default:"bottom"}),on:"reinit",description:"Where the badges/selection appear relative to the input."},{configKey:"badgesThresholdMode",attribute:"badges-threshold-mode",converter:S(["count","partial"],{default:"count"}),on:"update",description:'How `badgesThreshold` is interpreted: collapse to a count badge, or keep partial badges + a "more" badge.'},{configKey:"searchInputMode",attribute:"search-input-mode",converter:S(["normal","readonly","hidden"],{default:"normal"}),on:"reinit",description:"Search field mode: editable, read-only, or hidden."},{configKey:"searchMode",attribute:"search-mode",converter:S(["filter","navigate"],{default:"filter"}),on:"reinit",description:"Whether typing filters the list or navigates it."},{configKey:"overlayGroup",attribute:"overlay-group",converter:L({isNullable:!0}),on:"reinit",description:'Scope the "one overlay open at a time" coordination to a named group. Overlays (multiselects, datepickers, external popovers) sharing a group dismiss each other when one opens; different groups are independent. Unset = the default (ungrouped) group.'},{configKey:"actionsLayout",attribute:"actions-layout",converter:S(["nowrap","wrap"],{default:"nowrap"}),on:"reinit",description:"Whether the action bar wraps or stays on one line."},{configKey:"actionsPosition",attribute:"actions-position",converter:S(["top","bottom"],{default:"top"}),on:"reinit",description:"Whether the action bar sits above or below the list."},{configKey:"actionsAlign",attribute:"actions-align",converter:S(["stretch","left","right","center","space-between"],{default:"stretch"}),on:"update",description:"Horizontal alignment of the action buttons."},{configKey:"checkboxAlign",attribute:"checkbox-align",converter:S(["top","center","bottom"],{default:"center"}),on:"update",description:"Vertical alignment of an option checkbox."},{configKey:"valueFormat",attribute:"value-format",converter:S(["json","csv","array"],{default:"json"}),on:"reinit",description:"Serialization format the control emits its value in."},{configKey:"badgeTooltipPlacement",attribute:"badge-tooltip-placement",converter:S(Po,{default:"top"}),on:"update",description:"Preferred placement of a badge tooltip relative to its badge (floating-ui placement)."},{configKey:"optionTooltipPlacement",attribute:"option-tooltip-placement",converter:S(Po,{default:"top-start"}),on:"update",description:"Preferred placement of an option tooltip (floating-ui placement)."},{configKey:"mobilePresentation",attribute:"mobile-presentation",converter:S(["auto","floating","fullscreen"],{default:"auto"}),reflect:!0,on:"update",description:"How the open dropdown is presented on phones. `auto` (default) keeps the floating panel on desktop/tablet and switches to a full-screen overlay on phone-sized touch devices (touch primary + shorter viewport side < 600px, orientation-robust); `floating` forces the anchored panel everywhere; `fullscreen` forces the full-screen overlay on any device (handy for previews/testing). Resolved reactively from the device/viewport environment."},{configKey:"fullscreenAutofocus",attribute:"fullscreen-autofocus",converter:W("default-false"),on:"update",description:"In the phone fullscreen overlay, auto-focus the search field on open (pops the soft keyboard immediately). Default `false`: the sheet opens with the list visible and the keyboard closed, appearing only when the user taps the search. Set `true` to type-to-filter right away. No effect in the floating presentation."},{configKey:"badgesThreshold",attribute:"badges-threshold",converter:D(),on:"update",description:"Threshold at which badges collapse to a count/compact view."},{configKey:"badgesMaxVisible",attribute:"badges-max-visible",converter:D(),on:"update",description:"Maximum number of badges rendered before overflow."},{configKey:"collapseBadgesBelow",attribute:"collapse-badges-below",converter:D(),on:"update",description:'Container-responsive opt-in (off by default). When set to a px width, the control watches its OWN border box (not the window, via the core `resized` hook / a shared ResizeObserver) and collapses `badges-display-mode` to `count` ("N selected") while the box is narrower than this — so a picker in a narrow column/sidebar never overflows with pills, even on a wide monitor. Widening past the threshold restores the configured badges mode. Element-only: the override is applied to the live picker, never to your `badges-display-mode` config.'},{configKey:"minSearchLength",attribute:"min-search-length",converter:D({default:0}),on:"update",description:"Minimum characters before searching/filtering starts."},{configKey:"searchDebounce",attribute:"search-debounce",converter:D({default:0}),on:"update",description:"Debounce delay in ms applied to the search input."},{configKey:"virtualScrollThreshold",attribute:"virtual-scroll-threshold",converter:D({default:100}),on:"reinit",description:"Option count above which virtual scrolling turns on."},{configKey:"optionHeight",attribute:"option-height",converter:D({default:50}),on:"update",description:"Fixed row height in px used by virtual scrolling."},{configKey:"badgeHeight",attribute:"badge-height",converter:D({default:36}),on:"update",description:"Fixed badge height in px used for layout/virtualization."},{configKey:"virtualScrollBuffer",attribute:"virtual-scroll-buffer",converter:D({default:10}),on:"update",description:"Extra rows rendered above/below the viewport when virtualizing."},{configKey:"badgeTooltipDelay",attribute:"badge-tooltip-delay",converter:D({default:100}),on:"update",description:"Delay in ms before a badge tooltip appears."},{configKey:"badgeTooltipOffset",attribute:"badge-tooltip-offset",converter:D({default:8}),on:"update",description:"Gap in px between a badge and its tooltip."},{configKey:"optionTooltipDelay",attribute:"option-tooltip-delay",converter:D(),on:"update",description:"Delay in ms before an option tooltip appears (falls back to badgeTooltipDelay)."},{configKey:"optionTooltipOffset",attribute:"option-tooltip-offset",converter:D(),on:"update",description:"Gap in px between an option and its tooltip."},{configKey:"isMultipleEnabled",attribute:"multiple",converter:W("default-true"),on:"reinit",description:"Allow selecting multiple options. When off, selecting one replaces the previous."},{configKey:"isGroupsAllowed",attribute:"allow-groups",converter:W("default-true"),on:"reinit",description:"Allow grouping options under group headers."},{configKey:"isCheckboxesShown",attribute:"show-checkboxes",converter:W("default-true"),on:"reinit",description:"Show a checkbox on each option."},{configKey:"isActionsSticky",attribute:"sticky-actions",converter:W("default-true"),on:"update",description:"Keep the action bar pinned while the list scrolls."},{configKey:"isPlacementLocked",attribute:"lock-placement",converter:W("default-true"),on:"update",description:"Keep the dropdown initial placement instead of flipping when it fits."},{configKey:"isSearchEnabled",attribute:"enable-search",converter:W("default-true"),on:"reinit",description:"Show the search input."},{configKey:"isKeepOptionsOnSearch",attribute:"keep-options-on-search",converter:W("default-true"),on:"update",description:"Keep already-selected options visible while filtering."},{configKey:"shouldKeepSearchOnClose",attribute:"should-keep-search-on-close",converter:W("default-true"),on:"update",description:"Preserve the search text after the dropdown closes."},{configKey:"isSelectedPopoverEnabled",attribute:"enable-selected-popover",converter:W("default-true"),on:"update",description:'Allow the selected-items popover to open (from the count/compact/"+X more" badge or the in-input counter). Turn off when you render your own selection UI, so those affordances become inert.'},{configKey:"isCloseOnSelect",attribute:"close-on-select",converter:W("default-false"),on:"update",description:"Close the dropdown immediately after a selection."},{configKey:"isAddNewAllowed",attribute:"allow-add-new",converter:W("default-false"),on:"reinit",description:"Allow adding a new option from the search text."},{configKey:"isCounterShown",attribute:"show-counter",converter:W("default-false"),on:"update",description:"Show a selected-count indicator."},{configKey:"isClearShown",attribute:"show-clear",converter:W("default-false"),on:"update",description:"Show an inline clear (✕) button inside the input that wipes the whole selection. Appears only while something is selected and the control is enabled; clicking it clears the selection and any search text, fires `change`, and refocuses."},{configKey:"isBadgeFullTitleShown",attribute:"show-badge-full-title",converter:W("default-false"),on:"update",description:"Show the full title on badges instead of the short label."},{configKey:"isVirtualScrollEnabled",attribute:"enable-virtual-scroll",converter:W("default-false"),on:"reinit",description:"Force virtual scrolling on regardless of the threshold."},{configKey:"isBadgeTooltipsEnabled",attribute:"enable-badge-tooltips",converter:W("default-false"),on:"update",description:"Enable tooltips on badges."},{configKey:"isOptionTooltipsEnabled",attribute:"enable-option-tooltips",converter:W("default-false"),on:"update",description:"Enable tooltips on options."},{configKey:"isOptionTooltipFollowCursor",attribute:"option-tooltip-follow-cursor",converter:W("default-false"),on:"update",description:"Make option tooltips follow the pointer."},{configKey:"isSearchModeToggleShown",attribute:"show-search-mode-toggle",converter:W("default-false"),on:"update",description:"Show a clickable toggle in the phone fullscreen overlay search header that flips `search-mode` between `filter` and `navigate` live. Fullscreen-only; no effect in the floating presentation or when search is disabled."},{configKey:"initialValues",attribute:"initial-values",converter:pn(),default:[],on:"reinit",type:"Array<string | number>",description:'Values selected on first render. Accepts a JSON array (`["a","b"]`) or a bare CSV (`a,b,c`).'},{configKey:"showDebugInfo",attribute:"show-debug-info",converter:W("default-false"),on:"update",description:"Render an in-component debug panel.",deprecated:"Use per-instance logging (el.enableLogging()) instead."},{configKey:"options",converter:qo(),on:"reinit",type:"ReadonlyArray<Record<string, unknown>>",description:"The array of option objects to render. The JS API — assign `el.options` directly. For HTML authoring use the `data-options` attribute (parsed per `data-options-format`) or declarative <option> children; both feed the same list and take precedence over this property in the order: <option> children > property > data-options."},{configKey:"optionsSource",attribute:"data-options",converter:L({isNullable:!0}),on:"reinit",type:"string",description:"HTML-authoring source for the option list, parsed per `data-options-format`. Reactive: changing either attribute re-renders. Prefer the `options` property in JS; a set `options` property and declarative <option> children both win over this."},{configKey:"optionsFormat",attribute:"data-options-format",converter:S(_o,{default:"json"}),on:"reinit",type:"'json' | 'csv' | 'plain'",description:"How to parse the `data-options` attribute: `json` (a JSON array of objects or [value, label] tuples), `csv` (rows split on `data-options-row-splitter`, cells on `data-options-splitter`; the first row is a header — map columns via *-member), or `plain` (bare values split on both splitters -> [value, label] tuples, value === label). Default `json`."},{configKey:"optionsSplitter",attribute:"data-options-splitter",converter:L({default:","}),on:"reinit",type:"string",description:'Field/cell delimiter for the `csv` and `plain` `data-options` formats. Default `,`. Escapes `\\t` `\\n` `\\r` are honoured (e.g. `data-options-splitter="\\t"` for TSV). Ignored for `json`.'},{configKey:"optionsRowSplitter",attribute:"data-options-row-splitter",converter:L({default:`
|
|
42
|
-
`}),on:"reinit",type:"string",description:'Row/record delimiter for the `csv` and `plain` `data-options` formats. Default newline. Escapes honoured (e.g. `data-options-row-splitter=";"` for single-line data). Ignored for `json`.'},{configKey:"actionButtons",converter:Go({validate:s=>Array.isArray(s)}),on:"reinit",type:"Array<Record<string, unknown>>",description:"Custom action buttons for the dropdown footer/header. Property-only; when unset the default Select-All / Clear buttons apply."},{configKey:"getValueCallback",converter:$(),on:"reinit",type:"(item: unknown) => string | number",description:"Extract an option value (overrides valueMember)."},{configKey:"getPathCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Extract a node tree path (enables tree mode; overrides pathMember)."},{configKey:"getGroupCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Extract the group name from an option (overrides groupMember)."},{configKey:"getDisabledCallback",converter:$(),on:"reinit",type:"(item: unknown) => boolean",description:"Whether an option is disabled (overrides disabledMember)."},{configKey:"getIsSelectableCallback",converter:$(),on:"reinit",type:"(node: unknown) => boolean",description:"Whether a tree node can be selected (overrides is-selectable-member)."},{configKey:"getSearchValueCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Text an option is searched against (overrides searchValueMember)."},{configKey:"searchCallback",converter:$(),on:"reinit",type:"(searchTerm: string, signal?: AbortSignal) => Promise<unknown[]>",description:"Custom / async search; return the filtered options."},{configKey:"getDisplayValueCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Compute the display label for an option (overrides displayValueMember)."},{configKey:"getBadgeDisplayCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Compute the text shown on an option badge."},{configKey:"getBadgeClassCallback",converter:$(),on:"update",type:"(item: unknown) => string | string[]",description:"Extra CSS class(es) for an option badge."},{configKey:"getIconCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Icon for an option (overrides iconMember)."},{configKey:"getSubtitleCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Subtitle for an option (overrides subtitleMember)."},{configKey:"getFullTitleCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Full title for an option (used by badges when show-badge-full-title is on)."},{configKey:"getCounterCallback",converter:$(),on:"update",type:"(count: number, moreCount?: number) => string",description:"Render the selected-count label."},{configKey:"getValueFormatCallback",converter:$(),on:"update",type:"(selectedValues: (string | number)[]) => string",description:"Serialize the selected values for form submission."},{configKey:"getBadgeTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Tooltip content for an option badge."},{configKey:"getOptionTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Tooltip content for an option row."},{configKey:"getRemoveButtonTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Tooltip text for a badge remove button."},{configKey:"getSelectedItemClassCallback",converter:$(),on:"update",type:"(item: unknown) => string | string[]",description:"Extra CSS class(es) for a selected item."},{configKey:"renderOptionContentCallback",converter:$(),on:"update",type:"(item: unknown, context: OptionContentRenderContext) => string | HTMLElement",description:"Custom render for an option row; may return HTML or an element."},{configKey:"renderBadgeContentCallback",converter:$(),on:"update",type:"(item: unknown, context: BadgeContentRenderContext) => string | HTMLElement",description:"Custom render for a badge content (fills the built-in pill); may return HTML or an element."},{configKey:"renderBadgeCallback",converter:$(),on:"update",type:"(item: unknown, context: BadgeContentRenderContext) => string | HTMLElement | null",description:'Custom render for the WHOLE badge (main area), not just its content — return the entire pill/card. The component wraps it in `.ms__badge.ms__badge--custom` with `data-value` and delegates removal to any inner element with `data-action="remove"` (or `.ms__badge-remove`). Return null/empty to fall back to the default pill for that item.'},{configKey:"renderGroupLabelContentCallback",converter:$(),on:"update",type:"(groupName: string) => string | HTMLElement",description:"Customize a group label; may return an HTML string or element."},{configKey:"renderSelectedContentCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Custom render for the whole selected area."},{configKey:"renderSelectedItemContentCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Custom render for one selected item."},{configKey:"customStylesCallback",converter:$(),on:"update",type:"() => string",description:"Returns a CSS string injected into the component via a replaceable style slot (§12.8)."},{configKey:"beforeSearchCallback",converter:$(),on:"update",type:"(searchTerm: string) => string | null",description:"Runs before a search; return a rewritten term or null to veto."},{configKey:"beforeSelectCallback",converter:$(),on:"update",type:"(option: unknown, selectedOptions: unknown[]) => boolean | string | void",description:"Runs before selecting; return false to veto, or a string to veto and show it as a message."},{configKey:"beforeDeselectCallback",converter:$(),on:"update",type:"(option: unknown, selectedOptions: unknown[]) => boolean | string | void",description:"Runs before deselecting; return false to veto, or a string to veto and show it as a message."},{configKey:"addNewCallback",converter:$(),on:"update",type:"(value: string) => unknown | null | undefined | Promise<unknown | null | undefined>",description:"Create a new option from the typed text. May return a rich option object (renders via the same get*/render* callbacks as any option). Async + cancelable: return null/undefined to abort (no add, no `add` event). Omit entirely to handle creation yourself via the `add` event."},{configKey:"getAddNewTextCallback",converter:$(),on:"update",type:"(value: string) => string",description:'Dynamically compute the "add new" prompt label from the typed text (returns plain text). Takes precedence over `add-new-text`.'},{configKey:"keydownCallback",converter:$(),on:"update",type:"(context: MultiSelectKeydownContext) => boolean | void",description:"Intercept keydown before built-in handling; return true to suppress the default. Gets the event, current state, and an imperative controller."}],yn=[{name:"select",description:"An option was selected. `detail.option` is the selected option; `detail.selectedOptions`/`detail.selectedValues` are the full selection."},{name:"deselect",description:"An option was removed from the selection. `detail.option` is that option."},{name:"change",description:"The selection changed. `detail.selectedOptions`/`detail.selectedValues` are the full selection."},{name:"add",description:'The user chose to create a new option from the typed text (via the "add new" prompt or Enter) — requires `allow-add-new`. `detail.value` is the typed text; `detail.option` is the created item when `addNewCallback` produced one.'}],Oo=new Set(["dropdownWidth","selectedPopoverWidth","showDebugInfo","initialValues","optionsSource","optionsFormat","optionsSplitter","optionsRowSplitter","mobilePresentation","collapseBadgesBelow"]),Rt={dropdownWidth:"--ms-dropdown-width",selectedPopoverWidth:"--ms-selected-popover-width"};let xn=null;function _n(){return xn??(xn=zi(Io,"--ms-"))}const kn=[{key:"valueMember",member:"value",callbackKey:"getValueCallback"},{key:"displayValueMember",member:"label",callbackKey:"getDisplayValueCallback"},{key:"groupMember",member:"group",callbackKey:"getGroupCallback"},{key:"iconMember",member:"icon",callbackKey:"getIconCallback"},{key:"subtitleMember",member:"subtitle",callbackKey:"getSubtitleCallback"},{key:"disabledMember",member:"disabled",callbackKey:"getDisabledCallback"}];class De extends Gt{constructor(){super();z(this,y);z(this,Q);z(this,C);z(this,be);z(this,ht,null);z(this,ut,new Set);z(this,mt,!1);z(this,Ue,!1);z(this,Ge);z(this,Le);z(this,ve,!1);M(this,Q,this.attachShadow({mode:"open"})),Ei(h(this,Q),Io),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>this.setAttribute("data-ready","")):this.setAttribute("data-ready","")}formResetCallback(){var t;(t=h(this,C))==null||t.clearAll()}directionChanged(t){var o;(o=h(this,C))==null||o.refreshDirection()}reinit(){b(this,y,Ho).call(this),this.isConnected&&b(this,y,bs).call(this)}update(t){b(this,y,Fo).call(this,t),"customStylesCallback"in t&&b(this,y,ws).call(this),"showDebugInfo"in t&&b(this,y,xs).call(this);const o={};for(const[i,r]of Object.entries(t))Oo.has(i)||(o[i]=r===null?void 0:r);h(this,C)&&Object.keys(o).length>0&&(h(this,C).updateOptions(o)||b(this,y,bs).call(this)),"mobilePresentation"in t&&b(this,y,Ft).call(this,Je()),"collapseBadgesBelow"in t&&b(this,y,Kt).call(this,this.getBoundingClientRect().width)}connect(){h(this,C)||b(this,y,vs).call(this)}disconnect(){var t;(t=h(this,C))==null||t.destroy(),M(this,C,void 0)}environmentChanged(t){b(this,y,Ft).call(this,t)}resized({width:t}){b(this,y,Kt).call(this,t)}get name(){return this.getAttribute("name")}set name(t){t?this.setAttribute("name",t):this.removeAttribute("name")}get selectedValue(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.selectedValue)??null}get selectedItem(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.selectedItem)??null}getSelected(){return this.flush(),h(this,C)?h(this,C).getSelected():[]}setSelected(t,o={}){var i;this.flush(),(i=h(this,C))==null||i.setSelected(t,o)}getValue(){return this.flush(),h(this,C)?h(this,C).getValue():null}showMessage(t,o){var i;this.flush(),(i=h(this,C))==null||i.showMessage(t,o)}hideMessage(){var t;(t=h(this,C))==null||t.hideMessage()}clearSearch(){var t;this.flush(),(t=h(this,C))==null||t.clearSearch()}get searchText(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.searchText)??""}search(t){var o;this.flush(),(o=h(this,C))==null||o.search(t)}scrollToIndex(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToIndex(t,o))??!1}scrollToValue(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToValue(t,o))??!1}scrollToGroup(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToGroup(t,o))??!1}open(){var t;this.flush(),(t=h(this,C))==null||t.open()}close(){var t;this.flush(),(t=h(this,C))==null||t.close()}toggle(){var t;this.flush(),(t=h(this,C))==null||t.toggle()}get isOpen(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.isOpen)??!1}set isOpen(t){this.flush(),h(this,C)&&(h(this,C).isOpen=t)}destroy(){var t;(t=h(this,C))==null||t.destroy()}}Q=new WeakMap,C=new WeakMap,be=new WeakMap,ht=new WeakMap,ut=new WeakMap,mt=new WeakMap,Ue=new WeakMap,Ge=new WeakMap,Le=new WeakMap,y=new WeakSet,Ft=function(t){var r;const o=this.config.mobilePresentation??"auto",i=Ri(o,t);(r=h(this,C))==null||r.setPresentation(i==="modal"?"fullscreen":i)},ve=new WeakMap,Kt=function(t){const o=this.config.collapseBadgesBelow;if(o==null){h(this,ve)&&(M(this,ve,!1),b(this,y,fs).call(this));return}const i=t>0&&t<o;i!==h(this,ve)&&(M(this,ve,i),i?b(this,y,gs).call(this,"count"):b(this,y,fs).call(this))},fs=function(){const t=this.config.badgesDisplayMode??"badges";b(this,y,gs).call(this,t)},gs=function(t){var o;(o=h(this,C))==null||o.updateOptions({badgesDisplayMode:t})},bs=function(){var t;(t=h(this,C))==null||t.destroy(),M(this,C,void 0),b(this,y,vs).call(this)},vs=function(){b(this,y,Vo).call(this),b(this,y,Ko).call(this);const t=b(this,y,Do).call(this),o=b(this,y,Ro).call(this);o&&o.length>0?h(this,be).dataset.initialValues=JSON.stringify(o):delete h(this,be).dataset.initialValues,M(this,C,new xo(h(this,be),t)),b(this,y,ws).call(this),b(this,y,xs).call(this),b(this,y,Ft).call(this,Je()),M(this,ve,!1),b(this,y,Kt).call(this,this.getBoundingClientRect().width)},Vo=function(){if(h(this,be))return;const t=document.createElement("div");t.setAttribute("data-multiselect",""),this.className&&(t.className=this.className),h(this,Q).appendChild(t),M(this,ht,Ai(h(this,Q),{position:"first",className:"ms-custom-styles"})),M(this,be,t)},Do=function(){const t={...this.config};for(const i of Oo)delete t[i];for(const i of Object.keys(t))t[i]===null&&delete t[i];let o=t.options;if(h(this,Ue)&&h(this,Ge))o&&o.length>0&&U.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."),o=h(this,Ge);else if(!o||o.length===0){const i=this.config.optionsSource;if(i!=null){const r=this.config.optionsFormat??"json",{options:n,error:a}=So(i,r,{splitter:this.config.optionsSplitter,rowSplitter:this.config.optionsRowSplitter});a&&U.error(`[MultiSelectElement] ${a}`),o=n}}if(t.options=o,h(this,Ue))for(const{key:i,member:r,callbackKey:n}of kn)t[i]===void 0&&!t[n]&&(t[i]=r);return t.getCounterCallback||(t.getCounterCallback=(i,r)=>r!==void 0?`+${r} more`:`${i} selected`),t.onSelect=i=>{var r;this.emit("select",{option:i,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,y,ft).call(this)})},t.onDeselect=i=>{var r;this.emit("deselect",{option:i,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,y,ft).call(this)})},t.onChange=i=>{this.emit("change",{selectedOptions:i,selectedValues:b(this,y,ft).call(this)})},t.onAddNew=i=>{var r;this.emit("add",{value:i.value,option:i.option,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,y,ft).call(this)})},t.container=h(this,Q),t.hostElement=this,t},Ro=function(){if(h(this,Le)&&h(this,Le).length>0)return h(this,Le);const t=this.config.initialValues;return t&&t.length>0?t:void 0},ft=function(){var o;const t=(o=h(this,C))==null?void 0:o.getValue();return t==null?[]:Array.isArray(t)?t:[t]},ws=function(){const t=h(this,ht);if(!t)return;const o=this.config.customStylesCallback;if(typeof o!="function"){t.clear();return}try{const i=o();t.set(i),i&&b(this,y,Bo).call(this,i)}catch(i){U.warn("[MultiSelectElement] customStylesCallback threw",i),t.clear()}},Bo=function(t){const o=_n();if(o.size!==0)for(const{name:i,suggestions:r}of Vi(t,{prefix:"--ms-",consumed:o}))h(this,ut).has(i)||(h(this,ut).add(i),console.warn(`[web-multiselect] customStylesCallback sets "${i}", which no web-multiselect style consumes — it will have no effect.`+(r.length?` Did you mean: ${r.join(", ")}?`:"")+" (If it's for your own custom-rendered content, ignore this.)"))},Ho=function(){for(const t of Object.keys(Rt))b(this,y,ys).call(this,Rt[t],this.config[t])},Fo=function(t){for(const o of Object.keys(Rt))o in t&&b(this,y,ys).call(this,Rt[o],t[o])},ys=function(t,o){o==null||o===""?this.style.removeProperty(t):this.style.setProperty(t,String(o))},Ko=function(){if(h(this,mt))return;M(this,mt,!0);const t=b(this,y,Wo).call(this);t&&(M(this,Ge,t),M(this,Ue,!0))},Wo=function(){const t=Array.from(this.children);if(t.length===0)return null;const o=[];let i=!1;const r=(n,a)=>{var c,d;const l={value:n.value||((c=n.textContent)==null?void 0:c.trim())||"",label:((d=n.textContent)==null?void 0:d.trim())||n.value||""};a&&(l.group=a),n.hasAttribute("selected")&&(h(this,Le)??M(this,Le,[])).push(l.value),n.hasAttribute("disabled")&&(l.disabled=!0),n.hasAttribute("data-icon")&&(l.icon=n.getAttribute("data-icon")),n.hasAttribute("data-subtitle")&&(l.subtitle=n.getAttribute("data-subtitle")),o.push(l),i=!0};for(const n of t)if(n.tagName==="OPTION")r(n);else if(n.tagName==="OPTGROUP"){const a=n,l=a.label||a.getAttribute("label")||"Group";for(const c of Array.from(a.querySelectorAll("option")))r(c,l)}if(!i)return null;U.debug(`[MultiSelectElement] Parsed ${o.length} declarative options from Light DOM`);for(const n of t)(n.tagName==="OPTION"||n.tagName==="OPTGROUP")&&n.remove();return o},xs=function(){const t=h(this,Q).querySelector(".ms__debug-info");if(t&&t.remove(),!this.config.showDebugInfo)return;const o=document.createElement("div");o.className="ms__debug-info";const i=document.createElement("details"),r=document.createElement("summary");r.textContent="Debug Info";const n=document.createElement("div");n.className="ms__debug-stats",i.appendChild(r),i.appendChild(n),o.appendChild(i),h(this,Q).appendChild(o),b(this,y,_s).call(this)},_s=function(){var l,c,d,u;const t=h(this,Q).querySelector(".ms__debug-stats");if(!t||!h(this,C))return;const o="2.0.0",i=typeof window<"u"&&((c=(l=window.components)==null?void 0:l["web-multiselect"])==null?void 0:c.getInstances().length)||0,r=h(this,C).getSelected().length,n=((d=this.config.options)==null?void 0:d.length)||0,a=h(this,C);t.innerHTML=`
|
|
39
|
+
${o}`:t}attachOptionTooltips(){if(this.destroyAllOptionTooltips(),!this.options.isOptionTooltipsEnabled)return;this.dropdown.querySelectorAll(".ms__option").forEach(t=>{const o=t,i=parseInt(o.dataset.index??"-1",10);if(i<0)return;const r=this.filteredOptions[i];if(!r)return;const n=this.buildOptionTooltipContent(r);n&&this.spawnTooltip({id:`option-${i}`,trigger:o,content:n,placement:this.options.optionTooltipPlacement??"top-start",offsetDistance:this.options.optionTooltipOffset??this.options.badgeTooltipOffset??8,showDelay:this.options.optionTooltipDelay??this.options.badgeTooltipDelay??100,cssClass:"ms__option-tooltip",visibleClass:"ms__option-tooltip--visible",followCursor:this.options.isOptionTooltipFollowCursor})})}markTruncatedOptions(){if(this.presentationMode!=="fullscreen")return;this.dropdown.querySelectorAll(".ms__option").forEach(t=>{const o=t,i=o.querySelector(".ms__option-title"),r=!!i&&i.scrollWidth>i.clientWidth+1;o.classList.toggle("ms__option--truncated",r)})}toggleLabelReveal(e){var d;if(this.labelRevealPopover&&this.labelRevealTrigger===e){this.hideLabelReveal();return}this.hideLabelReveal();const t=e.closest(".ms__option");if(!t)return;const o=parseInt(t.dataset.index??"-1",10);if(o<0)return;const i=this.isTreeMode()?(d=this.treeNodes[o])==null?void 0:d.data:this.filteredOptions[o];if(!i)return;const r=this.buildOptionTooltipContent(i);if(!r)return;const n=document.createElement("div");n.className="ms__option-tooltip ms__option-tooltip--fullscreen",typeof r=="string"?n.textContent=r:n.appendChild(r);const a=this.element.getRootNode(),l=a instanceof ShadowRoot?a:null,c=this.options.container??l??document.body;this.labelRevealTrigger=e,this.labelRevealPanel=n,this.labelRevealPopover=nn({reference:e,panel:n,container:c,placement:"top-end",offset:this.options.optionTooltipOffset??this.options.badgeTooltipOffset??8,shift:8,strategy:"fixed"}),this.labelRevealPopover.open(),requestAnimationFrame(()=>n.classList.add("ms__option-tooltip--visible"))}hideLabelReveal(){this.labelRevealPopover&&(this.labelRevealPopover.destroy(),this.labelRevealPopover=null),this.labelRevealPanel&&(this.labelRevealPanel.remove(),this.labelRevealPanel=null),this.labelRevealTrigger=null}showMessage(e,t){this.hideMessage();const o=(t==null?void 0:t.variant)??"info",i=(t==null?void 0:t.duration)??3e3,r=o==="error"||o==="warning",n=document.createElement("div");n.className=`ms__message ms__message--${o}`,n.setAttribute("role",r?"alert":"status"),n.setAttribute("aria-live",r?"assertive":"polite"),typeof e=="string"?n.textContent=e:n.appendChild(e),n.addEventListener("click",()=>this.hideMessage());const a=this.element.getRootNode(),l=a instanceof ShadowRoot?a:null;if((this.options.container??l??document.body).appendChild(n),this.messageEl=n,this.presentationMode==="fullscreen"&&(h(this,R)||this.showSelectedPopover))n.classList.add("ms__message--fullscreen");else{const u=rt(n,this.inputWrapper,{strategy:"fixed",placement:(t==null?void 0:t.placement)??"bottom",offset:8,shift:8,lockPlacement:"freeze"});this.messageCleanup=()=>u.destroy()}requestAnimationFrame(()=>n.classList.add("ms__message--visible")),i>0&&(this.messageTimer=setTimeout(()=>this.hideMessage(),i))}hideMessage(){this.messageTimer!==null&&(clearTimeout(this.messageTimer),this.messageTimer=null),this.messageCleanup&&(this.messageCleanup(),this.messageCleanup=null),this.messageEl&&(this.messageEl.remove(),this.messageEl=null)}hideOptionTooltips(){for(const[e,t]of this.tooltips)e.startsWith("option-")&&t.hide()}destroyAllOptionTooltips(){var e;for(const t of Array.from(this.tooltips.keys()))t.startsWith("option-")&&((e=this.tooltips.get(t))==null||e.destroy(),this.tooltips.delete(t))}attachActionButtonTooltips(){this.dropdown.querySelectorAll(".ms__action-btn").forEach(t=>{var c,d;const o=t,i=o.dataset.action;if(!i)return;const r=parseInt(o.dataset.buttonIndex||"-1"),n=r>=0?(c=this.options.actionButtons)==null?void 0:c[r]:(d=this.options.actionButtons)==null?void 0:d.find(u=>u.action===i);if(!n)return;const a=n.getTooltipCallback?n.getTooltipCallback(this):n.tooltip;if(!a)return;const l=`action-${r>=0?r:i}`;this.spawnTooltip({id:l,trigger:o,content:a})})}destroyAllActionButtonTooltips(){var e;for(const t of Array.from(this.tooltips.keys()))t.startsWith("action-")&&((e=this.tooltips.get(t))==null||e.destroy(),this.tooltips.delete(t))}destroyAllBadgeTooltips(){var e;for(const t of Array.from(this.tooltips.keys()))!t.startsWith("action-")&&!t.startsWith("popover-")&&((e=this.tooltips.get(t))==null||e.destroy(),this.tooltips.delete(t))}destroy(){var e;this.destroyAllTooltips(),this.hideLabelReveal(),this.hideMessage(),this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=void 0),this.abortInFlightSearch(),this.dropdownCleanup&&this.dropdownCleanup(),this.hintCleanup&&this.hintCleanup(),this.selectedPopoverCleanup&&this.selectedPopoverCleanup(),this.overlayHistoryActive&&(this.overlayHistoryActive=!1,typeof window<"u"&&window.removeEventListener("popstate",this.onOverlayPopstate)),this.exitFullscreen(),this.documentClickHandler&&(document.removeEventListener("click",this.documentClickHandler),this.documentClickHandler=null),this.documentKeydownHandler&&(document.removeEventListener("keydown",this.documentKeydownHandler),this.documentKeydownHandler=null),(e=this.overlayCoord)==null||e.dispose(),this.overlayCoord=null,this.virtualScroll&&(this.virtualScroll.destroy(),this.virtualScroll=null),this.dropdown&&this.dropdown.remove(),this.hint&&this.hint.remove(),this.selectedPopover&&this.selectedPopover.remove(),this.element.innerHTML="",this.element.classList.remove("ms","ms--open","ms--no-checkboxes"),nt.info(`[${this.instanceId}] Component destroyed`)}}R=new WeakMap;function gn(){return{fromAttribute(s){if(s===null||s.trim()==="")return[];const e=s.trim();if(e.startsWith("["))try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.split(",").map(t=>t.trim())},validate(s){return Array.isArray(s)&&s.every(e=>typeof e=="string"||typeof e=="number")},toAttribute(s){return Array.isArray(s)?JSON.stringify(s):null}}}const Co=["json","csv","plain"],So=",",To=`
|
|
40
|
+
`;function Io(s,e,t={}){if(s==null||s.trim()==="")return{options:[]};const o=Po(t.splitter??So)||So,i=Po(t.rowSplitter??To)||To;switch(e){case"csv":return wn(s,o,i);case"plain":return vn(s,o,i);case"json":default:return bn(s)}}function Po(s){return s.replace(/\\[ntr\\]/g,e=>e==="\\n"?`
|
|
41
|
+
`:e==="\\t"?" ":e==="\\r"?"\r":"\\")}function bn(s){let e;try{e=JSON.parse(s)}catch(t){return{options:[],error:`data-options is not valid JSON: ${t.message}`}}return Array.isArray(e)?{options:e}:{options:[],error:"data-options JSON must be an array"}}function vn(s,e,t){return{options:s.split(t).flatMap(i=>i.split(e)).map(i=>i.trim()).filter(i=>i.length>0).map(i=>[i,i])}}function wn(s,e,t){const o=yn(s,e,t).filter(n=>!(n.length===1&&n[0].trim()===""));if(o.length<2)return{options:[],error:"data-options CSV needs a header row and at least one data row"};const i=o[0].map(n=>n.trim());return{options:o.slice(1).map(n=>{const a={};return i.forEach((l,c)=>{a[l]=(n[c]??"").trim()}),a})}}function yn(s,e,t){const o=[];let i=[],r="",n=!1;for(let a=0;a<s.length;){const l=s[a];if(n){l==='"'?s[a+1]==='"'?(r+='"',a+=2):(n=!1,a+=1):(r+=l,a+=1);continue}l==='"'?(n=!0,a+=1):s.startsWith(e,a)?(i.push(r),r="",a+=e.length):s.startsWith(t,a)?(i.push(r),o.push(i),i=[],r="",a+=t.length):(l==="\r"||(r+=l),a+=1)}return i.push(r),o.push(i),o}const Oo=`@layer variables,component,overrides;@layer variables{:host{display:block;--ms-rem: var(--base-rem, 10px);font-family:var(--ms-font-family, var(--base-font-family, inherit));--ms-accent-color: var(--base-accent-color, #3b82f6);--ms-accent-color-hover: var(--base-accent-color-hover, #2563eb);--ms-accent-color-active: var(--base-accent-color-active, #1d4ed8);--ms-accent-color-light: var(--base-accent-color-light, light-dark(#eff6ff, #1e3a5f));--ms-accent-color-light-hover: var(--base-accent-color-light-hover, light-dark(#e0f2fe, #264a73));--ms-text-color-1: var(--base-text-color-1, light-dark(#111827, #f5f5f5));--ms-text-color-2: var(--base-text-color-2, light-dark(#353b47, #d4d4d4));--ms-text-color-3: var(--base-text-color-3, light-dark(#6b7280, #a3a3a3));--ms-text-color-4: var(--base-text-color-4, light-dark(#a0a3a9, #737373));--ms-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--ms-text-primary: var(--ms-text-color-1);--ms-text-secondary: var(--ms-text-color-3);--ms-primary-bg: var(--base-hover-bg, color-mix(in srgb, var(--ms-text-color-1) 8%, var(--base-main-bg, light-dark(#ffffff, #1a1a1a))));--ms-primary-bg-hover: var(--base-active-bg, color-mix(in srgb, var(--ms-text-color-1) 14%, var(--base-main-bg, light-dark(#ffffff, #1a1a1a))));--ms-border-color: var(--base-border-color, light-dark(#cbd5e1, #52525b));--ms-border: var(--base-border, 1px solid var(--ms-border-color));--ms-input-bg: var(--base-input-bg, light-dark(#ffffff, #1a1a1a));--ms-input-color: var(--base-input-color, var(--ms-text-color-1));--ms-input-border: var(--base-input-border, 1px solid var(--ms-border-color));--ms-input-border-hover: var(--base-input-border-hover, 1px solid var(--ms-accent-color));--ms-input-border-focus: var(--base-input-border-focus, 1px solid var(--ms-accent-color));--ms-input-placeholder-color: var(--base-input-placeholder-color, var(--ms-text-color-4));--ms-toggle-icon-color: var(--ms-text-color-3);--ms-toggle-icon-color-open: var(--ms-text-color-3);--ms-toggle-icon-size: calc(1.6 * var(--ms-rem));--ms-toggle-rotate-closed: 90deg;--ms-toggle-rotate-open: -90deg;--ms-counter-badge-bg: var(--ms-accent-color);--ms-counter-badge-bg-hover: var(--ms-accent-color-hover);--ms-counter-badge-color: var(--ms-text-color-on-accent);--ms-hint-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-hint-color: var(--ms-text-color-4);--ms-hint-border-color: var(--ms-border-color);--ms-dropdown-bg: var(--base-dropdown-bg, var(--base-elevated-bg, light-dark(#ffffff, #1a1a1a)));--ms-dropdown-text-color: var(--ms-text-color-1);--ms-dropdown-border-color: var(--ms-border-color);--ms-dropdown-box-shadow-semantic: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-actions-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-actions-border-color: var(--ms-border-color);--ms-action-button-bg: transparent;--ms-action-button-bg-hover: var(--ms-primary-bg);--ms-action-button-border-color: var(--ms-border-color);--ms-action-button-border-color-hover: var(--ms-accent-color);--ms-action-button-color: var(--ms-text-color-1);--ms-group-border-color: var(--ms-border-color);--ms-option-text-color: var(--ms-text-color-1);--ms-option-bg: transparent;--ms-option-bg-hover: var(--ms-primary-bg);--ms-option-color-hover: inherit;--ms-option-bg-focused: var(--ms-primary-bg);--ms-option-color-focused: inherit;--ms-option-outline-color-focused: var(--ms-accent-color);--ms-option-bg-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-option-bg-matched: color-mix(in srgb, var(--ms-accent-color) 8%, transparent);--ms-option-color-matched: inherit;--ms-option-border-matched-color: color-mix(in srgb, var(--ms-accent-color) 40%, transparent);--ms-option-title-color: var(--ms-text-color-1);--ms-option-subtitle-color: var(--ms-text-color-3);--ms-option-mark-bg: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-option-mark-color: inherit;--ms-loading-color: var(--ms-text-color-3);--ms-badge-bg: var(--ms-accent-color-light);--ms-badge-bg-hover: color-mix(in srgb, var(--ms-badge-bg) 88%, var(--ms-badge-text-color) 12%);--ms-badge-bg-active: var(--ms-accent-color-light-hover);--ms-badge-text-bg-hover: color-mix(in srgb, var(--ms-badge-text-bg) 88%, var(--ms-badge-text-color) 12%);--ms-badge-text-color-hover: var(--ms-badge-text-color);--ms-badge-counter-border-color: var(--ms-border-color);--ms-badge-counter-text-bg: color-mix(in srgb, var(--ms-text-color-1) 10%, transparent);--ms-badge-counter-text-bg-hover: color-mix(in srgb, var(--ms-text-color-1) 16%, transparent);--ms-badge-counter-text-color: var(--ms-text-color-1);--ms-badge-counter-text-color-hover: var(--ms-text-color-1);--ms-badge-counter-remove-bg: color-mix(in srgb, var(--ms-text-color-1) 10%, transparent);--ms-badge-counter-remove-bg-hover: color-mix(in srgb, var(--ms-text-color-1) 16%, transparent);--ms-badge-counter-remove-color: var(--ms-text-color-3);--ms-badge-counter-remove-color-hover: var(--ms-text-color-1);--ms-counter-wrapper-border-color: var(--ms-border-color);--ms-tooltip-bg: var(--base-tooltip-bg, var(--base-inverse-bg, light-dark(#333333, #f5f5f5)));--ms-tooltip-text-color: var(--base-tooltip-text-color, light-dark(#ffffff, #1a1a1a));--ms-selected-popover-bg: var(--base-dropdown-bg, var(--base-elevated-bg, light-dark(#ffffff, #1a1a1a)));--ms-selected-popover-border-color: var(--ms-border-color);--ms-selected-popover-header-border-color: var(--ms-border-color);--ms-input-padding-h: calc(1.2 * var(--ms-rem));--ms-input-gap: calc(.6 * var(--ms-rem));--ms-input-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-border-width: 1px;--ms-input-border-radius: var(--ms-border-radius-md);--ms-input-text: var(--ms-text-color-1);--ms-input-bg-disabled: var(--base-input-bg-disabled, rgba(107, 114, 128, .05));--ms-toggle-color: var(--ms-text-color-3);--ms-transform-rotate-180: 180deg;--ms-input-clear-size: calc(2.4 * var(--ms-rem));--ms-input-clear-icon-size: calc(1.4 * var(--ms-rem));--ms-input-clear-color: var(--base-input-clear-color, var(--ms-text-secondary));--ms-input-clear-bg-hover: var(--base-input-clear-bg-hover, var(--ms-option-bg-matched, transparent));--ms-input-clear-border-radius: var(--ms-border-radius);--ms-counter-padding: calc(.2 * var(--ms-rem)) calc(.4 * var(--ms-rem));--ms-counter-bg: var(--ms-accent-color);--ms-counter-color: var(--ms-text-color-on-accent);--ms-counter-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-counter-font-weight: var(--base-font-weight-semibold, 600);--ms-counter-border-radius: var(--ms-border-radius-sm);--ms-counter-bg-hover: var(--ms-accent-color-hover);--ms-transform-scale-hover: 1.1;--ms-hint-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-hint-border: 1px solid var(--ms-hint-border-color);--ms-hint-border-radius: var(--ms-border-radius-lg);--ms-hint-box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ms-hint-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-dropdown-border: var(--base-dropdown-border, 1px solid var(--ms-dropdown-border-color));--ms-dropdown-border-radius: var(--ms-border-radius-lg);--ms-dropdown-inner-border-radius: max(0px, calc(var(--ms-dropdown-border-radius) - 1px));--ms-dropdown-box-shadow: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-input-current-width: auto;--ms-dropdown-width: var(--ms-input-current-width);--ms-options-max-height: calc(32 * var(--ms-rem));--ms-option-color: var(--ms-text-color-1);--ms-z-index-dropdown: 9999;--ms-z-index-sticky: 1;--ms-z-index-fullscreen: 10001;--ms-z-index-fullscreen-tooltip: 10002;--ms-fullscreen-rem: 12px;--ms-fullscreen-bg: var(--ms-dropdown-bg);--ms-fullscreen-text-color: var(--ms-dropdown-text-color);--ms-fullscreen-header-bg: var(--ms-dropdown-bg);--ms-fullscreen-header-border: 1px solid var(--ms-dropdown-border-color);--ms-fullscreen-header-gap: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding-v: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding-h: calc(1.2 * var(--ms-fullscreen-rem));--ms-fullscreen-header-padding: var(--ms-fullscreen-header-padding-v) var(--ms-fullscreen-header-padding-h);--ms-fullscreen-header-min-height: calc(5.6 * var(--ms-fullscreen-rem));--ms-fullscreen-title-font-size: calc(1.7 * var(--ms-fullscreen-rem));--ms-fullscreen-title-font-weight: var(--base-font-weight-semibold, 600);--ms-fullscreen-search-border: var(--ms-input-border);--ms-fullscreen-search-border-radius: var(--ms-input-border-radius);--ms-fullscreen-search-padding: calc(.8 * var(--ms-fullscreen-rem)) calc(1.2 * var(--ms-fullscreen-rem));--ms-fullscreen-search-font-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-icon-size: calc(1.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-inset: calc(.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-gutter: calc(3.4 * var(--ms-fullscreen-rem));--ms-fullscreen-search-clear-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-search-clear-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-mode-toggle-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-mode-toggle-icon-size: calc(1.5 * var(--ms-fullscreen-rem));--ms-fullscreen-mode-toggle-gap: var(--ms-fullscreen-header-gap);--ms-fullscreen-mode-toggle-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-mode-toggle-bg: transparent;--ms-fullscreen-mode-toggle-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-close-size: calc(3.6 * var(--ms-fullscreen-rem));--ms-fullscreen-close-icon-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-close-color: var(--ms-dropdown-text-color);--ms-fullscreen-close-bg: transparent;--ms-fullscreen-close-border: none;--ms-fullscreen-close-border-radius: 50%;--ms-fullscreen-close-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-close-edge-nudge: calc(.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-size: calc(2.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-icon-size: calc(1.8 * var(--ms-fullscreen-rem));--ms-fullscreen-info-color: var(--ms-accent-color);--ms-fullscreen-info-bg-hover: var(--ms-option-bg-matched, transparent);--ms-fullscreen-nav-gap: calc(.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-padding-top: calc(.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-count-font-size: calc(1.3 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-count-color: var(--ms-text-muted-color, var(--ms-dropdown-text-color));--ms-fullscreen-nav-btn-size: calc(3.2 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-btn-icon-size: calc(1.6 * var(--ms-fullscreen-rem));--ms-fullscreen-nav-btn-color: var(--ms-dropdown-text-color);--ms-fullscreen-nav-btn-bg: var(--ms-option-bg-matched, transparent);--ms-fullscreen-nav-btn-bg-hover: color-mix(in srgb, var(--ms-accent-color) 22%, transparent);--ms-fullscreen-nav-btn-icon: var(--ms-icon-chevron);--ms-icon-chevron: var(--base-icon-chevron, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>"));--ms-icon-info: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/><circle cx='12' cy='7.5' r='1.3' fill='black'/><path d='M12 11v6' stroke='black' stroke-width='2' stroke-linecap='round' fill='none'/></svg>");--ms-fullscreen-tree-base-indent: calc(.7 * var(--ms-fullscreen-rem));--ms-fullscreen-tree-indent: calc(1.2 * var(--ms-fullscreen-rem));--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem));--ms-actions-border-bottom: 1px solid var(--ms-actions-border-color);--ms-action-btn-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-action-btn-border: var(--ms-border);--ms-action-btn-border-radius: var(--ms-border-radius-sm);--ms-action-btn-bg: transparent;--ms-action-btn-color: inherit;--ms-action-btn-bg-hover: var(--ms-primary-bg);--ms-action-btn-border-color-hover: var(--ms-accent-color);--ms-transform-scale-active: .98;--ms-options-padding: 0;--ms-group-border-top: 1px solid var(--ms-group-border-color);--ms-group-margin-top: calc(.4 * var(--ms-rem));--ms-group-padding-top: calc(.4 * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-font-weight: var(--base-font-weight-semibold, 600);--ms-group-label-color: var(--ms-text-color-3);--ms-group-label-transform: uppercase;--ms-group-label-letter-spacing: .05em;--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-padding-h: calc(1.2 * var(--ms-rem));--ms-option-min-height: auto;--ms-option-outline-focused: 2px solid var(--ms-option-outline-color-focused);--ms-option-focus-outline-offset: -2px;--ms-option-border-matched: 3px solid var(--ms-option-border-matched-color);--ms-option-bg-focused-hover: var(--ms-primary-bg);--ms-option-bg-matched-hover: color-mix(in srgb, var(--ms-accent-color) 12%, transparent);--ms-option-bg-selected-focused: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-bg-selected-matched: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-disabled-bg: var(--base-disabled-bg, transparent);--ms-option-bg-disabled-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-disabled-opacity: .5;--ms-option-content-gap: calc(.8 * var(--ms-rem));--ms-option-icon-size: calc(2 * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-mark-font-weight: var(--base-font-weight-semibold, 600);--ms-option-title-white-space: normal;--ms-option-title-overflow: visible;--ms-option-title-text-overflow: clip;--ms-option-subtitle-margin-top: calc(.4 * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-subtitle-line-height: var(--base-line-height-tight, 1.25);--ms-checkbox-margin-top: 0;--ms-checkbox-margin-right: 0;--ms-checkbox-margin-bottom: 0;--ms-checkbox-margin-left: 0;--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-checkbox-scale: 1;--ms-checkbox-align: center;--ms-checkbox-bg: var(--ms-input-bg);--ms-checkbox-border-width: 1px;--ms-checkbox-border-color: var(--base-checkbox-border-color, #8f8f8f);--ms-checkbox-border: var(--ms-checkbox-border-width) solid var(--ms-checkbox-border-color);--ms-checkbox-border-radius: calc(.3 * var(--ms-rem));--ms-checkbox-checkmark-thickness: 2.5px;--ms-checkbox-checked-bg: var(--ms-accent-color);--ms-checkbox-checked-border: var(--ms-checkbox-border-width) solid var(--ms-accent-color);--ms-checkbox-checkmark-color: var(--ms-text-color-on-accent);--ms-checkbox-hover-border-color: var(--ms-accent-color);--ms-checkbox-disabled-bg: var(--ms-primary-bg);--ms-checkbox-disabled-border: var(--ms-checkbox-border-width) solid var(--ms-border-color);--ms-checkbox-checked-bg-hover: var(--ms-accent-color-hover);--ms-checkbox-checked-border-color-hover: var(--ms-accent-color-hover);--ms-state-min-height: calc(8 * var(--ms-rem));--ms-empty-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-empty-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-empty-color: var(--ms-text-color-3);--ms-add-new-padding: var(--ms-option-padding);--ms-add-new-gap: var(--ms-option-gap);--ms-add-new-font-size: var(--ms-empty-font-size);--ms-add-new-color: var(--ms-accent-color);--ms-add-new-color-hover: var(--ms-accent-color);--ms-add-new-bg-hover: var(--ms-option-bg-hover);--ms-add-new-icon-size: calc(1.6 * var(--ms-rem));--ms-loader-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-loader-gap: calc(.8 * var(--ms-rem));--ms-loading-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-loading-text-color: var(--ms-text-color-3);--ms-badges-gap: calc(.8 * var(--ms-rem));--ms-badges-margin-bottom: calc(.8 * var(--ms-rem));--ms-badges-margin-top: calc(.8 * var(--ms-rem));--ms-badges-margin-left: calc(.4 * var(--ms-rem));--ms-badges-margin-right: calc(.4 * var(--ms-rem));--ms-inline-align: center;--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(2.7 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-font-weight: var(--base-font-weight-semibold, 600);--ms-badge-border-radius: var(--ms-border-radius-sm);--ms-order-first: -1;--ms-badge-text-padding: 0 calc(.8 * var(--ms-rem));--ms-badge-text-bg: var(--ms-accent-color-light);--ms-badge-text-color: var(--ms-accent-color);--ms-badge-text-border: none;--ms-badge-remove-width: calc(2.7 * var(--ms-rem));--ms-badge-remove-bg: var(--ms-accent-color);--ms-badge-remove-color: var(--ms-text-color-on-accent);--ms-badge-remove-border: none;--ms-badge-remove-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-remove-bg-hover: var(--ms-accent-color-hover);--ms-badge-remove-box-shadow-focus: 0 0 0 2px color-mix(in srgb, var(--ms-accent-color) 50%, transparent);--ms-badge-remove-icon-size: calc(1.4 * var(--ms-rem));--ms-icon-remove: var(--base-icon-remove, var(--base-icon-close, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>")));--ms-icon-search-clear: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m13.5 8.5-5 5'/><path d='m8.5 8.5 5 5'/><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");--ms-icon-search: var(--base-icon-search, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>"));--ms-icon-filter: var(--base-icon-filter, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/></svg>"));--ms-icon-check: var(--base-icon-check, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"));--ms-icon-indeterminate: var(--base-icon-indeterminate, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/></svg>"));--ms-icon-check-size: var(--base-icon-check-size, 68%);--ms-icon-add-new: var(--base-icon-plus, var(--base-icon-add, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='M12 5v14'/></svg>")));--ms-badge-counter-bg: transparent;--ms-badge-counter-border: 1px solid var(--ms-badge-counter-border-color);--ms-badge-counter-border-radius: var(--ms-border-radius-sm);--ms-more-badge-bg: var(--ms-accent-color-light);--ms-more-badge-hover-bg: var(--ms-badge-bg-hover);--ms-more-badge-active-bg: var(--ms-accent-color-light-hover);--ms-count-display-margin-bottom: calc(.8 * var(--ms-rem));--ms-count-display-margin-top: calc(.8 * var(--ms-rem));--ms-count-display-margin-left: calc(.8 * var(--ms-rem));--ms-count-display-margin-right: calc(.8 * var(--ms-rem));--ms-counter-wrapper-bg: transparent;--ms-counter-wrapper-border: var(--ms-border);--ms-counter-wrapper-border-radius: var(--ms-border-radius-sm);--ms-counter-wrapper-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-counter-wrapper-gap: calc(.4 * var(--ms-rem));--ms-counter-wrapper-bg-hover: var(--ms-primary-bg);--ms-counter-wrapper-border-color-hover: var(--ms-accent-color);--ms-count-text-bg: transparent;--ms-count-text-border: none;--ms-count-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-count-text-color: var(--ms-text-color-1);--ms-count-clear-size: calc(1.6 * var(--ms-rem));--ms-count-clear-bg: transparent;--ms-count-clear-color: var(--ms-text-color-3);--ms-count-clear-font-size: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-count-clear-border-radius: var(--ms-border-radius-sm);--ms-count-clear-bg-hover: var(--ms-accent-color);--ms-count-clear-color-hover: var(--ms-text-color-on-accent);--ms-count-clear-icon-size: calc(1.4 * var(--ms-rem));--ms-icon-clear: var(--base-icon-clear, var(--ms-icon-remove));--ms-tooltip-color: var(--ms-tooltip-text-color);--ms-tooltip-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tooltip-border-radius: var(--ms-border-radius-lg);--ms-tooltip-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-tooltip-max-width: calc(32 * var(--ms-rem));--ms-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ms-tooltip-z-index: 10000;--ms-option-tooltip-bg: var(--ms-tooltip-bg);--ms-option-tooltip-text-color: var(--ms-tooltip-text-color);--ms-option-tooltip-padding: var(--ms-tooltip-padding);--ms-option-tooltip-border-radius: var(--ms-tooltip-border-radius);--ms-option-tooltip-font-size: var(--ms-tooltip-font-size);--ms-option-tooltip-max-width: var(--ms-tooltip-max-width);--ms-option-tooltip-shadow: var(--ms-tooltip-shadow);--ms-option-tooltip-z-index: var(--ms-tooltip-z-index);--ms-message-bg: var(--ms-message-info-bg);--ms-message-color: var(--ms-message-info-color);--ms-message-border: 1px solid transparent;--ms-message-border-radius: var(--ms-border-radius-lg);--ms-message-padding: calc(1 * var(--ms-rem)) calc(1.4 * var(--ms-rem));--ms-message-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-message-font-weight: var(--base-font-weight-medium, 500);--ms-message-max-width: calc(40 * var(--ms-rem));--ms-message-shadow: 0 4px 16px rgb(0 0 0 / .18);--ms-message-fullscreen-offset: calc(2.4 * var(--ms-fullscreen-rem));--ms-message-z-index: var(--ms-z-index-fullscreen-tooltip);--ms-message-info-bg: var(--ms-tooltip-bg);--ms-message-info-color: var(--ms-tooltip-text-color);--ms-message-warning-bg: var(--base-warning-bg, #f59e0b);--ms-message-warning-color: var(--base-warning-color, #1a1a1a);--ms-message-error-bg: var(--base-danger-bg, #ef4444);--ms-message-error-color: var(--base-danger-color, #ffffff);--ms-message-success-bg: var(--base-success-bg, #10b981);--ms-message-success-color: var(--base-success-color, #ffffff);--ms-z-index-popover: 10000;--ms-selected-popover-width: var(--ms-input-current-width);--ms-selected-popover-max-height: calc(32 * var(--ms-rem));--ms-selected-popover-border: 1px solid var(--ms-selected-popover-border-color);--ms-selected-popover-border-radius: var(--ms-border-radius-lg);--ms-selected-popover-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-selected-popover-header-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-selected-popover-header-bg: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-selected-popover-header-border-bottom: 1px solid var(--ms-selected-popover-header-border-color);--ms-selected-popover-header-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-selected-popover-header-font-weight: var(--base-font-weight-semibold, 600);--ms-selected-popover-header-color: var(--ms-text-color-1);--ms-popover-close-size: calc(2.4 * var(--ms-rem));--ms-selected-popover-close-bg: transparent;--ms-selected-popover-close-color: var(--ms-text-color-3);--ms-selected-popover-close-font-size: calc(var(--base-font-size-xl, 2) * var(--ms-rem));--ms-selected-popover-close-border-radius: var(--ms-border-radius-sm);--ms-selected-popover-close-bg-hover: var(--ms-accent-color);--ms-selected-popover-close-color-hover: var(--ms-text-color-on-accent);--ms-selected-popover-close-icon-size: calc(1.4 * var(--ms-rem));--ms-selected-popover-body-gap: calc(.4 * var(--ms-rem));--ms-selected-popover-body-padding: calc(.8 * var(--ms-rem));--ms-selected-popover-body-max-height: calc(28.8 * var(--ms-rem));--ms-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--ms-rem));--ms-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-font-weight-normal: var(--base-font-weight-normal, 400);--ms-font-weight-medium: var(--base-font-weight-medium, 500);--ms-font-weight-semibold: var(--base-font-weight-semibold, 600);--ms-line-height-none: 1;--ms-line-height-tight: var(--base-line-height-tight, 1.25);--ms-line-height-normal: var(--base-line-height-normal, 1.5);--ms-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--ms-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--ms-rem));--ms-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--ms-rem));--ms-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--ms-rem));--ms-border-radius: var(--ms-border-radius-md);--ms-spacing-xs: calc(.4 * var(--ms-rem));--ms-spacing-sm: calc(.8 * var(--ms-rem));--ms-spacing-md: calc(1.2 * var(--ms-rem));--ms-spacing-lg: calc(1.6 * var(--ms-rem));--ms-transition-fast: .15s;--ms-transition-normal: .2s;--ms-easing-snappy: var(--base-ease-standard, cubic-bezier(.4, 0, .2, 1));--ms-placeholder-opacity: .6;--ms-disabled-input-opacity: .6;--ms-scrollbar-width: 8px;--ms-scrollbar-track-bg: transparent;--ms-scrollbar-thumb-bg: var(--ms-border-color);--ms-scrollbar-thumb-bg-hover: var(--ms-text-color-3);--ms-scrollbar-thumb-border-radius: 4px;--ms-debug-bg: var(--base-elevated-bg, light-dark(#f9fafb, #2b2b2b));--ms-debug-border-color: var(--ms-border-color);--ms-debug-text-color: var(--ms-text-color-1);--ms-debug-border-radius: var(--ms-border-radius-md);--ms-debug-summary-color: var(--ms-accent-color);--ms-debug-summary-bg-hover: var(--ms-primary-bg);--ms-debug-summary-outline-color: var(--ms-accent-color);--ms-debug-summary-border-radius: var(--ms-border-radius-sm);--ms-debug-stats-bg: var(--base-main-bg, light-dark(#ffffff, #1a1a1a));--ms-debug-stats-border-radius: var(--ms-border-radius-sm);--ms-debug-bullet-color: var(--ms-accent-color)}}@layer component{web-multiselect:not(:defined){display:block;min-height:calc(3.5 * var(--ms-rem));color:transparent!important;background:transparent}:host([defer]:not([is-ready])){display:block;min-height:calc(3.5 * var(--ms-rem))}:host{-webkit-tap-highlight-color:transparent}.ms__wrapper{display:flex;flex-direction:column;align-items:stretch}.ms__wrapper--inline{flex-direction:row;align-items:var(--ms-inline-align, center)}.ms{position:relative;width:100%}}@layer component{.ms__input-wrapper{box-sizing:border-box;position:relative;display:flex;align-items:center;gap:var(--ms-input-gap);height:var(--ms-input-height);padding-inline:var(--ms-input-padding-h);background:var(--ms-input-bg);color:var(--ms-input-color);border:var(--ms-input-border);border-radius:var(--ms-input-border-radius);cursor:pointer;transition:border var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input-wrapper:hover:not(:focus-within){border:var(--ms-input-border-hover)}.ms__input-wrapper:focus-within{border:var(--ms-input-border-focus)}.ms__input{flex:1 1 auto;min-width:0;box-sizing:border-box;font-family:inherit;height:100%;padding:0;border:none;background:transparent;font-size:var(--ms-input-font-size);color:var(--ms-input-color);cursor:pointer;outline:none}.ms__input::placeholder{color:var(--ms-input-placeholder-color);opacity:0;transition:opacity var(--ms-transition-fast) var(--ms-easing-snappy)}:host([data-ready]) .ms__input::placeholder{opacity:var(--ms-placeholder-opacity)}.ms__toggle{flex:0 0 auto;display:block;width:var(--ms-toggle-icon-size);height:var(--ms-toggle-icon-size);color:var(--ms-toggle-icon-color);cursor:pointer}.ms__toggle:before{content:"";display:block;width:100%;height:100%;background-color:currentColor;-webkit-mask:var(--ms-icon-chevron) center / contain no-repeat;mask:var(--ms-icon-chevron) center / contain no-repeat;transform:rotate(var(--ms-toggle-rotate-closed, 90deg));transition:transform var(--ms-transition-fast) var(--ms-easing-snappy)}.ms--open .ms__toggle{color:var(--ms-toggle-icon-color-open)}.ms--open .ms__toggle:before{transform:rotate(var(--ms-toggle-rotate-open, -90deg))}.ms__counter{flex:0 0 auto;padding:var(--ms-counter-padding);background:var(--ms-counter-badge-bg);color:var(--ms-counter-badge-color);font-size:var(--ms-counter-font-size);font-weight:var(--ms-counter-font-weight);border-radius:var(--ms-counter-border-radius);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter:hover{background:var(--ms-counter-badge-bg-hover);transform:scale(var(--ms-transform-scale-hover))}.ms__input-clear{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-input-clear-size);height:var(--ms-input-clear-size);padding:0;color:var(--ms-input-clear-color);background:transparent;border:none;border-radius:var(--ms-input-clear-border-radius);cursor:pointer;transition:background var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input-clear:hover{background:var(--ms-input-clear-bg-hover)}.ms__input-clear:before{content:"";display:block;width:var(--ms-input-clear-icon-size);height:var(--ms-input-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-clear) center / contain no-repeat;mask:var(--ms-icon-clear) center / contain no-repeat}.ms__actions{display:flex;flex-direction:column;gap:var(--ms-actions-gap);padding:var(--ms-actions-padding)}.ms__actions--top{border-bottom:var(--ms-actions-border-bottom)}.ms__actions--bottom{flex-direction:column-reverse;border-top:var(--ms-actions-border-bottom)}.ms__actions-row{display:flex;flex-wrap:nowrap;gap:var(--ms-actions-gap)}.ms__actions--wrap .ms__actions-row{flex-wrap:wrap}.ms__actions--sticky{position:sticky;z-index:var(--ms-z-index-sticky);background:var(--ms-actions-bg)}.ms__actions--sticky.ms__actions--top{top:0}.ms__actions--sticky.ms__actions--bottom{bottom:0}.ms__actions--align-stretch .ms__action-btn{flex:1}.ms__actions--align-left .ms__actions-row{justify-content:flex-start}.ms__actions--align-right .ms__actions-row{justify-content:flex-end}.ms__actions--align-center .ms__actions-row{justify-content:center}.ms__actions--align-space-between .ms__actions-row{justify-content:space-between}.ms__action-btn{font-family:inherit;padding:var(--ms-action-btn-padding);font-size:var(--ms-action-btn-font-size);border:var(--ms-action-btn-border);border-radius:var(--ms-action-btn-border-radius);background:var(--ms-action-button-bg);color:var(--ms-action-button-color);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}@media (hover: hover){.ms__action-btn:hover{background:var(--ms-action-button-bg-hover);border-color:var(--ms-action-button-border-color-hover)}}.ms__action-btn:active{transform:scale(var(--ms-transform-scale-active))}.ms__action-btn:disabled,.ms__action-btn[disabled]{opacity:var(--ms-disabled-opacity);cursor:not-allowed;pointer-events:none}}@layer component{.ms__hint{display:none;position:fixed;z-index:var(--ms-z-index-popover);padding:var(--ms-hint-padding);background:var(--ms-hint-bg);border:var(--ms-hint-border);border-radius:var(--ms-hint-border-radius);box-shadow:var(--ms-hint-box-shadow);font-size:var(--ms-hint-font-size);color:var(--ms-hint-color);line-height:var(--ms-line-height-relaxed);max-width:100%}.ms__hint--visible{display:block}.ms__dropdown{display:none;position:fixed;box-sizing:border-box;font-family:inherit;z-index:var(--ms-z-index-dropdown);background:var(--ms-dropdown-bg);border:var(--ms-dropdown-border);border-radius:var(--ms-dropdown-border-radius);box-shadow:var(--ms-dropdown-box-shadow);width:var(--ms-dropdown-width);max-height:var(--ms-options-max-height);overflow:hidden;color:var(--ms-dropdown-text-color)}.ms__dropdown--visible{display:flex;flex-direction:column}.ms__dropdown--fullscreen,.ms__selected-popover--fullscreen{--ms-rem: var(--ms-fullscreen-rem);--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tree-base-indent: var(--ms-fullscreen-tree-base-indent);--ms-tree-indent: var(--ms-fullscreen-tree-indent)}.ms__selected-popover--fullscreen{--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(4.2 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-badge-text-padding: 0 calc(1.2 * var(--ms-rem));--ms-badge-remove-width: calc(3.6 * var(--ms-rem));--ms-badge-remove-icon-size: calc(1.2 * var(--ms-rem));--ms-badge-remove-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem))}.ms__dropdown--fullscreen{--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-action-btn-padding: calc(.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem))}.ms__dropdown--fullscreen{position:fixed;top:0;inset-inline-start:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border:none;border-radius:0;--ms-dropdown-inner-border-radius: 0;background:var(--ms-fullscreen-bg);color:var(--ms-fullscreen-text-color);z-index:var(--ms-z-index-fullscreen);box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.ms__dropdown--fullscreen .ms__dropdown-inner{display:flex;flex-direction:column;flex:1;min-height:0;max-height:none;overflow:hidden}.ms__dropdown--fullscreen .ms__options{flex:1 1 0;min-height:0;height:auto;max-height:none;overflow-y:auto;padding-bottom:var(--ms-option-gap)}.ms__dropdown--fullscreen .ms__actions{flex:0 0 auto}.ms__fullscreen-header,.ms__selected-popover--fullscreen .ms__selected-popover-header{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:var(--ms-fullscreen-header-gap);min-height:var(--ms-fullscreen-header-min-height);padding:var(--ms-fullscreen-header-padding);background:var(--ms-fullscreen-header-bg);border-bottom:var(--ms-fullscreen-header-border)}.ms__fullscreen-header{align-content:flex-start}.ms__fullscreen-header>.ms__fullscreen-search-wrapper{min-height:var(--ms-fullscreen-header-min-height)}.ms__fullscreen-nav{flex:0 0 100%;display:flex;align-items:center;justify-content:space-between;gap:var(--ms-fullscreen-nav-gap);padding-top:var(--ms-fullscreen-nav-padding-top)}.ms__fullscreen-nav-count{font-size:var(--ms-fullscreen-nav-count-font-size);color:var(--ms-fullscreen-nav-count-color)}.ms__fullscreen-nav-controls{display:flex;align-items:center;gap:var(--ms-fullscreen-nav-gap)}.ms__fullscreen-nav-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-nav-btn-size);height:var(--ms-fullscreen-nav-btn-size);padding:0;color:var(--ms-fullscreen-nav-btn-color);background:var(--ms-fullscreen-nav-btn-bg);border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-nav-btn:hover:not(:disabled){background:var(--ms-fullscreen-nav-btn-bg-hover)}.ms__fullscreen-nav-btn:disabled{opacity:.4;cursor:default}.ms__fullscreen-nav-btn:before{content:"";display:block;width:var(--ms-fullscreen-nav-btn-icon-size);height:var(--ms-fullscreen-nav-btn-icon-size);background-color:currentColor;-webkit-mask:var(--ms-fullscreen-nav-btn-icon) center / contain no-repeat;mask:var(--ms-fullscreen-nav-btn-icon) center / contain no-repeat;transform:rotate(-90deg)}.ms__fullscreen-nav-btn--next:before{transform:rotate(90deg)}.ms__fullscreen-header>.ms__fullscreen-search-wrapper,.ms__selected-popover--fullscreen .ms__selected-popover-header>span{flex:1 1 0;min-width:0}.ms__fullscreen-search-wrapper{position:relative;display:flex;align-items:center}.ms__selected-popover--fullscreen .ms__selected-popover-header{font-size:var(--ms-fullscreen-title-font-size);font-weight:var(--ms-fullscreen-title-font-weight);color:var(--ms-fullscreen-text-color)}.ms__fullscreen-search{flex:1 1 auto;min-width:0;font-family:inherit;font-size:var(--ms-fullscreen-search-font-size);color:inherit;background:transparent;border:var(--ms-fullscreen-search-border);border-radius:var(--ms-fullscreen-search-border-radius);padding:var(--ms-fullscreen-search-padding);padding-inline-end:var(--ms-fullscreen-search-clear-gutter)}.ms__fullscreen-search:focus{outline:none;border:var(--ms-input-border-focus)}.ms__fullscreen-search-clear{position:absolute;inset-inline-end:var(--ms-fullscreen-search-clear-inset);top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-search-clear-size);height:var(--ms-fullscreen-search-clear-size);padding:0;color:var(--ms-fullscreen-search-clear-color);background:transparent;border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-search-clear:hover{background:var(--ms-fullscreen-search-clear-bg-hover)}.ms__fullscreen-search-clear:before{content:"";display:block;width:var(--ms-fullscreen-search-clear-icon-size);height:var(--ms-fullscreen-search-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-search-clear) center / contain no-repeat;mask:var(--ms-icon-search-clear) center / contain no-repeat}.ms__fullscreen-mode-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-mode-toggle-size);height:var(--ms-fullscreen-mode-toggle-size);margin-inline-end:var(--ms-fullscreen-mode-toggle-gap);margin-inline-start:calc((var(--ms-fullscreen-close-size) - var(--ms-fullscreen-mode-toggle-size)) / 2 - var(--ms-fullscreen-close-edge-nudge));padding:0;color:var(--ms-fullscreen-mode-toggle-color);background:var(--ms-fullscreen-mode-toggle-bg);border:none;border-radius:50%;cursor:pointer}.ms__fullscreen-mode-toggle:hover{background:var(--ms-fullscreen-mode-toggle-bg-hover)}.ms__fullscreen-mode-toggle:before{content:"";display:block;width:var(--ms-fullscreen-mode-toggle-icon-size);height:var(--ms-fullscreen-mode-toggle-icon-size);background-color:currentColor;-webkit-mask:var(--ms-fullscreen-mode-toggle-icon, var(--ms-icon-search)) center / contain no-repeat;mask:var(--ms-fullscreen-mode-toggle-icon, var(--ms-icon-search)) center / contain no-repeat}.ms__fullscreen-mode-toggle[data-mode=navigate]{--ms-fullscreen-mode-toggle-icon: var(--ms-icon-search)}.ms__fullscreen-mode-toggle[data-mode=filter]{--ms-fullscreen-mode-toggle-icon: var(--ms-icon-filter)}.ms__fullscreen-close,.ms__selected-popover--fullscreen .ms__selected-popover-close{flex:0 0 auto;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:var(--ms-fullscreen-close-size);height:var(--ms-fullscreen-close-size);margin-inline-end:calc(-1 * var(--ms-fullscreen-close-edge-nudge));padding:0;color:var(--ms-fullscreen-close-color);background:var(--ms-fullscreen-close-bg);border:var(--ms-fullscreen-close-border);border-radius:var(--ms-fullscreen-close-border-radius);cursor:pointer}.ms__fullscreen-close:after,.ms__selected-popover--fullscreen .ms__selected-popover-close:after{content:"";position:absolute;inset-block-start:calc(-1 * var(--ms-fullscreen-close-size));inset-block-end:calc(-1 * var(--ms-fullscreen-header-padding-v));inset-inline-end:calc(-1 * var(--ms-fullscreen-header-padding-h));inset-inline-start:calc(-1 * var(--ms-fullscreen-header-gap))}.ms__fullscreen-close:hover,.ms__selected-popover--fullscreen .ms__selected-popover-close:hover{background:var(--ms-fullscreen-close-bg-hover);color:var(--ms-fullscreen-close-color)}.ms__fullscreen-close:before,.ms__selected-popover--fullscreen .ms__selected-popover-close:before{content:"";display:block;width:var(--ms-fullscreen-close-icon-size);height:var(--ms-fullscreen-close-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__dropdown--fullscreen .ms__option-info{flex:0 0 auto;display:none;align-items:center;justify-content:center;width:var(--ms-fullscreen-info-size);height:var(--ms-fullscreen-info-size);margin-inline-start:var(--ms-option-gap);padding:0;color:var(--ms-fullscreen-info-color);background:transparent;border:none;border-radius:50%;cursor:pointer}.ms__dropdown--fullscreen .ms__option--truncated .ms__option-info{display:inline-flex}@media (hover: hover){.ms__dropdown--fullscreen .ms__option-info:hover{background:var(--ms-fullscreen-info-bg-hover)}}.ms__dropdown--fullscreen .ms__option-info:before{content:"";display:block;width:var(--ms-fullscreen-info-icon-size);height:var(--ms-fullscreen-info-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-info) center / contain no-repeat;mask:var(--ms-icon-info) center / contain no-repeat}.ms__dropdown-inner{flex:1;overflow-y:auto;border-radius:var(--ms-dropdown-inner-border-radius);overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__dropdown-inner::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__dropdown-inner::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__dropdown--virtual{max-height:none}.ms__dropdown--virtual .ms__dropdown-inner{overflow:hidden}.ms__badge-tooltip{position:fixed;z-index:var(--ms-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-tooltip-bg);color:var(--ms-tooltip-text-color);padding:var(--ms-tooltip-padding);border-radius:var(--ms-tooltip-border-radius);font-size:var(--ms-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-tooltip-shadow);pointer-events:none}.ms__badge-tooltip--visible{opacity:1;visibility:visible}.ms__option-tooltip{position:fixed;z-index:var(--ms-option-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-option-tooltip-bg);color:var(--ms-option-tooltip-text-color);padding:var(--ms-option-tooltip-padding);border-radius:var(--ms-option-tooltip-border-radius);font-size:var(--ms-option-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-option-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-option-tooltip-shadow);pointer-events:none}.ms__option-tooltip--visible{opacity:1;visibility:visible}.ms__option-tooltip--fullscreen{z-index:var(--ms-z-index-fullscreen-tooltip)}.ms__message{position:fixed;z-index:var(--ms-message-z-index);box-sizing:border-box;max-width:var(--ms-message-max-width);padding:var(--ms-message-padding);font-family:inherit;font-size:var(--ms-message-font-size);font-weight:var(--ms-message-font-weight);line-height:var(--ms-line-height-normal);color:var(--ms-message-color);background:var(--ms-message-bg);border:var(--ms-message-border);border-radius:var(--ms-message-border-radius);box-shadow:var(--ms-message-shadow);cursor:pointer;opacity:0;transition:opacity var(--ms-transition-normal) ease;-webkit-tap-highlight-color:transparent}.ms__message--visible{opacity:1}.ms__message--info{background:var(--ms-message-info-bg);color:var(--ms-message-info-color)}.ms__message--warning{background:var(--ms-message-warning-bg);color:var(--ms-message-warning-color)}.ms__message--error{background:var(--ms-message-error-bg);color:var(--ms-message-error-color)}.ms__message--success{background:var(--ms-message-success-bg);color:var(--ms-message-success-color)}.ms__message--fullscreen{left:50%;right:auto;bottom:calc(var(--ms-message-fullscreen-offset) + env(safe-area-inset-bottom));transform:translate(-50%);max-width:min(var(--ms-message-max-width),calc(100vw - 4 * var(--ms-fullscreen-rem)));padding:calc(1 * var(--ms-fullscreen-rem)) calc(1.4 * var(--ms-fullscreen-rem));font-size:calc(var(--base-font-size-sm, 1.4) * var(--ms-fullscreen-rem))}.ms__selected-popover{display:none;position:fixed;box-sizing:border-box;z-index:var(--ms-z-index-popover);background:var(--ms-selected-popover-bg);border:var(--ms-selected-popover-border);border-radius:var(--ms-selected-popover-border-radius);box-shadow:var(--ms-selected-popover-box-shadow);width:var(--ms-selected-popover-width);max-height:var(--ms-selected-popover-max-height);overflow:hidden}.ms__selected-popover--visible{display:flex;flex-direction:column}.ms__selected-popover--virtual{display:block;overflow:visible;max-height:none}.ms__selected-popover--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border:none;border-radius:0;overflow:hidden;background:var(--ms-fullscreen-bg);color:var(--ms-fullscreen-text-color);z-index:var(--ms-z-index-fullscreen);box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}.ms__selected-popover--fullscreen .ms__selected-popover-body{flex:1 1 0;min-height:0;max-height:none}.ms__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ms-selected-popover-header-padding);background:var(--ms-selected-popover-header-bg);border-bottom:var(--ms-selected-popover-header-border-bottom);font-size:var(--ms-selected-popover-header-font-size);font-weight:var(--ms-selected-popover-header-font-weight);color:var(--ms-selected-popover-header-color)}.ms__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ms-popover-close-size);height:var(--ms-popover-close-size);padding:0;border:none;background:var(--ms-selected-popover-close-bg);color:var(--ms-selected-popover-close-color);font-size:var(--ms-selected-popover-close-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-selected-popover-close-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__selected-popover-close:hover{background:var(--ms-selected-popover-close-bg-hover);color:var(--ms-selected-popover-close-color-hover)}.ms__selected-popover-close:before{content:"";display:block;width:var(--ms-selected-popover-close-icon-size);height:var(--ms-selected-popover-close-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__selected-popover-body{display:flex;flex-direction:column;gap:var(--ms-selected-popover-body-gap);padding:var(--ms-selected-popover-body-padding);overflow-y:auto;max-height:var(--ms-selected-popover-body-max-height);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__selected-popover-body::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__selected-popover-body::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__selected-popover-body .ms__badge{width:100%;min-height:fit-content;line-height:var(--ms-line-height-relaxed);flex-shrink:0}.ms__selected-popover-body .ms__badge-text{flex:1;min-width:0;white-space:normal;word-wrap:break-word}.ms__selected-popover-body--virtual{display:block;max-height:none;padding:0}.ms__selected-popover-body--virtual .ms__badge{height:var(--ms-badge-height-virtual, 36px);min-height:var(--ms-badge-height-virtual, 36px);max-height:var(--ms-badge-height-virtual, 36px);margin-bottom:var(--ms-selected-popover-body-gap);overflow:hidden;box-sizing:border-box}.ms__selected-popover-body--virtual .ms__badge-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@layer component{.ms--disabled .ms__input-wrapper{opacity:var(--ms-disabled-input-opacity);background:var(--ms-input-bg-disabled);cursor:not-allowed}.ms--disabled .ms__input{cursor:not-allowed}.ms--no-checkboxes .ms__option{gap:0;padding-inline-start:var(--ms-option-padding-h)}.ms--no-checkboxes .ms__option-content{padding-inline-start:0}.ms--no-selected-popover .ms__counter,.ms--no-selected-popover .ms__badge[data-action=show-selected],.ms--no-selected-popover .ms__badge--counter,.ms--no-selected-popover .ms__badge--more{cursor:default}}@layer component{@keyframes ms-spin{to{transform:rotate(360deg)}}}@layer component{.ms__badges{display:flex;flex-wrap:wrap;gap:var(--ms-badges-gap);padding:0}.ms__badges:empty{display:none}.ms__badges--bottom{margin-top:var(--ms-badges-margin-bottom)}.ms__badges--top{margin-bottom:var(--ms-badges-margin-top);order:var(--ms-order-first)}.ms__badges--left{order:var(--ms-order-first);margin-right:var(--ms-badges-margin-left);justify-content:flex-end}.ms__badges--right{margin-left:var(--ms-badges-margin-right);justify-content:flex-start}.ms__badge{display:inline-flex;align-items:center;height:var(--ms-badge-height);font-size:var(--ms-badge-font-size);font-weight:var(--ms-badge-font-weight);line-height:var(--ms-line-height-none);border-radius:var(--ms-badge-border-radius);overflow:hidden;max-width:100%}.ms__badge--custom{display:block;height:auto;max-width:none;overflow:visible;border-radius:0;font-size:inherit;font-weight:inherit}.ms__badge-text{display:flex;align-items:center;box-sizing:border-box;height:100%;padding:var(--ms-badge-text-padding);background:var(--ms-badge-text-bg);color:var(--ms-badge-text-color);border:var(--ms-badge-text-border);border-inline-end:none;border-start-start-radius:var(--ms-badge-border-radius);border-end-start-radius:var(--ms-badge-border-radius);border-start-end-radius:0;border-end-end-radius:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ms-transition-normal) ease,color var(--ms-transition-normal) ease}.ms__badge:hover .ms__badge-text{background:var(--ms-badge-text-bg-hover, var(--ms-badge-text-bg));color:var(--ms-badge-text-color-hover, var(--ms-badge-text-color))}.ms__badge-remove{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;font-family:inherit;width:var(--ms-badge-remove-width);height:100%;flex-shrink:0;background:var(--ms-badge-remove-bg);color:var(--ms-badge-remove-color);border:var(--ms-badge-remove-border);border-inline-start:none;border-start-end-radius:var(--ms-badge-border-radius);border-end-end-radius:var(--ms-badge-border-radius);border-start-start-radius:0;border-end-start-radius:0;cursor:pointer;transition:background-color var(--ms-transition-normal) ease;font-size:var(--ms-badge-remove-font-size)}.ms__badge-remove:hover{background:var(--ms-badge-remove-bg-hover)}.ms__badge-remove:focus{outline:none}.ms__badge-remove:focus-visible{outline:none;box-shadow:var(--ms-badge-remove-box-shadow-focus)}.ms__badge-remove:before{content:"";display:block;width:var(--ms-badge-remove-icon-size);height:var(--ms-badge-remove-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__badge--counter{cursor:pointer}.ms__badge--counter .ms__badge-text{background:var(--ms-badge-counter-text-bg);color:var(--ms-badge-counter-text-color);border:var(--ms-badge-counter-border);border-inline-end:none}.ms__badge--counter .ms__badge-remove{background:var(--ms-badge-counter-remove-bg);color:var(--ms-badge-counter-remove-color);border:var(--ms-badge-counter-border);border-inline-start:none}.ms__badge--counter .ms__badge-remove:hover{background:var(--ms-badge-counter-remove-bg-hover);color:var(--ms-badge-counter-remove-color-hover, var(--ms-badge-counter-remove-color))}.ms__badge--counter:hover .ms__badge-text{background:var(--ms-badge-counter-text-bg-hover, var(--ms-badge-counter-text-bg));color:var(--ms-badge-counter-text-color-hover, var(--ms-badge-counter-text-color))}.ms__badge--more,.ms__badge[data-action=show-selected]{cursor:pointer}}@layer component{.ms__count-display{display:flex;align-items:center}.ms__count-display:empty{display:none}.ms__count-display--bottom{margin-top:var(--ms-count-display-margin-bottom)}.ms__count-display--top{margin-bottom:var(--ms-count-display-margin-top);order:var(--ms-order-first)}.ms__count-display--left{order:var(--ms-order-first);margin-right:var(--ms-count-display-margin-left);justify-content:flex-start}.ms__count-display--right{margin-left:var(--ms-count-display-margin-right);justify-content:flex-end}.ms__counter-wrapper{display:inline-flex;align-items:center;gap:var(--ms-counter-wrapper-gap);background:var(--ms-counter-wrapper-bg);border:var(--ms-counter-wrapper-border);border-radius:var(--ms-counter-wrapper-border-radius);padding:var(--ms-counter-wrapper-padding);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter-wrapper:hover{background:var(--ms-counter-wrapper-bg-hover);border-color:var(--ms-counter-wrapper-border-color-hover)}.ms__count-text{display:inline-flex;align-items:center;background:var(--ms-count-text-bg);border:var(--ms-count-text-border);padding:0;font-size:var(--ms-count-text-font-size);color:var(--ms-count-text-color);cursor:pointer;transition:color var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ms-count-clear-size);height:var(--ms-count-clear-size);padding:0;border:none;background:var(--ms-count-clear-bg);color:var(--ms-count-clear-color);font-size:var(--ms-count-clear-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-count-clear-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear:hover{background:var(--ms-count-clear-bg-hover);color:var(--ms-count-clear-color-hover)}.ms__count-clear:before{content:"";display:block;width:var(--ms-count-clear-icon-size);height:var(--ms-count-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-clear) center / contain no-repeat;mask:var(--ms-icon-clear) center / contain no-repeat}}@layer component{.ms__debug-info{margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:var(--ms-debug-bg);border:1px solid var(--ms-debug-border-color);border-radius:var(--ms-debug-border-radius);font-size:calc(1.2 * var(--ms-rem));color:var(--ms-debug-text-color)}.ms__debug-info details summary{cursor:pointer;font-weight:600;color:var(--ms-debug-summary-color);-webkit-user-select:none;user-select:none;padding:calc(.4 * var(--ms-rem));border-radius:var(--ms-debug-summary-border-radius)}.ms__debug-info details summary:hover{background-color:var(--ms-debug-summary-bg-hover)}.ms__debug-info details summary:focus{outline:2px solid var(--ms-debug-summary-outline-color);outline-offset:2px}.ms__debug-info .ms__debug-stats{display:flex;flex-direction:column;gap:calc(.4 * var(--ms-rem));margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:var(--ms-debug-stats-bg);border-radius:var(--ms-debug-stats-border-radius)}.ms__debug-info .ms__debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:calc(1 * var(--ms-rem))}.ms__debug-info .ms__debug-stats span:before{content:"•";margin-inline-end:calc(.4 * var(--ms-rem));color:var(--ms-debug-bullet-color)}}@layer component{.ms__options{padding:var(--ms-options-padding);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__options::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__options::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__options--virtual .ms__option,.ms__options--fixed-height .ms__option{height:var(--ms-option-height, 50px);min-height:var(--ms-option-height, 50px);max-height:var(--ms-option-height, 50px);overflow:hidden;box-sizing:border-box}.ms__group+.ms__group{border-top:var(--ms-group-border-top);margin-top:var(--ms-group-margin-top);padding-top:var(--ms-group-padding-top)}.ms__group-label{padding:var(--ms-group-label-padding);font-size:var(--ms-group-label-font-size);font-weight:var(--ms-group-label-font-weight);color:var(--ms-group-label-color);text-transform:var(--ms-group-label-transform);letter-spacing:var(--ms-group-label-letter-spacing)}.ms__option{display:flex;align-items:var(--ms-checkbox-align, center);gap:var(--ms-option-gap);padding:var(--ms-option-padding);position:relative;min-height:var(--ms-option-min-height, auto);color:var(--ms-option-text-color);background:var(--ms-option-bg);cursor:pointer;user-select:none;-webkit-user-select:none}@media (hover: hover){.ms__option:hover{background:var(--ms-option-bg-hover);color:var(--ms-option-color-hover, inherit)}}.ms__option--focused{background:var(--ms-option-bg-focused);color:var(--ms-option-color-focused, inherit);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--matched{background:var(--ms-option-bg-matched);color:var(--ms-option-color-matched, inherit)}.ms__option--matched:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;border-inline-start:var(--ms-option-border-matched);pointer-events:none}.ms__option--selected{background:var(--ms-option-bg-selected)}@media (hover: hover){.ms__option--selected:hover{background:var(--ms-option-bg-selected-hover, var(--ms-option-bg-selected))}}.ms__option--disabled{opacity:var(--ms-disabled-opacity);cursor:not-allowed;background:var(--ms-option-disabled-bg)}.ms__option--disabled:hover{background:var(--ms-option-disabled-bg)}@media (hover: hover){.ms__option--focused:hover{background:var(--ms-option-bg-focused-hover);color:var(--ms-option-color-focused-hover, var(--ms-option-color-focused, var(--ms-option-text-color)))}}.ms__option--matched:hover{background:var(--ms-option-bg-matched-hover);color:var(--ms-option-color-matched-hover, var(--ms-option-color-matched, var(--ms-option-text-color)))}.ms__option--selected.ms__option--focused{background:var(--ms-option-bg-selected-focused);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--selected.ms__option--matched{background:var(--ms-option-bg-selected-matched)}.ms__option--disabled.ms__option--selected{background:var(--ms-option-bg-disabled-selected)}.ms__option--disabled.ms__option--focused{outline:none}.ms__option[data-checkbox-align=top]{--ms-checkbox-align: flex-start;--ms-checkbox-margin-top: calc(.2 * var(--ms-rem))}.ms__option[data-checkbox-align=bottom]{--ms-checkbox-align: flex-end}.ms__checkbox{appearance:none;-webkit-appearance:none;-moz-appearance:none;flex-shrink:0;position:relative;margin-top:var(--ms-checkbox-margin-top);margin-inline-end:var(--ms-checkbox-margin-right);margin-bottom:var(--ms-checkbox-margin-bottom);margin-inline-start:var(--ms-checkbox-margin-left);width:var(--ms-checkbox-size);height:var(--ms-checkbox-size);transform:scale(var(--ms-checkbox-scale));transform-origin:top left;cursor:pointer;background:var(--ms-checkbox-bg);border:var(--ms-checkbox-border);border-radius:var(--ms-checkbox-border-radius);transition:background-color .15s ease,border-color .15s ease}.ms__checkbox:after{content:"";position:absolute;display:none;top:0;right:0;bottom:0;left:0;background-color:var(--ms-checkbox-checkmark-color);-webkit-mask:var(--ms-icon-check) no-repeat center / var(--ms-icon-check-size);mask:var(--ms-icon-check) no-repeat center / var(--ms-icon-check-size)}.ms__checkbox:hover:not(:disabled){border-color:var(--ms-checkbox-hover-border-color)}.ms__checkbox:checked{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox:checked:after{display:block}.ms__checkbox--indeterminate{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox--indeterminate:after{display:block;-webkit-mask-image:var(--ms-icon-indeterminate);mask-image:var(--ms-icon-indeterminate)}.ms__checkbox--indeterminate:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:checked:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:focus-visible{outline:2px solid var(--ms-checkbox-checked-bg);outline-offset:2px}.ms__checkbox:disabled{cursor:not-allowed;background:var(--ms-checkbox-disabled-bg);border:var(--ms-checkbox-disabled-border);opacity:.6}.ms__checkbox:disabled:checked{background:var(--ms-checkbox-disabled-bg)}.ms__option--disabled .ms__checkbox{cursor:not-allowed}.ms__option-content{flex:1;display:flex;align-items:center;gap:var(--ms-option-content-gap);min-width:0}.ms__option-icon{flex-shrink:0;width:var(--ms-option-icon-size);height:var(--ms-option-icon-size);display:flex;align-items:center;justify-content:center;font-size:var(--ms-option-icon-font-size)}.ms__option-icon svg{width:100%;height:100%;fill:currentColor}.ms__option-text{flex:1;min-width:0}.ms__option-title{font-size:var(--ms-option-title-font-size);color:var(--ms-option-title-color);line-height:var(--ms-line-height-relaxed);white-space:var(--ms-option-title-white-space, normal);overflow:var(--ms-option-title-overflow, visible);text-overflow:var(--ms-option-title-text-overflow, clip)}@media (hover: hover){.ms__option:hover .ms__option-title{color:var(--ms-option-title-color-hover, var(--ms-option-title-color))}}.ms__option--selected .ms__option-title{color:var(--ms-option-title-color-selected, var(--ms-option-title-color))}@media (hover: hover){.ms__option--selected:hover .ms__option-title{color:var(--ms-option-title-color-selected-hover, var(--ms-option-title-color-selected, var(--ms-option-title-color)))}}.ms__option-title mark{background:var(--ms-option-mark-bg);color:var(--ms-option-mark-color);font-weight:var(--ms-option-mark-font-weight)}.ms__option-subtitle{margin-top:var(--ms-option-subtitle-margin-top);font-size:var(--ms-option-subtitle-font-size);color:var(--ms-option-subtitle-color);line-height:var(--ms-option-subtitle-line-height)}@media (hover: hover){.ms__option:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-hover, var(--ms-option-subtitle-color))}}.ms__option--selected .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color))}@media (hover: hover){.ms__option--selected:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected-hover, var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color)))}}.ms__empty{display:flex;align-items:center;justify-content:center;min-height:var(--ms-state-min-height);padding:var(--ms-empty-padding);text-align:center;font-size:var(--ms-empty-font-size);color:var(--ms-empty-color)}.ms__add-new{display:flex;align-items:center;gap:var(--ms-add-new-gap);padding:var(--ms-add-new-padding);font-size:var(--ms-add-new-font-size);color:var(--ms-add-new-color);cursor:pointer;user-select:none;-webkit-user-select:none}@media (hover: hover){.ms__add-new:hover{background:var(--ms-add-new-bg-hover);color:var(--ms-add-new-color-hover)}}.ms__add-new--focused{background:var(--ms-add-new-bg-hover);color:var(--ms-add-new-color-hover)}.ms__add-new--loading{cursor:default}.ms__add-new-spinner{flex-shrink:0;width:var(--ms-add-new-icon-size);height:var(--ms-add-new-icon-size);border-radius:50%;border:2px solid color-mix(in srgb,currentColor 25%,transparent);border-top-color:currentColor;animation:ms-spin .6s linear infinite}@media (prefers-reduced-motion: reduce){.ms__add-new-spinner{animation-duration:1.5s}}.ms__add-new-icon{flex-shrink:0;width:var(--ms-add-new-icon-size);height:var(--ms-add-new-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-add-new) center / contain no-repeat;mask:var(--ms-icon-add-new) center / contain no-repeat}.ms__add-new-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ms__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--ms-state-min-height);padding:var(--ms-loader-padding);gap:var(--ms-loader-gap)}.ms__loading-text{font-size:var(--ms-loading-text-font-size);color:var(--ms-loading-color)}}@layer component{.ms--rtl .ms__badges{direction:rtl}.ms--rtl .ms__badges--right{margin-left:0;margin-right:var(--ms-badges-margin-right)}.ms--rtl .ms__badges--left{margin-right:0;margin-left:var(--ms-badges-margin-left)}.ms--rtl .ms__count-display{direction:rtl}.ms--rtl .ms__count-display--right{margin-left:0;margin-right:var(--ms-count-display-margin-right)}.ms--rtl .ms__count-display--left{margin-right:0;margin-left:var(--ms-count-display-margin-left)}}@layer component{.ms__option--tree{padding-inline-start:calc(var(--ms-tree-base-indent, .75rem) + var(--ms-tree-depth, 0) * var(--ms-tree-indent, 1.25rem))}.ms__option--tree-unselectable{cursor:default}.ms__option--tree-unselectable:hover{background:transparent}}@layer overrides{:host-context([data-theme="dark"]),:host-context([data-bs-theme="dark"]),:host-context(.dark){color-scheme:dark}:host-context([data-theme="light"]),:host-context([data-bs-theme="light"]),:host-context(.light){color-scheme:light}:host([data-theme="dark"]){color-scheme:dark}:host([data-theme="light"]){color-scheme:light}}`,Mo=["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],$=()=>Jo(),xn=[{configKey:"searchHint",attribute:"search-hint",converter:L({isNullable:!0}),on:"update",description:"Small hint text shown beneath the search input."},{configKey:"searchPlaceholder",attribute:"search-placeholder",converter:L({isNullable:!0}),on:"update",description:'Placeholder text for the search input. When unset it defaults to "Search..."; if `show-search-mode-toggle` is on, the default instead becomes mode-aware ("Search…" in navigate, "Filter…" in filter). An explicit value always wins and stays fixed.'},{configKey:"selectPlaceholder",attribute:"select-placeholder",converter:L({default:"Pick an option..."}),on:"update",description:"Placeholder shown on the control when nothing is selected."},{configKey:"noDataPlaceholder",attribute:"no-data-placeholder",converter:L({isNullable:!0}),on:"update",description:"Text shown when there are no options at all."},{configKey:"dropdownMinWidth",attribute:"dropdown-min-width",converter:L({isNullable:!0}),on:"update",description:"Minimum width of the dropdown panel (any CSS length)."},{configKey:"dropdownMaxWidth",attribute:"dropdown-max-width",converter:L({isNullable:!0}),on:"update",description:"Maximum width of the dropdown panel (any CSS length)."},{configKey:"maxHeight",attribute:"max-height",converter:L({default:"20rem"}),on:"update",description:"Maximum height of the dropdown list before it scrolls."},{configKey:"emptyMessage",attribute:"empty-message",converter:L({default:"No results found"}),on:"update",description:"Message shown when a search yields no matches."},{configKey:"addNewText",attribute:"add-new-text",converter:L({isNullable:!0}),on:"update",description:'Template for the clickable "add new" prompt shown (when `allow-add-new` is on) in place of the empty message once a search yields no matches. `{value}` is replaced with the typed text. Default: `Add "{value}"`. A `getAddNewTextCallback` wins.'},{configKey:"addNewPendingText",attribute:"add-new-pending-text",converter:L({isNullable:!0}),on:"update",description:'Template for the pending prompt (spinner + text) shown while an async `addNewCallback` runs. `{value}` is replaced with the typed text. Default: `Adding "{value}"…`.'},{configKey:"loadingMessage",attribute:"loading-message",converter:L({default:"Loading..."}),on:"update",description:"Message shown while options are loading."},{configKey:"removeButtonTooltipText",attribute:"remove-button-tooltip-text",converter:L({isNullable:!0}),on:"update",description:"Tooltip text for a badge remove (×) button."},{configKey:"formFieldId",attribute:"name",converter:L({isNullable:!0}),on:"reinit",description:"HTML form field name/id used for the hidden input(s)."},{configKey:"dropdownWidth",attribute:"dropdown-width",converter:L({isNullable:!0}),on:"update",description:"Fixed dropdown width; mirrored to the `--ms-dropdown-width` CSS variable."},{configKey:"selectedPopoverWidth",attribute:"selected-popover-width",converter:L({isNullable:!0}),on:"update",description:"Selected-items popover width; mirrored to `--ms-selected-popover-width`."},{configKey:"valueMember",attribute:"value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name on an option object that holds its value."},{configKey:"displayValueMember",attribute:"display-value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option display label."},{configKey:"searchValueMember",attribute:"search-value-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name searched against (falls back to the display value)."},{configKey:"iconMember",attribute:"icon-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option icon."},{configKey:"subtitleMember",attribute:"subtitle-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option subtitle."},{configKey:"fullTitleMember",attribute:"full-title-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that holds an option full/long title."},{configKey:"groupMember",attribute:"group-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name used to group options under headers."},{configKey:"disabledMember",attribute:"disabled-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name that marks an option disabled."},{configKey:"pathMember",attribute:"path-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node materialized tree path."},{configKey:"parentPathMember",attribute:"parent-path-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node parent path."},{configKey:"levelMember",attribute:"level-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name holding a node depth level."},{configKey:"hasChildrenMember",attribute:"has-children-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name flagging that a node has children."},{configKey:"isSelectableMember",attribute:"is-selectable-member",converter:L({isNullable:!0}),reflect:!0,on:"reinit",description:"Property name marking whether a node can be selected."},{configKey:"treePathSeparator",attribute:"tree-path-separator",converter:L({default:"."}),reflect:!0,on:"reinit",description:"Separator between segments in a materialized tree path."},{configKey:"isTreeEnabled",converter:W("tristate"),on:"reinit",type:"boolean",description:"Force tree mode on/off. Property-only; when unset (null) tree mode auto-enables if a path source (path-member / getPathCallback) is present."},{configKey:"checkboxMode",attribute:"checkbox-mode",converter:S(["independent","cascade"],{default:"independent"}),reflect:!0,on:"update",description:"Tree checkbox interaction.\n- `independent` (default) — toggles only the clicked node.\n- `cascade` — checks a node whole subtree and shows a tristate (checked / indeterminate / unchecked) box on branches.\n\nTree + multiple only."},{configKey:"cascadeSelectPolicy",attribute:"cascade-select-policy",converter:S(["rolled-up","leaves","all"],{default:"rolled-up"}),reflect:!0,on:"update",description:"In `cascade` mode, which values a selection emits (badges / form / change):\n- `rolled-up` (default) — minimal cover: a fully-selected subtree collapses to its root; partially-selected branches emit their individually-checked descendants.\n- `leaves` — only the checked leaf-level nodes.\n- `all` — every fully-checked node (branches and leaves)."},{configKey:"badgesDisplayMode",attribute:"badges-display-mode",converter:S(["badges","count","compact","partial","none"],{default:"badges"}),on:"reinit",description:"How the current selection is shown in the control."},{configKey:"badgesPosition",attribute:"badges-position",converter:S(["top","bottom","left","right"],{default:"bottom"}),on:"reinit",description:"Where the badges/selection appear relative to the input."},{configKey:"badgesThresholdMode",attribute:"badges-threshold-mode",converter:S(["count","partial"],{default:"count"}),on:"update",description:'How `badgesThreshold` is interpreted: collapse to a count badge, or keep partial badges + a "more" badge.'},{configKey:"searchInputMode",attribute:"search-input-mode",converter:S(["normal","readonly","hidden"],{default:"normal"}),on:"reinit",description:"Search field mode: editable, read-only, or hidden."},{configKey:"searchMode",attribute:"search-mode",converter:S(["filter","navigate"],{default:"filter"}),on:"reinit",description:"Whether typing filters the list or navigates it."},{configKey:"overlayGroup",attribute:"overlay-group",converter:L({isNullable:!0}),on:"reinit",description:'Scope the "one overlay open at a time" coordination to a named group. Overlays (multiselects, datepickers, external popovers) sharing a group dismiss each other when one opens; different groups are independent. Unset = the default (ungrouped) group.'},{configKey:"actionsLayout",attribute:"actions-layout",converter:S(["nowrap","wrap"],{default:"nowrap"}),on:"reinit",description:"Whether the action bar wraps or stays on one line."},{configKey:"actionsPosition",attribute:"actions-position",converter:S(["top","bottom"],{default:"top"}),on:"reinit",description:"Whether the action bar sits above or below the list."},{configKey:"actionsAlign",attribute:"actions-align",converter:S(["stretch","left","right","center","space-between"],{default:"stretch"}),on:"update",description:"Horizontal alignment of the action buttons."},{configKey:"checkboxAlign",attribute:"checkbox-align",converter:S(["top","center","bottom"],{default:"center"}),on:"update",description:"Vertical alignment of an option checkbox."},{configKey:"valueFormat",attribute:"value-format",converter:S(["json","csv","array"],{default:"json"}),on:"reinit",description:"Serialization format the control emits its value in."},{configKey:"badgeTooltipPlacement",attribute:"badge-tooltip-placement",converter:S(Mo,{default:"top"}),on:"update",description:"Preferred placement of a badge tooltip relative to its badge (floating-ui placement)."},{configKey:"optionTooltipPlacement",attribute:"option-tooltip-placement",converter:S(Mo,{default:"top-start"}),on:"update",description:"Preferred placement of an option tooltip (floating-ui placement)."},{configKey:"mobilePresentation",attribute:"mobile-presentation",converter:S(["auto","floating","fullscreen"],{default:"auto"}),reflect:!0,on:"update",description:"How the open dropdown is presented on phones. `auto` (default) keeps the floating panel on desktop/tablet and switches to a full-screen overlay on phone-sized touch devices (touch primary + shorter viewport side < 600px, orientation-robust); `floating` forces the anchored panel everywhere; `fullscreen` forces the full-screen overlay on any device (handy for previews/testing). Resolved reactively from the device/viewport environment."},{configKey:"fullscreenAutofocus",attribute:"fullscreen-autofocus",converter:W("default-false"),on:"update",description:"In the phone fullscreen overlay, auto-focus the search field on open (pops the soft keyboard immediately). Default `false`: the sheet opens with the list visible and the keyboard closed, appearing only when the user taps the search. Set `true` to type-to-filter right away. No effect in the floating presentation."},{configKey:"badgesThreshold",attribute:"badges-threshold",converter:D(),on:"update",description:"Threshold at which badges collapse to a count/compact view."},{configKey:"badgesMaxVisible",attribute:"badges-max-visible",converter:D(),on:"update",description:"Maximum number of badges rendered before overflow."},{configKey:"collapseBadgesBelow",attribute:"collapse-badges-below",converter:D(),on:"update",description:'Container-responsive opt-in (off by default). When set to a px width, the control watches its OWN border box (not the window, via the core `resized` hook / a shared ResizeObserver) and collapses `badges-display-mode` to `count` ("N selected") while the box is narrower than this — so a picker in a narrow column/sidebar never overflows with pills, even on a wide monitor. Widening past the threshold restores the configured badges mode. Element-only: the override is applied to the live picker, never to your `badges-display-mode` config.'},{configKey:"minSearchLength",attribute:"min-search-length",converter:D({default:0}),on:"update",description:"Minimum characters before searching/filtering starts."},{configKey:"searchDebounce",attribute:"search-debounce",converter:D({default:0}),on:"update",description:"Debounce delay in ms applied to the search input."},{configKey:"virtualScrollThreshold",attribute:"virtual-scroll-threshold",converter:D({default:100}),on:"reinit",description:"Option count above which virtual scrolling turns on."},{configKey:"optionHeight",attribute:"option-height",converter:D({default:50}),on:"update",description:"Fixed row height in px used by virtual scrolling."},{configKey:"badgeHeight",attribute:"badge-height",converter:D({default:36}),on:"update",description:"Fixed badge height in px used for layout/virtualization."},{configKey:"virtualScrollBuffer",attribute:"virtual-scroll-buffer",converter:D({default:10}),on:"update",description:"Extra rows rendered above/below the viewport when virtualizing."},{configKey:"badgeTooltipDelay",attribute:"badge-tooltip-delay",converter:D({default:100}),on:"update",description:"Delay in ms before a badge tooltip appears."},{configKey:"badgeTooltipOffset",attribute:"badge-tooltip-offset",converter:D({default:8}),on:"update",description:"Gap in px between a badge and its tooltip."},{configKey:"optionTooltipDelay",attribute:"option-tooltip-delay",converter:D(),on:"update",description:"Delay in ms before an option tooltip appears (falls back to badgeTooltipDelay)."},{configKey:"optionTooltipOffset",attribute:"option-tooltip-offset",converter:D(),on:"update",description:"Gap in px between an option and its tooltip."},{configKey:"isMultipleEnabled",attribute:"multiple",converter:W("default-true"),on:"reinit",description:"Allow selecting multiple options. When off, selecting one replaces the previous."},{configKey:"isGroupsAllowed",attribute:"allow-groups",converter:W("default-true"),on:"reinit",description:"Allow grouping options under group headers."},{configKey:"isCheckboxesShown",attribute:"show-checkboxes",converter:W("default-true"),on:"reinit",description:"Show a checkbox on each option."},{configKey:"isActionsSticky",attribute:"sticky-actions",converter:W("default-true"),on:"update",description:"Keep the action bar pinned while the list scrolls."},{configKey:"isPlacementLocked",attribute:"lock-placement",converter:W("default-true"),on:"update",description:"Keep the dropdown initial placement instead of flipping when it fits."},{configKey:"isSearchEnabled",attribute:"enable-search",converter:W("default-true"),on:"reinit",description:"Show the search input."},{configKey:"isKeepOptionsOnSearch",attribute:"keep-options-on-search",converter:W("default-true"),on:"update",description:"Keep already-selected options visible while filtering."},{configKey:"shouldKeepSearchOnClose",attribute:"should-keep-search-on-close",converter:W("default-true"),on:"update",description:"Preserve the search text after the dropdown closes."},{configKey:"isSelectedPopoverEnabled",attribute:"enable-selected-popover",converter:W("default-true"),on:"update",description:'Allow the selected-items popover to open (from the count/compact/"+X more" badge or the in-input counter). Turn off when you render your own selection UI, so those affordances become inert.'},{configKey:"isCloseOnSelect",attribute:"close-on-select",converter:W("default-false"),on:"update",description:"Close the dropdown immediately after a selection."},{configKey:"isAddNewAllowed",attribute:"allow-add-new",converter:W("default-false"),on:"reinit",description:"Allow adding a new option from the search text."},{configKey:"isCounterShown",attribute:"show-counter",converter:W("default-false"),on:"update",description:"Show a selected-count indicator."},{configKey:"isClearShown",attribute:"show-clear",converter:W("default-false"),on:"update",description:"Show an inline clear (✕) button inside the input that wipes the whole selection. Appears only while something is selected and the control is enabled; clicking it clears the selection and any search text, fires `change`, and refocuses."},{configKey:"isBadgeFullTitleShown",attribute:"show-badge-full-title",converter:W("default-false"),on:"update",description:"Show the full title on badges instead of the short label."},{configKey:"isVirtualScrollEnabled",attribute:"enable-virtual-scroll",converter:W("default-false"),on:"reinit",description:"Force virtual scrolling on regardless of the threshold."},{configKey:"isBadgeTooltipsEnabled",attribute:"enable-badge-tooltips",converter:W("default-false"),on:"update",description:"Enable tooltips on badges."},{configKey:"isOptionTooltipsEnabled",attribute:"enable-option-tooltips",converter:W("default-false"),on:"update",description:"Enable tooltips on options."},{configKey:"isOptionTooltipFollowCursor",attribute:"option-tooltip-follow-cursor",converter:W("default-false"),on:"update",description:"Make option tooltips follow the pointer."},{configKey:"isSearchModeToggleShown",attribute:"show-search-mode-toggle",converter:W("default-false"),on:"update",description:"Show a clickable toggle in the phone fullscreen overlay search header that flips `search-mode` between `filter` and `navigate` live. Fullscreen-only; no effect in the floating presentation or when search is disabled."},{configKey:"initialValues",attribute:"initial-values",converter:gn(),default:[],on:"reinit",type:"Array<string | number>",description:'Values selected on first render. Accepts a JSON array (`["a","b"]`) or a bare CSV (`a,b,c`).'},{configKey:"showDebugInfo",attribute:"show-debug-info",converter:W("default-false"),on:"update",description:"Render an in-component debug panel.",deprecated:"Use per-instance logging (el.enableLogging()) instead."},{configKey:"deferRender",attribute:"defer",converter:W("presence"),on:"reinit",description:"Hold the initial render. When the `defer` attribute is present on upgrade the component builds nothing (it only reserves space) — so options, callbacks (e.g. `customStylesCallback`) and event listeners can all be wired first, then released with `el.ready()` (or by removing the `defer` attribute, for server-driven frameworks). The release builds the picker ONCE with everything already in place, avoiding the upgrade-then-restyle flash. Absent (default): builds immediately on connect. Latched — once released the gate never re-closes."},{configKey:"options",converter:Yo(),on:"reinit",type:"ReadonlyArray<Record<string, unknown>>",description:"The array of option objects to render. The JS API — assign `el.options` directly. For HTML authoring use the `data-options` attribute (parsed per `data-options-format`) or declarative <option> children; both feed the same list and take precedence over this property in the order: <option> children > property > data-options."},{configKey:"optionsSource",attribute:"data-options",converter:L({isNullable:!0}),on:"reinit",type:"string",description:"HTML-authoring source for the option list, parsed per `data-options-format`. Reactive: changing either attribute re-renders. Prefer the `options` property in JS; a set `options` property and declarative <option> children both win over this."},{configKey:"optionsFormat",attribute:"data-options-format",converter:S(Co,{default:"json"}),on:"reinit",type:"'json' | 'csv' | 'plain'",description:"How to parse the `data-options` attribute: `json` (a JSON array of objects or [value, label] tuples), `csv` (rows split on `data-options-row-splitter`, cells on `data-options-splitter`; the first row is a header — map columns via *-member), or `plain` (bare values split on both splitters -> [value, label] tuples, value === label). Default `json`."},{configKey:"optionsSplitter",attribute:"data-options-splitter",converter:L({default:","}),on:"reinit",type:"string",description:'Field/cell delimiter for the `csv` and `plain` `data-options` formats. Default `,`. Escapes `\\t` `\\n` `\\r` are honoured (e.g. `data-options-splitter="\\t"` for TSV). Ignored for `json`.'},{configKey:"optionsRowSplitter",attribute:"data-options-row-splitter",converter:L({default:`
|
|
42
|
+
`}),on:"reinit",type:"string",description:'Row/record delimiter for the `csv` and `plain` `data-options` formats. Default newline. Escapes honoured (e.g. `data-options-row-splitter=";"` for single-line data). Ignored for `json`.'},{configKey:"actionButtons",converter:Xo({validate:s=>Array.isArray(s)}),on:"reinit",type:"Array<Record<string, unknown>>",description:"Custom action buttons for the dropdown footer/header. Property-only; when unset the default Select-All / Clear buttons apply."},{configKey:"getValueCallback",converter:$(),on:"reinit",type:"(item: unknown) => string | number",description:"Extract an option value (overrides valueMember)."},{configKey:"getPathCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Extract a node tree path (enables tree mode; overrides pathMember)."},{configKey:"getGroupCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Extract the group name from an option (overrides groupMember)."},{configKey:"getDisabledCallback",converter:$(),on:"reinit",type:"(item: unknown) => boolean",description:"Whether an option is disabled (overrides disabledMember)."},{configKey:"getIsSelectableCallback",converter:$(),on:"reinit",type:"(node: unknown) => boolean",description:"Whether a tree node can be selected (overrides is-selectable-member)."},{configKey:"getSearchValueCallback",converter:$(),on:"reinit",type:"(item: unknown) => string",description:"Text an option is searched against (overrides searchValueMember)."},{configKey:"searchCallback",converter:$(),on:"reinit",type:"(searchTerm: string, signal?: AbortSignal) => Promise<unknown[]>",description:"Custom / async search; return the filtered options."},{configKey:"getDisplayValueCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Compute the display label for an option (overrides displayValueMember)."},{configKey:"getBadgeDisplayCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Compute the text shown on an option badge."},{configKey:"getBadgeClassCallback",converter:$(),on:"update",type:"(item: unknown) => string | string[]",description:"Extra CSS class(es) for an option badge."},{configKey:"getIconCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Icon for an option (overrides iconMember)."},{configKey:"getSubtitleCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Subtitle for an option (overrides subtitleMember)."},{configKey:"getFullTitleCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Full title for an option (used by badges when show-badge-full-title is on)."},{configKey:"getCounterCallback",converter:$(),on:"update",type:"(count: number, moreCount?: number) => string",description:"Render the selected-count label."},{configKey:"getValueFormatCallback",converter:$(),on:"update",type:"(selectedValues: (string | number)[]) => string",description:"Serialize the selected values for form submission."},{configKey:"getBadgeTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Tooltip content for an option badge."},{configKey:"getOptionTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Tooltip content for an option row."},{configKey:"getRemoveButtonTooltipCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Tooltip text for a badge remove button."},{configKey:"getSelectedItemClassCallback",converter:$(),on:"update",type:"(item: unknown) => string | string[]",description:"Extra CSS class(es) for a selected item."},{configKey:"renderOptionContentCallback",converter:$(),on:"update",type:"(item: unknown, context: OptionContentRenderContext) => string | HTMLElement",description:"Custom render for an option row; may return HTML or an element."},{configKey:"renderBadgeContentCallback",converter:$(),on:"update",type:"(item: unknown, context: BadgeContentRenderContext) => string | HTMLElement",description:"Custom render for a badge content (fills the built-in pill); may return HTML or an element."},{configKey:"renderBadgeCallback",converter:$(),on:"update",type:"(item: unknown, context: BadgeContentRenderContext) => string | HTMLElement | null",description:'Custom render for the WHOLE badge (main area), not just its content — return the entire pill/card. The component wraps it in `.ms__badge.ms__badge--custom` with `data-value` and delegates removal to any inner element with `data-action="remove"` (or `.ms__badge-remove`). Return null/empty to fall back to the default pill for that item.'},{configKey:"renderGroupLabelContentCallback",converter:$(),on:"update",type:"(groupName: string) => string | HTMLElement",description:"Customize a group label; may return an HTML string or element."},{configKey:"renderSelectedContentCallback",converter:$(),on:"update",type:"(item: unknown) => string",description:"Custom render for the whole selected area."},{configKey:"renderSelectedItemContentCallback",converter:$(),on:"update",type:"(item: unknown) => string | HTMLElement",description:"Custom render for one selected item."},{configKey:"customStylesCallback",converter:$(),on:"update",type:"() => string",description:"Returns a CSS string injected into the component via a replaceable style slot (§12.8)."},{configKey:"beforeSearchCallback",converter:$(),on:"update",type:"(searchTerm: string) => string | null",description:"Runs before a search; return a rewritten term or null to veto."},{configKey:"beforeSelectCallback",converter:$(),on:"update",type:"(option: unknown, selectedOptions: unknown[]) => boolean | string | void",description:"Runs before selecting; return false to veto, or a string to veto and show it as a message."},{configKey:"beforeDeselectCallback",converter:$(),on:"update",type:"(option: unknown, selectedOptions: unknown[]) => boolean | string | void",description:"Runs before deselecting; return false to veto, or a string to veto and show it as a message."},{configKey:"addNewCallback",converter:$(),on:"update",type:"(value: string) => unknown | null | undefined | Promise<unknown | null | undefined>",description:"Create a new option from the typed text. May return a rich option object (renders via the same get*/render* callbacks as any option). Async + cancelable: return null/undefined to abort (no add, no `add` event). Omit entirely to handle creation yourself via the `add` event."},{configKey:"getAddNewTextCallback",converter:$(),on:"update",type:"(value: string) => string",description:'Dynamically compute the "add new" prompt label from the typed text (returns plain text). Takes precedence over `add-new-text`.'},{configKey:"keydownCallback",converter:$(),on:"update",type:"(context: MultiSelectKeydownContext) => boolean | void",description:"Intercept keydown before built-in handling; return true to suppress the default. Gets the event, current state, and an imperative controller."}],_n=[{name:"select",description:"An option was selected. `detail.option` is the selected option; `detail.selectedOptions`/`detail.selectedValues` are the full selection."},{name:"deselect",description:"An option was removed from the selection. `detail.option` is that option."},{name:"change",description:"The selection changed. `detail.selectedOptions`/`detail.selectedValues` are the full selection."},{name:"add",description:'The user chose to create a new option from the typed text (via the "add new" prompt or Enter) — requires `allow-add-new`. `detail.value` is the typed text; `detail.option` is the created item when `addNewCallback` produced one.'},{name:"ready",description:"The picker was built and painted for the first time (once per element lifetime). Fires right after the first build — synchronously during upgrade for a normal element, or when the render gate is released (`el.ready()` / removing `defer`) for a deferred one. No detail."}],Lo=new Set(["dropdownWidth","selectedPopoverWidth","showDebugInfo","initialValues","optionsSource","optionsFormat","optionsSplitter","optionsRowSplitter","mobilePresentation","collapseBadgesBelow","deferRender"]),Bt={dropdownWidth:"--ms-dropdown-width",selectedPopoverWidth:"--ms-selected-popover-width"};let kn=null;function Cn(){return kn??(kn=$i(Oo,"--ms-"))}const Sn=[{key:"valueMember",member:"value",callbackKey:"getValueCallback"},{key:"displayValueMember",member:"label",callbackKey:"getDisplayValueCallback"},{key:"groupMember",member:"group",callbackKey:"getGroupCallback"},{key:"iconMember",member:"icon",callbackKey:"getIconCallback"},{key:"subtitleMember",member:"subtitle",callbackKey:"getSubtitleCallback"},{key:"disabledMember",member:"disabled",callbackKey:"getDisabledCallback"}];class De extends Xt{constructor(){super();A(this,w);A(this,Q);A(this,C);A(this,be);A(this,Ue,!1);A(this,ut,null);A(this,mt,new Set);A(this,pt,!1);A(this,Ge,!1);A(this,qe);A(this,Le);A(this,ve,!1);O(this,Q,this.attachShadow({mode:"open"})),zi(h(this,Q),Oo),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>this.setAttribute("data-ready","")):this.setAttribute("data-ready","")}formResetCallback(){var t;(t=h(this,C))==null||t.clearAll()}directionChanged(t){var o;(o=h(this,C))==null||o.refreshDirection()}reinit(){b(this,w,Ko).call(this),this.isConnected&&!b(this,w,bs).call(this)&&b(this,w,ys).call(this)}update(t){b(this,w,Wo).call(this,t),"customStylesCallback"in t&&b(this,w,xs).call(this),"showDebugInfo"in t&&b(this,w,ks).call(this);const o={};for(const[i,r]of Object.entries(t))Lo.has(i)||(o[i]=r===null?void 0:r);h(this,C)&&Object.keys(o).length>0&&(h(this,C).updateOptions(o)||b(this,w,ys).call(this)),"mobilePresentation"in t&&b(this,w,Kt).call(this,Qe()),"collapseBadgesBelow"in t&&b(this,w,Wt).call(this,this.getBoundingClientRect().width)}connect(){!h(this,C)&&!b(this,w,bs).call(this)&&b(this,w,jt).call(this)}disconnect(){var t;(t=h(this,C))==null||t.destroy(),O(this,C,void 0)}environmentChanged(t){b(this,w,Kt).call(this,t)}resized({width:t}){b(this,w,Wt).call(this,t)}get name(){return this.getAttribute("name")}set name(t){t?this.setAttribute("name",t):this.removeAttribute("name")}get selectedValue(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.selectedValue)??null}get selectedItem(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.selectedItem)??null}getSelected(){return this.flush(),h(this,C)?h(this,C).getSelected():[]}setSelected(t,o={}){var i;this.flush(),(i=h(this,C))==null||i.setSelected(t,o)}getValue(){return this.flush(),h(this,C)?h(this,C).getValue():null}showMessage(t,o){var i;this.flush(),(i=h(this,C))==null||i.showMessage(t,o)}hideMessage(){var t;(t=h(this,C))==null||t.hideMessage()}clearSearch(){var t;this.flush(),(t=h(this,C))==null||t.clearSearch()}get searchText(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.searchText)??""}search(t){var o;this.flush(),(o=h(this,C))==null||o.search(t)}scrollToIndex(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToIndex(t,o))??!1}scrollToValue(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToValue(t,o))??!1}scrollToGroup(t,o){var i;return this.flush(),((i=h(this,C))==null?void 0:i.scrollToGroup(t,o))??!1}open(){var t;this.flush(),(t=h(this,C))==null||t.open()}close(){var t;this.flush(),(t=h(this,C))==null||t.close()}toggle(){var t;this.flush(),(t=h(this,C))==null||t.toggle()}get isOpen(){var t;return this.flush(),((t=h(this,C))==null?void 0:t.isOpen)??!1}set isOpen(t){this.flush(),h(this,C)&&(h(this,C).isOpen=t)}destroy(){var t;(t=h(this,C))==null||t.destroy()}ready(){O(this,Ue,!0),this.flush(),this.isConnected&&!h(this,C)&&b(this,w,jt).call(this)}get isReady(){return this.hasAttribute("is-ready")}}Q=new WeakMap,C=new WeakMap,be=new WeakMap,Ue=new WeakMap,ut=new WeakMap,mt=new WeakMap,pt=new WeakMap,Ge=new WeakMap,qe=new WeakMap,Le=new WeakMap,w=new WeakSet,bs=function(){return this.config.deferRender===!0&&!h(this,Ue)},Kt=function(t){var r;const o=this.config.mobilePresentation??"auto",i=Hi(o,t);(r=h(this,C))==null||r.setPresentation(i==="modal"?"fullscreen":i)},ve=new WeakMap,Wt=function(t){const o=this.config.collapseBadgesBelow;if(o==null){h(this,ve)&&(O(this,ve,!1),b(this,w,vs).call(this));return}const i=t>0&&t<o;i!==h(this,ve)&&(O(this,ve,i),i?b(this,w,ws).call(this,"count"):b(this,w,vs).call(this))},vs=function(){const t=this.config.badgesDisplayMode??"badges";b(this,w,ws).call(this,t)},ws=function(t){var o;(o=h(this,C))==null||o.updateOptions({badgesDisplayMode:t})},ys=function(){var t;(t=h(this,C))==null||t.destroy(),O(this,C,void 0),b(this,w,jt).call(this)},jt=function(){b(this,w,Ro).call(this),b(this,w,jo).call(this);const t=b(this,w,Bo).call(this),o=b(this,w,Ho).call(this);o&&o.length>0?h(this,be).dataset.initialValues=JSON.stringify(o):delete h(this,be).dataset.initialValues,O(this,C,new ko(h(this,be),t)),b(this,w,xs).call(this),b(this,w,ks).call(this),b(this,w,Kt).call(this,Qe()),O(this,ve,!1),b(this,w,Wt).call(this,this.getBoundingClientRect().width),this.hasAttribute("is-ready")||(O(this,Ue,!0),this.setAttribute("is-ready",""),this.emit("ready"))},Ro=function(){if(h(this,be))return;const t=document.createElement("div");t.setAttribute("data-multiselect",""),this.className&&(t.className=this.className),h(this,Q).appendChild(t),O(this,ut,Ni(h(this,Q),{position:"first",className:"ms-custom-styles"})),O(this,be,t)},Bo=function(){const t={...this.config};for(const i of Lo)delete t[i];for(const i of Object.keys(t))t[i]===null&&delete t[i];let o=t.options;if(h(this,Ge)&&h(this,qe))o&&o.length>0&&U.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."),o=h(this,qe);else if(!o||o.length===0){const i=this.config.optionsSource;if(i!=null){const r=this.config.optionsFormat??"json",{options:n,error:a}=Io(i,r,{splitter:this.config.optionsSplitter,rowSplitter:this.config.optionsRowSplitter});a&&U.error(`[MultiSelectElement] ${a}`),o=n}}if(t.options=o,h(this,Ge))for(const{key:i,member:r,callbackKey:n}of Sn)t[i]===void 0&&!t[n]&&(t[i]=r);return t.getCounterCallback||(t.getCounterCallback=(i,r)=>r!==void 0?`+${r} more`:`${i} selected`),t.onSelect=i=>{var r;this.emit("select",{option:i,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,w,gt).call(this)})},t.onDeselect=i=>{var r;this.emit("deselect",{option:i,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,w,gt).call(this)})},t.onChange=i=>{this.emit("change",{selectedOptions:i,selectedValues:b(this,w,gt).call(this)})},t.onAddNew=i=>{var r;this.emit("add",{value:i.value,option:i.option,selectedOptions:((r=h(this,C))==null?void 0:r.getSelected())??[],selectedValues:b(this,w,gt).call(this)})},t.container=h(this,Q),t.hostElement=this,t},Ho=function(){if(h(this,Le)&&h(this,Le).length>0)return h(this,Le);const t=this.config.initialValues;return t&&t.length>0?t:void 0},gt=function(){var o;const t=(o=h(this,C))==null?void 0:o.getValue();return t==null?[]:Array.isArray(t)?t:[t]},xs=function(){const t=h(this,ut);if(!t)return;const o=this.config.customStylesCallback;if(typeof o!="function"){t.clear();return}try{const i=o();t.set(i),i&&b(this,w,Fo).call(this,i)}catch(i){U.warn("[MultiSelectElement] customStylesCallback threw",i),t.clear()}},Fo=function(t){const o=Cn();if(o.size!==0)for(const{name:i,suggestions:r}of Ri(t,{prefix:"--ms-",consumed:o}))h(this,mt).has(i)||(h(this,mt).add(i),console.warn(`[web-multiselect] customStylesCallback sets "${i}", which no web-multiselect style consumes — it will have no effect.`+(r.length?` Did you mean: ${r.join(", ")}?`:"")+" (If it's for your own custom-rendered content, ignore this.)"))},Ko=function(){for(const t of Object.keys(Bt))b(this,w,_s).call(this,Bt[t],this.config[t])},Wo=function(t){for(const o of Object.keys(Bt))o in t&&b(this,w,_s).call(this,Bt[o],t[o])},_s=function(t,o){o==null||o===""?this.style.removeProperty(t):this.style.setProperty(t,String(o))},jo=function(){if(h(this,pt))return;O(this,pt,!0);const t=b(this,w,Uo).call(this);t&&(O(this,qe,t),O(this,Ge,!0))},Uo=function(){const t=Array.from(this.children);if(t.length===0)return null;const o=[];let i=!1;const r=(n,a)=>{var c,d;const l={value:n.value||((c=n.textContent)==null?void 0:c.trim())||"",label:((d=n.textContent)==null?void 0:d.trim())||n.value||""};a&&(l.group=a),n.hasAttribute("selected")&&(h(this,Le)??O(this,Le,[])).push(l.value),n.hasAttribute("disabled")&&(l.disabled=!0),n.hasAttribute("data-icon")&&(l.icon=n.getAttribute("data-icon")),n.hasAttribute("data-subtitle")&&(l.subtitle=n.getAttribute("data-subtitle")),o.push(l),i=!0};for(const n of t)if(n.tagName==="OPTION")r(n);else if(n.tagName==="OPTGROUP"){const a=n,l=a.label||a.getAttribute("label")||"Group";for(const c of Array.from(a.querySelectorAll("option")))r(c,l)}if(!i)return null;U.debug(`[MultiSelectElement] Parsed ${o.length} declarative options from Light DOM`);for(const n of t)(n.tagName==="OPTION"||n.tagName==="OPTGROUP")&&n.remove();return o},ks=function(){const t=h(this,Q).querySelector(".ms__debug-info");if(t&&t.remove(),!this.config.showDebugInfo)return;const o=document.createElement("div");o.className="ms__debug-info";const i=document.createElement("details"),r=document.createElement("summary");r.textContent="Debug Info";const n=document.createElement("div");n.className="ms__debug-stats",i.appendChild(r),i.appendChild(n),o.appendChild(i),h(this,Q).appendChild(o),b(this,w,Cs).call(this)},Cs=function(){var l,c,d,u;const t=h(this,Q).querySelector(".ms__debug-stats");if(!t||!h(this,C))return;const o="2.1.0",i=typeof window<"u"&&((c=(l=window.components)==null?void 0:l["web-multiselect"])==null?void 0:c.getInstances().length)||0,r=h(this,C).getSelected().length,n=((d=this.config.options)==null?void 0:d.length)||0,a=h(this,C);t.innerHTML=`
|
|
43
43
|
<span>Version: ${o}</span>
|
|
44
44
|
<span>Total Instances: ${i}</span>
|
|
45
45
|
<span>Options: ${n}</span>
|
|
@@ -48,4 +48,4 @@ ${o}`:t}attachOptionTooltips(){if(this.destroyAllOptionTooltips(),!this.options.
|
|
|
48
48
|
<span>Dropdown: ${a.isOpen?"Open":"Closed"}</span>
|
|
49
49
|
<span>Search: ${a.searchTerm||"none"}</span>
|
|
50
50
|
<span>Loading: ${a.isLoading?"Yes":"No"}</span>
|
|
51
|
-
`,setTimeout(()=>{this.config.showDebugInfo&&b(this,
|
|
51
|
+
`,setTimeout(()=>{this.config.showDebugInfo&&b(this,w,Cs).call(this)},500)},p(De,"formAssociated",!0),p(De,"inputs",xn),p(De,"events",_n),typeof customElements<"u"&&!customElements.get("web-multiselect")&&customElements.define("web-multiselect",De),Ei("web-multiselect",De,{config:{name:"@keenmate/web-multiselect",version:"2.1.0",author:"Keenmate s.r.o.",license:"MIT",repository:"git+https://github.com/keenmate/web-multiselect.git",homepage:"https://web-multiselect.keenmate.dev"},logging:le}),k.LOGGING_CATEGORIES=an,k.MultiSelectElement=De,k.OPTIONS_FORMATS=Co,k.TABLET_MIN_SHORT_SIDE=Ns,k.WebMultiSelect=ko,k.classifyDevice=$s,k.configureBreakpoints=di,k.dataLogger=U,k.disableLogging=cn,k.enableLogging=ln,k.getEnvironment=Qe,k.initLogger=nt,k.interactionLogger=H,k.observeEnvironment=As,k.observeViewport=zs,k.parseOptionsData=Io,k.setCategoryLevel=hn,k.setLogLevel=dn,k.uiLogger=J,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|