/*! For license information please see d50bb744.js.LICENSE.txt */
(()=>{"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class r{constructor(t,e,o){if(this._$cssResult$=!0,o!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const n=this.t;if(e&&void 0===t){const e=void 0!==n&&1===n.length;e&&(t=o.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(n,t))}return t}toString(){return this.cssText}}const i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,n,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[o+1]),t[0]);return new r(o,t,n)},s=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:l,defineProperty:a,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:h}=Object,u=globalThis,v=u.trustedTypes,f=v?v.emptyScript:"",y=u.reactiveElementPolyfillSupport,g=(t,e)=>t,m={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},b=(t,e)=>!l(t,e),w={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,e);void 0!==o&&a(this.prototype,t,o)}}static getPropertyDescriptor(t,e,n){const{get:o,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return o?.call(this)},set(e){const i=o?.call(this);r.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,o)=>{if(e)n.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),r=t.litNonce;void 0!==r&&o.setAttribute("nonce",r),o.textContent=e.cssText,n.appendChild(o)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e){const n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(void 0!==o&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:m).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const n=this.constructor,o=n._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=n.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=o,this[o]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n,o=!1,r){if(void 0!==t){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??b)(o?r:this[t],e))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[g("elementProperties")]=new Map,x[g("finalized")]=new Map,y?.({ReactiveElement:x}),(u.reactiveElementVersions??=[]).push("2.0.2");const k=globalThis,$=k.trustedTypes,E=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,_="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,S="?"+A,C=`<${S}>`,P=document,O=()=>P.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,R=t=>M(t)||"function"==typeof t?.[Symbol.iterator],j="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,U=/>/g,B=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,L=/"/g,H=/^(?:script|style|textarea|title)$/i,W=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),I=W(1),q=(W(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),V=new WeakMap,F=P.createTreeWalker(P,129);function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}const J=(t,e)=>{const n=t.length-1,o=[];let r,i=2===e?"":"")),o]};class K{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let r=0,i=0;const s=t.length-1,l=this.parts,[a,c]=J(t,e);if(this.el=K.createElement(a,n),F.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=F.nextNode())&&l.length0){o.textContent=$?$.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(t,e=this,n,o){const r=this.strings;let i=!1;if(void 0===r)t=Z(this,t,e,0),i=!z(t)||t!==this._$AH&&t!==q,i&&(this._$AH=t);else{const o=t;let s,l;for(t=r[0],s=0;s{const o=n?.renderBefore??e;let r=o._$litPart$;if(void 0===r){const t=n?.renderBefore??null;o._$litPart$=r=new Q(e.insertBefore(O(),t),t,void 0,n??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}st._$litElement$=!0,st.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:st});const lt=globalThis.litElementPolyfillSupport;lt?.({LitElement:st});(globalThis.litElementVersions??=[]).push("4.0.2");const at={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:b},ct=(t=at,e,n)=>{const{kind:o,metadata:r}=n;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),i.set(n.name,t),"accessor"===o){const{name:o}=n;return{set(n){const r=e.get.call(this);e.set.call(this,n),this.requestUpdate(o,r,t)},init(e){return void 0!==e&&this.C(o,void 0,t),e}}}if("setter"===o){const{name:o}=n;return function(n){const r=this[o];e.call(this,n),this.requestUpdate(o,r,t)}}throw Error("Unsupported decorator location: "+o)};function dt(t){return(e,n)=>"object"==typeof n?ct(t,e,n):((t,e,n)=>{const o=e.hasOwnProperty(n);return e.constructor.createProperty(n,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function ht(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:document,o=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});n.dispatchEvent(o)}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).addEventListener(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).removeEventListener(t,e)}}],n&&ht(e.prototype,n),o&&ht(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Wt=new Ht;function It(){return It="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gt(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},It.apply(this,arguments)}function qt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Xt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vt(t,e){for(var n=0;n=0;l--)(r=t[l])&&(s=(i<3?r(s):i>3?r(e,n,s):r(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}"function"==typeof SuppressedError&&SuppressedError;var ee=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.call(this)).invisible=!1,t.uid=t.generateUniqueId(),t.eventBus=Wt,t}return Ft(n,[{key:"generateUniqueId",value:function(){return"unique-".concat(Math.random().toString(36).slice(2,11))}}]),n}(st);ee.styles=i(vt||(vt=qt(["\n :host([invisible]) {\n display: none;\n }\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.6;\n }\n "]))),te([dt({type:String})],ee.prototype,"uid",void 0),te([dt({type:Boolean})],ee.prototype,"disabled",void 0),te([dt({type:Boolean,reflect:!0})],ee.prototype,"invisible",void 0);var ne=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).size="md",t.type="solid",t}return Ft(n,[{key:"render",value:function(){return I(ft||(ft=qt([''])),this.size,this.round?"round":"",this.handleClick,this.type)}},{key:"handleClick",value:function(){var t=this.uid;this.eventBus.emit("cosy-button:click:".concat(t),{uid:t})}}],[{key:"styles",get:function(){return[ee.styles,i(yt||(yt=qt(['\n button {\n transition: all 0.3s ease;\n background-color: var(--color-button-bg);\n border-width: 1px;\n border-color: var(--color-button-border);\n color: var(--color-button-font);\n text-align: center;\n text-decoration: none;\n border-radius: var(--radius-base, 4px);\n display: inline-flex;\n gap: 6px;\n align-items: center;\n cursor: pointer;\n }\n button:hover {\n color: var(--color-button-font-hover);\n background-color: var(--color-button-bg-hover);\n border-color: var(--color-button-border-hover);\n }\n ::slotted([slot="content"]) {\n padding-right: 2px;\n line-height: 1.5;\n }\n .round {\n border-radius: 16px;\n }\n .size-sm {\n padding: 2px 6px;\n font-size: 12px;\n }\n .size-md {\n padding: 2px 6px;\n font-size: 14px;\n }\n .size-lg {\n padding: 2px 6px;\n font-size: 16px;\n }\n\n .size-sm ::slotted([slot="prefix"]),\n .size-sm ::slotted([slot="suffix"]) {\n width: 12px;\n height: 12px;\n }\n\n .size-md ::slotted([slot="prefix"]),\n .size-md ::slotted([slot="suffix"]) {\n width: 14px;\n height: 14px;\n }\n\n .size-lg ::slotted([slot="prefix"]),\n .size-lg ::slotted([slot="suffix"]) {\n width: 16px;\n height: 16px;\n }\n '])))]}}]),n}(ee);te([dt({type:String})],ne.prototype,"size",void 0),te([dt({type:String})],ne.prototype,"type",void 0),te([dt({type:Boolean})],ne.prototype,"round",void 0),customElements.get("cosy-button")||customElements.define("cosy-button",ne);var oe="cosy-icon",re=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).size="md",t.blank=!1,t.buttonStyle=!1,t}return Ft(n,[{key:"render",value:function(){if(this.href){var t=this.blank?"blank":"";return I(mt||(mt=qt([''])),this.href,t,this.size)}return I(gt||(gt=qt([''])),this.size)}}],[{key:"styles",get:function(){return[ee.styles,i(bt||(bt=qt(["\n :host {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n }\n a {\n color: var(--color-icon);\n text-decoration: none;\n transition: color 0.3s;\n cursor: pointer;\n }\n a:hover {\n color: var(--color-icon-hover);\n }\n .size-sm {\n width: 16px;\n height: 16px;\n }\n .size-md {\n width: 20px;\n height: 20px;\n }\n .size-lg {\n width: 24px;\n height: 24px;\n }\n svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n :host([bordered]) {\n background: var(--color-button-bg);\n border: 1px solid var(--color-button-border);\n border-radius: var(--raius-base, 4px);\n }\n :host([bordered]:hover) {\n background: var(--color-button-bg-hover);\n border-color: var(--color-button-border-hover);\n }\n "])))]}}]),n}(ee);te([dt({type:String})],re.prototype,"size",void 0),te([dt({type:String})],re.prototype,"href",void 0),te([dt({type:Boolean})],re.prototype,"blank",void 0),te([dt({type:Boolean,attribute:"bordered"})],re.prototype,"buttonStyle",void 0),customElements.get(oe)||customElements.define(oe,re);var ie=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).size="md",t}return Ft(n,[{key:"render",value:function(){return I(wt||(wt=qt(["\n \n
"])),"size-".concat(this.size))}}],[{key:"styles",get:function(){return[ee.styles,i(xt||(xt=qt(["\n div {\n display: inline-flex;\n padding: 6px;\n border-radius: var(--radius-base, 4px);\n background-color: var(--color-short-key-bg);\n color: var(--color-short-key-font);\n }\n .size-sm {\n padding: 2px;\n }\n .size-md {\n padding: 4px;\n }\n .size-lg {\n padding: 6px;\n }\n span {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n text-transform: capitalize;\n height: 14px;\n min-width: 14px;\n font-size: 14px;\n }\n svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n "])))]}}]),n}(ee);te([dt({type:String})],ie.prototype,"size",void 0),customElements.get("cosy-short-key")||customElements.define("cosy-short-key",ie);var se=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).placeholder="搜索",t.iconOnly=!1,t}return Ft(n,[{key:"handleClick",value:function(){}},{key:"render",value:function(){return I(kt||(kt=qt([''])),this.handleClick,this.iconOnly?"icon-only":"",this.placeholder)}}],[{key:"styles",get:function(){return[ee.styles,i($t||($t=qt(["\n form {\n display: flex;\n align-items: center;\n padding: 0 6px;\n height: 32px;\n border-radius: var(--radius-base, 4px);\n background: var(--color-search-bg);\n border: 1px solid var(--color-search-border);\n transition: all 0.3s;\n cursor: pointer;\n }\n .icon-only {\n display: inline-flex;\n justify-content: center;\n padding: 6px;\n height: auto;\n }\n .icon-only span {\n display: none;\n }\n .icon-only slot {\n display: none;\n }\n form:hover {\n border-color: var(--color-search-border-hover);\n }\n svg {\n transition: all 0.3s;\n color: var(--color-search-font);\n width: 16px;\n height: 16px;\n }\n span {\n flex: 1;\n padding: 0 6px;\n font-size: 13px;\n color: var(--color-search-font);\n }\n "])))]}}]),n}(ee);te([dt({type:String})],se.prototype,"placeholder",void 0),te([dt({type:Boolean,attribute:"icon-only"})],se.prototype,"iconOnly",void 0),customElements.get("cosy-search")||customElements.define("cosy-search",se);var le=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).checked=!1,t.size="md",t}return Ft(n,[{key:"toggleChecked",value:function(){this.checked=!this.checked}},{key:"render",value:function(){return I(Et||(Et=qt(['\n \n '])),this.size,this.toggleChecked)}}],[{key:"styles",get:function(){return[ee.styles,i(_t||(_t=qt(["\n .switch-sm {\n --switch-width: 36px; /* 默认宽度 */\n --switch-height: 18px; /* 默认高度 */\n --switch-radius: 9px; /* 默认圆角 */\n }\n .switch-md {\n --switch-width: 42px; /* 默认宽度 */\n --switch-height: 20px; /* 默认高度 */\n --switch-radius: 10px; /* 默认圆角 */\n }\n .switch-lg {\n --switch-width: 48px; /* 默认宽度 */\n --switch-height: 24px; /* 默认高度 */\n --switch-radius: 12px; /* 默认圆角 */\n }\n .switch {\n width: var(--switch-width);\n height: var(--switch-height);\n border-radius: var(--switch-radius);\n background-color: var(--color-switch-track-bg);\n border: 1px solid var(--color-switch-border);\n position: relative;\n cursor: pointer;\n transition: border 0.3s, background-color 0.3s;\n }\n .switch:hover {\n border-color: var(--color-switch-border-hover);\n }\n .switch-knob {\n position: absolute;\n width: 50%;\n height: 100%;\n background-color: var(--color-switch-bg);\n border-radius: var(--switch-radius);\n transition: background-color 0.3s, border 0.3s, left 0.3s;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transform: scale(1.05);\n left: 0;\n }\n :host([checked]) .switch {\n background-color: var(--color-switch-track-bg-checked);\n }\n :host([checked]) .switch-knob {\n left: 50%;\n color: var(--color-switch-font-checked);\n background-color: var(--color-switch-bg-checked);\n }\n .content {\n position: absolute;\n width: 100%;\n height: 100%;\n display: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n }\n .content ::slotted(*) {\n max-width: 70%;\n max-height: 70%;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n :host(:not([checked])) .content-left,\n :host([checked]) .content-right {\n display: flex;\n }\n "])))]}}]),n}(ee);te([dt({type:Boolean,reflect:!0})],le.prototype,"checked",void 0),te([dt({type:String})],le.prototype,"size",void 0),customElements.get("cosy-switch")||customElements.define("cosy-switch",le);var ae=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).placement="bottom",t.maxWidth="220px",t.textWrap=!1,t.textWrapWidth="220px",t.fontColor="var(--color-font-1)",t}return Ft(n,[{key:"render",value:function(){return I(At||(At=qt(['\n \n
'])),this.placement,this.fontColor,this.maxWidth,this.textWrap?"wrap":"nowrap",this.textWrap?1.5:1,this.textWrap?this.textWrapWidth:"inherit")}}],[{key:"styles",get:function(){return[ee.styles,i(St||(St=qt(["\n .tooltip {\n position: relative;\n display: inline-flex;\n user-select: none;\n }\n .tooltip-content {\n display: inline-block;\n visibility: hidden;\n opacity: 0;\n background-color: var(--color-tooltip-bg);\n border: 1px solid var(--color-tooltip-border);\n backdrop-filter: var(--color-frost-bg);\n padding: 4px 8px;\n border-radius: var(--radius-base, 4px);\n position: absolute;\n z-index: 1;\n font-size: 13px;\n transition: opacity 0.3s ease, visibility 0.3s;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .tooltip:hover .tooltip-content {\n visibility: visible;\n opacity: 1;\n }\n .top {\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n }\n .top-left {\n left: 0;\n bottom: calc(100% + 6px);\n }\n .top-right {\n right: 0;\n bottom: 115%;\n }\n .bottom {\n top: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n }\n .bottom-left {\n left: 0;\n top: calc(100% + 6px);\n }\n .bottom-right {\n right: 0;\n top: calc(100% + 6px);\n }\n .left {\n right: calc(100% + 6px);\n top: 50%;\n transform: translateY(-50%);\n }\n .right {\n left: calc(100% + 6px);\n top: 50%;\n transform: translateY(-50%);\n }\n "])))]}}]),n}(ee);te([dt({type:String})],ae.prototype,"placement",void 0),te([dt({type:String,attribute:"max-width"})],ae.prototype,"maxWidth",void 0),te([dt({type:Boolean,attribute:"text-wrap"})],ae.prototype,"textWrap",void 0),te([dt({type:String,attribute:"text-wrap-width"})],ae.prototype,"textWrapWidth",void 0),te([dt({type:String,attribute:"font-color"})],ae.prototype,"fontColor",void 0),customElements.get("cosy-tooltip")||customElements.define("cosy-tooltip",ae);var ce="cosy-drag-box",de=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).trigger="right",t.minWidth=100,t.hideThreshold=50,t.dragging=null,t.startX=0,t.startWidth=0,t.drag=function(e){if(t.dragging){t.updateDraggerOpacity();var n=e.clientX-t.startX,o="left"===t.dragging?t.startWidth-n:t.startWidth+n;o>t.minWidth?t.style.width="".concat(o,"px"):o\n '])),e,(function(n){return t.startDrag(n,e)}))},t}return Ft(n,[{key:"updateDraggerOpacity",value:function(){var t,e,n=this;null===(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".dragger"))||void 0===e||e.forEach((function(t){n.dragging?t.style.opacity="1":t.removeAttribute("style")}))}},{key:"render",value:function(){var t="min-width: ".concat(this.minWidth,"px;border-").concat(this.trigger,":1px solid var(--color-border);height:100%");return I(Pt||(Pt=qt(['\n \n ',"\n \n
\n "])),t,this.renderDragger())}}],[{key:"styles",get:function(){return[ee.styles,i(Ot||(Ot=qt(["\n :host {\n display: block;\n position: relative;\n overflow-x: hidden;\n }\n .dragger {\n position: absolute;\n background-color: var(--color-dragger);\n opacity: 0;\n transition: opacity 0.2s;\n }\n .dragger:hover {\n opacity: 1;\n }\n .dragger[dragging] {\n opacity: 1;\n }\n .dragger-left,\n .dragger-right {\n top: 0;\n bottom: 0;\n width: 3px;\n cursor: col-resize;\n }\n .dragger-left {\n left: 0;\n }\n .dragger-right {\n right: 0;\n }\n "])))]}}]),n}(ee);te([dt({type:String})],de.prototype,"trigger",void 0),te([dt({type:Number,attribute:"min-width"})],de.prototype,"minWidth",void 0),te([dt({type:Number,attribute:"threshold"})],de.prototype,"hideThreshold",void 0),customElements.get(ce)||customElements.define(ce,de);var pe=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).margin="1rem 0",t}return Ft(n,[{key:"render",value:function(){return I(zt||(zt=qt([''])),this.margin)}}],[{key:"styles",get:function(){return[ee.styles,i(Mt||(Mt=qt(["\n div {\n height: 1px;\n background-image: linear-gradient(\n to right,\n transparent,\n var(--color-border),\n transparent\n );\n }\n "])))]}}]),n}(ee);te([dt({type:String})],pe.prototype,"margin",void 0),customElements.get("cosy-divider")||customElements.define("cosy-divider",pe);var he="cosy-popup",ue=function(t){Jt(n,t);var e=Zt(n);function n(){return Xt(this,n),e.apply(this,arguments)}return Ft(n,[{key:"destroy",value:function(){this.parentNode&&this.parentNode.removeChild(this)}},{key:"onBackdropClick",value:function(t){t.target===this&&this.destroy()}},{key:"connectedCallback",value:function(){It(Gt(n.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this.onBackdropClick)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this.onBackdropClick),It(Gt(n.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function(){return I(Rt||(Rt=qt(['\n \n \n
\n '])))}}],[{key:"styles",get:function(){return i(jt||(jt=qt(["\n :host {\n display: block;\n position: fixed;\n padding: 24px;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--color-popup-mask-bg); /* 半透明蒙版 */\n backdrop-filter: blur(5px); /* 模糊效果 */\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 19940121;\n }\n .content {\n background: var(--color-popup-bg);\n padding: 20px;\n border-radius: var(--radius-base, 4px);\n box-shadow: rgba(0, 0, 0, 0.2) 0px 16px 70px;\n backdrop-filter: blur(20px) saturate(190%) contrast(70%) brightness(80%);\n border: 0.5px solid var(--color-popup-border);\n }\n "])))}}]),n}(ee);customElements.get(he)||customElements.define(he,ue);var ve=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).blank=!1,t}return Ft(n,[{key:"render",value:function(){var t=this.href?this.href:"javascript:void(0);",e=this.blank?"blank":"";return I(Tt||(Tt=qt(['\n \n \n '])),this.bordered?"bordered":"",t,e,this.color?"dot "+this.color:"")}}],[{key:"styles",get:function(){return[ee.styles,i(Dt||(Dt=qt(["\n a {\n padding: 4px;\n transition: all 0.3s ease;\n background-color: var(--color-label-bg);\n color: var(--color-label-font);\n border-radius: var(--radius-base, 4px);\n display: inline-flex;\n align-items: center;\n font-size: 12px;\n text-decoration: none;\n user-select: none;\n }\n .bordered {\n border: 1px solid var(--color-label-border);\n }\n a:hover {\n border-color: var(--color-label-border-hover);\n /* background-color: var(--color-label-bg-hover); */\n color: var(--color-label-font-hover);\n }\n .round {\n border-radius: 16px;\n }\n .dot {\n margin-right: 6px;\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n }\n .yellow {\n background: var(--color-yellow);\n }\n .orange {\n background: var(--color-orange);\n }\n .teal {\n background: var(--color-teal);\n }\n .red {\n background: var(--color-red);\n }\n .blue {\n background: var(--color-blue);\n }\n .grey {\n background: var(--color-grey);\n }\n .green {\n background: var(--color-green);\n }\n "])))]}}]),n}(ee);te([dt({type:String})],ve.prototype,"color",void 0),te([dt({type:Boolean})],ve.prototype,"bordered",void 0),te([dt({type:String})],ve.prototype,"href",void 0),te([dt({type:Boolean})],ve.prototype,"blank",void 0),customElements.get("cosy-label")||customElements.define("cosy-label",ve);var fe="cosy-card",ye=function(t){Jt(n,t);var e=Zt(n);function n(){return Xt(this,n),e.apply(this,arguments)}return Ft(n,[{key:"handleCardMouseMove",value:function(t){var e=t.detail,n=e.mouseX,o=e.mouseY,r=this.getBoundingClientRect(),i=n-r.left,s=o-r.top;this.style.setProperty("--mouse-x","".concat(i,"px")),this.style.setProperty("--mouse-y","".concat(s,"px"))}},{key:"connectedCallback",value:function(){var t=this;It(Gt(n.prototype),"connectedCallback",this).call(this),this.eventBus.on("card-group:mousemove",(function(e){return t.handleCardMouseMove(e)}))}},{key:"disconnectedCallback",value:function(){It(Gt(n.prototype),"disconnectedCallback",this).call(this),this.eventBus.off("card-group:mousemove",this.handleCardMouseMove)}},{key:"render",value:function(){return I(Ut||(Ut=qt(['\n \n
\n '])))}}],[{key:"styles",get:function(){return[ee.styles,i(Bt||(Bt=qt(['\n .card {\n background-color: var(--color-border);\n border-radius: 10px;\n cursor: pointer;\n display: inline-flex;\n flex-direction: column;\n position: relative;\n color: var(--color-font);\n }\n\n .card::before,\n .card::after {\n border-radius: inherit;\n content: "";\n height: 100%;\n left: 0px;\n opacity: 0;\n position: absolute;\n top: 0px;\n transition: opacity 500ms;\n width: 100%;\n background: radial-gradient(\n 800px circle at var(--mouse-x) var(--mouse-y),\n var(--color-radial-before),\n transparent 40%\n );\n z-index: 3;\n }\n\n .card::after {\n background: radial-gradient(\n 800px circle at var(--mouse-x) var(--mouse-y),\n var(--color-radial-after),\n transparent 40%\n );\n opacity: 1;\n z-index: 1;\n }\n\n .mask {\n position: absolute;\n background-color: var(--color-bg-2);\n border-radius: inherit;\n inset: 1px;\n z-index: 2;\n }\n\n .content {\n z-index: 4;\n }\n '])))]}}]),n}(ee);customElements.get(fe)||customElements.define(fe,ye);var ge="cosy-card-group",me=function(t){Jt(n,t);var e=Zt(n);function n(){var t;return Xt(this,n),(t=e.apply(this,arguments)).row=3,t}return Ft(n,[{key:"handleMouseMove",value:function(t){var e=t.clientX,n=t.clientY;this.eventBus.emit("card-group:mousemove",{mouseX:e,mouseY:n})}},{key:"render",value:function(){return I(Nt||(Nt=qt(['\n \n
'])),this.handleMouseMove)}}],[{key:"styles",get:function(){return[ee.styles,i(Lt||(Lt=qt(["\n .card-group {\n display: grid;\n justify-items: center;\n align-items: center;\n gap: 12px;\n }\n "])))]}}]),n}(ee);te([dt({type:Number})],me.prototype,"row",void 0),customElements.get(ge)||customElements.define(ge,me);var be=function(){function t(e,n,o){Xt(this,t),this.dropdownElement=null,this.selector=e,this.options=n,this.element=document.querySelector(this.selector),this.onClickItem=o.onClickItem,this.init()}return Ft(t,[{key:"init",value:function(){this.element&&(this.element.addEventListener("click",this.toggleDropdown.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this)))}},{key:"toggleDropdown",value:function(e){e.stopPropagation(),t.activeDropdown&&t.activeDropdown!==this&&t.activeDropdown.removeDropdown(),this.dropdownElement?this.removeDropdown():(this.createDropdown(),t.activeDropdown=this)}},{key:"fadeIn",value:function(t,e){var n=0,o=16.7/e;!function e(){if((n+=o)>=1)return n=1,void(t.style.opacity=String(n));t.style.opacity=String(n),requestAnimationFrame(e)}()}},{key:"fadeOut",value:function(t,e,n){var o=1,r=16.7/e,i=t;!function t(){if(i){if((o-=r)<=0)return o=0,i.style.opacity=String(o),void n();i.style.opacity=String(o),requestAnimationFrame(t)}}()}},{key:"createDropdown",value:function(){var t,e=this;this.dropdownElement=document.createElement("div"),this.dropdownElement.style.opacity="0",this.options.forEach((function(t){var n=document.createElement("div");if(n.style.padding="8px 12px",n.style.color="var(--color-font-2)",n.style.borderRadius="var(--radius-base, 4px)",n.style.fontSize="13px",n.style.cursor="pointer",n.style.display="flex",n.style.alignItems="center",t.icon){var o=document.createElement("span");o.innerHTML=t.icon,o.style.marginRight="8px",o.style.width="16px",o.style.height="16px",n.appendChild(o)}var r=document.createTextNode(String(t.label));n.appendChild(r),n.addEventListener("click",(function(){var n;null===(n=e.onClickItem)||void 0===n||n.call(e,t),e.removeDropdown()})),n.addEventListener("mouseenter",(function(){n.style.backgroundColor="var(--color-dropdown-hover)",n.style.color="var(--color-font)"})),n.addEventListener("mouseleave",(function(){n.style.backgroundColor="",n.style.color="var(--color-font-2)"})),e.dropdownElement.appendChild(n)})),document.body.appendChild(this.dropdownElement),this.dropdownElement.style.position="absolute",this.dropdownElement.style.padding="6px 4px",this.dropdownElement.style.borderRadius="var(--radius-base,4px)",this.dropdownElement.style.background="var(--color-dropdown-bg)",this.dropdownElement.style.backdropFilter="var(--color-frost-bg)",this.dropdownElement.style.border="1px solid var(--color-dropdown-border)",this.dropdownElement.style.boxShadow="var(--color-dropdown-shadow)";var n=null===(t=document.querySelector(this.selector))||void 0===t?void 0:t.getBoundingClientRect();this.dropdownElement.style.top="".concat(n.top,"px"),this.dropdownElement.style.left="".concat(n.left,"px"),this.dropdownElement.style.minWidth="".concat(n.width,"px"),this.fadeIn(this.dropdownElement,150)}},{key:"removeDropdown",value:function(){var t=this;if(this.dropdownElement){var e=this.dropdownElement;this.fadeOut(e,150,(function(){e.remove(),t.dropdownElement===e&&(t.dropdownElement=null)}))}}},{key:"handleDocumentClick",value:function(){this.removeDropdown()}}]),t}();be.activeDropdown=null;var we,xe=function(){function t(e,n){Xt(this,t),this.popoverElement=null,this.options=n,this.element="string"==typeof e?document.querySelector(e):e,this.init()}return Ft(t,[{key:"init",value:function(){this.element&&(this.element.addEventListener("click",this.togglePopover.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this)))}},{key:"togglePopover",value:function(e){e.stopPropagation(),t.activePopover&&t.activePopover!==this&&t.activePopover.removePopover(),this.popoverElement?this.removePopover():(this.createPopover(),t.activePopover=this)}},{key:"fadeIn",value:function(t,e){var n=0,o=16.7/e;!function e(){if((n+=o)>=1)return n=1,void(t.style.opacity=String(n));t.style.opacity=String(n),requestAnimationFrame(e)}()}},{key:"fadeOut",value:function(t,e,n){var o=1,r=16.7/e,i=t;!function t(){if(i){if((o-=r)<=0)return o=0,i.style.opacity=String(o),void n();i.style.opacity=String(o),requestAnimationFrame(t)}}()}},{key:"createPopover",value:function(){var t=this;this.popoverElement=document.createElement("div");var e=this.options.classNames,n=void 0===e?[]:e;if(this.popoverElement.classList.add("popover-content","scrollbar-obtrusive"),n.forEach((function(e){var n;return null===(n=t.popoverElement)||void 0===n?void 0:n.classList.add(e)})),this.popoverElement.style.opacity="0",this.options.title){var o=document.createElement("p");o.textContent=this.options.title,o.style.margin="0 0 8px 0",o.style.fontSize="12px",o.style.color="var(--color-font-2)",this.popoverElement.appendChild(o)}if(this.options.content){var r=document.createElement("p");r.style.margin="0",r.textContent=this.options.content,this.popoverElement.appendChild(r)}document.body.appendChild(this.popoverElement);var i=this.options.styles,s=void 0===i?null:i;if(s)for(var l in s)this.popoverElement.style.setProperty(l,s[l]);this.popoverElement.style.lineHeight="1.5",this.popoverElement.style.zIndex="20231026",this.popoverElement.style.overflow="auto",this.popoverElement.style.padding="10px",this.popoverElement.style.borderRadius="var(--radius)",this.popoverElement.style.backdropFilter="var(--dropdown-bdf)",this.popoverElement.style.background="var(--dropdown-bg)",this.popoverElement.style.border="var(--dropdown-border)",this.popoverElement.style.boxShadow="var(--dropdown-boxShadow)",this.fadeIn(this.popoverElement,150)}},{key:"removePopover",value:function(){var t=this;if(this.popoverElement){var e=this.popoverElement;this.fadeOut(e,150,(function(){e.remove(),t.popoverElement===e&&(t.popoverElement=null)}))}}},{key:"handleDocumentClick",value:function(t){t.target&&this.popoverElement&&this.popoverElement.contains(t.target)||this.removePopover()}}]),t}();xe.activePopover=null,we=()=>{var t,e,n,o,r,i,s,l,a,c;const d=[{value:"all",label:null!==(e=null===(t=window.i18n)||void 0===t?void 0:t["tip-status-default"])&&void 0!==e?e:"all",icon:''},{value:"todo",label:null!==(o=null===(n=window.i18n)||void 0===n?void 0:n["tip-status-todo"])&&void 0!==o?o:"todo",icon:''},{value:"doing",label:null!==(i=null===(r=window.i18n)||void 0===r?void 0:r["tip-status-doing"])&&void 0!==i?i:"doing",icon:''},{value:"done",label:null!==(l=null===(s=window.i18n)||void 0===s?void 0:s["tip-status-done"])&&void 0!==l?l:"done",icon:''},{value:"other",label:null!==(c=null===(a=window.i18n)||void 0===a?void 0:a["tip-status-other"])&&void 0!==c?c:"other",icon:''}];new be("#filter-button",d,{onClickItem:t=>{const{value:e}=t;document.querySelectorAll(".category .post-list li").forEach((t=>{var n;const o=t;if("all"===e)return o.classList.remove("selected");(null===(n=t.getAttribute("data-status"))||void 0===n?void 0:n.includes(e))?o.classList.add("selected"):o.classList.remove("selected")}))}})},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",we):we()})();