light-chain-open-ui 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -177,8 +177,8 @@ import { OPTIONS_ASPECT_RATIO } from 'light-chain-open-ui/options'
177
177
  默认样式会随组件一起工作。需要切换暗色主题时,引入主题样式并在页面上添加主题标记。
178
178
 
179
179
  ```ts
180
- import 'light-chain-open-ui/src/styles/themes/default.css'
181
- import 'light-chain-open-ui/src/styles/themes/dark.css'
180
+ import 'light-chain-open-ui/styles/themes/default.css'
181
+ import 'light-chain-open-ui/styles/themes/dark.css'
182
182
 
183
183
  document.documentElement.dataset.theme = 'dark'
184
184
  ```
@@ -222,12 +222,3 @@ document.documentElement.dataset.theme = 'dark'
222
222
  ]
223
223
  }
224
224
  ```
225
-
226
- ## 打包与发布
227
-
228
- ```bash
229
- npm run build
230
- npm publish --access public
231
- ```
232
-
233
- 如果 npm 开启了双因素认证,需要使用支持 publish 的 automation token,或在发布时输入 OTP。
@@ -1,4 +1,55 @@
1
- const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);require(`./react.cjs`);let n=require(`lit`);var r=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},i=globalThis,a=i.ShadowRoot&&(i.ShadyCSS===void 0||i.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap,c=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(a&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=s.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}},l=e=>new c(typeof e==`string`?e:e+``,void 0,o),u=(e,t)=>{if(a)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=i.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},d=a?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return l(t)})(e):e,{is:ee,defineProperty:te,getOwnPropertyDescriptor:ne,getOwnPropertyNames:re,getOwnPropertySymbols:ie,getPrototypeOf:ae}=Object,f=globalThis,oe=f.trustedTypes,se=oe?oe.emptyScript:``,ce=f.reactiveElementPolyfillSupport,p=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?se:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},le=(e,t)=>!ee(e,t),ue={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:le};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var h=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ue){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&te(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=ne(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ue}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ae(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...re(e),...ie(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(d(e))}else e!==void 0&&t.push(d(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?m:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?m:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??le)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};h.elementStyles=[],h.shadowRootOptions={mode:`open`},h[p(`elementProperties`)]=new Map,h[p(`finalized`)]=new Map,ce?.({ReactiveElement:h}),(f.reactiveElementVersions??=[]).push(`2.1.2`);var de={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:le},fe=(e=de,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function g(e){return(t,n)=>typeof n==`object`?fe(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function _(e){return g({...e,state:!0,attribute:!1})}var pe=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function me(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return pe(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return pe(n,r,{get(){return a(this)}})}}function v(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var y=class extends n.LitElement{constructor(...e){super(...e),this.name=``,this.label=``,this.hint=``,this.value=``,this.file=null,this.disabled=!1,this.showMaskHint=!1,this._previewUrl=``,this._errorMessage=``,this._isDragOver=!1}static{this.styles=n.css`
1
+ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);require(`./react.cjs`);let n=require(`lit`);var r=`light-chain-open-ui-theme`,i=`
2
+ :root {
3
+ --lc-color-blue-50: #eff6ff;
4
+ --lc-color-blue-100: #dbeafe;
5
+ --lc-color-blue-500: #3b82f6;
6
+ --lc-color-blue-600: #2563eb;
7
+ --lc-color-blue-700: #1d4ed8;
8
+ --lc-color-gray-50: #f9fafb;
9
+ --lc-color-gray-100: #f3f4f6;
10
+ --lc-color-gray-200: #e5e7eb;
11
+ --lc-color-gray-300: #d1d5db;
12
+ --lc-color-gray-500: #6b7280;
13
+ --lc-color-gray-700: #374151;
14
+ --lc-color-gray-900: #111827;
15
+ --lc-color-success: #10b981;
16
+ --lc-color-warning: #f59e0b;
17
+ --lc-color-error: #ef4444;
18
+ --lc-spacing-1: 4px;
19
+ --lc-spacing-2: 8px;
20
+ --lc-spacing-3: 12px;
21
+ --lc-spacing-4: 16px;
22
+ --lc-spacing-5: 20px;
23
+ --lc-spacing-6: 24px;
24
+ --lc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
25
+ --lc-font-size-xs: 12px;
26
+ --lc-font-size-sm: 14px;
27
+ --lc-font-size-base: 16px;
28
+ --lc-font-size-lg: 18px;
29
+ --lc-font-size-xl: 20px;
30
+ --lc-line-height: 1.5;
31
+ --lc-radius-sm: 4px;
32
+ --lc-radius-md: 8px;
33
+ --lc-radius-lg: 12px;
34
+ --lc-radius-full: 9999px;
35
+ --lc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
36
+ --lc-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
37
+ --lc-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
38
+ --lc-transition-fast: 150ms ease;
39
+ --lc-transition-normal: 200ms ease;
40
+ --lc-color-primary: var(--lc-color-blue-600);
41
+ --lc-color-primary-hover: var(--lc-color-blue-700);
42
+ --lc-color-primary-light: var(--lc-color-blue-50);
43
+ --lc-color-bg: #ffffff;
44
+ --lc-color-bg-secondary: var(--lc-color-gray-50);
45
+ --lc-color-border: var(--lc-color-gray-200);
46
+ --lc-color-text: var(--lc-color-gray-900);
47
+ --lc-color-text-secondary: var(--lc-color-gray-500);
48
+ --lc-color-text-placeholder: var(--lc-color-gray-300);
49
+ --lc-radius-component: var(--lc-radius-md);
50
+ --lc-spacing-component: var(--lc-spacing-4);
51
+ }
52
+ `;function a(){if(typeof document>`u`||document.getElementById(r))return;let e=document.createElement(`style`);e.id=r,e.textContent=i,document.head.append(e)}var o=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},s=globalThis,c=s.ShadowRoot&&(s.ShadyCSS===void 0||s.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,l=Symbol(),u=new WeakMap,d=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(c&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=u.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&u.set(t,e))}return e}toString(){return this.cssText}},ee=e=>new d(typeof e==`string`?e:e+``,void 0,l),te=(e,t)=>{if(c)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=s.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},ne=c?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ee(t)})(e):e,{is:re,defineProperty:ie,getOwnPropertyDescriptor:ae,getOwnPropertyNames:oe,getOwnPropertySymbols:se,getPrototypeOf:ce}=Object,f=globalThis,le=f.trustedTypes,ue=le?le.emptyScript:``,de=f.reactiveElementPolyfillSupport,p=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?ue:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},h=(e,t)=>!re(e,t),fe={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:h};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var g=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=fe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&ie(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=ae(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fe}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ce(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...oe(e),...se(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(ne(e))}else e!==void 0&&t.push(ne(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return te(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?m:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?m:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??h)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};g.elementStyles=[],g.shadowRootOptions={mode:`open`},g[p(`elementProperties`)]=new Map,g[p(`finalized`)]=new Map,de?.({ReactiveElement:g}),(f.reactiveElementVersions??=[]).push(`2.1.2`);var pe={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:h},me=(e=pe,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function _(e){return(t,n)=>typeof n==`object`?me(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function v(e){return _({...e,state:!0,attribute:!1})}var he=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function ge(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return he(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return he(n,r,{get(){return a(this)}})}}function y(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var b=class extends n.LitElement{constructor(...e){super(...e),this.name=``,this.label=``,this.hint=``,this.value=``,this.file=null,this.disabled=!1,this.showMaskHint=!1,this._previewUrl=``,this._errorMessage=``,this._isDragOver=!1}static{this.styles=n.css`
2
53
  :host {
3
54
  display: block;
4
55
  --lc-uploader-border-color: var(--lc-color-border);
@@ -183,7 +234,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
183
234
  &times;
184
235
  </button>
185
236
  </div>
186
- `}_renderMaskHint(){return n.html`<div class="mask-hint" part="hint">${this.hint||`Mask hint: white keeps the area, black removes the area`}</div>`}};v([g({type:String})],y.prototype,`name`,void 0),v([g({type:String})],y.prototype,`label`,void 0),v([g({type:String})],y.prototype,`hint`,void 0),v([g({type:String})],y.prototype,`value`,void 0),v([g({attribute:!1})],y.prototype,`file`,void 0),v([g({type:Boolean})],y.prototype,`disabled`,void 0),v([g({type:Boolean})],y.prototype,`showMaskHint`,void 0),v([_()],y.prototype,`_previewUrl`,void 0),v([_()],y.prototype,`_errorMessage`,void 0),v([_()],y.prototype,`_isDragOver`,void 0),v([me(`input[type="file"]`)],y.prototype,`_fileInput`,void 0),y=v([r(`lc-image-uploader`)],y);var b=class extends n.LitElement{constructor(...e){super(...e),this.label=`涂抹蒙版`,this.name=``,this.hint=``,this.required=!1,this.value=``,this.source=``,this.disabled=!1,this.brushSize=28,this._mode=`paint`,this._isDrawing=!1,this._errorMessage=``,this._aspectRatio=`1 / 1`,this._canUndo=!1,this._canRedo=!1,this._zoom=1,this._isSpacePressed=!1,this._isPanning=!1,this._panX=0,this._panY=0,this._lastPoint=null,this._lastPanPoint=null,this._history=[],this._historyIndex=-1,this._sourceWidth=0,this._sourceHeight=0}static{this.styles=n.css`
237
+ `}_renderMaskHint(){return n.html`<div class="mask-hint" part="hint">${this.hint||`Mask hint: white keeps the area, black removes the area`}</div>`}};y([_({type:String})],b.prototype,`name`,void 0),y([_({type:String})],b.prototype,`label`,void 0),y([_({type:String})],b.prototype,`hint`,void 0),y([_({type:String})],b.prototype,`value`,void 0),y([_({attribute:!1})],b.prototype,`file`,void 0),y([_({type:Boolean})],b.prototype,`disabled`,void 0),y([_({type:Boolean})],b.prototype,`showMaskHint`,void 0),y([v()],b.prototype,`_previewUrl`,void 0),y([v()],b.prototype,`_errorMessage`,void 0),y([v()],b.prototype,`_isDragOver`,void 0),y([ge(`input[type="file"]`)],b.prototype,`_fileInput`,void 0),b=y([o(`lc-image-uploader`)],b);var x=class extends n.LitElement{constructor(...e){super(...e),this.label=`涂抹蒙版`,this.name=``,this.hint=``,this.required=!1,this.value=``,this.source=``,this.disabled=!1,this.brushSize=28,this._mode=`paint`,this._isDrawing=!1,this._errorMessage=``,this._aspectRatio=`1 / 1`,this._canUndo=!1,this._canRedo=!1,this._zoom=1,this._isSpacePressed=!1,this._isPanning=!1,this._panX=0,this._panY=0,this._lastPoint=null,this._lastPanPoint=null,this._history=[],this._historyIndex=-1,this._sourceWidth=0,this._sourceHeight=0}static{this.styles=n.css`
187
238
  :host {
188
239
  display: block;
189
240
  --lc-mask-border-color: var(--lc-color-border);
@@ -393,7 +444,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
393
444
  <button type="button" @click=${()=>this._clearCanvas()}>清空</button>
394
445
  </div>
395
446
  </div>
396
- `}};v([g({type:String})],b.prototype,`label`,void 0),v([g({type:String})],b.prototype,`name`,void 0),v([g({type:String})],b.prototype,`hint`,void 0),v([g({type:Boolean})],b.prototype,`required`,void 0),v([g({type:String})],b.prototype,`value`,void 0),v([g({type:String})],b.prototype,`source`,void 0),v([g({type:Boolean})],b.prototype,`disabled`,void 0),v([g({type:Number})],b.prototype,`brushSize`,void 0),v([_()],b.prototype,`_mode`,void 0),v([_()],b.prototype,`_isDrawing`,void 0),v([_()],b.prototype,`_errorMessage`,void 0),v([_()],b.prototype,`_aspectRatio`,void 0),v([_()],b.prototype,`_canUndo`,void 0),v([_()],b.prototype,`_canRedo`,void 0),v([_()],b.prototype,`_zoom`,void 0),v([_()],b.prototype,`_isSpacePressed`,void 0),v([_()],b.prototype,`_isPanning`,void 0),v([_()],b.prototype,`_panX`,void 0),v([_()],b.prototype,`_panY`,void 0),v([me(`canvas`)],b.prototype,`_canvas`,void 0),b=v([r(`lc-mask-editor`)],b);var x=class extends n.LitElement{constructor(...e){super(...e),this.label=``,this.name=``,this.value=``,this.mode=`button`,this.multiple=!1,this.required=!1,this.disabled=!1,this.showIcon=!1,this.options=`[]`}static{this.styles=n.css`
447
+ `}};y([_({type:String})],x.prototype,`label`,void 0),y([_({type:String})],x.prototype,`name`,void 0),y([_({type:String})],x.prototype,`hint`,void 0),y([_({type:Boolean})],x.prototype,`required`,void 0),y([_({type:String})],x.prototype,`value`,void 0),y([_({type:String})],x.prototype,`source`,void 0),y([_({type:Boolean})],x.prototype,`disabled`,void 0),y([_({type:Number})],x.prototype,`brushSize`,void 0),y([v()],x.prototype,`_mode`,void 0),y([v()],x.prototype,`_isDrawing`,void 0),y([v()],x.prototype,`_errorMessage`,void 0),y([v()],x.prototype,`_aspectRatio`,void 0),y([v()],x.prototype,`_canUndo`,void 0),y([v()],x.prototype,`_canRedo`,void 0),y([v()],x.prototype,`_zoom`,void 0),y([v()],x.prototype,`_isSpacePressed`,void 0),y([v()],x.prototype,`_isPanning`,void 0),y([v()],x.prototype,`_panX`,void 0),y([v()],x.prototype,`_panY`,void 0),y([ge(`canvas`)],x.prototype,`_canvas`,void 0),x=y([o(`lc-mask-editor`)],x);var S=class extends n.LitElement{constructor(...e){super(...e),this.label=``,this.name=``,this.value=``,this.mode=`button`,this.multiple=!1,this.required=!1,this.disabled=!1,this.showIcon=!1,this.options=`[]`}static{this.styles=n.css`
397
448
  :host {
398
449
  display: block;
399
450
  font-family: var(--lc-font-family);
@@ -570,7 +621,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
570
621
  ${e.label}
571
622
  </option>`)}
572
623
  </select>
573
- `}};v([g({type:String})],x.prototype,`label`,void 0),v([g({type:String})],x.prototype,`name`,void 0),v([g()],x.prototype,`value`,void 0),v([g({type:String})],x.prototype,`mode`,void 0),v([g({type:Boolean})],x.prototype,`multiple`,void 0),v([g({type:Boolean})],x.prototype,`required`,void 0),v([g({type:Boolean})],x.prototype,`disabled`,void 0),v([g({type:Boolean,attribute:`show-icon`})],x.prototype,`showIcon`,void 0),v([g({type:String})],x.prototype,`options`,void 0),x=v([r(`lc-enum-selector`)],x);var S=class extends n.LitElement{constructor(...e){super(...e),this.value=``,this.name=``,this.label=``,this.placeholder=``,this.maxLength=500,this.required=!1,this.disabled=!1}static{this.styles=n.css`
624
+ `}};y([_({type:String})],S.prototype,`label`,void 0),y([_({type:String})],S.prototype,`name`,void 0),y([_()],S.prototype,`value`,void 0),y([_({type:String})],S.prototype,`mode`,void 0),y([_({type:Boolean})],S.prototype,`multiple`,void 0),y([_({type:Boolean})],S.prototype,`required`,void 0),y([_({type:Boolean})],S.prototype,`disabled`,void 0),y([_({type:Boolean,attribute:`show-icon`})],S.prototype,`showIcon`,void 0),y([_({type:String})],S.prototype,`options`,void 0),S=y([o(`lc-enum-selector`)],S);var C=class extends n.LitElement{constructor(...e){super(...e),this.value=``,this.name=``,this.label=``,this.placeholder=``,this.maxLength=500,this.required=!1,this.disabled=!1}static{this.styles=n.css`
574
625
  :host {
575
626
  display: block;
576
627
  font-family: var(--lc-font-family);
@@ -646,8 +697,8 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
646
697
  <div class="counter ${e?`over`:``}">
647
698
  ${this.value.length}/${this.maxLength}
648
699
  </div>
649
- `}};v([g({type:String})],S.prototype,`value`,void 0),v([g({type:String})],S.prototype,`name`,void 0),v([g({type:String})],S.prototype,`label`,void 0),v([g({type:String})],S.prototype,`placeholder`,void 0),v([g({type:Number})],S.prototype,`maxLength`,void 0),v([g({type:Boolean})],S.prototype,`required`,void 0),v([g({type:Boolean})],S.prototype,`disabled`,void 0),S=v([r(`lc-prompt-input`)],S);var C=globalThis,he=e=>e,w=C.trustedTypes,ge=w?w.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,T=`$lit$`,E=`lit$${Math.random().toFixed(9).slice(2)}$`,D=`?`+E,_e=`<${D}>`,O=document,k=()=>O.createComment(``),A=e=>e===null||typeof e!=`object`&&typeof e!=`function`,j=Array.isArray,ve=e=>j(e)||typeof e?.[Symbol.iterator]==`function`,M=`[
650
- \f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ye=/-->/g,be=/>/g,P=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),xe=/'/g,Se=/"/g,Ce=/^(?:script|style|textarea|title)$/i,F=Symbol.for(`lit-noChange`),I=Symbol.for(`lit-nothing`),we=new WeakMap,L=O.createTreeWalker(O,129);function Te(e,t){if(!j(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ge===void 0?t:ge.createHTML(t)}var Ee=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=N;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===N?c[1]===`!--`?o=ye:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=P):(Ce.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=P):o=be:o===P?c[0]===`>`?(o=i??N,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?P:c[3]===`"`?Se:xe):o===Se||o===xe?o=P:o===ye||o===be?o=N:(o=P,i=void 0);let d=o===P&&e[t+1].startsWith(`/>`)?` `:``;a+=o===N?n+_e:l>=0?(r.push(s),n.slice(0,l)+T+n.slice(l)+E+d):n+E+(l===-2?t:d)}return[Te(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},R=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Ee(t,n);if(this.el=e.createElement(l,r),L.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=L.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(T)){let t=u[o++],n=i.getAttribute(e).split(E),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Oe:r[1]===`?`?ke:r[1]===`@`?Ae:V}),i.removeAttribute(e)}else e.startsWith(E)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Ce.test(i.tagName)){let e=i.textContent.split(E),t=e.length-1;if(t>0){i.textContent=w?w.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],k()),L.nextNode(),c.push({type:2,index:++a});i.append(e[t],k())}}}else if(i.nodeType===8)if(i.data===D)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(E,e+1))!==-1;)c.push({type:7,index:a}),e+=E.length-1}a++}}static createElement(e,t){let n=O.createElement(`template`);return n.innerHTML=e,n}};function z(e,t,n=e,r){if(t===F)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=A(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=z(e,i._$AS(e,t.values),i,r)),t}var De=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??O).importNode(t,!0);L.currentNode=r;let i=L.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new B(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new je(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=L.nextNode(),a++)}return L.currentNode=O,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},B=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=z(this,e,t),A(e)?e===I||e==null||e===``?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==F&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ve(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=R.createElement(Te(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new De(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=we.get(e.strings);return t===void 0&&we.set(e.strings,t=new R(e)),t}k(t){j(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(k()),this.O(k()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=he(e).nextSibling;he(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},V=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=I}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=z(this,e,t,0),a=!A(e)||e!==this._$AH&&e!==F,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=z(this,r[n+o],t,o),s===F&&(s=this._$AH[o]),a||=!A(s)||s!==this._$AH[o],s===I?e=I:e!==I&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Oe=class extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}},ke=class extends V{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}},Ae=class extends V{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??I)===F)return;let n=this._$AH,r=e===I&&n!==I||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==I&&(n===I||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},je=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){z(this,e)}},Me={M:T,P:E,A:D,C:1,L:Ee,R:De,D:ve,V:z,I:B,H:V,N:ke,U:Ae,B:Oe,F:je},Ne=C.litHtmlPolyfillSupport;Ne?.(R,B),(C.litHtmlVersions??=[]).push(`3.3.3`);var{I:Pe}=Me,Fe=e=>e.strings===void 0,Ie={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Le=e=>(...t)=>({_$litDirective$:e,values:t}),Re=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},H=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),H(e,t);return!0},U=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},ze=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),He(t)}};function Be(e){this._$AN===void 0?this._$AM=e:(U(this),this._$AM=e,ze(this))}function Ve(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)H(r[e],!1),U(r[e]);else r!=null&&(H(r,!1),U(r));else H(this,e)}var He=e=>{e.type==Ie.CHILD&&(e._$AP??=Ve,e._$AQ??=Be)},Ue=class extends Re{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),ze(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(H(this,e),U(this))}setValue(e){if(Fe(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},We=()=>new Ge,Ge=class{},W=new WeakMap,Ke=Le(class extends Ue{render(e){return I}update(e,[t]){let n=t!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),I}rt(e){if(this.G!==void 0)if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=W.get(t);n===void 0&&(n=new WeakMap,W.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?W.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),G=class extends n.LitElement{constructor(...e){super(...e),this.value=``,this.name=``,this.label=``,this.disabled=!1,this.colorInputRef=We()}static{this.styles=n.css`
700
+ `}};y([_({type:String})],C.prototype,`value`,void 0),y([_({type:String})],C.prototype,`name`,void 0),y([_({type:String})],C.prototype,`label`,void 0),y([_({type:String})],C.prototype,`placeholder`,void 0),y([_({type:Number})],C.prototype,`maxLength`,void 0),y([_({type:Boolean})],C.prototype,`required`,void 0),y([_({type:Boolean})],C.prototype,`disabled`,void 0),C=y([o(`lc-prompt-input`)],C);var w=globalThis,_e=e=>e,T=w.trustedTypes,ve=T?T.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,E=`$lit$`,D=`lit$${Math.random().toFixed(9).slice(2)}$`,ye=`?`+D,be=`<${ye}>`,O=document,k=()=>O.createComment(``),A=e=>e===null||typeof e!=`object`&&typeof e!=`function`,j=Array.isArray,xe=e=>j(e)||typeof e?.[Symbol.iterator]==`function`,M=`[
701
+ \f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ce=/>/g,P=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),we=/'/g,Te=/"/g,Ee=/^(?:script|style|textarea|title)$/i,F=Symbol.for(`lit-noChange`),I=Symbol.for(`lit-nothing`),De=new WeakMap,L=O.createTreeWalker(O,129);function Oe(e,t){if(!j(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ve===void 0?t:ve.createHTML(t)}var ke=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=N;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===N?c[1]===`!--`?o=Se:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=P):(Ee.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=P):o=Ce:o===P?c[0]===`>`?(o=i??N,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?P:c[3]===`"`?Te:we):o===Te||o===we?o=P:o===Se||o===Ce?o=N:(o=P,i=void 0);let d=o===P&&e[t+1].startsWith(`/>`)?` `:``;a+=o===N?n+be:l>=0?(r.push(s),n.slice(0,l)+E+n.slice(l)+D+d):n+D+(l===-2?t:d)}return[Oe(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},R=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=ke(t,n);if(this.el=e.createElement(l,r),L.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=L.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(E)){let t=u[o++],n=i.getAttribute(e).split(D),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?je:r[1]===`?`?Me:r[1]===`@`?Ne:V}),i.removeAttribute(e)}else e.startsWith(D)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Ee.test(i.tagName)){let e=i.textContent.split(D),t=e.length-1;if(t>0){i.textContent=T?T.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],k()),L.nextNode(),c.push({type:2,index:++a});i.append(e[t],k())}}}else if(i.nodeType===8)if(i.data===ye)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(D,e+1))!==-1;)c.push({type:7,index:a}),e+=D.length-1}a++}}static createElement(e,t){let n=O.createElement(`template`);return n.innerHTML=e,n}};function z(e,t,n=e,r){if(t===F)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=A(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=z(e,i._$AS(e,t.values),i,r)),t}var Ae=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??O).importNode(t,!0);L.currentNode=r;let i=L.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new B(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Pe(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=L.nextNode(),a++)}return L.currentNode=O,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},B=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=z(this,e,t),A(e)?e===I||e==null||e===``?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==F&&this._(e):e._$litType$===void 0?e.nodeType===void 0?xe(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=R.createElement(Oe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Ae(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=De.get(e.strings);return t===void 0&&De.set(e.strings,t=new R(e)),t}k(t){j(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(k()),this.O(k()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=_e(e).nextSibling;_e(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},V=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=I}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=z(this,e,t,0),a=!A(e)||e!==this._$AH&&e!==F,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=z(this,r[n+o],t,o),s===F&&(s=this._$AH[o]),a||=!A(s)||s!==this._$AH[o],s===I?e=I:e!==I&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},je=class extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}},Me=class extends V{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}},Ne=class extends V{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??I)===F)return;let n=this._$AH,r=e===I&&n!==I||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==I&&(n===I||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Pe=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){z(this,e)}},Fe={M:E,P:D,A:ye,C:1,L:ke,R:Ae,D:xe,V:z,I:B,H:V,N:Me,U:Ne,B:je,F:Pe},Ie=w.litHtmlPolyfillSupport;Ie?.(R,B),(w.litHtmlVersions??=[]).push(`3.3.3`);var{I:Le}=Fe,Re=e=>e.strings===void 0,ze={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Be=e=>(...t)=>({_$litDirective$:e,values:t}),Ve=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},H=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),H(e,t);return!0},U=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},He=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Ge(t)}};function Ue(e){this._$AN===void 0?this._$AM=e:(U(this),this._$AM=e,He(this))}function We(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)H(r[e],!1),U(r[e]);else r!=null&&(H(r,!1),U(r));else H(this,e)}var Ge=e=>{e.type==ze.CHILD&&(e._$AP??=We,e._$AQ??=Ue)},Ke=class extends Ve{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),He(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(H(this,e),U(this))}setValue(e){if(Re(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},qe=()=>new Je,Je=class{},W=new WeakMap,Ye=Be(class extends Ke{render(e){return I}update(e,[t]){let n=t!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),I}rt(e){if(this.G!==void 0)if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=W.get(t);n===void 0&&(n=new WeakMap,W.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?W.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),G=class extends n.LitElement{constructor(...e){super(...e),this.value=``,this.name=``,this.label=``,this.disabled=!1,this.colorInputRef=qe()}static{this.styles=n.css`
651
702
  :host {
652
703
  display: block;
653
704
  font-family: var(--lc-font-family);
@@ -722,7 +773,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
722
773
  .value=${e}
723
774
  ?disabled=${this.disabled}
724
775
  @input=${this.handleColorInput}
725
- ${Ke(this.colorInputRef)}
776
+ ${Ye(this.colorInputRef)}
726
777
  />
727
778
  <div
728
779
  class="preview ${this.disabled?`disabled`:``}"
@@ -738,7 +789,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
738
789
  @input=${this.handleHexInput}
739
790
  />
740
791
  </div>
741
- `}};v([g({type:String})],G.prototype,`value`,void 0),v([g({type:String})],G.prototype,`name`,void 0),v([g({type:String})],G.prototype,`label`,void 0),v([g({type:Boolean})],G.prototype,`disabled`,void 0),G=v([r(`lc-color-picker`)],G);var K=class extends n.LitElement{constructor(...e){super(...e),this.value=.5,this.min=0,this.max=1,this.step=.1,this.name=``,this.label=``,this.disabled=!1}static{this.styles=n.css`
792
+ `}};y([_({type:String})],G.prototype,`value`,void 0),y([_({type:String})],G.prototype,`name`,void 0),y([_({type:String})],G.prototype,`label`,void 0),y([_({type:Boolean})],G.prototype,`disabled`,void 0),G=y([o(`lc-color-picker`)],G);var K=class extends n.LitElement{constructor(...e){super(...e),this.value=.5,this.min=0,this.max=1,this.step=.1,this.name=``,this.label=``,this.disabled=!1}static{this.styles=n.css`
742
793
  :host {
743
794
  display: block;
744
795
  font-family: var(--lc-font-family);
@@ -786,7 +837,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
786
837
  />
787
838
  <span class="value-display">${this.value}</span>
788
839
  </div>
789
- `}};v([g({type:Number})],K.prototype,`value`,void 0),v([g({type:Number})],K.prototype,`min`,void 0),v([g({type:Number})],K.prototype,`max`,void 0),v([g({type:Number})],K.prototype,`step`,void 0),v([g({type:String})],K.prototype,`name`,void 0),v([g({type:String})],K.prototype,`label`,void 0),v([g({type:Boolean})],K.prototype,`disabled`,void 0),K=v([r(`lc-strength-slider`)],K);var qe={pending:`等待中`,running:`运行中`,done:`已完成`,exception:`异常`},q=class extends n.LitElement{constructor(...e){super(...e),this.taskId=``,this.status=`pending`,this.progress=0,this.queuePos=-1,this.errorMessage=``,this.submittedAt=0}static{this.styles=n.css`
840
+ `}};y([_({type:Number})],K.prototype,`value`,void 0),y([_({type:Number})],K.prototype,`min`,void 0),y([_({type:Number})],K.prototype,`max`,void 0),y([_({type:Number})],K.prototype,`step`,void 0),y([_({type:String})],K.prototype,`name`,void 0),y([_({type:String})],K.prototype,`label`,void 0),y([_({type:Boolean})],K.prototype,`disabled`,void 0),K=y([o(`lc-strength-slider`)],K);var Xe={pending:`等待中`,running:`运行中`,done:`已完成`,exception:`异常`},q=class extends n.LitElement{constructor(...e){super(...e),this.taskId=``,this.status=`pending`,this.progress=0,this.queuePos=-1,this.errorMessage=``,this.submittedAt=0}static{this.styles=n.css`
790
841
  :host {
791
842
  display: block;
792
843
  --lc-progress-height: 8px;
@@ -869,7 +920,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
869
920
  </div>
870
921
  <div class="meta">
871
922
  <span class="status-dot" style=${r}></span>
872
- <span part="status">${qe[this.status]}</span>
923
+ <span part="status">${Xe[this.status]}</span>
873
924
  ${this.queuePos>=0?n.html`<span class="separator">·</span><span>队列位置: ${this.queuePos}</span>`:null}
874
925
  </div>
875
926
  ${this.submittedAt?n.html`<div class="meta" style="margin-top: var(--lc-spacing-1)">
@@ -877,7 +928,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
877
928
  </div>`:null}
878
929
  ${this.status===`exception`&&this.errorMessage?n.html`<div class="error-message">${this.errorMessage}</div>`:null}
879
930
  </div>
880
- `}};v([g({type:String})],q.prototype,`taskId`,void 0),v([g({type:String})],q.prototype,`status`,void 0),v([g({type:Number})],q.prototype,`progress`,void 0),v([g({type:Number})],q.prototype,`queuePos`,void 0),v([g({type:String})],q.prototype,`errorMessage`,void 0),v([g({type:Number})],q.prototype,`submittedAt`,void 0),q=v([r(`lc-task-progress-card`)],q);var J=class extends n.LitElement{constructor(...e){super(...e),this.images=`[]`,this.originalUrl=``,this.showDownload=!0}static{this.styles=n.css`
931
+ `}};y([_({type:String})],q.prototype,`taskId`,void 0),y([_({type:String})],q.prototype,`status`,void 0),y([_({type:Number})],q.prototype,`progress`,void 0),y([_({type:Number})],q.prototype,`queuePos`,void 0),y([_({type:String})],q.prototype,`errorMessage`,void 0),y([_({type:Number})],q.prototype,`submittedAt`,void 0),q=y([o(`lc-task-progress-card`)],q);var J=class extends n.LitElement{constructor(...e){super(...e),this.images=`[]`,this.originalUrl=``,this.showDownload=!0}static{this.styles=n.css`
881
932
  :host {
882
933
  display: block;
883
934
  --lc-gallery-gap: var(--lc-spacing-3);
@@ -951,7 +1002,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
951
1002
  <div class="gallery">
952
1003
  ${this.getParsedImages().map(e=>this.renderImageItem(e))}
953
1004
  </div>
954
- `}};v([g({type:String})],J.prototype,`images`,void 0),v([g({type:String})],J.prototype,`originalUrl`,void 0),v([g({type:Boolean})],J.prototype,`showDownload`,void 0),J=v([r(`lc-result-gallery`)],J);var Y=class extends n.LitElement{constructor(...e){super(...e),this.beforeSrc=``,this.afterSrc=``,this.beforeLabel=`原图`,this.afterLabel=`结果`,this._position=50}static{this.styles=n.css`
1005
+ `}};y([_({type:String})],J.prototype,`images`,void 0),y([_({type:String})],J.prototype,`originalUrl`,void 0),y([_({type:Boolean})],J.prototype,`showDownload`,void 0),J=y([o(`lc-result-gallery`)],J);var Y=class extends n.LitElement{constructor(...e){super(...e),this.beforeSrc=``,this.afterSrc=``,this.beforeLabel=`原图`,this.afterLabel=`结果`,this._position=50}static{this.styles=n.css`
955
1006
  :host {
956
1007
  display: block;
957
1008
  --lc-compare-width: 100%;
@@ -1047,11 +1098,11 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
1047
1098
  <span class="label label-before">${this.beforeLabel}</span>
1048
1099
  <span class="label label-after">${this.afterLabel}</span>
1049
1100
  </div>
1050
- `}};v([g({type:String})],Y.prototype,`beforeSrc`,void 0),v([g({type:String})],Y.prototype,`afterSrc`,void 0),v([g({type:String})],Y.prototype,`beforeLabel`,void 0),v([g({type:String})],Y.prototype,`afterLabel`,void 0),v([_()],Y.prototype,`_position`,void 0),Y=v([r(`lc-image-compare-slider`)],Y);var X=t.P,Z=t.o,Q=class extends n.LitElement{constructor(...n){super(...n),this.type=``,this.submitEndpoint=``,this.pollEndpoint=t.N.POLL_ENDPOINT,this.pollInterval=t.N.POLL_INTERVAL,this.maxPollAttempts=t.N.MAX_POLL_ATTEMPTS,this.phase=X.IDLE,this.taskId=``,this.progress=0,this.result=null,this.error=``,this._defaultClient=new e.t}get typeDef(){return this._syncClientConfig(),this._activeClient.typeDef}get taskFields(){return this.typeDef?.fields??[]}async submit(e){this.phase===X.SUBMITTING||this.phase===X.POLLING||(this._syncClientConfig(),this.phase=X.SUBMITTING,this.error=``,this.progress=0,this.result=null,await this._activeClient.submit(this.type||this._activeClient.type,e),this._syncStateFromClient())}reset(){this._activeClient.reset(),this._syncStateFromClient()}async _handleFormSubmit(e){e.preventDefault(),await this.submit(this.collectFormData())}_handleClick(e){e.composedPath().find(e=>e instanceof HTMLElement?(e.type||e.getAttribute(`type`))===`submit`:!1)&&(e.preventDefault(),this.submit(this.collectFormData()))}_handleChildChange(e){let t=e.target;if(!(t instanceof HTMLElement))return;let n=Je(t);if(!n)return;let r=Ze(e)??Ye(t);r!==void 0&&(t.value=r,this._syncMaskSources(n,r))}_syncMaskSources(e,t){this.taskFields.find(t=>t.name===e)?.type===`image`&&(typeof t!=`string`||!t||this.querySelectorAll(`lc-mask-editor`).forEach(e=>{let n=e;n.source||=t}))}collectFormData(){let e={},t=this.querySelectorAll(`*`),n=new Map(this.taskFields.map(e=>[e.name,e]));return t.forEach(t=>{let r=Je(t);if(!r)return;let i=Xe(t);n.get(r)?.type===`images`&&typeof i==`string`&&i&&(i=[i]),n.get(r)?.type===`multiEnum`&&typeof i==`string`&&i&&(i=Qe(i)),i!==void 0&&(e[r]=i)}),e}get _activeClient(){return this.client??this._defaultClient}_syncClientConfig(){let e={customRequest:this.customRequest,customUploadRequest:this.customUploadRequest,onSubmit:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.SUBMIT,{detail:e,bubbles:!0,composed:!0}))},onPoll:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.POLL,{detail:e,bubbles:!0,composed:!0}))},onSuccess:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.SUCCESS,{detail:e,bubbles:!0,composed:!0}))},onError:e=>this._fail(e.message,e.phase)};this.client?(this.type&&(e.type=this.type),this.submitEndpoint&&(e.submitEndpoint=this.submitEndpoint),this.pollEndpoint!==t.N.POLL_ENDPOINT&&(e.pollEndpoint=this.pollEndpoint),this.pollInterval!==t.N.POLL_INTERVAL&&(e.pollInterval=this.pollInterval),this.maxPollAttempts!==t.N.MAX_POLL_ATTEMPTS&&(e.maxPollAttempts=this.maxPollAttempts)):(e.type=this.type,this.submitEndpoint&&(e.submitEndpoint=this.submitEndpoint),e.pollEndpoint=this.pollEndpoint,e.pollInterval=this.pollInterval,e.maxPollAttempts=this.maxPollAttempts),this._activeClient.configure(e)}_syncStateFromClient(){let e=this._activeClient;this.phase=e.phase,this.taskId=e.taskId,this.progress=e.progress,this.result=e.result,this.error=e.error}_fail(e,t){this.phase=X.ERROR,this.error=e,this.dispatchEvent(new CustomEvent(Z.ERROR,{detail:{message:e,phase:t},bubbles:!0,composed:!0}))}render(){return n.html`
1101
+ `}};y([_({type:String})],Y.prototype,`beforeSrc`,void 0),y([_({type:String})],Y.prototype,`afterSrc`,void 0),y([_({type:String})],Y.prototype,`beforeLabel`,void 0),y([_({type:String})],Y.prototype,`afterLabel`,void 0),y([v()],Y.prototype,`_position`,void 0),Y=y([o(`lc-image-compare-slider`)],Y);var X=t.P,Z=t.o,Q=class extends n.LitElement{constructor(...n){super(...n),this.type=``,this.submitEndpoint=``,this.pollEndpoint=t.N.POLL_ENDPOINT,this.pollInterval=t.N.POLL_INTERVAL,this.maxPollAttempts=t.N.MAX_POLL_ATTEMPTS,this.phase=X.IDLE,this.taskId=``,this.progress=0,this.result=null,this.error=``,this._defaultClient=new e.t}get typeDef(){return this._syncClientConfig(),this._activeClient.typeDef}get taskFields(){return this.typeDef?.fields??[]}async submit(e){this.phase===X.SUBMITTING||this.phase===X.POLLING||(this._syncClientConfig(),this.phase=X.SUBMITTING,this.error=``,this.progress=0,this.result=null,await this._activeClient.submit(this.type||this._activeClient.type,e),this._syncStateFromClient())}reset(){this._activeClient.reset(),this._syncStateFromClient()}async _handleFormSubmit(e){e.preventDefault(),await this.submit(this.collectFormData())}_handleClick(e){e.composedPath().find(e=>e instanceof HTMLElement?(e.type||e.getAttribute(`type`))===`submit`:!1)&&(e.preventDefault(),this.submit(this.collectFormData()))}_handleChildChange(e){let t=e.target;if(!(t instanceof HTMLElement))return;let n=Ze(t);if(!n)return;let r=et(e)??Qe(t);r!==void 0&&(t.value=r,this._syncMaskSources(n,r))}_syncMaskSources(e,t){this.taskFields.find(t=>t.name===e)?.type===`image`&&(typeof t!=`string`||!t||this.querySelectorAll(`lc-mask-editor`).forEach(e=>{let n=e;n.source||=t}))}collectFormData(){let e={},t=this.querySelectorAll(`*`),n=new Map(this.taskFields.map(e=>[e.name,e]));return t.forEach(t=>{let r=Ze(t);if(!r)return;let i=$e(t);n.get(r)?.type===`images`&&typeof i==`string`&&i&&(i=[i]),n.get(r)?.type===`multiEnum`&&typeof i==`string`&&i&&(i=tt(i)),i!==void 0&&(e[r]=i)}),e}get _activeClient(){return this.client??this._defaultClient}_syncClientConfig(){let e={customRequest:this.customRequest,customUploadRequest:this.customUploadRequest,onSubmit:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.SUBMIT,{detail:e,bubbles:!0,composed:!0}))},onPoll:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.POLL,{detail:e,bubbles:!0,composed:!0}))},onSuccess:e=>{this._syncStateFromClient(),this.dispatchEvent(new CustomEvent(Z.SUCCESS,{detail:e,bubbles:!0,composed:!0}))},onError:e=>this._fail(e.message,e.phase)};this.client?(this.type&&(e.type=this.type),this.submitEndpoint&&(e.submitEndpoint=this.submitEndpoint),this.pollEndpoint!==t.N.POLL_ENDPOINT&&(e.pollEndpoint=this.pollEndpoint),this.pollInterval!==t.N.POLL_INTERVAL&&(e.pollInterval=this.pollInterval),this.maxPollAttempts!==t.N.MAX_POLL_ATTEMPTS&&(e.maxPollAttempts=this.maxPollAttempts)):(e.type=this.type,this.submitEndpoint&&(e.submitEndpoint=this.submitEndpoint),e.pollEndpoint=this.pollEndpoint,e.pollInterval=this.pollInterval,e.maxPollAttempts=this.maxPollAttempts),this._activeClient.configure(e)}_syncStateFromClient(){let e=this._activeClient;this.phase=e.phase,this.taskId=e.taskId,this.progress=e.progress,this.result=e.result,this.error=e.error}_fail(e,t){this.phase=X.ERROR,this.error=e,this.dispatchEvent(new CustomEvent(Z.ERROR,{detail:{message:e,phase:t},bubbles:!0,composed:!0}))}render(){return n.html`
1051
1102
  <form @submit=${this._handleFormSubmit} @click=${this._handleClick} @change=${this._handleChildChange}>
1052
1103
  <slot></slot>
1053
1104
  </form>
1054
- `}};v([g({type:String})],Q.prototype,`type`,void 0),v([g({type:String,attribute:`submit-endpoint`})],Q.prototype,`submitEndpoint`,void 0),v([g({type:String,attribute:`poll-endpoint`})],Q.prototype,`pollEndpoint`,void 0),v([g({type:Number})],Q.prototype,`pollInterval`,void 0),v([g({type:Number})],Q.prototype,`maxPollAttempts`,void 0),v([g({attribute:!1})],Q.prototype,`client`,void 0),v([g({attribute:!1})],Q.prototype,`customRequest`,void 0),v([g({attribute:!1})],Q.prototype,`customUploadRequest`,void 0),v([_()],Q.prototype,`phase`,void 0),v([_()],Q.prototype,`taskId`,void 0),v([_()],Q.prototype,`progress`,void 0),v([_()],Q.prototype,`result`,void 0),v([_()],Q.prototype,`error`,void 0),Q=v([r(`lc-task-workflow`)],Q);function Je(e){return e.name||e.getAttribute(`name`)||``}function Ye(e){let t=e.value;if(t!==void 0)return t;if(e.hasAttribute(`value`))return e.getAttribute(`value`)??``}function Xe(e){return e.file||Ye(e)}function Ze(e){let t=e.detail;if(t){if(`value`in t)return t.value;if(`file`in t)return t.file}}function Qe(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.map(String)}catch{}return e.split(`,`).map(e=>e.trim()).filter(Boolean)}var $=class extends n.LitElement{constructor(...e){super(...e),this.type=`button`,this.variant=`primary`,this.disabled=!1}static{this.styles=n.css`
1105
+ `}};y([_({type:String})],Q.prototype,`type`,void 0),y([_({type:String,attribute:`submit-endpoint`})],Q.prototype,`submitEndpoint`,void 0),y([_({type:String,attribute:`poll-endpoint`})],Q.prototype,`pollEndpoint`,void 0),y([_({type:Number})],Q.prototype,`pollInterval`,void 0),y([_({type:Number})],Q.prototype,`maxPollAttempts`,void 0),y([_({attribute:!1})],Q.prototype,`client`,void 0),y([_({attribute:!1})],Q.prototype,`customRequest`,void 0),y([_({attribute:!1})],Q.prototype,`customUploadRequest`,void 0),y([v()],Q.prototype,`phase`,void 0),y([v()],Q.prototype,`taskId`,void 0),y([v()],Q.prototype,`progress`,void 0),y([v()],Q.prototype,`result`,void 0),y([v()],Q.prototype,`error`,void 0),Q=y([o(`lc-task-workflow`)],Q);function Ze(e){return e.name||e.getAttribute(`name`)||``}function Qe(e){let t=e.value;if(t!==void 0)return t;if(e.hasAttribute(`value`))return e.getAttribute(`value`)??``}function $e(e){return e.file||Qe(e)}function et(e){let t=e.detail;if(t){if(`value`in t)return t.value;if(`file`in t)return t.file}}function tt(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.map(String)}catch{}return e.split(`,`).map(e=>e.trim()).filter(Boolean)}var $=class extends n.LitElement{constructor(...e){super(...e),this.type=`button`,this.variant=`primary`,this.disabled=!1}static{this.styles=n.css`
1055
1106
  :host {
1056
1107
  display: inline-block;
1057
1108
  --lc-button-bg: var(--lc-color-primary);
@@ -1094,8 +1145,8 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
1094
1145
  --lc-button-color: var(--lc-color-text);
1095
1146
  --lc-button-border: 1px solid var(--lc-color-border);
1096
1147
  }
1097
- `}handleClick(e){e.stopPropagation(),!this.disabled&&this.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,composed:!0,cancelable:!0}))}render(){return n.html`
1148
+ `}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.type!==`submit`&&this.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,composed:!0,cancelable:!0}))}render(){return n.html`
1098
1149
  <button type=${this.type} ?disabled=${this.disabled} part="button" @click=${this.handleClick}>
1099
1150
  <slot></slot>
1100
1151
  </button>
1101
- `}};v([g({type:String})],$.prototype,`type`,void 0),v([g({type:String,reflect:!0})],$.prototype,`variant`,void 0),v([g({type:Boolean})],$.prototype,`disabled`,void 0),$=v([r(`lc-button`)],$),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return b}});
1152
+ `}};y([_({type:String})],$.prototype,`type`,void 0),y([_({type:String,reflect:!0})],$.prototype,`variant`,void 0),y([_({type:Boolean})],$.prototype,`disabled`,void 0),$=y([o(`lc-button`)],$),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return x}});