@wsxjs/wsx-base-components 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +5 -5
- package/src/ResponsiveNav.wsx +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
left: -9999px;
|
|
4
4
|
opacity: 0;
|
|
5
5
|
pointer-events: none;
|
|
6
|
-
`;const i=He(k=>{var A;const C=k.target,b=ne(C.value);this.setSelectedColor(b),this.setCustomColor(b),document.body.removeChild(r),(A=this.onColorPicked)==null||A.call(this,b),this.dispatchEvent(new CustomEvent("colorchange",{detail:{color:b},bubbles:!0,composed:!0})),re.debug("Custom color selected",{color:b})},30);r.addEventListener("input",i),document.body.appendChild(r),requestAnimationFrame(()=>{r.focus(),r.click()})}),X(this,"handleDocumentClick",r=>{this.isOpen&&!this.contains(r.target)&&this.closePanel()}),this.colorCollections=e.colorCollections||Gt,this.onColorPicked=e.onColorPicked,this.hasCustomPicker=e.hasCustomPicker||!1,this.pluginType=e.pluginType||"text",this.disabled=e.disabled||!1,this.defaultColor=ne(e.defaultColor||this.colorCollections[0]),this.selectedColor=this.defaultColor,this.customColor=Ue(this.pluginType)||"",this.isOpen=!1,re.debug("ColorPicker initialized",{colorCollections:this.colorCollections.length,hasCustomPicker:this.hasCustomPicker,pluginType:this.pluginType})}render(){const e=this.renderColorButton(),r=this.isOpen?this.renderColorPanel():null;return _.jsx("section",{class:"color-section"},_.jsx("div",{class:"color-popover"},e,r))}renderColorButton(){return _.jsx("wsx-button",{type:"button",class:`color-btn ${this.disabled?"disabled":""}`,style:`--theme-color: ${this.selectedColor}`,disabled:this.disabled,onClick:this.handleButtonClick,ref:e=>{this.colorBtn=e}},_.jsx("span",{class:"color-indicator"},"_"))}renderColorPanel(){return _.jsx("div",{class:"color-panel",onClick:this.handlePanelClick,ref:e=>{this.colorPanel=e}},_.jsx("div",{class:"color-grid"},this.hasCustomPicker?this.renderCustomPicker():null,this.renderColorButtons()))}renderCustomPicker(){return _.jsx("wsx-button",{type:"button",class:"color-cube custom-picker",style:{backgroundColor:this.customColor},onClick:this.handleCustomPickerClick,title:"自定义颜色"})}renderColorButtons(){return this.colorCollections.map(e=>_.jsx("wsx-button",{key:e,type:"button",class:"color-cube",style:`background-color: ${e}`,"data-color":e,title:e,onClick:()=>this.handleColorSelect(e)}))}togglePanel(){this.setOpen(!this.isOpen)}closePanel(){this.setOpen(!1)}setSelectedColor(e){this.selectedColor=e,this.setAttr("selected-color",e),this.updateColorButton()}setCustomColor(e){this.customColor=e,Be(e,this.pluginType)}setOpen(e){this.isOpen=e,e?this.setAttr("open",""):this.removeAttr("open"),this.rerender()}updateColorButton(){this.colorBtn&&this.colorBtn.style.setProperty("--theme-color",this.selectedColor)}onConnected(){document.addEventListener("click",this.handleDocumentClick),re.info("ColorPicker connected to DOM")}onDisconnected(){document.removeEventListener("click",this.handleDocumentClick),re.info("ColorPicker disconnected from DOM")}onAttributeChanged(e,r,i){switch(e){case"disabled":this.disabled=i!==null,this.rerender();break;case"selected-color":i&&i!==this.selectedColor&&(this.selectedColor=i,this.updateColorButton());break;case"open":this.isOpen=i!==null;break}}getSelectedColor(){return this.selectedColor}setColor(e){this.setSelectedColor(ne(e))}focus(){var e;(e=this.colorBtn)==null||e.focus()}}Ge=Wt;[exports.ColorPicker,We]=Bt(Ge,[],Ve,0,void 0,_.WebComponent).c;We();const Vt=":host{display:block}.theme-switcher-container{position:relative;display:flex;align-items:center}.theme-switcher-btn{width:var(--theme-switcher-width, 2.5rem);height:var(--theme-switcher-height, 2.5rem);padding:var(--theme-switcher-padding, .5rem);border-radius:var(--theme-switcher-border-radius, 8px);background:var(--theme-switcher-bg, #dc2626);border:var(--theme-switcher-border, none);color:var(--theme-switcher-color, white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--theme-switcher-transition, .3s ease);box-shadow:var(--theme-switcher-shadow, 0 4px 15px rgba(220, 38, 38, .4));font-weight:var(--theme-switcher-font-weight, 600);font-family:var(--theme-switcher-font-family, inherit)}.theme-switcher-btn:hover{background:var(--theme-switcher-hover-bg, #b91c1c);transform:var(--theme-switcher-hover-transform, translateY(-2px));box-shadow:var(--theme-switcher-hover-shadow, 0 8px 25px rgba(220, 38, 38, .5))}.theme-switcher-btn:active{transform:var(--theme-switcher-active-transform, translateY(0))}.theme-switcher-icon{font-size:var(--theme-switcher-icon-size, 1rem);line-height:1;transition:transform var(--theme-switcher-icon-transition, .3s ease)}.theme-switcher-btn:hover .theme-switcher-icon{transform:var(--theme-switcher-icon-hover-transform, rotate(360deg))}.theme-switcher-btn[data-theme=light]{background:var(--theme-switcher-light-bg, #dc2626);color:var(--theme-switcher-light-color, white)}.theme-switcher-btn[data-theme=light]:hover{background:var(--theme-switcher-light-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=dark]{background:var(--theme-switcher-dark-bg, #dc2626);color:var(--theme-switcher-dark-color, white)}.theme-switcher-btn[data-theme=dark]:hover{background:var(--theme-switcher-dark-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=auto]{background:var(--theme-switcher-auto-bg, linear-gradient(135deg, #dc2626, #b91c1c));color:var(--theme-switcher-auto-color, white)}.theme-switcher-btn[data-theme=auto]:hover{background:var(--theme-switcher-auto-hover-bg, linear-gradient(135deg, #b91c1c, #991b1b))}@media (max-width: 768px){.theme-switcher-btn{width:var(--theme-switcher-mobile-width, 2rem);height:var(--theme-switcher-mobile-height, 2rem)}.theme-switcher-icon{font-size:var(--theme-switcher-mobile-icon-size, .9rem)}}";var Ke;let Ze,Xe;function le(t,e,r){return(e=qe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yt(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:be(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||be(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return Zt(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:qe(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function qe(t){var e=Kt(t,"string");return typeof e=="symbol"?e:e+""}function Kt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function be(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Zt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Xe=[_.autoRegister({tagName:"theme-switcher"})];exports.ThemeSwitcher=void 0;class Xt extends _.WebComponent{constructor(){super({styleName:"theme-switcher"}),le(this,"_autoStyles",Vt),le(this,"currentTheme","auto"),le(this,"toggleTheme",()=>{const e=["auto","light","dark"],i=(e.indexOf(this.currentTheme)+1)%e.length;this.setTheme(e[i])}),this.initTheme()}render(){return _.jsx("div",{class:"theme-switcher-container"},_.jsx("button",{class:"theme-switcher-btn","data-theme":this.currentTheme,onClick:this.toggleTheme,title:`当前主题: ${this.getThemeLabel()}`,"data-wsx-key":"ThemeSwitcher-button-text-1"},_.jsx("span",{class:"theme-switcher-icon"},this.getThemeIcon())))}getThemeIcon(){const r=document.documentElement.classList.contains("dark");return this.currentTheme==="auto"?r?"🌙":"☀️":this.currentTheme==="light"?"☀️":"🌙"}getThemeLabel(){return{light:"浅色",dark:"深色",auto:"自动"}[this.currentTheme]}setTheme(e){this.currentTheme=e;const r=document.documentElement;e==="auto"?(r.removeAttribute("class"),this.checkSystemTheme()):r.className=e,localStorage.setItem("wsx-theme",e),this.rerender()}checkSystemTheme(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.className=e?"dark":""}initTheme(){const e=localStorage.getItem("wsx-theme")||"auto";this.setTheme(e),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r=>{this.currentTheme==="auto"&&(document.documentElement.className=r.matches?"dark":"")})}}Ke=Xt;[exports.ThemeSwitcher,Ze]=Yt(Ke,[],Xe,0,void 0,_.WebComponent).c;Ze();const me=":host{display:inline-block;position:relative}.dropdown-container{position:relative;display:inline-block}.dropdown-button{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.5rem .75rem;min-width:120px;background:var(--dropdown-bg, rgba(255, 255, 255, .1));border:1px solid var(--dropdown-border, rgba(255, 255, 255, .2));border-radius:var(--dropdown-border-radius, .5rem);color:var(--dropdown-color, currentColor);cursor:pointer;font-size:.875rem;font-weight:500;transition:all .2s ease;text-align:left}.dropdown-button:hover:not(.disabled){background:var(--dropdown-hover-bg, rgba(255, 255, 255, .15));border-color:var(--dropdown-hover-border, rgba(255, 255, 255, .3))}.dropdown-button:focus:not(.disabled){outline:2px solid var(--dropdown-focus-color, var(--focus-color, #dc2626));outline-offset:2px}.dropdown-button.open{background:var(--dropdown-open-bg, rgba(255, 255, 255, .2))}.dropdown-button.disabled{opacity:.5;cursor:not-allowed}.dropdown-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-arrow{font-size:.625rem;opacity:.7;transition:transform .2s ease;flex-shrink:0}.dropdown-button.open .dropdown-arrow{transform:rotate(180deg)}.dropdown-menu{position:absolute;z-index:1000;min-width:160px;max-width:300px;max-height:300px;overflow-y:auto;background:var(--dropdown-menu-bg, #ffffff);border:1px solid var(--dropdown-menu-border, #e5e7eb);border-radius:var(--dropdown-border-radius, .5rem);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;padding:.25rem;margin:.25rem 0 0}[data-theme=dark] .dropdown-menu{background:var(--dropdown-menu-bg-dark, #1f2937);border-color:var(--dropdown-menu-border-dark, #374151)}.dropdown-menu.dropdown-top{bottom:100%;margin:0 0 .25rem}.dropdown-menu.dropdown-bottom{top:100%;margin:.25rem 0 0}.dropdown-menu.dropdown-left{left:0}.dropdown-menu.dropdown-right{right:0}.dropdown-menu.dropdown-center{left:50%;transform:translate(-50%)}.dropdown-menu.dropdown-top.dropdown-center{transform:translate(-50%) translateY(-100%)}.dropdown-option{display:flex;align-items:center;width:100%;padding:.5rem .75rem;background:transparent;border:none;border-radius:.375rem;color:var(--dropdown-option-color, #1f2937);cursor:pointer;font-size:.875rem;text-align:left;transition:background-color .15s ease}[data-theme=dark] .dropdown-option{color:var(--dropdown-option-color-dark, #f3f4f6)}.dropdown-option:hover:not(.disabled){background:var(--dropdown-option-hover-bg, #f3f4f6)}[data-theme=dark] .dropdown-option:hover:not(.disabled){background:var(--dropdown-option-hover-bg-dark, #374151)}.dropdown-option.selected{background:var(--dropdown-option-selected-bg, #dc2626);color:var(--dropdown-option-selected-color, #ffffff);font-weight:600}.dropdown-option.selected:hover{background:var(--dropdown-option-selected-hover-bg, #b91c1c)}.dropdown-option.disabled{opacity:.5;cursor:not-allowed}.dropdown-empty{padding:.5rem .75rem;color:var(--dropdown-empty-color, #9ca3af);font-size:.875rem;text-align:center}@media (max-width: 768px){.dropdown-button{min-width:100px;padding:.375rem .5rem;font-size:.8125rem}.dropdown-menu{min-width:140px;max-width:200px}}";var Qe;let Je,et;function J(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:ve(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||ve(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return Jt(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:tt(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function tt(t){var e=Qt(t,"string");return typeof e=="symbol"?e:e+""}function Qt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ve(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Jt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}et=[_.autoRegister({tagName:"wsx-dropdown"})];exports.Dropdown=void 0;class er extends _.WebComponent{constructor(e={}){super({styles:me,styleName:"wsx-dropdown"}),J(this,"_autoStyles",me),J(this,"options",[]),J(this,"selectedValue",void 0),J(this,"isOpen",void 0),J(this,"config",{}),J(this,"buttonElement",void 0),J(this,"dropdownElement",void 0),J(this,"outsideClickHandler",void 0),J(this,"toggleDropdown",()=>{this.config.disabled||(this.isOpen=!this.isOpen,this.rerender(),this.isOpen?setTimeout(()=>{this.attachOutsideClickHandler()},0):this.detachOutsideClickHandler())}),J(this,"openDropdown",()=>{this.config.disabled||this.isOpen||(this.isOpen=!0,this.rerender())}),J(this,"closeDropdown",()=>{this.isOpen&&(this.isOpen=!1,this.rerender(),this.detachOutsideClickHandler())}),J(this,"selectOption",b=>{this.setValue(b),this.config.trigger==="click"&&this.closeDropdown()}),J(this,"attachOutsideClickHandler",()=>{this.config.trigger!=="hover"&&(this.outsideClickHandler=b=>{const A=b.target;this.dropdownElement&&this.buttonElement&&!this.dropdownElement.contains(A)&&!this.buttonElement.contains(A)&&this.closeDropdown()},document.addEventListener("click",this.outsideClickHandler,!0))}),J(this,"detachOutsideClickHandler",()=>{this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,!0),this.outsideClickHandler=void 0)}),this.config={placeholder:"Select...",align:"left",position:"bottom",trigger:"click",...e};const[r,i]=this.useState("selectedValue","");Object.defineProperty(this,"selectedValue",{get:r,set:i,enumerable:!0,configurable:!0});const[k,C]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:k,set:C,enumerable:!0,configurable:!0})}setOptions(e){this.options=e,this.rerender()}setValue(e){this.selectedValue=e,this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0}))}getValue(){return this.selectedValue||void 0}render(){const e=this.options.find(i=>i.value===this.selectedValue&&this.selectedValue!==""),r=(e==null?void 0:e.label)||this.config.placeholder||"Select...";return _.jsx("div",{class:"dropdown-container"},_.jsx("button",{ref:i=>this.buttonElement=i,class:`dropdown-button ${this.isOpen?"open":""} ${this.config.disabled?"disabled":""}`,onClick:this.config.trigger==="click"?this.toggleDropdown:void 0,onMouseEnter:this.config.trigger==="hover"?this.openDropdown:void 0,onMouseLeave:this.config.trigger==="hover"?this.closeDropdown:void 0,disabled:this.config.disabled,"aria-expanded":this.isOpen,"aria-haspopup":"listbox","data-wsx-key":"Dropdown-button-text-1"},_.jsx("span",{class:"dropdown-text"},r),_.jsx("span",{class:"dropdown-arrow"},this.isOpen?"▲":"▼")),this.isOpen&&_.jsx("div",{ref:i=>this.dropdownElement=i,class:`dropdown-menu dropdown-${this.config.position} dropdown-${this.config.align}`,role:"listbox",onMouseEnter:this.config.trigger==="hover"?this.openDropdown:void 0,onMouseLeave:this.config.trigger==="hover"?this.closeDropdown:void 0},this.options.length===0?_.jsx("div",{class:"dropdown-empty"},"No options"):this.options.map(i=>_.jsx("button",{key:i.value,class:`dropdown-option ${i.value===this.selectedValue&&this.selectedValue!==""?"selected":""} ${i.disabled?"disabled":""}`,onClick:()=>!i.disabled&&this.selectOption(i.value),role:"option","aria-selected":i.value===this.selectedValue&&this.selectedValue!=="",disabled:i.disabled,"data-wsx-key":"Dropdown-button-text-0"},i.render?i.render():_.jsx("span",null,i.label)))))}onDisconnected(){this.detachOutsideClickHandler()}}Qe=er;[exports.Dropdown,Je]=qt(Qe,[],et,0,void 0,_.WebComponent).c;Je();const ye=":host{display:inline-block;position:relative}.combobox-container{position:relative;display:inline-block;width:100%}.combobox-input-wrapper{position:relative;display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;min-width:200px;background:var(--combobox-bg, rgba(255, 255, 255, .1));border:1px solid var(--combobox-border, rgba(255, 255, 255, .2));border-radius:var(--combobox-border-radius, .5rem);transition:all .2s ease}.combobox-input-wrapper:focus-within{background:var(--combobox-focus-bg, rgba(255, 255, 255, .15));border-color:var(--combobox-focus-border, var(--focus-color, #dc2626));outline:2px solid var(--combobox-focus-outline, rgba(220, 38, 38, .2));outline-offset:2px}.combobox-tags{display:flex;align-items:center;gap:.25rem;flex-wrap:wrap;flex:1}.combobox-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;background:var(--combobox-tag-bg, #dc2626);color:var(--combobox-tag-color, #ffffff);border-radius:.25rem;font-size:.75rem;font-weight:500}.combobox-tag-remove{background:none;border:none;color:var(--combobox-tag-color, #ffffff);cursor:pointer;font-size:1rem;line-height:1;padding:0;width:16px;height:16px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color .15s ease}.combobox-tag-remove:hover{background:#fff3}.combobox-tag-more{padding:.25rem .5rem;color:var(--combobox-tag-color, #ffffff);font-size:.75rem;font-weight:500}.combobox-input{flex:1;border:none;background:transparent;color:var(--combobox-color, currentColor);font-size:.875rem;font-weight:500;outline:none;min-width:0}.combobox-input::placeholder{color:var(--combobox-placeholder-color, rgba(255, 255, 255, .5))}.combobox-input:disabled{opacity:.5;cursor:not-allowed}.combobox-arrow{background:none;border:none;color:var(--combobox-arrow-color, currentColor);cursor:pointer;font-size:.625rem;opacity:.7;transition:transform .2s ease;flex-shrink:0;padding:.25rem;display:flex;align-items:center;justify-content:center}.combobox-arrow:hover{opacity:1}.combobox-arrow.open{transform:rotate(180deg)}.combobox-arrow:disabled{opacity:.5;cursor:not-allowed}.combobox-menu{position:absolute;z-index:1000;min-width:100%;max-width:300px;max-height:300px;overflow-y:auto;background:var(--combobox-menu-bg, #ffffff);border:1px solid var(--combobox-menu-border, #e5e7eb);border-radius:var(--combobox-border-radius, .5rem);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;padding:.25rem;margin:.25rem 0 0}[data-theme=dark] .combobox-menu{background:var(--combobox-menu-bg-dark, #1f2937);border-color:var(--combobox-menu-border-dark, #374151)}.combobox-menu.combobox-top{bottom:100%;margin:0 0 .25rem}.combobox-menu.combobox-bottom{top:100%;margin:.25rem 0 0}.combobox-menu.combobox-left{left:0}.combobox-menu.combobox-right{right:0}.combobox-menu.combobox-center{left:50%;transform:translate(-50%)}.combobox-menu.combobox-top.combobox-center{transform:translate(-50%) translateY(-100%)}.combobox-option{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .75rem;background:transparent;border:none;border-radius:.375rem;color:var(--combobox-option-color, #1f2937);cursor:pointer;font-size:.875rem;text-align:left;transition:background-color .15s ease}[data-theme=dark] .combobox-option{color:var(--combobox-option-color-dark, #f3f4f6)}.combobox-option:hover:not(.disabled){background:var(--combobox-option-hover-bg, #f3f4f6)}[data-theme=dark] .combobox-option:hover:not(.disabled){background:var(--combobox-option-hover-bg-dark, #374151)}.combobox-option.selected{background:var(--combobox-option-selected-bg, #dc2626);color:var(--combobox-option-selected-color, #ffffff);font-weight:600}.combobox-option.selected:hover{background:var(--combobox-option-selected-hover-bg, #b91c1c)}.combobox-option.disabled{opacity:.5;cursor:not-allowed}.combobox-checkbox{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.75rem;font-weight:700}.combobox-empty{padding:.5rem .75rem;color:var(--combobox-empty-color, #9ca3af);font-size:.875rem;text-align:center}@media (max-width: 768px){.combobox-input-wrapper{min-width:150px;padding:.375rem .5rem}.combobox-input{font-size:.8125rem}.combobox-menu{max-width:200px}}";var rt;let nt,ot;function q(t,e,r){return(e=it(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tr(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:xe(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||xe(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return nr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:it(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function it(t){var e=rr(t,"string");return typeof e=="symbol"?e:e+""}function rr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function xe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function nr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}ot=[_.autoRegister({tagName:"wsx-combobox"})];exports.Combobox=void 0;class or extends _.WebComponent{constructor(e={}){super({styles:ye,styleName:"wsx-combobox"}),q(this,"_autoStyles",ye),q(this,"options",[]),q(this,"selectedValue",void 0),q(this,"searchQuery",void 0),q(this,"isOpen",void 0),q(this,"config",{}),q(this,"inputElement",void 0),q(this,"dropdownElement",void 0),q(this,"outsideClickHandler",void 0),q(this,"handleInput",y=>{if(!this.config.searchable)return;const D=y.target;this.searchQuery=D.value,this.rerender()}),q(this,"toggleDropdown",()=>{this.config.disabled||(this.isOpen=!this.isOpen,this.isOpen&&this.config.searchable&&this.inputElement&&this.inputElement.focus(),this.rerender(),this.isOpen?setTimeout(()=>{this.attachOutsideClickHandler()},0):(this.detachOutsideClickHandler(),this.searchQuery=""))}),q(this,"openDropdown",()=>{this.config.disabled||this.isOpen||(this.isOpen=!0,this.config.searchable&&this.inputElement&&this.inputElement.focus(),this.rerender(),setTimeout(()=>{this.attachOutsideClickHandler()},0))}),q(this,"closeDropdown",()=>{this.isOpen&&(this.isOpen=!1,this.searchQuery="",this.rerender(),this.detachOutsideClickHandler())}),q(this,"selectOption",y=>{if(this.config.multiple){const D=Array.isArray(this.selectedValue)?this.selectedValue:[],L=D.includes(y)?D.filter(T=>T!==y):[...D,y];this.selectedValue=L}else this.selectedValue=y,this.closeDropdown();this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selectedValue},bubbles:!0}))}),q(this,"removeValue",y=>{if(!this.config.multiple)return;const D=Array.isArray(this.selectedValue)?this.selectedValue:[];this.selectedValue=D.filter(L=>L!==y),this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selectedValue},bubbles:!0}))}),q(this,"attachOutsideClickHandler",()=>{this.outsideClickHandler=y=>{const D=y.target;this.dropdownElement&&this.inputElement&&!this.dropdownElement.contains(D)&&!this.inputElement.contains(D)&&this.closeDropdown()},document.addEventListener("click",this.outsideClickHandler,!0)}),q(this,"detachOutsideClickHandler",()=>{this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,!0),this.outsideClickHandler=void 0)}),this.config={placeholder:"Select or search...",searchable:!0,multiple:!1,align:"left",position:"bottom",...e};const[r,i]=this.useState("selectedValue","");Object.defineProperty(this,"selectedValue",{get:r,set:i,enumerable:!0,configurable:!0});const[k,C]=this.useState("searchQuery","");Object.defineProperty(this,"searchQuery",{get:k,set:C,enumerable:!0,configurable:!0});const[b,A]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:b,set:A,enumerable:!0,configurable:!0})}setOptions(e){this.options=e,this.rerender()}setValue(e){if(this.selectedValue=e,this.inputElement&&!this.config.multiple){const r=this.options.find(i=>i.value===(Array.isArray(e)?e[0]:e));this.inputElement.value=(r==null?void 0:r.label)||""}this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0}))}getValue(){return this.selectedValue}getFilteredOptions(){if(!this.config.searchable||!this.searchQuery.trim())return this.options;const e=this.searchQuery.toLowerCase();return this.options.filter(r=>r.label.toLowerCase().includes(e)||r.value.toLowerCase().includes(e))}render(){const e=this.getFilteredOptions(),r=this.config.multiple,i=Array.isArray(this.selectedValue)?this.selectedValue:this.selectedValue?[this.selectedValue]:[];let k="";if(r)if(i.length===0)k=this.config.placeholder||"Select...";else if(i.length===1){const C=this.options.find(b=>b.value===i[0]);k=(C==null?void 0:C.label)||i[0]}else k=`${i.length} selected`;else{const C=this.options.find(b=>b.value===this.selectedValue);k=(C==null?void 0:C.label)||this.config.placeholder||"Select..."}return _.jsx("div",{class:"combobox-container"},_.jsx("div",{class:"combobox-input-wrapper"},r&&i.length>0&&_.jsx("div",{class:"combobox-tags"},i.slice(0,2).map(C=>{const b=this.options.find(A=>A.value===C);return _.jsx("span",{key:C,class:"combobox-tag"},(b==null?void 0:b.label)||C,_.jsx("button",{class:"combobox-tag-remove",onClick:A=>{A.stopPropagation(),this.removeValue(C)},"data-wsx-key":"Combobox-button-text-3"},"×"))}),i.length>2&&_.jsx("span",{class:"combobox-tag-more"},"+",i.length-2)),_.jsx("input",{ref:C=>this.inputElement=C,type:"text",class:"combobox-input",placeholder:k,value:this.config.searchable&&this.isOpen?this.searchQuery:"",onInput:this.handleInput,onFocus:this.openDropdown,onClick:this.openDropdown,disabled:this.config.disabled,readonly:!this.config.searchable,"data-wsx-key":"Combobox-input-text-1-3"}),_.jsx("button",{class:`combobox-arrow ${this.isOpen?"open":""}`,onClick:this.toggleDropdown,disabled:this.config.disabled,"data-wsx-key":"Combobox-button-text-1-5"},this.isOpen?"▲":"▼")),this.isOpen&&_.jsx("div",{ref:C=>this.dropdownElement=C,class:`combobox-menu combobox-${this.config.position} combobox-${this.config.align}`,role:"listbox"},e.length===0?_.jsx("div",{class:"combobox-empty"},this.config.searchable&&this.searchQuery?"No results found":"No options"):e.map(C=>{const b=r?i.includes(C.value):C.value===this.selectedValue;return _.jsx("button",{key:C.value,class:`combobox-option ${b?"selected":""} ${C.disabled?"disabled":""}`,onClick:()=>!C.disabled&&this.selectOption(C.value),role:"option","aria-selected":b,disabled:C.disabled,"data-wsx-key":"Combobox-button-text-0"},r&&_.jsx("span",{class:"combobox-checkbox"},b?"✓":""),C.render?C.render():_.jsx("span",null,C.label))})))}onDisconnected(){this.detachOutsideClickHandler()}}rt=or;[exports.Combobox,nt]=tr(rt,[],ot,0,void 0,_.WebComponent).c;nt();class de{static detect(e){const{container:r,items:i,gap:k=16,reservedWidth:C=0,overflowButtonWidth:b=0,padding:A=0,minVisibleItems:y=1}=e;if(!r||i.length===0)return{visibleIndices:[],hiddenIndices:[],needsOverflow:!1};const L=r.offsetWidth-C-A*2;let T=0;const R=[],P=[];for(let o=0;o<i.length;o++){const n=i[o];if(!n||n.offsetWidth===0){R.push(o);continue}const u=n.offsetWidth+(o>0?k:0);T+u<=L?(T+=u,R.push(o)):P.push(o)}if(P.length===0)return{visibleIndices:R,hiddenIndices:[],needsOverflow:!1};const a=L-b-k;T=0;const s=[],c=[];for(let o=0;o<i.length;o++){const n=i[o];if(!n||n.offsetWidth===0){s.length<y?s.push(o):c.push(o);continue}const u=n.offsetWidth+(s.length>0?k:0);T+u<=a?(T+=u,s.push(o)):c.push(o)}if(s.length<y&&i.length>0){const o=y-s.length,n=c.splice(0,o);s.push(...n),s.sort((u,h)=>u-h)}return{visibleIndices:s,hiddenIndices:c,needsOverflow:c.length>0}}static calculateTotalWidth(e,r=16){return e.length===0?0:e.reduce((i,k,C)=>{const b=k.offsetWidth||0;return i+b+(C>0?r:0)},0)}static getElementTotalWidth(e){if(!e)return 0;const r=window.getComputedStyle(e),i=e.offsetWidth,k=parseFloat(r.marginLeft)||0,C=parseFloat(r.marginRight)||0;return i+k+C}}const we=':host{display:block}.responsive-nav{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--nav-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);border-bottom:1px solid var(--nav-border, var(--border-color));transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 3px #0000000d}.responsive-nav.nav-scrolled{background:var(--nav-bg-scrolled, var(--bg-primary));box-shadow:0 4px 24px var(--nav-shadow, var(--card-shadow));border-bottom-color:var(--nav-border, var(--border-color))}.nav-container{max-width:1280px;margin:0 auto;padding:0 2rem;display:flex;align-items:center;justify-content:space-between;height:72px;gap:1.5rem}.nav-brand{display:flex;align-items:center;gap:.75rem;font-weight:800;font-size:1.5rem;color:var(--nav-brand-color, var(--text-primary));flex-shrink:0;transition:transform .2s ease;cursor:pointer}.nav-brand:hover{transform:scale(1.05)}.nav-brand-icon{display:flex;align-items:center;font-size:1.8rem;transition:transform .3s ease}.nav-brand:hover .nav-brand-icon{transform:rotate(5deg) scale(1.1)}.nav-brand-text{background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;letter-spacing:-.02em;position:relative}.nav-menu{display:flex;align-items:center;gap:.5rem;flex:1;justify-content:flex-end;overflow:visible;padding-right:.5rem}wsx-link.nav-link{display:inline-flex;align-items:center;flex-shrink:0}wsx-link.nav-link::part(link){color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}wsx-link.nav-link::part(link):hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));text-decoration:none!important;transform:translateY(-1px)}wsx-link.nav-link::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):hover:after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):before{display:none}wsx-link.nav-link[active]::part(link),wsx-link.nav-link.nav-link-active::part(link){color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary));text-decoration:none!important}wsx-link.nav-link[active]::part(link):after,wsx-link.nav-link.nav-link-active::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link[active]::part(link):before,wsx-link.nav-link.nav-link-active::part(link):before{content:"";display:block;position:absolute;bottom:.125rem;left:50%;transform:translate(-50%);width:calc(100% - 1.5rem);height:3px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;z-index:1}.nav-link{color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;flex-shrink:0;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}.nav-link:hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));transform:translateY(-1px)}.nav-link:after{content:"";position:absolute;bottom:.25rem;left:50%;transform:translate(-50%);width:0;height:2px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;transition:width .3s cubic-bezier(.4,0,.2,1)}.nav-link:hover:after{width:calc(100% - 1.5rem)}.nav-link-active{color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary))}.nav-link-active:after{width:calc(100% - 1.5rem)!important;height:3px!important;bottom:.125rem!important}.nav-overflow{position:relative;flex-shrink:0}.nav-overflow-button{padding:.5rem .875rem;background:var(--nav-overflow-bg, transparent);border:1px solid var(--nav-overflow-border, var(--border-color));border-radius:.5rem;color:var(--nav-link-color, var(--text-secondary));cursor:pointer;font-size:.875rem;font-weight:500;transition:all .25s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;gap:.25rem}.nav-overflow-button:hover{background:var(--nav-overflow-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));border-color:var(--nav-overflow-hover-border, var(--border-color));transform:translateY(-1px);box-shadow:0 2px 8px var(--card-shadow)}.nav-overflow-menu{position:absolute;top:calc(100% + .75rem);right:0;min-width:180px;background:var(--nav-overflow-menu-bg, var(--bg-primary));border:1px solid var(--nav-overflow-menu-border, var(--border-color));border-radius:.75rem;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000001a;padding:.5rem;z-index:1001;-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);animation:slideDown .2s cubic-bezier(.4,0,.2,1)}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}wsx-link.nav-overflow-link::part(link){display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}wsx-link.nav-overflow-link::part(link):hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px)}wsx-link.nav-overflow-link[active]::part(link),wsx-link.nav-overflow-link.nav-link-active::part(link){background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-overflow-link{display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}.nav-overflow-link:hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px)}.nav-overflow-link.nav-link-active{background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0;margin-left:.5rem;z-index:1002;padding-left:.75rem;border-left:1px solid var(--nav-actions-border, var(--border-color))}.nav-action{display:flex;align-items:center;transition:transform .2s ease}.nav-action:hover{transform:scale(1.05)}.nav-toggle{display:none;flex-direction:column;gap:5px;background:var(--nav-toggle-bg, transparent);border:1px solid var(--nav-toggle-border, var(--border-color));border-radius:.5rem;cursor:pointer;padding:.625rem .5rem;z-index:1001;transition:all .25s ease}.nav-toggle:hover{background:var(--nav-toggle-hover-bg, var(--bg-secondary));border-color:var(--nav-toggle-hover-border, var(--border-color))}.nav-toggle-line{width:24px;height:3px;background:var(--nav-toggle-color, var(--text-primary));border-radius:3px;transition:all .3s cubic-bezier(.4,0,.2,1);transform-origin:center}.nav-toggle-line.open:nth-child(1){transform:rotate(45deg) translate(8px,8px)}.nav-toggle-line.open:nth-child(2){opacity:0}.nav-toggle-line.open:nth-child(3){transform:rotate(-45deg) translate(7px,-7px)}.nav-mobile-menu{position:fixed;top:72px;left:0;right:0;background:var(--nav-mobile-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);flex-direction:column;padding:1.5rem;gap:.5rem;transform:translateY(-100%);opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.4,0,.2,1);border-bottom:1px solid var(--nav-border, var(--border-color));max-height:calc(100vh - 72px);overflow-y:auto;z-index:999;box-shadow:0 4px 24px #0000001a}.nav-mobile-menu.open{transform:translateY(0);opacity:1;visibility:visible}wsx-link.nav-mobile-link::part(link){display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}wsx-link.nav-mobile-link::part(link):hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px);border-left-color:var(--primary-red)}wsx-link.nav-mobile-link[active]::part(link),wsx-link.nav-mobile-link.nav-link-active::part(link){background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}.nav-mobile-link{display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}.nav-mobile-link:hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px);border-left-color:var(--primary-red)}.nav-mobile-link.nav-link-active{background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}@media (max-width: 768px){.nav-container{padding:0 1.25rem;height:68px}.nav-brand{font-size:1.35rem}.nav-menu{display:none}.nav-actions{margin-left:0;gap:.5rem;padding-left:.5rem;border-left:none}.nav-toggle{display:flex;margin-left:.5rem}.nav-mobile-menu{display:flex;top:68px;max-height:calc(100vh - 68px)}}@media (min-width: 769px){.nav-mobile-menu{display:none!important}}@media (prefers-reduced-motion: no-preference){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle{transition-duration:.25s}}@media (prefers-reduced-motion: reduce){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle,.nav-mobile-menu{transition:none;animation:none}}';var at;let st,lt;function Z(t,e,r){return(e=ct(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ir(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:ke(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||ke(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return sr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:ct(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function ct(t){var e=ar(t,"string");return typeof e=="symbol"?e:e+""}function ar(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ke(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function sr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}lt=[_.autoRegister({tagName:"wsx-responsive-nav"})];exports.ResponsiveNav=void 0;class lr extends _.WebComponent{constructor(e){super({styles:we,styleName:"wsx-responsive-nav"}),Z(this,"_autoStyles",we),Z(this,"navigation",void 0),Z(this,"isMobileMenuOpen",void 0),Z(this,"visibleItemIndices",void 0),Z(this,"hiddenItemIndices",void 0),Z(this,"isMobile",void 0),Z(this,"isOverflowOpen",void 0),Z(this,"navMenuElement",void 0),Z(this,"navItemsElements",[]),Z(this,"resizeObserver",void 0),Z(this,"resizeHandler",void 0),Z(this,"toggleMobileMenu",()=>{this.isMobileMenuOpen=!this.isMobileMenuOpen,this.rerender()}),Z(this,"closeMobileMenu",()=>{this.isMobileMenuOpen=!1,this.rerender()}),Z(this,"toggleOverflow",()=>{this.isOverflowOpen=!this.isOverflowOpen,this.rerender(),this.isOverflowOpen?setTimeout(()=>{document.addEventListener("click",this.handleOverflowOutsideClick,!0)},0):document.removeEventListener("click",this.handleOverflowOutsideClick,!0)}),Z(this,"closeOverflow",()=>{this.isOverflowOpen=!1,this.rerender(),document.removeEventListener("click",this.handleOverflowOutsideClick,!0)}),Z(this,"handleOverflowOutsideClick",T=>{const R=T.target,P=this.querySelector(".nav-overflow"),a=P==null?void 0:P.querySelector(".nav-overflow-menu"),s=P==null?void 0:P.querySelector(".nav-overflow-button");a&&s&&!a.contains(R)&&!s.contains(R)&&this.closeOverflow()}),Z(this,"updateVisibleItems",()=>{var u;if(!this.navigation.autoOverflow||this.isMobile||!this.navMenuElement){if(!this.isMobile){const h=this.navigation.items.map((p,x)=>x);JSON.stringify(h.sort())!==JSON.stringify(this.visibleItemIndices.sort())&&(this.visibleItemIndices=h,this.hiddenItemIndices=[],this.rerender())}return}const T=[];for(let h=0;h<this.navigation.items.length;h++){let p=this.navItemsElements[h];if(!p){const x=Array.from(this.navMenuElement.querySelectorAll(".nav-link"));x[h]&&(p=x[h],this.navItemsElements[h]=p)}if(p)T.push(p);else{const x=document.createElement("wsx-link");x.textContent=this.navigation.items[h].label,x.style.visibility="hidden",x.style.position="absolute",document.body.appendChild(x),T.push(x),setTimeout(()=>{x.parentElement&&x.parentElement.removeChild(x)},0)}}const R=(u=this.navMenuElement.parentElement)==null?void 0:u.querySelector(".nav-actions"),P=R?Array.from(R.children).reduce((h,p)=>h+de.getElementTotalWidth(p),0)+8:0,c=de.detect({container:this.navMenuElement,items:T,gap:16,reservedWidth:P,overflowButtonWidth:90,padding:0,minVisibleItems:1}),o=c.visibleIndices,n=c.hiddenIndices;T.forEach(h=>{h.parentElement===document.body&&document.body.removeChild(h)}),(JSON.stringify(o.sort())!==JSON.stringify(this.visibleItemIndices.sort())||JSON.stringify(n.sort())!==JSON.stringify(this.hiddenItemIndices.sort()))&&(this.visibleItemIndices=o,this.hiddenItemIndices=n,this.rerender())}),Z(this,"checkMobile",()=>{var R;const T=window.innerWidth<=(((R=this.navigation)==null?void 0:R.mobileBreakpoint)||768);T!==this.isMobile&&(this.isMobile=T,this.rerender())}),e&&(this.navigation={mobileBreakpoint:768,autoOverflow:!0,...e},this.visibleItemIndices=e.items.map((T,R)=>R));let r=this.reactive({items:[]});Object.defineProperty(this,"navigation",{get:()=>r,set:T=>{r=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});const[i,k]=this.useState("isMobileMenuOpen",!1);Object.defineProperty(this,"isMobileMenuOpen",{get:i,set:k,enumerable:!0,configurable:!0});let C=this.reactive([]);Object.defineProperty(this,"visibleItemIndices",{get:()=>C,set:T=>{C=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});let b=this.reactive([]);Object.defineProperty(this,"hiddenItemIndices",{get:()=>b,set:T=>{b=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});const[A,y]=this.useState("isMobile",!1);Object.defineProperty(this,"isMobile",{get:A,set:y,enumerable:!0,configurable:!0});const[D,L]=this.useState("isOverflowOpen",!1);Object.defineProperty(this,"isOverflowOpen",{get:D,set:L,enumerable:!0,configurable:!0})}render(){var r,i;if(!((r=this.navigation)!=null&&r.items)||((i=this.navigation)==null?void 0:i.items.length)===0)return _.jsx("nav",{class:"responsive-nav"});const e=this.hiddenItemIndices.map(k=>this.navigation.items[k]);return _.jsx("nav",{class:"responsive-nav"},_.jsx("div",{class:"nav-container"},_.jsx("div",{class:"nav-brand"},_.jsx("slot",{name:"brand-icon"},this.navigation.brandIcon&&typeof this.navigation.brandIcon=="string"&&_.jsx("span",{class:"nav-brand-icon"},this.navigation.brandIcon)),this.navigation.brand&&_.jsx("span",{class:"nav-brand-text"},this.navigation.brand)),!this.isMobile&&_.jsx("div",{ref:k=>this.navMenuElement=k,class:"nav-menu"},this.navigation.items.map((k,C)=>{const b=this.visibleItemIndices.includes(C);return _.jsx("wsx-link",{key:C,ref:A=>{A&&(this.navItemsElements[C]=A)},to:k.to,class:`nav-link ${b?"":"hidden-item"}`,"active-class":"nav-link-active",exact:k.exact,style:b?"":"position: absolute; visibility: hidden; pointer-events: none;"},k.label)}),this.navigation.autoOverflow&&e.length>0&&!this.isMobile&&_.jsx("div",{class:"nav-overflow"},_.jsx("button",{class:"nav-overflow-button",onClick:this.toggleOverflow,"data-wsx-key":"ResponsiveNav-button-text-1-1"},"More ▼"),this.isOverflowOpen&&_.jsx("div",{class:"nav-overflow-menu"},e.map((k,C)=>{const b=this.hiddenItemIndices[C];return _.jsx("wsx-link",{key:b,to:k.to,class:"nav-overflow-link","active-class":"nav-link-active",exact:k.exact,onClick:this.closeOverflow},k.label)})))),this.navigation.actionTags&&_.jsx("div",{class:"nav-actions"},this.navigation.actionTags.map((k,C)=>{const b=k;return _.jsx("div",{key:C,class:"nav-action"},_.jsx(b,null))})),this.isMobile&&_.jsx("button",{class:"nav-toggle",onClick:this.toggleMobileMenu,"data-wsx-key":"ResponsiveNav-button-text-1"},_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}),_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}),_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}))),this.isMobile&&_.jsx("div",{class:`nav-mobile-menu ${this.isMobileMenuOpen?"open":""}`},this.navigation.items.filter(k=>!k.hideOnMobile).map((k,C)=>_.jsx("wsx-link",{key:C,to:k.to,class:"nav-mobile-link","active-class":"nav-link-active",exact:k.exact,onClick:this.closeMobileMenu},k.label))))}onConnected(){var r,i;if(!((r=this.navigation)!=null&&r.items)||((i=this.navigation)==null?void 0:i.items.length)===0)try{this.visibleItemIndices=this.navigation.items.map((k,C)=>C),this.rerender()}catch(k){console.error("Failed to parse ResponsiveNav config:",k)}this.checkMobile();const e=(k=0)=>{k>10||setTimeout(()=>{this.navMenuElement&&(this.navigation.items.every((b,A)=>this.navItemsElements[A])||k>5?this.updateVisibleItems():e(k+1))},50)};e(),this.resizeHandler=()=>{this.checkMobile(),setTimeout(()=>{this.updateVisibleItems()},100)},window.addEventListener("resize",this.resizeHandler),setTimeout(()=>{this.navMenuElement&&window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{setTimeout(()=>{this.updateVisibleItems()},0)}),this.resizeObserver.observe(this.navMenuElement))},0)}onDisconnected(){this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.resizeObserver&&this.resizeObserver.disconnect()}}at=lr;[exports.ResponsiveNav,st]=ir(at,[],lt,0,void 0,_.WebComponent).c;st();var ut;let dt,pt;function te(t,e,r){return(e=ht(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:Ee(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||Ee(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return dr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:ht(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function ht(t){var e=ur(t,"string");return typeof e=="symbol"?e:e+""}function ur(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ee(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function dr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const Se=ze("SvgIcon");pt=[_.autoRegister({tagName:"svg-icon"})];exports.SvgIcon=void 0;class pr extends _.WebComponent{constructor(){super(),te(this,"size",void 0),te(this,"color",void 0),te(this,"name",void 0),te(this,"handleClick",A=>{Se.debug("SVG icon clicked",{name:this.name}),this.dispatchEvent(new CustomEvent("icon-click",{detail:{name:this.name,originalEvent:A},bubbles:!0}))}),te(this,"handleMouseEnter",A=>{const y=A.target;y.style.transform="scale(1.1)"}),te(this,"handleMouseLeave",A=>{const y=A.target;y.style.transform="scale(1)"});const[e,r]=this.useState("size",24);Object.defineProperty(this,"size",{get:e,set:r,enumerable:!0,configurable:!0});const[i,k]=this.useState("color","currentColor");Object.defineProperty(this,"color",{get:i,set:k,enumerable:!0,configurable:!0});const[C,b]=this.useState("name","star");Object.defineProperty(this,"name",{get:C,set:b,enumerable:!0,configurable:!0})}render(){const e=this.size||"24",r=this.color||"currentColor",i=this.name||"star",k={star:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",heart:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",check:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",close:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",github:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",play:"M8 5v14l11-7z",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},C=k[i]||k.star;return _.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"svg-icon",onClick:this.handleClick,style:"cursor: pointer; transition: transform 0.2s ease; display: inline-block;",onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},_.jsx("path",{d:C,fill:r}))}static get observedAttributes(){return["name","size","color"]}onAttributeChanged(e,r,i){Se.debug(`Attribute ${e} changed from ${r} to ${i}`),this.connected&&this.rerender()}}ut=pr;[exports.SvgIcon,dt]=cr(ut,[],pt,0,void 0,_.WebComponent).c;dt();var gt={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
6
|
+
`;const i=He(k=>{var A;const C=k.target,b=ne(C.value);this.setSelectedColor(b),this.setCustomColor(b),document.body.removeChild(r),(A=this.onColorPicked)==null||A.call(this,b),this.dispatchEvent(new CustomEvent("colorchange",{detail:{color:b},bubbles:!0,composed:!0})),re.debug("Custom color selected",{color:b})},30);r.addEventListener("input",i),document.body.appendChild(r),requestAnimationFrame(()=>{r.focus(),r.click()})}),X(this,"handleDocumentClick",r=>{this.isOpen&&!this.contains(r.target)&&this.closePanel()}),this.colorCollections=e.colorCollections||Gt,this.onColorPicked=e.onColorPicked,this.hasCustomPicker=e.hasCustomPicker||!1,this.pluginType=e.pluginType||"text",this.disabled=e.disabled||!1,this.defaultColor=ne(e.defaultColor||this.colorCollections[0]),this.selectedColor=this.defaultColor,this.customColor=Ue(this.pluginType)||"",this.isOpen=!1,re.debug("ColorPicker initialized",{colorCollections:this.colorCollections.length,hasCustomPicker:this.hasCustomPicker,pluginType:this.pluginType})}render(){const e=this.renderColorButton(),r=this.isOpen?this.renderColorPanel():null;return _.jsx("section",{class:"color-section"},_.jsx("div",{class:"color-popover"},e,r))}renderColorButton(){return _.jsx("wsx-button",{type:"button",class:`color-btn ${this.disabled?"disabled":""}`,style:`--theme-color: ${this.selectedColor}`,disabled:this.disabled,onClick:this.handleButtonClick,ref:e=>{this.colorBtn=e}},_.jsx("span",{class:"color-indicator"},"_"))}renderColorPanel(){return _.jsx("div",{class:"color-panel",onClick:this.handlePanelClick,ref:e=>{this.colorPanel=e}},_.jsx("div",{class:"color-grid"},this.hasCustomPicker?this.renderCustomPicker():null,this.renderColorButtons()))}renderCustomPicker(){return _.jsx("wsx-button",{type:"button",class:"color-cube custom-picker",style:{backgroundColor:this.customColor},onClick:this.handleCustomPickerClick,title:"自定义颜色"})}renderColorButtons(){return this.colorCollections.map(e=>_.jsx("wsx-button",{key:e,type:"button",class:"color-cube",style:`background-color: ${e}`,"data-color":e,title:e,onClick:()=>this.handleColorSelect(e)}))}togglePanel(){this.setOpen(!this.isOpen)}closePanel(){this.setOpen(!1)}setSelectedColor(e){this.selectedColor=e,this.setAttr("selected-color",e),this.updateColorButton()}setCustomColor(e){this.customColor=e,Be(e,this.pluginType)}setOpen(e){this.isOpen=e,e?this.setAttr("open",""):this.removeAttr("open"),this.rerender()}updateColorButton(){this.colorBtn&&this.colorBtn.style.setProperty("--theme-color",this.selectedColor)}onConnected(){document.addEventListener("click",this.handleDocumentClick),re.info("ColorPicker connected to DOM")}onDisconnected(){document.removeEventListener("click",this.handleDocumentClick),re.info("ColorPicker disconnected from DOM")}onAttributeChanged(e,r,i){switch(e){case"disabled":this.disabled=i!==null,this.rerender();break;case"selected-color":i&&i!==this.selectedColor&&(this.selectedColor=i,this.updateColorButton());break;case"open":this.isOpen=i!==null;break}}getSelectedColor(){return this.selectedColor}setColor(e){this.setSelectedColor(ne(e))}focus(){var e;(e=this.colorBtn)==null||e.focus()}}Ge=Wt;[exports.ColorPicker,We]=Bt(Ge,[],Ve,0,void 0,_.WebComponent).c;We();const Vt=":host{display:block}.theme-switcher-container{position:relative;display:flex;align-items:center}.theme-switcher-btn{width:var(--theme-switcher-width, 2.5rem);height:var(--theme-switcher-height, 2.5rem);padding:var(--theme-switcher-padding, .5rem);border-radius:var(--theme-switcher-border-radius, 8px);background:var(--theme-switcher-bg, #dc2626);border:var(--theme-switcher-border, none);color:var(--theme-switcher-color, white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--theme-switcher-transition, .3s ease);box-shadow:var(--theme-switcher-shadow, 0 4px 15px rgba(220, 38, 38, .4));font-weight:var(--theme-switcher-font-weight, 600);font-family:var(--theme-switcher-font-family, inherit)}.theme-switcher-btn:hover{background:var(--theme-switcher-hover-bg, #b91c1c);transform:var(--theme-switcher-hover-transform, translateY(-2px));box-shadow:var(--theme-switcher-hover-shadow, 0 8px 25px rgba(220, 38, 38, .5))}.theme-switcher-btn:active{transform:var(--theme-switcher-active-transform, translateY(0))}.theme-switcher-icon{font-size:var(--theme-switcher-icon-size, 1rem);line-height:1;transition:transform var(--theme-switcher-icon-transition, .3s ease)}.theme-switcher-btn:hover .theme-switcher-icon{transform:var(--theme-switcher-icon-hover-transform, rotate(360deg))}.theme-switcher-btn[data-theme=light]{background:var(--theme-switcher-light-bg, #dc2626);color:var(--theme-switcher-light-color, white)}.theme-switcher-btn[data-theme=light]:hover{background:var(--theme-switcher-light-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=dark]{background:var(--theme-switcher-dark-bg, #dc2626);color:var(--theme-switcher-dark-color, white)}.theme-switcher-btn[data-theme=dark]:hover{background:var(--theme-switcher-dark-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=auto]{background:var(--theme-switcher-auto-bg, linear-gradient(135deg, #dc2626, #b91c1c));color:var(--theme-switcher-auto-color, white)}.theme-switcher-btn[data-theme=auto]:hover{background:var(--theme-switcher-auto-hover-bg, linear-gradient(135deg, #b91c1c, #991b1b))}@media (max-width: 768px){.theme-switcher-btn{width:var(--theme-switcher-mobile-width, 2rem);height:var(--theme-switcher-mobile-height, 2rem)}.theme-switcher-icon{font-size:var(--theme-switcher-mobile-icon-size, .9rem)}}";var Ke;let Ze,Xe;function le(t,e,r){return(e=qe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yt(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:be(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||be(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return Zt(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:qe(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function qe(t){var e=Kt(t,"string");return typeof e=="symbol"?e:e+""}function Kt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function be(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Zt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Xe=[_.autoRegister({tagName:"theme-switcher"})];exports.ThemeSwitcher=void 0;class Xt extends _.WebComponent{constructor(){super({styleName:"theme-switcher"}),le(this,"_autoStyles",Vt),le(this,"currentTheme","auto"),le(this,"toggleTheme",()=>{const e=["auto","light","dark"],i=(e.indexOf(this.currentTheme)+1)%e.length;this.setTheme(e[i])}),this.initTheme()}render(){return _.jsx("div",{class:"theme-switcher-container"},_.jsx("button",{class:"theme-switcher-btn","data-theme":this.currentTheme,onClick:this.toggleTheme,title:`当前主题: ${this.getThemeLabel()}`,"data-wsx-key":"ThemeSwitcher-button-text-1"},_.jsx("span",{class:"theme-switcher-icon"},this.getThemeIcon())))}getThemeIcon(){const r=document.documentElement.classList.contains("dark");return this.currentTheme==="auto"?r?"🌙":"☀️":this.currentTheme==="light"?"☀️":"🌙"}getThemeLabel(){return{light:"浅色",dark:"深色",auto:"自动"}[this.currentTheme]}setTheme(e){this.currentTheme=e;const r=document.documentElement;e==="auto"?(r.removeAttribute("class"),this.checkSystemTheme()):r.className=e,localStorage.setItem("wsx-theme",e),this.rerender()}checkSystemTheme(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.className=e?"dark":""}initTheme(){const e=localStorage.getItem("wsx-theme")||"auto";this.setTheme(e),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r=>{this.currentTheme==="auto"&&(document.documentElement.className=r.matches?"dark":"")})}}Ke=Xt;[exports.ThemeSwitcher,Ze]=Yt(Ke,[],Xe,0,void 0,_.WebComponent).c;Ze();const me=":host{display:inline-block;position:relative}.dropdown-container{position:relative;display:inline-block}.dropdown-button{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.5rem .75rem;min-width:120px;background:var(--dropdown-bg, rgba(255, 255, 255, .1));border:1px solid var(--dropdown-border, rgba(255, 255, 255, .2));border-radius:var(--dropdown-border-radius, .5rem);color:var(--dropdown-color, currentColor);cursor:pointer;font-size:.875rem;font-weight:500;transition:all .2s ease;text-align:left}.dropdown-button:hover:not(.disabled){background:var(--dropdown-hover-bg, rgba(255, 255, 255, .15));border-color:var(--dropdown-hover-border, rgba(255, 255, 255, .3))}.dropdown-button:focus:not(.disabled){outline:2px solid var(--dropdown-focus-color, var(--focus-color, #dc2626));outline-offset:2px}.dropdown-button.open{background:var(--dropdown-open-bg, rgba(255, 255, 255, .2))}.dropdown-button.disabled{opacity:.5;cursor:not-allowed}.dropdown-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-arrow{font-size:.625rem;opacity:.7;transition:transform .2s ease;flex-shrink:0}.dropdown-button.open .dropdown-arrow{transform:rotate(180deg)}.dropdown-menu{position:absolute;z-index:1000;min-width:160px;max-width:300px;max-height:300px;overflow-y:auto;background:var(--dropdown-menu-bg, #ffffff);border:1px solid var(--dropdown-menu-border, #e5e7eb);border-radius:var(--dropdown-border-radius, .5rem);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;padding:.25rem;margin:.25rem 0 0}[data-theme=dark] .dropdown-menu{background:var(--dropdown-menu-bg-dark, #1f2937);border-color:var(--dropdown-menu-border-dark, #374151)}.dropdown-menu.dropdown-top{bottom:100%;margin:0 0 .25rem}.dropdown-menu.dropdown-bottom{top:100%;margin:.25rem 0 0}.dropdown-menu.dropdown-left{left:0}.dropdown-menu.dropdown-right{right:0}.dropdown-menu.dropdown-center{left:50%;transform:translate(-50%)}.dropdown-menu.dropdown-top.dropdown-center{transform:translate(-50%) translateY(-100%)}.dropdown-option{display:flex;align-items:center;width:100%;padding:.5rem .75rem;background:transparent;border:none;border-radius:.375rem;color:var(--dropdown-option-color, #1f2937);cursor:pointer;font-size:.875rem;text-align:left;transition:background-color .15s ease}[data-theme=dark] .dropdown-option{color:var(--dropdown-option-color-dark, #f3f4f6)}.dropdown-option:hover:not(.disabled){background:var(--dropdown-option-hover-bg, #f3f4f6)}[data-theme=dark] .dropdown-option:hover:not(.disabled){background:var(--dropdown-option-hover-bg-dark, #374151)}.dropdown-option.selected{background:var(--dropdown-option-selected-bg, #dc2626);color:var(--dropdown-option-selected-color, #ffffff);font-weight:600}.dropdown-option.selected:hover{background:var(--dropdown-option-selected-hover-bg, #b91c1c)}.dropdown-option.disabled{opacity:.5;cursor:not-allowed}.dropdown-empty{padding:.5rem .75rem;color:var(--dropdown-empty-color, #9ca3af);font-size:.875rem;text-align:center}@media (max-width: 768px){.dropdown-button{min-width:100px;padding:.375rem .5rem;font-size:.8125rem}.dropdown-menu{min-width:140px;max-width:200px}}";var Qe;let Je,et;function J(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:ve(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||ve(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return Jt(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:tt(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function tt(t){var e=Qt(t,"string");return typeof e=="symbol"?e:e+""}function Qt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ve(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Jt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}et=[_.autoRegister({tagName:"wsx-dropdown"})];exports.Dropdown=void 0;class er extends _.WebComponent{constructor(e={}){super({styles:me,styleName:"wsx-dropdown"}),J(this,"_autoStyles",me),J(this,"options",[]),J(this,"selectedValue",void 0),J(this,"isOpen",void 0),J(this,"config",{}),J(this,"buttonElement",void 0),J(this,"dropdownElement",void 0),J(this,"outsideClickHandler",void 0),J(this,"toggleDropdown",()=>{this.config.disabled||(this.isOpen=!this.isOpen,this.rerender(),this.isOpen?setTimeout(()=>{this.attachOutsideClickHandler()},0):this.detachOutsideClickHandler())}),J(this,"openDropdown",()=>{this.config.disabled||this.isOpen||(this.isOpen=!0,this.rerender())}),J(this,"closeDropdown",()=>{this.isOpen&&(this.isOpen=!1,this.rerender(),this.detachOutsideClickHandler())}),J(this,"selectOption",b=>{this.setValue(b),this.config.trigger==="click"&&this.closeDropdown()}),J(this,"attachOutsideClickHandler",()=>{this.config.trigger!=="hover"&&(this.outsideClickHandler=b=>{const A=b.target;this.dropdownElement&&this.buttonElement&&!this.dropdownElement.contains(A)&&!this.buttonElement.contains(A)&&this.closeDropdown()},document.addEventListener("click",this.outsideClickHandler,!0))}),J(this,"detachOutsideClickHandler",()=>{this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,!0),this.outsideClickHandler=void 0)}),this.config={placeholder:"Select...",align:"left",position:"bottom",trigger:"click",...e};const[r,i]=this.useState("selectedValue","");Object.defineProperty(this,"selectedValue",{get:r,set:i,enumerable:!0,configurable:!0});const[k,C]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:k,set:C,enumerable:!0,configurable:!0})}setOptions(e){this.options=e,this.rerender()}setValue(e){this.selectedValue=e,this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0}))}getValue(){return this.selectedValue||void 0}render(){const e=this.options.find(i=>i.value===this.selectedValue&&this.selectedValue!==""),r=(e==null?void 0:e.label)||this.config.placeholder||"Select...";return _.jsx("div",{class:"dropdown-container"},_.jsx("button",{ref:i=>this.buttonElement=i,class:`dropdown-button ${this.isOpen?"open":""} ${this.config.disabled?"disabled":""}`,onClick:this.config.trigger==="click"?this.toggleDropdown:void 0,onMouseEnter:this.config.trigger==="hover"?this.openDropdown:void 0,onMouseLeave:this.config.trigger==="hover"?this.closeDropdown:void 0,disabled:this.config.disabled,"aria-expanded":this.isOpen,"aria-haspopup":"listbox","data-wsx-key":"Dropdown-button-text-1"},_.jsx("span",{class:"dropdown-text"},r),_.jsx("span",{class:"dropdown-arrow"},this.isOpen?"▲":"▼")),this.isOpen&&_.jsx("div",{ref:i=>this.dropdownElement=i,class:`dropdown-menu dropdown-${this.config.position} dropdown-${this.config.align}`,role:"listbox",onMouseEnter:this.config.trigger==="hover"?this.openDropdown:void 0,onMouseLeave:this.config.trigger==="hover"?this.closeDropdown:void 0},this.options.length===0?_.jsx("div",{class:"dropdown-empty"},"No options"):this.options.map(i=>_.jsx("button",{key:i.value,class:`dropdown-option ${i.value===this.selectedValue&&this.selectedValue!==""?"selected":""} ${i.disabled?"disabled":""}`,onClick:()=>!i.disabled&&this.selectOption(i.value),role:"option","aria-selected":i.value===this.selectedValue&&this.selectedValue!=="",disabled:i.disabled,"data-wsx-key":"Dropdown-button-text-0"},i.render?i.render():_.jsx("span",null,i.label)))))}onDisconnected(){this.detachOutsideClickHandler()}}Qe=er;[exports.Dropdown,Je]=qt(Qe,[],et,0,void 0,_.WebComponent).c;Je();const ye=":host{display:inline-block;position:relative}.combobox-container{position:relative;display:inline-block;width:100%}.combobox-input-wrapper{position:relative;display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;min-width:200px;background:var(--combobox-bg, rgba(255, 255, 255, .1));border:1px solid var(--combobox-border, rgba(255, 255, 255, .2));border-radius:var(--combobox-border-radius, .5rem);transition:all .2s ease}.combobox-input-wrapper:focus-within{background:var(--combobox-focus-bg, rgba(255, 255, 255, .15));border-color:var(--combobox-focus-border, var(--focus-color, #dc2626));outline:2px solid var(--combobox-focus-outline, rgba(220, 38, 38, .2));outline-offset:2px}.combobox-tags{display:flex;align-items:center;gap:.25rem;flex-wrap:wrap;flex:1}.combobox-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;background:var(--combobox-tag-bg, #dc2626);color:var(--combobox-tag-color, #ffffff);border-radius:.25rem;font-size:.75rem;font-weight:500}.combobox-tag-remove{background:none;border:none;color:var(--combobox-tag-color, #ffffff);cursor:pointer;font-size:1rem;line-height:1;padding:0;width:16px;height:16px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color .15s ease}.combobox-tag-remove:hover{background:#fff3}.combobox-tag-more{padding:.25rem .5rem;color:var(--combobox-tag-color, #ffffff);font-size:.75rem;font-weight:500}.combobox-input{flex:1;border:none;background:transparent;color:var(--combobox-color, currentColor);font-size:.875rem;font-weight:500;outline:none;min-width:0}.combobox-input::placeholder{color:var(--combobox-placeholder-color, rgba(255, 255, 255, .5))}.combobox-input:disabled{opacity:.5;cursor:not-allowed}.combobox-arrow{background:none;border:none;color:var(--combobox-arrow-color, currentColor);cursor:pointer;font-size:.625rem;opacity:.7;transition:transform .2s ease;flex-shrink:0;padding:.25rem;display:flex;align-items:center;justify-content:center}.combobox-arrow:hover{opacity:1}.combobox-arrow.open{transform:rotate(180deg)}.combobox-arrow:disabled{opacity:.5;cursor:not-allowed}.combobox-menu{position:absolute;z-index:1000;min-width:100%;max-width:300px;max-height:300px;overflow-y:auto;background:var(--combobox-menu-bg, #ffffff);border:1px solid var(--combobox-menu-border, #e5e7eb);border-radius:var(--combobox-border-radius, .5rem);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;padding:.25rem;margin:.25rem 0 0}[data-theme=dark] .combobox-menu{background:var(--combobox-menu-bg-dark, #1f2937);border-color:var(--combobox-menu-border-dark, #374151)}.combobox-menu.combobox-top{bottom:100%;margin:0 0 .25rem}.combobox-menu.combobox-bottom{top:100%;margin:.25rem 0 0}.combobox-menu.combobox-left{left:0}.combobox-menu.combobox-right{right:0}.combobox-menu.combobox-center{left:50%;transform:translate(-50%)}.combobox-menu.combobox-top.combobox-center{transform:translate(-50%) translateY(-100%)}.combobox-option{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .75rem;background:transparent;border:none;border-radius:.375rem;color:var(--combobox-option-color, #1f2937);cursor:pointer;font-size:.875rem;text-align:left;transition:background-color .15s ease}[data-theme=dark] .combobox-option{color:var(--combobox-option-color-dark, #f3f4f6)}.combobox-option:hover:not(.disabled){background:var(--combobox-option-hover-bg, #f3f4f6)}[data-theme=dark] .combobox-option:hover:not(.disabled){background:var(--combobox-option-hover-bg-dark, #374151)}.combobox-option.selected{background:var(--combobox-option-selected-bg, #dc2626);color:var(--combobox-option-selected-color, #ffffff);font-weight:600}.combobox-option.selected:hover{background:var(--combobox-option-selected-hover-bg, #b91c1c)}.combobox-option.disabled{opacity:.5;cursor:not-allowed}.combobox-checkbox{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.75rem;font-weight:700}.combobox-empty{padding:.5rem .75rem;color:var(--combobox-empty-color, #9ca3af);font-size:.875rem;text-align:center}@media (max-width: 768px){.combobox-input-wrapper{min-width:150px;padding:.375rem .5rem}.combobox-input{font-size:.8125rem}.combobox-menu{max-width:200px}}";var rt;let nt,ot;function q(t,e,r){return(e=it(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tr(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:xe(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||xe(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return nr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:it(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function it(t){var e=rr(t,"string");return typeof e=="symbol"?e:e+""}function rr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function xe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function nr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}ot=[_.autoRegister({tagName:"wsx-combobox"})];exports.Combobox=void 0;class or extends _.WebComponent{constructor(e={}){super({styles:ye,styleName:"wsx-combobox"}),q(this,"_autoStyles",ye),q(this,"options",[]),q(this,"selectedValue",void 0),q(this,"searchQuery",void 0),q(this,"isOpen",void 0),q(this,"config",{}),q(this,"inputElement",void 0),q(this,"dropdownElement",void 0),q(this,"outsideClickHandler",void 0),q(this,"handleInput",y=>{if(!this.config.searchable)return;const D=y.target;this.searchQuery=D.value,this.rerender()}),q(this,"toggleDropdown",()=>{this.config.disabled||(this.isOpen=!this.isOpen,this.isOpen&&this.config.searchable&&this.inputElement&&this.inputElement.focus(),this.rerender(),this.isOpen?setTimeout(()=>{this.attachOutsideClickHandler()},0):(this.detachOutsideClickHandler(),this.searchQuery=""))}),q(this,"openDropdown",()=>{this.config.disabled||this.isOpen||(this.isOpen=!0,this.config.searchable&&this.inputElement&&this.inputElement.focus(),this.rerender(),setTimeout(()=>{this.attachOutsideClickHandler()},0))}),q(this,"closeDropdown",()=>{this.isOpen&&(this.isOpen=!1,this.searchQuery="",this.rerender(),this.detachOutsideClickHandler())}),q(this,"selectOption",y=>{if(this.config.multiple){const D=Array.isArray(this.selectedValue)?this.selectedValue:[],L=D.includes(y)?D.filter(T=>T!==y):[...D,y];this.selectedValue=L}else this.selectedValue=y,this.closeDropdown();this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selectedValue},bubbles:!0}))}),q(this,"removeValue",y=>{if(!this.config.multiple)return;const D=Array.isArray(this.selectedValue)?this.selectedValue:[];this.selectedValue=D.filter(L=>L!==y),this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selectedValue},bubbles:!0}))}),q(this,"attachOutsideClickHandler",()=>{this.outsideClickHandler=y=>{const D=y.target;this.dropdownElement&&this.inputElement&&!this.dropdownElement.contains(D)&&!this.inputElement.contains(D)&&this.closeDropdown()},document.addEventListener("click",this.outsideClickHandler,!0)}),q(this,"detachOutsideClickHandler",()=>{this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,!0),this.outsideClickHandler=void 0)}),this.config={placeholder:"Select or search...",searchable:!0,multiple:!1,align:"left",position:"bottom",...e};const[r,i]=this.useState("selectedValue","");Object.defineProperty(this,"selectedValue",{get:r,set:i,enumerable:!0,configurable:!0});const[k,C]=this.useState("searchQuery","");Object.defineProperty(this,"searchQuery",{get:k,set:C,enumerable:!0,configurable:!0});const[b,A]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:b,set:A,enumerable:!0,configurable:!0})}setOptions(e){this.options=e,this.rerender()}setValue(e){if(this.selectedValue=e,this.inputElement&&!this.config.multiple){const r=this.options.find(i=>i.value===(Array.isArray(e)?e[0]:e));this.inputElement.value=(r==null?void 0:r.label)||""}this.rerender(),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0}))}getValue(){return this.selectedValue}getFilteredOptions(){if(!this.config.searchable||!this.searchQuery.trim())return this.options;const e=this.searchQuery.toLowerCase();return this.options.filter(r=>r.label.toLowerCase().includes(e)||r.value.toLowerCase().includes(e))}render(){const e=this.getFilteredOptions(),r=this.config.multiple,i=Array.isArray(this.selectedValue)?this.selectedValue:this.selectedValue?[this.selectedValue]:[];let k="";if(r)if(i.length===0)k=this.config.placeholder||"Select...";else if(i.length===1){const C=this.options.find(b=>b.value===i[0]);k=(C==null?void 0:C.label)||i[0]}else k=`${i.length} selected`;else{const C=this.options.find(b=>b.value===this.selectedValue);k=(C==null?void 0:C.label)||this.config.placeholder||"Select..."}return _.jsx("div",{class:"combobox-container"},_.jsx("div",{class:"combobox-input-wrapper"},r&&i.length>0&&_.jsx("div",{class:"combobox-tags"},i.slice(0,2).map(C=>{const b=this.options.find(A=>A.value===C);return _.jsx("span",{key:C,class:"combobox-tag"},(b==null?void 0:b.label)||C,_.jsx("button",{class:"combobox-tag-remove",onClick:A=>{A.stopPropagation(),this.removeValue(C)},"data-wsx-key":"Combobox-button-text-3"},"×"))}),i.length>2&&_.jsx("span",{class:"combobox-tag-more"},"+",i.length-2)),_.jsx("input",{ref:C=>this.inputElement=C,type:"text",class:"combobox-input",placeholder:k,value:this.config.searchable&&this.isOpen?this.searchQuery:"",onInput:this.handleInput,onFocus:this.openDropdown,onClick:this.openDropdown,disabled:this.config.disabled,readonly:!this.config.searchable,"data-wsx-key":"Combobox-input-text-1-3"}),_.jsx("button",{class:`combobox-arrow ${this.isOpen?"open":""}`,onClick:this.toggleDropdown,disabled:this.config.disabled,"data-wsx-key":"Combobox-button-text-1-5"},this.isOpen?"▲":"▼")),this.isOpen&&_.jsx("div",{ref:C=>this.dropdownElement=C,class:`combobox-menu combobox-${this.config.position} combobox-${this.config.align}`,role:"listbox"},e.length===0?_.jsx("div",{class:"combobox-empty"},this.config.searchable&&this.searchQuery?"No results found":"No options"):e.map(C=>{const b=r?i.includes(C.value):C.value===this.selectedValue;return _.jsx("button",{key:C.value,class:`combobox-option ${b?"selected":""} ${C.disabled?"disabled":""}`,onClick:()=>!C.disabled&&this.selectOption(C.value),role:"option","aria-selected":b,disabled:C.disabled,"data-wsx-key":"Combobox-button-text-0"},r&&_.jsx("span",{class:"combobox-checkbox"},b?"✓":""),C.render?C.render():_.jsx("span",null,C.label))})))}onDisconnected(){this.detachOutsideClickHandler()}}rt=or;[exports.Combobox,nt]=tr(rt,[],ot,0,void 0,_.WebComponent).c;nt();class de{static detect(e){const{container:r,items:i,gap:k=16,reservedWidth:C=0,overflowButtonWidth:b=0,padding:A=0,minVisibleItems:y=1}=e;if(!r||i.length===0)return{visibleIndices:[],hiddenIndices:[],needsOverflow:!1};const L=r.offsetWidth-C-A*2;let T=0;const R=[],P=[];for(let o=0;o<i.length;o++){const n=i[o];if(!n||n.offsetWidth===0){R.push(o);continue}const u=n.offsetWidth+(o>0?k:0);T+u<=L?(T+=u,R.push(o)):P.push(o)}if(P.length===0)return{visibleIndices:R,hiddenIndices:[],needsOverflow:!1};const a=L-b-k;T=0;const s=[],c=[];for(let o=0;o<i.length;o++){const n=i[o];if(!n||n.offsetWidth===0){s.length<y?s.push(o):c.push(o);continue}const u=n.offsetWidth+(s.length>0?k:0);T+u<=a?(T+=u,s.push(o)):c.push(o)}if(s.length<y&&i.length>0){const o=y-s.length,n=c.splice(0,o);s.push(...n),s.sort((u,h)=>u-h)}return{visibleIndices:s,hiddenIndices:c,needsOverflow:c.length>0}}static calculateTotalWidth(e,r=16){return e.length===0?0:e.reduce((i,k,C)=>{const b=k.offsetWidth||0;return i+b+(C>0?r:0)},0)}static getElementTotalWidth(e){if(!e)return 0;const r=window.getComputedStyle(e),i=e.offsetWidth,k=parseFloat(r.marginLeft)||0,C=parseFloat(r.marginRight)||0;return i+k+C}}const we=':host{display:block}.responsive-nav{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--nav-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);border-bottom:1px solid var(--nav-border, var(--border-color));transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 3px #0000000d}.responsive-nav.nav-scrolled{background:var(--nav-bg-scrolled, var(--bg-primary));box-shadow:0 4px 24px var(--nav-shadow, var(--card-shadow));border-bottom-color:var(--nav-border, var(--border-color))}.nav-container{max-width:1280px;margin:0 auto;padding:0 2rem;display:flex;align-items:center;justify-content:space-between;height:72px;gap:1.5rem}.nav-brand{display:flex;align-items:center;gap:.75rem;font-weight:800;font-size:1.5rem;color:var(--nav-brand-color, var(--text-primary));flex-shrink:0;transition:transform .2s ease;cursor:pointer}.nav-brand:hover{transform:scale(1.05)}.nav-brand-icon{display:flex;align-items:center;font-size:1.8rem;transition:transform .3s ease}.nav-brand:hover .nav-brand-icon{transform:rotate(5deg) scale(1.1)}.nav-brand-text{background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;letter-spacing:-.02em;position:relative}.nav-menu{display:flex;align-items:center;gap:.5rem;flex:1;justify-content:flex-end;overflow:visible;padding-right:.5rem}wsx-link.nav-link{display:inline-flex;align-items:center;flex-shrink:0}wsx-link.nav-link::part(link){color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}wsx-link.nav-link::part(link):hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));text-decoration:none!important;transform:translateY(-1px)}wsx-link.nav-link::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):hover:after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link::part(link):before{display:none}wsx-link.nav-link[active]::part(link),wsx-link.nav-link.nav-link-active::part(link){color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary));text-decoration:none!important}wsx-link.nav-link[active]::part(link):after,wsx-link.nav-link.nav-link-active::part(link):after{content:none!important;display:none!important;width:0!important;height:0!important;background:none!important}wsx-link.nav-link[active]::part(link):before,wsx-link.nav-link.nav-link-active::part(link):before{content:"";display:block;position:absolute;bottom:.125rem;left:50%;transform:translate(-50%);width:calc(100% - 1.5rem);height:3px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;z-index:1}.nav-link{color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.95rem;transition:all .25s cubic-bezier(.4,0,.2,1);position:relative;white-space:nowrap;flex-shrink:0;padding:.5rem .75rem;border-radius:.5rem;display:inline-flex;align-items:center}.nav-link:hover{color:var(--nav-link-hover-color, var(--text-primary));background:var(--nav-link-hover-bg, var(--bg-secondary));transform:translateY(-1px)}.nav-link:after{content:"";position:absolute;bottom:.25rem;left:50%;transform:translate(-50%);width:0;height:2px;background:linear-gradient(135deg,var(--hero-gradient-start, var(--primary-red)),var(--hero-gradient-end, var(--accent-orange)));border-radius:2px;transition:width .3s cubic-bezier(.4,0,.2,1)}.nav-link:hover:after{width:calc(100% - 1.5rem)}.nav-link-active{color:var(--nav-link-active-color, var(--primary-red))!important;font-weight:600;background:var(--nav-link-active-bg, var(--bg-secondary))}.nav-link-active:after{width:calc(100% - 1.5rem)!important;height:3px!important;bottom:.125rem!important}.nav-overflow{position:relative;flex-shrink:0}.nav-overflow-button{padding:.5rem .875rem;background:var(--nav-overflow-bg, transparent);border:1px solid var(--nav-overflow-border, var(--border-color));border-radius:.5rem;color:var(--nav-link-color, var(--text-secondary));cursor:pointer;font-size:.875rem;font-weight:500;transition:all .25s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;gap:.25rem}.nav-overflow-button:hover{background:var(--nav-overflow-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));border-color:var(--nav-overflow-hover-border, var(--border-color));transform:translateY(-1px);box-shadow:0 2px 8px var(--card-shadow)}.nav-overflow-menu{position:absolute;top:calc(100% + .75rem);right:0;min-width:180px;background:var(--nav-overflow-menu-bg, var(--bg-primary));border:1px solid var(--nav-overflow-menu-border, var(--border-color));border-radius:.75rem;box-shadow:0 10px 25px -5px #0000001a,0 8px 10px -6px #0000001a;padding:.5rem;z-index:1001;-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);animation:slideDown .2s cubic-bezier(.4,0,.2,1)}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}wsx-link.nav-overflow-link::part(link){display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}wsx-link.nav-overflow-link::part(link):hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px)}wsx-link.nav-overflow-link[active]::part(link),wsx-link.nav-overflow-link.nav-link-active::part(link){background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-overflow-link{display:block;padding:.625rem .875rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:.9rem;border-radius:.5rem;transition:all .2s cubic-bezier(.4,0,.2,1);margin-bottom:.25rem;border-left:3px solid transparent}.nav-overflow-link:hover{background:var(--nav-overflow-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px)}.nav-overflow-link.nav-link-active{background:var(--nav-overflow-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);padding-left:.625rem}.nav-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0;margin-left:.5rem;z-index:1002;padding-left:.75rem;border-left:1px solid var(--nav-actions-border, var(--border-color))}.nav-action{display:flex;align-items:center;transition:transform .2s ease}.nav-action:hover{transform:scale(1.05)}.nav-toggle{display:none;flex-direction:column;gap:5px;background:var(--nav-toggle-bg, transparent);border:1px solid var(--nav-toggle-border, var(--border-color));border-radius:.5rem;cursor:pointer;padding:.625rem .5rem;z-index:1001;transition:all .25s ease}.nav-toggle:hover{background:var(--nav-toggle-hover-bg, var(--bg-secondary));border-color:var(--nav-toggle-hover-border, var(--border-color))}.nav-toggle-line{width:24px;height:3px;background:var(--nav-toggle-color, var(--text-primary));border-radius:3px;transition:all .3s cubic-bezier(.4,0,.2,1);transform-origin:center}.nav-toggle-line.open:nth-child(1){transform:rotate(45deg) translate(8px,8px)}.nav-toggle-line.open:nth-child(2){opacity:0}.nav-toggle-line.open:nth-child(3){transform:rotate(-45deg) translate(7px,-7px)}.nav-mobile-menu{position:fixed;top:72px;left:0;right:0;background:var(--nav-mobile-bg, var(--bg-primary));-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);flex-direction:column;padding:1.5rem;gap:.5rem;transform:translateY(-100%);opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.4,0,.2,1);border-bottom:1px solid var(--nav-border, var(--border-color));max-height:calc(100vh - 72px);overflow-y:auto;z-index:999;box-shadow:0 4px 24px #0000001a}.nav-mobile-menu.open{transform:translateY(0);opacity:1;visibility:visible}wsx-link.nav-mobile-link::part(link){display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none!important;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}wsx-link.nav-mobile-link::part(link):hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));text-decoration:none!important;transform:translate(4px);border-left-color:var(--primary-red)}wsx-link.nav-mobile-link[active]::part(link),wsx-link.nav-mobile-link.nav-link-active::part(link){background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}.nav-mobile-link{display:block;padding:.875rem 1.25rem;color:var(--nav-link-color, var(--text-secondary));text-decoration:none;font-weight:500;font-size:1rem;border-radius:.625rem;transition:all .25s cubic-bezier(.4,0,.2,1);border-left:3px solid transparent}.nav-mobile-link:hover{background:var(--nav-mobile-link-hover-bg, var(--bg-secondary));color:var(--nav-link-hover-color, var(--text-primary));transform:translate(4px);border-left-color:var(--primary-red)}.nav-mobile-link.nav-link-active{background:var(--nav-mobile-link-active-bg, var(--bg-secondary));color:var(--nav-link-active-color, var(--primary-red));font-weight:600;border-left-color:var(--primary-red);box-shadow:0 2px 8px var(--card-shadow)}@media (max-width: 768px){.nav-container{padding:0 1.25rem;height:68px}.nav-brand{font-size:1.35rem}.nav-menu{display:none}.nav-actions{margin-left:0;gap:.5rem;padding-left:.5rem;border-left:none}.nav-toggle{display:flex;margin-left:.5rem}.nav-mobile-menu{display:flex;top:68px;max-height:calc(100vh - 68px)}}@media (min-width: 769px){.nav-mobile-menu{display:none!important}}@media (prefers-reduced-motion: no-preference){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle{transition-duration:.25s}}@media (prefers-reduced-motion: reduce){.responsive-nav,.nav-link,.nav-overflow-button,.nav-toggle,.nav-mobile-menu{transition:none;animation:none}}';var at;let st,lt;function Z(t,e,r){return(e=ct(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ir(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:ke(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||ke(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return sr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:ct(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function ct(t){var e=ar(t,"string");return typeof e=="symbol"?e:e+""}function ar(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ke(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function sr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}lt=[_.autoRegister({tagName:"wsx-responsive-nav"})];exports.ResponsiveNav=void 0;class lr extends _.WebComponent{constructor(e){super({styles:we,styleName:"wsx-responsive-nav"}),Z(this,"_autoStyles",we),Z(this,"navigation",void 0),Z(this,"isMobileMenuOpen",void 0),Z(this,"visibleItemIndices",void 0),Z(this,"hiddenItemIndices",void 0),Z(this,"isMobile",void 0),Z(this,"isOverflowOpen",void 0),Z(this,"navMenuElement",void 0),Z(this,"navItemsElements",[]),Z(this,"resizeObserver",void 0),Z(this,"resizeHandler",void 0),Z(this,"toggleMobileMenu",()=>{this.isMobileMenuOpen=!this.isMobileMenuOpen,this.rerender()}),Z(this,"closeMobileMenu",()=>{this.isMobileMenuOpen=!1,this.rerender()}),Z(this,"toggleOverflow",()=>{this.isOverflowOpen=!this.isOverflowOpen,this.rerender(),this.isOverflowOpen?setTimeout(()=>{document.addEventListener("click",this.handleOverflowOutsideClick,!0)},0):document.removeEventListener("click",this.handleOverflowOutsideClick,!0)}),Z(this,"closeOverflow",()=>{this.isOverflowOpen=!1,this.rerender(),document.removeEventListener("click",this.handleOverflowOutsideClick,!0)}),Z(this,"handleOverflowOutsideClick",T=>{const R=T.target,P=this.querySelector(".nav-overflow"),a=P==null?void 0:P.querySelector(".nav-overflow-menu"),s=P==null?void 0:P.querySelector(".nav-overflow-button");a&&s&&!a.contains(R)&&!s.contains(R)&&this.closeOverflow()}),Z(this,"updateVisibleItems",()=>{var u;if(!this.navigation.autoOverflow||this.isMobile||!this.navMenuElement){if(!this.isMobile){const h=this.navigation.items.map((p,x)=>x);JSON.stringify(h.sort())!==JSON.stringify(this.visibleItemIndices.sort())&&(this.visibleItemIndices=h,this.hiddenItemIndices=[],this.rerender())}return}const T=[];for(let h=0;h<this.navigation.items.length;h++){let p=this.navItemsElements[h];if(!p){const x=Array.from(this.navMenuElement.querySelectorAll(".nav-link"));x[h]&&(p=x[h],this.navItemsElements[h]=p)}if(p)T.push(p);else{const x=document.createElement("wsx-link");x.textContent=this.navigation.items[h].label,x.style.visibility="hidden",x.style.position="absolute",document.body.appendChild(x),T.push(x),setTimeout(()=>{x.parentElement&&x.parentElement.removeChild(x)},0)}}const R=(u=this.navMenuElement.parentElement)==null?void 0:u.querySelector(".nav-actions"),P=R?Array.from(R.children).reduce((h,p)=>h+de.getElementTotalWidth(p),0)+8:0,c=de.detect({container:this.navMenuElement,items:T,gap:16,reservedWidth:P,overflowButtonWidth:90,padding:0,minVisibleItems:1}),o=c.visibleIndices,n=c.hiddenIndices;T.forEach(h=>{h.parentElement===document.body&&document.body.removeChild(h)}),(JSON.stringify(o.sort())!==JSON.stringify(this.visibleItemIndices.sort())||JSON.stringify(n.sort())!==JSON.stringify(this.hiddenItemIndices.sort()))&&(this.visibleItemIndices=o,this.hiddenItemIndices=n,this.rerender())}),Z(this,"checkMobile",()=>{var R;const T=window.innerWidth<=(((R=this.navigation)==null?void 0:R.mobileBreakpoint)||768);T!==this.isMobile&&(this.isMobile=T,this.rerender())}),e&&(this.navigation={mobileBreakpoint:768,autoOverflow:!0,...e},this.visibleItemIndices=e.items.map((T,R)=>R));let r=this.reactive({items:[]});Object.defineProperty(this,"navigation",{get:()=>r,set:T=>{r=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});const[i,k]=this.useState("isMobileMenuOpen",!1);Object.defineProperty(this,"isMobileMenuOpen",{get:i,set:k,enumerable:!0,configurable:!0});let C=this.reactive([]);Object.defineProperty(this,"visibleItemIndices",{get:()=>C,set:T=>{C=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});let b=this.reactive([]);Object.defineProperty(this,"hiddenItemIndices",{get:()=>b,set:T=>{b=T!==null&&typeof T<"u"&&(Array.isArray(T)||typeof T=="object")?this.reactive(T):T,this.scheduleRerender()},enumerable:!0,configurable:!0});const[A,y]=this.useState("isMobile",!1);Object.defineProperty(this,"isMobile",{get:A,set:y,enumerable:!0,configurable:!0});const[D,L]=this.useState("isOverflowOpen",!1);Object.defineProperty(this,"isOverflowOpen",{get:D,set:L,enumerable:!0,configurable:!0})}render(){var r,i;if(!((r=this.navigation)!=null&&r.items)||((i=this.navigation)==null?void 0:i.items.length)===0)return _.jsx("nav",{class:"responsive-nav"});const e=this.hiddenItemIndices.map(k=>this.navigation.items[k]);return _.jsx("nav",{class:"responsive-nav"},_.jsx("div",{class:"nav-container"},_.jsx("div",{class:"nav-brand"},_.jsx("slot",{name:"brand-icon"},this.navigation.brandIcon&&typeof this.navigation.brandIcon=="string"&&_.jsx("span",{class:"nav-brand-icon"},this.navigation.brandIcon)),this.navigation.brand&&_.jsx("span",{class:"nav-brand-text"},this.navigation.brand)),!this.isMobile&&_.jsx("div",{ref:k=>this.navMenuElement=k,class:"nav-menu"},this.navigation.items.map((k,C)=>{const b=this.visibleItemIndices.includes(C);return _.jsx("wsx-link",{key:`nav-${C}`,ref:A=>{A&&(this.navItemsElements[C]=A)},to:k.to,class:`nav-link ${b?"":"hidden-item"}`,"active-class":"nav-link-active",exact:k.exact,style:b?"":"position: absolute; visibility: hidden; pointer-events: none;"},k.label)}),this.navigation.autoOverflow&&e.length>0&&!this.isMobile&&_.jsx("div",{class:"nav-overflow"},_.jsx("button",{class:"nav-overflow-button",onClick:this.toggleOverflow,"data-wsx-key":"ResponsiveNav-button-text-1-1"},"More ▼"),this.isOverflowOpen&&_.jsx("div",{class:"nav-overflow-menu"},e.map((k,C)=>{const b=this.hiddenItemIndices[C];return _.jsx("wsx-link",{key:`overflow-${b}`,to:k.to,class:"nav-overflow-link","active-class":"nav-link-active",exact:k.exact,onClick:this.closeOverflow},k.label)})))),this.navigation.actionTags&&_.jsx("div",{class:"nav-actions"},this.navigation.actionTags.map((k,C)=>{const b=k;return _.jsx("div",{key:C,class:"nav-action"},_.jsx(b,null))})),this.isMobile&&_.jsx("button",{class:"nav-toggle",onClick:this.toggleMobileMenu,"data-wsx-key":"ResponsiveNav-button-text-1"},_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}),_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}),_.jsx("span",{class:`nav-toggle-line ${this.isMobileMenuOpen?"open":""}`}))),this.isMobile&&_.jsx("div",{class:`nav-mobile-menu ${this.isMobileMenuOpen?"open":""}`},this.navigation.items.filter(k=>!k.hideOnMobile).map((k,C)=>_.jsx("wsx-link",{key:C,to:k.to,class:"nav-mobile-link","active-class":"nav-link-active",exact:k.exact,onClick:this.closeMobileMenu},k.label))))}onConnected(){var r,i;if(!((r=this.navigation)!=null&&r.items)||((i=this.navigation)==null?void 0:i.items.length)===0)try{this.visibleItemIndices=this.navigation.items.map((k,C)=>C),this.rerender()}catch(k){console.error("Failed to parse ResponsiveNav config:",k)}this.checkMobile();const e=(k=0)=>{k>10||setTimeout(()=>{this.navMenuElement&&(this.navigation.items.every((b,A)=>this.navItemsElements[A])||k>5?this.updateVisibleItems():e(k+1))},50)};e(),this.resizeHandler=()=>{this.checkMobile(),setTimeout(()=>{this.updateVisibleItems()},100)},window.addEventListener("resize",this.resizeHandler),setTimeout(()=>{this.navMenuElement&&window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{setTimeout(()=>{this.updateVisibleItems()},0)}),this.resizeObserver.observe(this.navMenuElement))},0)}onDisconnected(){this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.resizeObserver&&this.resizeObserver.disconnect()}}at=lr;[exports.ResponsiveNav,st]=ir(at,[],lt,0,void 0,_.WebComponent).c;st();var ut;let dt,pt;function te(t,e,r){return(e=ht(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t,e,r,i,k,C){function b(a,s,c){return function(o,n){return c&&c(o),a[s].call(o,n)}}function A(a,s){for(var c=0;c<a.length;c++)a[c].call(s);return s}function y(a,s,c,o){if(typeof a!="function"&&(o||a!==void 0))throw new TypeError(s+" must "+(c||"be")+" a function"+(o?"":" or undefined"));return a}function D(a,s,c,o,n,u,h,p,x,E,m,d,v){function O(f){if(!v(f))throw new TypeError("Attempted to access private element on non-instance")}var g,I=s[0],F=s[3],j=!p;if(!j){c||Array.isArray(I)||(I=[I]);var l={},N=[],S=n===3?"get":n===4||d?"set":"value";E?(m||d?l={get:Ee(function(){return F(this)},o,"get"),set:function(f){s[4](this,f)}}:l[S]=F,m||Ee(l[S],o,n===2?"":S)):m||(l=Object.getOwnPropertyDescriptor(a,o))}for(var w=a,B=I.length-1;B>=0;B-=c?2:1){var W=I[B],G=c?I[B-1]:void 0,Y={},M={kind:["field","accessor","method","getter","setter","class"][n],name:o,metadata:u,addInitializer:(function(f,$){if(f.v)throw Error("attempted to call addInitializer after decoration was finished");y($,"An initializer","be",!0),h.push($)}).bind(null,Y)};try{if(j)(g=y(W.call(G,w,M),"class decorators","return"))&&(w=g);else{var z,U;M.static=x,M.private=E,E?n===2?z=function(f){return O(f),l.value}:(n<4&&(z=b(l,"get",O)),n!==3&&(U=b(l,"set",O))):(z=function(f){return f[o]},(n<2||n===4)&&(U=function(f,$){f[o]=$}));var V=M.access={has:E?v.bind():function(f){return o in f}};if(z&&(V.get=z),U&&(V.set=U),w=W.call(G,d?{get:l.get,set:l.set}:l[S],M),d){if(typeof w=="object"&&w)(g=y(w.get,"accessor.get"))&&(l.get=g),(g=y(w.set,"accessor.set"))&&(l.set=g),(g=y(w.init,"accessor.init"))&&N.push(g);else if(w!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(w,(m?"field":"method")+" decorators","return")&&(m?N.push(w):l[S]=w)}}finally{Y.v=!0}}return(m||d)&&p.push(function(f,$){for(var H=N.length-1;H>=0;H--)$=N[H].call(f,$);return $}),m||j||(E?d?p.push(b(l,"get"),b(l,"set")):p.push(n===2?l[S]:b.call.bind(l[S])):Object.defineProperty(a,o,l)),w}function L(a,s){return Object.defineProperty(a,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:s})}if(arguments.length>=6)var T=C[Symbol.metadata||Symbol.for("Symbol.metadata")];var R=Object.create(T??null),P=function(a,s,c,o){var n,u,h=[],p=function(S){return dr(S)===a},x=new Map;function E(S){S&&h.push(A.bind(null,S))}for(var m=0;m<s.length;m++){var d=s[m];if(Array.isArray(d)){var v=d[1],O=d[2],g=d.length>3,I=16&v,F=!!(8&v),j=(v&=7)==0,l=O+"/"+F;if(!j&&!g){var N=x.get(l);if(N===!0||N===3&&v!==4||N===4&&v!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+O);x.set(l,!(v>2)||v)}D(F?a:a.prototype,d,I,g?"#"+O:ht(O),v,o,F?u=u||[]:n=n||[],h,F,g,j,v===1,F&&g?p:c)}}return E(n),E(u),h}(t,e,k,R);return r.length||L(t,R),{e:P,get c(){var a=[];return r.length&&[L(D(t,[r],i,t.name,5,R,a),R),A.bind(null,a,t)]}}}function ht(t){var e=ur(t,"string");return typeof e=="symbol"?e:e+""}function ur(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ee(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function dr(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const Se=ze("SvgIcon");pt=[_.autoRegister({tagName:"svg-icon"})];exports.SvgIcon=void 0;class pr extends _.WebComponent{constructor(){super(),te(this,"size",void 0),te(this,"color",void 0),te(this,"name",void 0),te(this,"handleClick",A=>{Se.debug("SVG icon clicked",{name:this.name}),this.dispatchEvent(new CustomEvent("icon-click",{detail:{name:this.name,originalEvent:A},bubbles:!0}))}),te(this,"handleMouseEnter",A=>{const y=A.target;y.style.transform="scale(1.1)"}),te(this,"handleMouseLeave",A=>{const y=A.target;y.style.transform="scale(1)"});const[e,r]=this.useState("size",24);Object.defineProperty(this,"size",{get:e,set:r,enumerable:!0,configurable:!0});const[i,k]=this.useState("color","currentColor");Object.defineProperty(this,"color",{get:i,set:k,enumerable:!0,configurable:!0});const[C,b]=this.useState("name","star");Object.defineProperty(this,"name",{get:C,set:b,enumerable:!0,configurable:!0})}render(){const e=this.size||"24",r=this.color||"currentColor",i=this.name||"star",k={star:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",heart:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",check:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",close:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",github:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",play:"M8 5v14l11-7z",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},C=k[i]||k.star;return _.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"svg-icon",onClick:this.handleClick,style:"cursor: pointer; transition: transform 0.2s ease; display: inline-block;",onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},_.jsx("path",{d:C,fill:r}))}static get observedAttributes(){return["name","size","color"]}onAttributeChanged(e,r,i){Se.debug(`Attribute ${e} changed from ${r} to ${i}`),this.connected&&this.rerender()}}ut=pr;[exports.SvgIcon,dt]=cr(ut,[],pt,0,void 0,_.WebComponent).c;dt();var gt={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
7
7
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
8
8
|
*
|
|
9
9
|
* @license MIT <https://opensource.org/licenses/MIT>
|
package/dist/index.js
CHANGED
|
@@ -2054,12 +2054,12 @@ class fr extends Q {
|
|
|
2054
2054
|
const e = this.hiddenItemIndices.map((k) => this.navigation.items[k]);
|
|
2055
2055
|
return /* @__PURE__ */ $("nav", { class: "responsive-nav" }, /* @__PURE__ */ $("div", { class: "nav-container" }, /* @__PURE__ */ $("div", { class: "nav-brand" }, /* @__PURE__ */ $("slot", { name: "brand-icon" }, this.navigation.brandIcon && typeof this.navigation.brandIcon == "string" && /* @__PURE__ */ $("span", { class: "nav-brand-icon" }, this.navigation.brandIcon)), this.navigation.brand && /* @__PURE__ */ $("span", { class: "nav-brand-text" }, this.navigation.brand)), !this.isMobile && /* @__PURE__ */ $("div", { ref: (k) => this.navMenuElement = k, class: "nav-menu" }, this.navigation.items.map((k, O) => {
|
|
2056
2056
|
const m = this.visibleItemIndices.includes(O);
|
|
2057
|
-
return /* @__PURE__ */ $("wsx-link", { key: O
|
|
2057
|
+
return /* @__PURE__ */ $("wsx-link", { key: `nav-${O}`, ref: (A) => {
|
|
2058
2058
|
A && (this.navItemsElements[O] = A);
|
|
2059
2059
|
}, to: k.to, class: `nav-link ${m ? "" : "hidden-item"}`, "active-class": "nav-link-active", exact: k.exact, style: m ? "" : "position: absolute; visibility: hidden; pointer-events: none;" }, k.label);
|
|
2060
2060
|
}), this.navigation.autoOverflow && e.length > 0 && !this.isMobile && /* @__PURE__ */ $("div", { class: "nav-overflow" }, /* @__PURE__ */ $("button", { class: "nav-overflow-button", onClick: this.toggleOverflow, "data-wsx-key": "ResponsiveNav-button-text-1-1" }, "More ▼"), this.isOverflowOpen && /* @__PURE__ */ $("div", { class: "nav-overflow-menu" }, e.map((k, O) => {
|
|
2061
2061
|
const m = this.hiddenItemIndices[O];
|
|
2062
|
-
return /* @__PURE__ */ $("wsx-link", { key: m
|
|
2062
|
+
return /* @__PURE__ */ $("wsx-link", { key: `overflow-${m}`, to: k.to, class: "nav-overflow-link", "active-class": "nav-link-active", exact: k.exact, onClick: this.closeOverflow }, k.label);
|
|
2063
2063
|
})))), this.navigation.actionTags && /* @__PURE__ */ $("div", { class: "nav-actions" }, this.navigation.actionTags.map((k, O) => /* @__PURE__ */ $("div", { key: O, class: "nav-action" }, /* @__PURE__ */ $(k, null)))), this.isMobile && /* @__PURE__ */ $("button", { class: "nav-toggle", onClick: this.toggleMobileMenu, "data-wsx-key": "ResponsiveNav-button-text-1" }, /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }), /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }), /* @__PURE__ */ $("span", { class: `nav-toggle-line ${this.isMobileMenuOpen ? "open" : ""}` }))), this.isMobile && /* @__PURE__ */ $("div", { class: `nav-mobile-menu ${this.isMobileMenuOpen ? "open" : ""}` }, this.navigation.items.filter((k) => !k.hideOnMobile).map((k, O) => /* @__PURE__ */ $("wsx-link", { key: O, to: k.to, class: "nav-mobile-link", "active-class": "nav-link-active", exact: k.exact, onClick: this.closeMobileMenu }, k.label))));
|
|
2064
2064
|
}
|
|
2065
2065
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wsxjs/wsx-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Base UI components built with WSXJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"prismjs": "^1.30.0",
|
|
22
|
-
"@wsxjs/wsx-
|
|
23
|
-
"@wsxjs/wsx-
|
|
22
|
+
"@wsxjs/wsx-logger": "0.0.21",
|
|
23
|
+
"@wsxjs/wsx-core": "0.0.21"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/prismjs": "^1.26.5",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"typescript": "^5.0.0",
|
|
34
34
|
"vite": "^5.4.19",
|
|
35
35
|
"vitest": "^2.1.8",
|
|
36
|
-
"@wsxjs/eslint-plugin-wsx": "0.0.
|
|
37
|
-
"@wsxjs/wsx-vite-plugin": "0.0.
|
|
36
|
+
"@wsxjs/eslint-plugin-wsx": "0.0.21",
|
|
37
|
+
"@wsxjs/wsx-vite-plugin": "0.0.21"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"wsx",
|
package/src/ResponsiveNav.wsx
CHANGED
|
@@ -82,7 +82,7 @@ export default class ResponsiveNav extends WebComponent {
|
|
|
82
82
|
const isVisible = this.visibleItemIndices.includes(index);
|
|
83
83
|
return (
|
|
84
84
|
<wsx-link
|
|
85
|
-
key={index}
|
|
85
|
+
key={`nav-${index}`}
|
|
86
86
|
ref={(el) => {
|
|
87
87
|
if (el) {
|
|
88
88
|
this.navItemsElements[index] = el;
|
|
@@ -121,7 +121,7 @@ export default class ResponsiveNav extends WebComponent {
|
|
|
121
121
|
this.hiddenItemIndices[idx];
|
|
122
122
|
return (
|
|
123
123
|
<wsx-link
|
|
124
|
-
key={originalIndex}
|
|
124
|
+
key={`overflow-${originalIndex}`}
|
|
125
125
|
to={item.to}
|
|
126
126
|
class="nav-overflow-link"
|
|
127
127
|
active-class="nav-link-active"
|