best-unit 0.0.7 → 0.0.8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Me(){console.log("npm package test!!!")}function De(){console.log("Current time:",new Date().toISOString())}var D,d,ye,$,oe,ge,be,ke,Z,J,K,M={},we=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function C(e,t){for(var _ in t)e[_]=t[_];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,_){var n,o,r,l={};for(r in t)r=="key"?n=t[r]:r=="ref"?o=t[r]:l[r]=t[r];if(arguments.length>2&&(l.children=arguments.length>3?D.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)l[r]===void 0&&(l[r]=e.defaultProps[r]);return L(e,l,n,o,null)}function L(e,t,_,n,o){var r={type:e,props:t,key:_,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++ye,__i:-1,__u:0};return o==null&&d.vnode!=null&&d.vnode(r),r}function q(e){return e.children}function I(e,t){this.props=e,this.context=t}function P(e,t){if(t==null)return e.__?P(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?P(e):null}function xe(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return xe(e)}}function ie(e){(!e.__d&&(e.__d=!0)&&$.push(e)&&!R.__r++||oe!=d.debounceRendering)&&((oe=d.debounceRendering)||ge)(R)}function R(){for(var e,t,_,n,o,r,l,u=1;$.length;)$.length>u&&$.sort(be),e=$.shift(),u=$.length,e.__d&&(_=void 0,o=(n=(t=e).__v).__e,r=[],l=[],t.__P&&((_=C({},n)).__v=n.__v+1,d.vnode&&d.vnode(_),te(t.__P,_,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,r,o??P(n),!!(32&n.__u),l),_.__v=n.__v,_.__.__k[_.__i]=_,$e(r,_,l),_.__e!=o&&xe(_)));R.__r=0}function Ce(e,t,_,n,o,r,l,u,c,s,f){var i,p,a,g,w,b,h=n&&n.__k||we,m=t.length;for(c=Oe(_,t,h,c,m),i=0;i<m;i++)(a=_.__k[i])!=null&&(p=a.__i==-1?M:h[a.__i]||M,a.__i=i,b=te(e,a,p,o,r,l,u,c,s,f),g=a.__e,a.ref&&p.ref!=a.ref&&(p.ref&&_e(p.ref,null,a),f.push(a.ref,a.__c||g,a)),w==null&&g!=null&&(w=g),4&a.__u||p.__k===a.__k?c=Se(a,c,e):typeof a.type=="function"&&b!==void 0?c=b:g&&(c=g.nextSibling),a.__u&=-7);return _.__e=w,c}function Oe(e,t,_,n,o){var r,l,u,c,s,f=_.length,i=f,p=0;for(e.__k=new Array(o),r=0;r<o;r++)(l=t[r])!=null&&typeof l!="boolean"&&typeof l!="function"?(c=r+p,(l=e.__k[r]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?L(null,l,null,null,null):B(l)?L(q,{children:l},null,null,null):l.constructor==null&&l.__b>0?L(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,u=null,(s=l.__i=je(l,_,c,i))!=-1&&(i--,(u=_[s])&&(u.__u|=2)),u==null||u.__v==null?(s==-1&&(o>f?p--:o<f&&p++),typeof l.type!="function"&&(l.__u|=4)):s!=c&&(s==c-1?p--:s==c+1?p++:(s>c?p--:p++,l.__u|=4))):e.__k[r]=null;if(i)for(r=0;r<f;r++)(u=_[r])!=null&&(2&u.__u)==0&&(u.__e==n&&(n=P(u)),Pe(u,u));return n}function Se(e,t,_){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=Se(n[o],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=P(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function je(e,t,_,n){var o,r,l=e.key,u=e.type,c=t[_];if(c===null&&e.key==null||c&&l==c.key&&u==c.type&&(2&c.__u)==0)return _;if(n>(c!=null&&(2&c.__u)==0?1:0))for(o=_-1,r=_+1;o>=0||r<t.length;){if(o>=0){if((c=t[o])&&(2&c.__u)==0&&l==c.key&&u==c.type)return o;o--}if(r<t.length){if((c=t[r])&&(2&c.__u)==0&&l==c.key&&u==c.type)return r;r++}}return-1}function le(e,t,_){t[0]=="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Fe.test(t)?_:_+"px"}function j(e,t,_,n,o){var r,l;e:if(t=="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)_&&t in _||le(e.style,t,"");if(_)for(t in _)n&&_[t]==n[t]||le(e.style,t,_[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(ke,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=_,_?n?_.u=n.u:(_.u=Z,e.addEventListener(t,r?K:J,r)):e.removeEventListener(t,r?K:J,r);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function ue(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Z++;else if(t.t<_.u)return;return _(d.event?d.event(t):t)}}}function te(e,t,_,n,o,r,l,u,c,s){var f,i,p,a,g,w,b,h,m,T,S,F,H,re,O,N,V,x=t.type;if(t.constructor!=null)return null;128&_.__u&&(c=!!(32&_.__u),r=[u=t.__e=_.__e]),(f=d.__b)&&f(t);e:if(typeof x=="function")try{if(h=t.props,m="prototype"in x&&x.prototype.render,T=(f=x.contextType)&&n[f.__c],S=f?T?T.props.value:f.__:n,_.__c?b=(i=t.__c=_.__c).__=i.__E:(m?t.__c=i=new x(h,S):(t.__c=i=new I(h,S),i.constructor=x,i.render=We),T&&T.sub(i),i.props=h,i.state||(i.state={}),i.context=S,i.__n=n,p=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&x.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,x.getDerivedStateFromProps(h,i.__s))),a=i.props,g=i.state,i.__v=t,p)m&&x.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&x.getDerivedStateFromProps==null&&h!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,S),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,S)===!1||t.__v==_.__v){for(t.__v!=_.__v&&(i.props=h,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.some(function(U){U&&(U.__=t)}),F=0;F<i._sb.length;F++)i.__h.push(i._sb[F]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,S),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,g,w)})}if(i.context=S,i.props=h,i.__P=e,i.__e=!1,H=d.__r,re=0,m){for(i.state=i.__s,i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),O=0;O<i._sb.length;O++)i.__h.push(i._sb[O]);i._sb=[]}else do i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++re<25);i.state=i.__s,i.getChildContext!=null&&(n=C(C({},n),i.getChildContext())),m&&!p&&i.getSnapshotBeforeUpdate!=null&&(w=i.getSnapshotBeforeUpdate(a,g)),N=f,f!=null&&f.type===q&&f.key==null&&(N=Ee(f.props.children)),u=Ce(e,B(N)?N:[N],t,_,n,o,r,l,u,c,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),b&&(i.__E=i.__=null)}catch(U){if(t.__v=null,c||r!=null)if(U.then){for(t.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;r[r.indexOf(u)]=null,t.__e=u}else for(V=r.length;V--;)ee(r[V]);else t.__e=_.__e,t.__k=_.__k;d.__e(U,t,_)}else r==null&&t.__v==_.__v?(t.__k=_.__k,t.__e=_.__e):u=t.__e=Ie(_.__e,t,_,n,o,r,l,c,s);return(f=d.diffed)&&f(t),128&t.__u?void 0:u}function $e(e,t,_){for(var n=0;n<_.length;n++)_e(_[n],_[++n],_[++n]);d.__c&&d.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(r){r.call(o)})}catch(r){d.__e(r,o.__v)}})}function Ee(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:B(e)?e.map(Ee):C({},e)}function Ie(e,t,_,n,o,r,l,u,c){var s,f,i,p,a,g,w,b=_.props,h=t.props,m=t.type;if(m=="svg"?o="http://www.w3.org/2000/svg":m=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),r!=null){for(s=0;s<r.length;s++)if((a=r[s])&&"setAttribute"in a==!!m&&(m?a.localName==m:a.nodeType==3)){e=a,r[s]=null;break}}if(e==null){if(m==null)return document.createTextNode(h);e=document.createElementNS(o,m,h.is&&h),u&&(d.__m&&d.__m(t,r),u=!1),r=null}if(m==null)b===h||u&&e.data==h||(e.data=h);else{if(r=r&&D.call(e.childNodes),b=_.props||M,!u&&r!=null)for(b={},s=0;s<e.attributes.length;s++)b[(a=e.attributes[s]).name]=a.value;for(s in b)if(a=b[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=a;else if(!(s in h)){if(s=="value"&&"defaultValue"in h||s=="checked"&&"defaultChecked"in h)continue;j(e,s,null,a,o)}}for(s in h)a=h[s],s=="children"?p=a:s=="dangerouslySetInnerHTML"?f=a:s=="value"?g=a:s=="checked"?w=a:u&&typeof a!="function"||b[s]===a||j(e,s,a,b[s],o);if(f)u||i&&(f.__html==i.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),Ce(t.type=="template"?e.content:e,B(p)?p:[p],t,_,n,m=="foreignObject"?"http://www.w3.org/1999/xhtml":o,r,l,r?r[0]:_.__k&&P(_,0),u,c),r!=null)for(s=r.length;s--;)ee(r[s]);u||(s="value",m=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[s]||m=="progress"&&!g||m=="option"&&g!=b[s])&&j(e,s,g,b[s],o),s="checked",w!=null&&w!=e[s]&&j(e,s,w,b[s],o))}return e}function _e(e,t,_){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){d.__e(o,_)}}function Pe(e,t,_){var n,o;if(d.unmount&&d.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||_e(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){d.__e(r,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&Pe(n[o],t,_||typeof e.type!="function");_||ee(e.__e),e.__c=e.__=e.__e=void 0}function We(e,t,_){return this.constructor(e,_)}function z(e,t,_){var n,o,r,l;t==document&&(t=document.documentElement),d.__&&d.__(e,t),o=(n=typeof _=="function")?null:_&&_.__k||t.__k,r=[],l=[],te(t,e=(!n&&_||t).__k=E(q,null,[e]),o||M,M,t.namespaceURI,!n&&_?[_]:o?null:t.firstChild?D.call(t.childNodes):null,r,!n&&_?_:o?o.__e:t.firstChild,n,l),$e(r,e,l)}function Te(e,t){z(e,t,Te)}function He(e,t,_){var n,o,r,l,u=C({},e.props);for(r in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)r=="key"?n=t[r]:r=="ref"?o=t[r]:u[r]=t[r]===void 0&&l!=null?l[r]:t[r];return arguments.length>2&&(u.children=arguments.length>3?D.call(arguments,2):_),L(e.type,u,n||e.key,o||e.ref,null)}D=we.slice,d={__e:function(e,t,_,n){for(var o,r,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&r.getDerivedStateFromError!=null&&(o.setState(r.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),l=o.__d),l)return o.__E=o}catch(u){e=u}throw e}},ye=0,I.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof e=="function"&&(e=e(C({},_),this.props)),e&&C(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),ie(this))},I.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ie(this))},I.prototype.render=q,$=[],ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,be=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,ke=/(PointerCapture)$|Capture$/i,Z=0,J=ue(!1),K=ue(!0);var Re=0;function k(e,t,_,n,o,r){t||(t={});var l,u,c=t;if("ref"in c)for(u in c={},t)u=="ref"?l=t[u]:c[u]=t[u];var s={type:e,props:c,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Re,__i:-1,__u:0,__source:o,__self:r};if(typeof e=="function"&&(l=e.defaultProps))for(u in l)c[u]===void 0&&(c[u]=l[u]);return d.vnode&&d.vnode(s),s}function ne(){return(ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var n in _)Object.prototype.hasOwnProperty.call(_,n)&&(e[n]=_[n])}return e}).apply(this,arguments)}var Be=["context","children"];function qe(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(n,o){if(n==null)return{};var r,l,u={},c=Object.keys(n);for(l=0;l<c.length;l++)o.indexOf(r=c[l])>=0||(u[r]=n[r]);return u}(e,Be);return He(t,_)}function ze(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=E(qe,ne({},this._props,{context:e.detail.context}),function t(_,n){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var o=[],r={},l=0,u=_.attributes,c=_.childNodes;for(l=u.length;l--;)u[l].name!=="slot"&&(r[u[l].name]=u[l].value,r[Ne(u[l].name)]=u[l].value);for(l=c.length;l--;){var s=t(c[l],null),f=c[l].slot;f?r[f]=E(se,{name:f},s):o[l]=s}var i=n?E(se,null,o):o;return E(n||_.nodeName.toLowerCase(),r,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Te:z)(this._vdom,this._root)}function Ne(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function Ve(e,t,_){if(this._vdom){var n={};n[e]=_=_??void 0,n[Ne(e)]=_,this._vdom=He(this._vdom,n),z(this._vdom,this._root)}}function Ge(){z(this._vdom=null,this._root)}function se(e,t){var _=this;return E("slot",ne({},e,{ref:function(n){n?(_.ref=n,_._listener||(_._listener=function(o){o.stopPropagation(),o.detail.context=t},n.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function Ue(e,t,_,n){function o(){var r=Reflect.construct(HTMLElement,[],o);return r._vdomComponent=e,r._root=n&&n.shadow?r.attachShadow({mode:n.mode||"open"}):r,r}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=ze,o.prototype.attributeChangedCallback=Ve,o.prototype.disconnectedCallback=Ge,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=_,_.forEach(function(r){Object.defineProperty(o.prototype,r,{get:function(){return this._vdom.props[r]},set:function(l){this._vdom?this.attributeChangedCallback(r,null,l):(this._props||(this._props={}),this._props[r]=l,this.connectedCallback());var u=typeof l;l!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(r,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}const Je=({name:e="World"})=>k("p",{children:["Hello, ",e,"!"]});Ue(Je,"x-greeting",["name"],{shadow:!1});var Q,v,G,ce,X=0,Ae=[],y=d,ae=y.__b,fe=y.__r,pe=y.diffed,de=y.__c,he=y.unmount,me=y.__;function Ke(e,t){y.__h&&y.__h(v,e,X||t),X=0;var _=v.__H||(v.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function A(e){return X=1,Qe(Le,e)}function Qe(e,t,_){var n=Ke(Q++,2);if(n.t=e,!n.__c&&(n.__=[Le(void 0,t),function(u){var c=n.__N?n.__N[0]:n.__[0],s=n.t(c,u);c!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=v,!v.__f)){var o=function(u,c,s){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!r||r.call(this,u,c,s);var i=n.__c.props!==u;return f.forEach(function(p){if(p.__N){var a=p.__[0];p.__=p.__N,p.__N=void 0,a!==p.__[0]&&(i=!0)}}),r&&r.call(this,u,c,s)||i};v.__f=!0;var r=v.shouldComponentUpdate,l=v.componentWillUpdate;v.componentWillUpdate=function(u,c,s){if(this.__e){var f=r;r=void 0,o(u,c,s),r=f}l&&l.call(this,u,c,s)},v.shouldComponentUpdate=o}return n.__N||n.__}function Xe(){for(var e;e=Ae.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(W),e.__H.__h.forEach(Y),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){v=null,ae&&ae(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),me&&me(e,t)},y.__r=function(e){fe&&fe(e),Q=0;var t=(v=e.__c).__H;t&&(G===v?(t.__h=[],v.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.u=_.__N=void 0})):(t.__h.forEach(W),t.__h.forEach(Y),t.__h=[],Q=0)),G=v},y.diffed=function(e){pe&&pe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ae.push(t)!==1&&ce===y.requestAnimationFrame||((ce=y.requestAnimationFrame)||Ye)(Xe)),t.__H.__.forEach(function(_){_.u&&(_.__H=_.u),_.u=void 0})),G=v=null},y.__c=function(e,t){t.some(function(_){try{_.__h.forEach(W),_.__h=_.__h.filter(function(n){return!n.__||Y(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],y.__e(n,_.__v)}}),de&&de(e,t)},y.unmount=function(e){he&&he(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(n){try{W(n)}catch(o){t=o}}),_.__H=void 0,t&&y.__e(t,_.__v))};var ve=typeof requestAnimationFrame=="function";function Ye(e){var t,_=function(){clearTimeout(n),ve&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(_,35);ve&&(t=requestAnimationFrame(_))}function W(e){var t=v,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),v=t}function Y(e){var t=v;e.__c=e.__(),v=t}function Le(e,t){return typeof t=="function"?t(e):t}function Ze({onClick:e,color:t,children:_}){return k("button",{style:{background:t||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:_})}function et({visible:e,onClose:t,onSubmit:_,color:n}){const[o,r]=A(""),[l,u]=A(""),[c,s]=A(!1),[f,i]=A("");return e?k("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:k("form",{onSubmit:async a=>{a.preventDefault(),s(!0),i("");try{await _({name:o,email:l}),t()}catch{i("提交失败,请重试")}finally{s(!1)}},style:{background:"#fff",padding:24,borderRadius:8,minWidth:320},children:[k("h2",{style:{color:n||"#1890ff"},children:"表单"}),k("div",{style:{marginBottom:12},children:[k("input",{type:"text",placeholder:"姓名",value:o,onInput:a=>r(a.target.value),required:!0,style:{width:"100%",padding:8,marginBottom:8}}),k("input",{type:"email",placeholder:"邮箱",value:l,onInput:a=>u(a.target.value),required:!0,style:{width:"100%",padding:8}})]}),f&&k("div",{style:{color:"red",marginBottom:8},children:f}),k("button",{type:"submit",disabled:c,style:{background:n||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},children:c?"提交中...":"提交"}),k("button",{type:"button",onClick:t,style:{marginLeft:12,background:"#eee",color:"#333",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},children:"取消"})]})}):null}function tt(e){const[t,_]=A(!1),n=e.theme?.primaryColor;return k("div",{children:[k(Ze,{color:n,onClick:()=>_(!0),children:"打开表单"}),k(et,{visible:t,onClose:()=>_(!1),onSubmit:async r=>{console.log("submit",r)},color:n})]})}Ue(tt,"x-best-modal-form",["theme"],{shadow:!1});const _t=["x-greeting","x-best-modal-form"];exports.components=_t;exports.npmTest=Me;exports.printCurrentTime=De;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function De(){console.log("npm package test!!!")}function Me(){console.log("Current time:",new Date().toISOString())}var D,h,ve,w,oe,ge,ye,be,X,G,J,A={},ke=[],ze=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,W=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function Z(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function $(t,e,n){var o,_,r,l={};for(r in e)r=="key"?o=e[r]:r=="ref"?_=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?D.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)l[r]===void 0&&(l[r]=t.defaultProps[r]);return F(t,l,o,_,null)}function F(t,e,n,o,_){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++ve,__i:-1,__u:0};return _==null&&h.vnode!=null&&h.vnode(r),r}function I(t){return t.children}function L(t,e){this.props=t,this.context=e}function P(t,e){if(e==null)return t.__?P(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?P(t):null}function Ce(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Ce(t)}}function _e(t){(!t.__d&&(t.__d=!0)&&w.push(t)&&!j.__r++||oe!=h.debounceRendering)&&((oe=h.debounceRendering)||ge)(j)}function j(){for(var t,e,n,o,_,r,l,a=1;w.length;)w.length>a&&w.sort(ye),t=w.shift(),a=w.length,t.__d&&(n=void 0,_=(o=(e=t).__v).__e,r=[],l=[],e.__P&&((n=S({},o)).__v=o.__v+1,h.vnode&&h.vnode(n),ee(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[_]:null,r,_??P(o),!!(32&o.__u),l),n.__v=o.__v,n.__.__k[n.__i]=n,Ee(r,n,l),n.__e!=_&&Ce(n)));j.__r=0}function xe(t,e,n,o,_,r,l,a,u,c,s){var i,p,f,b,C,k,m=o&&o.__k||ke,v=e.length;for(u=Be(n,e,m,u,v),i=0;i<v;i++)(f=n.__k[i])!=null&&(p=f.__i==-1?A:m[f.__i]||A,f.__i=i,k=ee(t,f,p,_,r,l,a,u,c,s),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&te(p.ref,null,f),s.push(f.ref,f.__c||b,f)),C==null&&b!=null&&(C=b),4&f.__u||p.__k===f.__k?u=Se(f,u,t):typeof f.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),f.__u&=-7);return n.__e=C,u}function Be(t,e,n,o,_){var r,l,a,u,c,s=n.length,i=s,p=0;for(t.__k=new Array(_),r=0;r<_;r++)(l=e[r])!=null&&typeof l!="boolean"&&typeof l!="function"?(u=r+p,(l=t.__k[r]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?F(null,l,null,null,null):W(l)?F(I,{children:l},null,null,null):l.constructor==null&&l.__b>0?F(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=t,l.__b=t.__b+1,a=null,(c=l.__i=Le(l,n,u,i))!=-1&&(i--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(_>s?p--:_<s&&p++),typeof l.type!="function"&&(l.__u|=4)):c!=u&&(c==u-1?p--:c==u+1?p++:(c>u?p--:p++,l.__u|=4))):t.__k[r]=null;if(i)for(r=0;r<s;r++)(a=n[r])!=null&&(2&a.__u)==0&&(a.__e==o&&(o=P(a)),$e(a,a));return o}function Se(t,e,n){var o,_;if(typeof t.type=="function"){for(o=t.__k,_=0;o&&_<o.length;_++)o[_]&&(o[_].__=t,e=Se(o[_],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=P(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Le(t,e,n,o){var _,r,l=t.key,a=t.type,u=e[n];if(u===null&&t.key==null||u&&l==u.key&&a==u.type&&(2&u.__u)==0)return n;if(o>(u!=null&&(2&u.__u)==0?1:0))for(_=n-1,r=n+1;_>=0||r<e.length;){if(_>=0){if((u=e[_])&&(2&u.__u)==0&&l==u.key&&a==u.type)return _;_--}if(r<e.length){if((u=e[r])&&(2&u.__u)==0&&l==u.key&&a==u.type)return r;r++}}return-1}function ie(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||ze.test(e)?n:n+"px"}function B(t,e,n,o,_){var r,l;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ie(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ie(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(be,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=X,t.addEventListener(e,r?J:G,r)):t.removeEventListener(e,r?J:G,r);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function le(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=X++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function ee(t,e,n,o,_,r,l,a,u,c){var s,i,p,f,b,C,k,m,v,T,E,M,H,re,z,U,V,x=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),r=[a=e.__e=n.__e]),(s=h.__b)&&s(e);e:if(typeof x=="function")try{if(m=e.props,v="prototype"in x&&x.prototype.render,T=(s=x.contextType)&&o[s.__c],E=s?T?T.props.value:s.__:o,n.__c?k=(i=e.__c=n.__c).__=i.__E:(v?e.__c=i=new x(m,E):(e.__c=i=new L(m,E),i.constructor=x,i.render=je),T&&T.sub(i),i.props=m,i.state||(i.state={}),i.context=E,i.__n=o,p=i.__d=!0,i.__h=[],i._sb=[]),v&&i.__s==null&&(i.__s=i.state),v&&x.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=S({},i.__s)),S(i.__s,x.getDerivedStateFromProps(m,i.__s))),f=i.props,b=i.state,i.__v=e,p)v&&x.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),v&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(v&&x.getDerivedStateFromProps==null&&m!==f&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(m,E),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(m,i.__s,E)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(i.props=m,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(N){N&&(N.__=e)}),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(m,i.__s,E),v&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(f,b,C)})}if(i.context=E,i.props=m,i.__P=t,i.__e=!1,H=h.__r,re=0,v){for(i.state=i.__s,i.__d=!1,H&&H(e),s=i.render(i.props,i.state,i.context),z=0;z<i._sb.length;z++)i.__h.push(i._sb[z]);i._sb=[]}else do i.__d=!1,H&&H(e),s=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++re<25);i.state=i.__s,i.getChildContext!=null&&(o=S(S({},o),i.getChildContext())),v&&!p&&i.getSnapshotBeforeUpdate!=null&&(C=i.getSnapshotBeforeUpdate(f,b)),U=s,s!=null&&s.type===I&&s.key==null&&(U=we(s.props.children)),a=xe(t,W(U)?U:[U],e,n,o,_,r,l,a,u,c),i.base=e.__e,e.__u&=-161,i.__h.length&&l.push(i),k&&(i.__E=i.__=null)}catch(N){if(e.__v=null,u||r!=null)if(N.then){for(e.__u|=u?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else for(V=r.length;V--;)Z(r[V]);else e.__e=n.__e,e.__k=n.__k;h.__e(N,e,n)}else r==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Re(n.__e,e,n,o,_,r,l,u,c);return(s=h.diffed)&&s(e),128&e.__u?void 0:a}function Ee(t,e,n){for(var o=0;o<n.length;o++)te(n[o],n[++o],n[++o]);h.__c&&h.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(r){r.call(_)})}catch(r){h.__e(r,_.__v)}})}function we(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:W(t)?t.map(we):S({},t)}function Re(t,e,n,o,_,r,l,a,u){var c,s,i,p,f,b,C,k=n.props,m=e.props,v=e.type;if(v=="svg"?_="http://www.w3.org/2000/svg":v=="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName==v:f.nodeType==3)){t=f,r[c]=null;break}}if(t==null){if(v==null)return document.createTextNode(m);t=document.createElementNS(_,v,m.is&&m),a&&(h.__m&&h.__m(e,r),a=!1),r=null}if(v==null)k===m||a&&t.data==m||(t.data=m);else{if(r=r&&D.call(t.childNodes),k=n.props||A,!a&&r!=null)for(k={},c=0;c<t.attributes.length;c++)k[(f=t.attributes[c]).name]=f.value;for(c in k)if(f=k[c],c!="children"){if(c=="dangerouslySetInnerHTML")i=f;else if(!(c in m)){if(c=="value"&&"defaultValue"in m||c=="checked"&&"defaultChecked"in m)continue;B(t,c,null,f,_)}}for(c in m)f=m[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?s=f:c=="value"?b=f:c=="checked"?C=f:a&&typeof f!="function"||k[c]===f||B(t,c,f,k[c],_);if(s)a||i&&(s.__html==i.__html||s.__html==t.innerHTML)||(t.innerHTML=s.__html),e.__k=[];else if(i&&(t.innerHTML=""),xe(e.type=="template"?t.content:t,W(p)?p:[p],e,n,o,v=="foreignObject"?"http://www.w3.org/1999/xhtml":_,r,l,r?r[0]:n.__k&&P(n,0),a,u),r!=null)for(c=r.length;c--;)Z(r[c]);a||(c="value",v=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[c]||v=="progress"&&!b||v=="option"&&b!=k[c])&&B(t,c,b,k[c],_),c="checked",C!=null&&C!=t[c]&&B(t,c,C,k[c],_))}return t}function te(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(_){h.__e(_,n)}}function $e(t,e,n){var o,_;if(h.unmount&&h.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||te(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){h.__e(r,e)}o.base=o.__P=null}if(o=t.__k)for(_=0;_<o.length;_++)o[_]&&$e(o[_],e,n||typeof t.type!="function");n||Z(t.__e),t.__c=t.__=t.__e=void 0}function je(t,e,n){return this.constructor(t,n)}function q(t,e,n){var o,_,r,l;e==document&&(e=document.documentElement),h.__&&h.__(t,e),_=(o=typeof n=="function")?null:n&&n.__k||e.__k,r=[],l=[],ee(e,t=(!o&&n||e).__k=$(I,null,[t]),_||A,A,e.namespaceURI,!o&&n?[n]:_?null:e.firstChild?D.call(e.childNodes):null,r,!o&&n?n:_?_.__e:e.firstChild,o,l),Ee(r,t,l)}function Pe(t,e){q(t,e,Pe)}function Te(t,e,n){var o,_,r,l,a=S({},t.props);for(r in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)r=="key"?o=e[r]:r=="ref"?_=e[r]:a[r]=e[r]===void 0&&l!=null?l[r]:e[r];return arguments.length>2&&(a.children=arguments.length>3?D.call(arguments,2):n),F(t.type,a,o||t.key,_||t.ref,null)}D=ke.slice,h={__e:function(t,e,n,o){for(var _,r,l;e=e.__;)if((_=e.__c)&&!_.__)try{if((r=_.constructor)&&r.getDerivedStateFromError!=null&&(_.setState(r.getDerivedStateFromError(t)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,o||{}),l=_.__d),l)return _.__E=_}catch(a){t=a}throw t}},ve=0,L.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=S({},this.state),typeof t=="function"&&(t=t(S({},n),this.props)),t&&S(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),_e(this))},L.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),_e(this))},L.prototype.render=I,w=[],ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ye=function(t,e){return t.__v.__b-e.__v.__b},j.__r=0,be=/(PointerCapture)$|Capture$/i,X=0,G=le(!1),J=le(!0);var Oe=0;function d(t,e,n,o,_,r){e||(e={});var l,a,u=e;if("ref"in u)for(a in u={},e)a=="ref"?l=e[a]:u[a]=e[a];var c={type:t,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oe,__i:-1,__u:0,__source:_,__self:r};if(typeof t=="function"&&(l=t.defaultProps))for(a in l)u[a]===void 0&&(u[a]=l[a]);return h.vnode&&h.vnode(c),c}var O,g,Y,ae,K=0,He=[],y=h,ce=y.__b,ue=y.__r,se=y.diffed,fe=y.__c,pe=y.unmount,de=y.__;function Ue(t,e){y.__h&&y.__h(g,t,K||e),K=0;var n=g.__H||(g.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ne(t){return K=1,We(Fe,t)}function We(t,e,n){var o=Ue(O++,2);if(o.t=t,!o.__c&&(o.__=[Fe(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],c=o.t(u,a);u!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.__f)){var _=function(a,u,c){if(!o.__c.__H)return!0;var s=o.__c.__H.__.filter(function(p){return!!p.__c});if(s.every(function(p){return!p.__N}))return!r||r.call(this,a,u,c);var i=o.__c.props!==a;return s.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(i=!0)}}),r&&r.call(this,a,u,c)||i};g.__f=!0;var r=g.shouldComponentUpdate,l=g.componentWillUpdate;g.componentWillUpdate=function(a,u,c){if(this.__e){var s=r;r=void 0,_(a,u,c),r=s}l&&l.call(this,a,u,c)},g.shouldComponentUpdate=_}return o.__N||o.__}function Ie(t,e){var n=Ue(O++,3);!y.__s&&Ye(n.__H,e)&&(n.__=t,n.u=e,g.__H.__h.push(n))}function qe(){for(var t;t=He.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(R),t.__H.__h.forEach(Q),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,ce&&ce(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),de&&de(t,e)},y.__r=function(t){ue&&ue(t),O=0;var e=(g=t.__c).__H;e&&(Y===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(R),e.__h.forEach(Q),e.__h=[],O=0)),Y=g},y.diffed=function(t){se&&se(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(He.push(e)!==1&&ae===y.requestAnimationFrame||((ae=y.requestAnimationFrame)||Ve)(qe)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Y=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(R),n.__h=n.__h.filter(function(o){return!o.__||Q(o)})}catch(o){e.some(function(_){_.__h&&(_.__h=[])}),e=[],y.__e(o,n.__v)}}),fe&&fe(t,e)},y.unmount=function(t){pe&&pe(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{R(o)}catch(_){e=_}}),n.__H=void 0,e&&y.__e(e,n.__v))};var he=typeof requestAnimationFrame=="function";function Ve(t){var e,n=function(){clearTimeout(o),he&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);he&&(e=requestAnimationFrame(n))}function R(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function Q(t){var e=g;t.__c=t.__(),g=e}function Ye(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Fe(t,e){return typeof e=="function"?e(t):e}function Ge({onClick:t,color:e,children:n}){return d("button",{style:{background:e||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:t,children:n})}function Je({visible:t,onClose:e,onSubmit:n,color:o}){const[_,r]=Ne({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""});return Ie(()=>{t||r({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""})},[t]),t?d("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:u=>{u.target===u.currentTarget&&e()},children:d("form",{onSubmit:async u=>{u.preventDefault();let c=!0;if(r(s=>({...s,amountError:"",rechargeChannelError:""})),_.amount.trim()||(r(s=>({...s,amountError:"请输入充值金额"})),c=!1),_.rechargeChannel||(r(s=>({...s,rechargeChannelError:"请选择支付平台"})),c=!1),!!c){r(s=>({...s,loading:!0,error:""}));try{await n({amount:_.amount,rechargeChannel:_.rechargeChannel,currency:_.currency}),e()}catch{r(s=>({...s,error:"提交失败,请重试"}))}finally{r(s=>({...s,loading:!1}))}}},style:{background:"#181A20",padding:32,borderRadius:12,minWidth:360,color:o||"#fff",boxShadow:"0 4px 24px rgba(0,0,0,0.5)",position:"relative"},onClick:u=>u.stopPropagation(),children:[d("button",{type:"button",onClick:e,style:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},"aria-label":"关闭",children:"×"}),d("div",{style:{fontWeight:600,fontSize:18,marginBottom:24,textAlign:"left"},children:"在线充值"}),d("div",{style:{marginBottom:18},children:[d("div",{style:{marginBottom:8,fontSize:14},children:[d("span",{style:{color:"#00E8C6"},children:"*"})," 充值金额"]}),d("input",{type:"text",placeholder:"请输入充值金额",value:_.amount,onInput:u=>{const c=u.target.value;r(s=>({...s,amount:c,amountError:c.trim()?"":s.amountError}))},style:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:_.amountError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0}}),_.amountError&&d("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:_.amountError})]}),d("div",{style:{marginBottom:18},children:[d("div",{style:{marginBottom:8,fontSize:14},children:[d("span",{style:{color:"#00E8C6"},children:"*"})," 支付平台"]}),d("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:_.rechargeChannelError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},value:_.rechargeChannel,onInput:u=>{const c=u.target.value;r(s=>({...s,rechargeChannel:c,rechargeChannelError:c?"":s.rechargeChannelError}))},children:[d("option",{value:"alipay",children:"支付宝"}),d("option",{value:"wechat",children:"微信"}),d("option",{value:"paypal",children:"PayPal"})]}),_.rechargeChannelError&&d("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:_.rechargeChannelError})]}),d("div",{style:{marginBottom:24},children:[d("div",{style:{marginBottom:8,fontSize:14},children:"币种"}),d("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},value:_.currency,children:[d("option",{value:"USD",children:"USD"}),d("option",{value:"CNY",children:"CNY"}),d("option",{value:"EUR",children:"EUR"})]})]}),_.error&&d("div",{style:{color:"#ff4d4f",marginBottom:12},children:_.error}),d("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[d("button",{type:"button",onClick:e,style:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},children:"取消"}),d("button",{type:"submit",disabled:_.loading,style:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},children:_.loading?"提交中...":"去支付"})]})]})}):null}function ne(){return(ne=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}var Ke=["context","children"];function Qe(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(o,_){if(o==null)return{};var r,l,a={},u=Object.keys(o);for(l=0;l<u.length;l++)_.indexOf(r=u[l])>=0||(a[r]=o[r]);return a}(t,Ke);return Te(e,n)}function Xe(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=$(Qe,ne({},this._props,{context:t.detail.context}),function e(n,o){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],r={},l=0,a=n.attributes,u=n.childNodes;for(l=a.length;l--;)a[l].name!=="slot"&&(r[a[l].name]=a[l].value,r[Ae(a[l].name)]=a[l].value);for(l=u.length;l--;){var c=e(u[l],null),s=u[l].slot;s?r[s]=$(me,{name:s},c):_[l]=c}var i=o?$(me,null,_):_;return $(o||n.nodeName.toLowerCase(),r,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Pe:q)(this._vdom,this._root)}function Ae(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function Ze(t,e,n){if(this._vdom){var o={};o[t]=n=n??void 0,o[Ae(t)]=n,this._vdom=Te(this._vdom,o),q(this._vdom,this._root)}}function et(){q(this._vdom=null,this._root)}function me(t,e){var n=this;return $("slot",ne({},t,{ref:function(o){o?(n.ref=o,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=e},o.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function tt(t,e,n,o){function _(){var r=Reflect.construct(HTMLElement,[],_);return r._vdomComponent=t,r._root=r,r}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=Xe,_.prototype.attributeChangedCallback=Ze,_.prototype.disconnectedCallback=et,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),_.observedAttributes=n,n.forEach(function(r){Object.defineProperty(_.prototype,r,{get:function(){return this._vdom.props[r]},set:function(l){this._vdom?this.attributeChangedCallback(r,null,l):(this._props||(this._props={}),this._props[r]=l,this.connectedCallback());var a=typeof l;l!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(r,l)}})}),customElements.define(e,_)}function nt(t){const[e,n]=Ne(!1),o=t.theme?.primaryColor;return d("div",{children:[d(Ge,{color:o,onClick:()=>n(!0),children:"打开表单"}),d(Je,{visible:e,onClose:()=>n(!1),onSubmit:async r=>{console.log("submit",r)},color:o})]})}tt(nt,"x-best-modal-form",["theme"]);const rt=["x-greeting","x-best-modal-form"];exports.components=rt;exports.npmTest=De;exports.printCurrentTime=Me;