oops-ui 1.1.0 → 1.1.1
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/client.mjs +1 -2
- package/index.mjs +33 -2
- package/layoutUtil.mjs +1 -2
- package/package.json +10 -9
- package/server.mjs +1 -2
- package/type/components/Details/index.d.ts +3 -1
- package/type/index.d.ts +3 -2
- package/client.mjs.map +0 -1
- package/layoutUtil.mjs.map +0 -1
- package/server.mjs.map +0 -1
package/client.mjs
CHANGED
|
@@ -6,5 +6,4 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
"use client";
|
|
9
|
-
import{setStyle as e}from"a-element-inline-style";import{debounce as t,enArr as r,getRandomInt as n,getRandomString as i}from"a-js-tools";import*as o from"a-type-of-js";import{createContext as a,default as l,forwardRef as u,useCallback as s,useContext as c,useEffect as f,useImperativeHandle as p,useRef as d,useState as h}from"react";import{css as m,default as g,styled as v}from"styled-components";import{xcn as y}from"xcn";var b={319:(o,a,l)=>{l.d(a,{Ripples:()=>Ze});var u=l(362);function s(e,t,r,n){function i(e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,e)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,t)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var l=e+t,s=/uniform (\w+) (\w+)/g;!(0,u.isNull)(o=s.exec(l));){var c=o[2];a.locations[c]=r.getUniformLocation(a.id,c)}return a}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(t||0)),r.bindTexture(r.TEXTURE_2D,e)}function f(e){return"rgba(0, 0, 0, 0)"===e||"#ffffffff"===e||"transport"===e}function p(e){return"none"===e||""===e}function d(){var e=this,t=function(){return e.initState=!1,null};if(!this.gl)return t();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce(function(e,t){var n=r.getExtension(t);return n&&e.push([t,n]),e},[]));if(!n.OES_texture_float)return t();var i=[];function o(e,t,r){var i="OES_texture_"+e,o=i+"_linear",a=o in n;return{type:t,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function g(e,t,r){return t&&m(e.prototype,t),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var b,w=g(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"canvas",void 0),v(this,"gl",void 0),v(this,"config",void 0),v(this,"initState",!0),this.canvas=t;var r=t.getContext("webgl");if((0,u.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(d,this,[])}),E={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0,darkMode:void 0};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R(n.key),n)}}function R(e){var t=function(e){if("object"!=S(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==S(t)?t:t+""}function x(e,t,r){return e.set(A(e,t),r),r}function k(e,t){return e.get(A(e,t))}function A(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function T(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.freeze(E);var j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={list:[],diameter:48,radius:0,cells:0};r.diameter%2!=0&&r.diameter++;var i=r.diameter,o=r.list,a=i/2;r.radius=a,r.cells=Math.pow(i,2);for(var l=0;l<i;l++){o[l]=[];for(var u=0;u<i;u++)o[l][u]=[0,0,0,0]}for(var s=0;s<=a;s++)for(var c=function(){var e=o[s][f],r=Math.ceil(Math.sqrt(Math.pow(s,2)+Math.pow(f,2)))<=a,i=t?10:255,l=t?25:180,u=r?t?160:120:t?160:180,c=r?t?230:160:t?250:240,p=function(){return n(i,l)};e[0]=p(),e[1]=p(),e[2]=p(),e[3]=n(u,c)},f=s;f<=a;f++)c();for(var p=0;p<=a;p++)for(var d=0;d<=p;d++)o[p][d]=o[d][p];for(var h=a;h<i;h++)for(var m=0;m<=a;m++)o[h][m]=o[i-h][m];for(var g=0;g<a;g++)for(var v=a;v<i;v++)o[g][v]=o[g][i-v];for(var y=a;y<i;y++)for(var b=a;b<i;b++)o[y][b]=o[y][i-b];var w=e%i;return r.list=[].concat(T(o.slice(w)),T(o.slice(0,w))),r},I=new(b=new WeakMap,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(this,b,1),t=this,r="data",n=j(),(r=R(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n},(t=[{key:"build",value:function(e){var t,r;k(b,this)>100&&x(b,this,0),this.data=j((x(b,this,(t=k(b,this),r=t++,t)),r),e)}}])&&O(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function D(e,t){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,u.isNull)(i)||(0,u.isNull)(o)?r:(r.width=n.width=e||1,r.height=n.height=t||1,i.clearRect(0,0,e,t),o.clearRect(0,0,e,t),i.globalAlpha=1,i.putImageData(function(e,t){Date.now();for(var r=new ImageData(e||1,t||1),n=r.data,i=I.data,o=i.diameter,a=i.list,l=e*o,u=0;u<n.length;u+=4){var s=u/4%l,c=s%e%o,f=Math.floor(s/e),p=a[c][f];n[u]=p[0],n[u+1]=p[1],n[u+2]=p[2],n[u+3]=p[3]}return r}(e,t),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,e,t),o.drawImage(r,0,0,e||1,t||1),o.globalCompositeOperation="source-over",n)}function _(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.fadeData,n=this.options,o=r.backgroundInfo,a=r.toBeList,l=o.width,u=o.height,s=i({length:8,includeNumbers:!0,includeUppercaseLetters:!0});I.build(null!==(e=n.darkMode)&&void 0!==e?e:r.isDark),a.push({resource:D(l,u),width:l,height:u,kind:"default",tag:s}),t&&r.run()}function C(e,t){var r,n,i=e.imgUrl;return(0,u.isString)(i)&&i||(r=t.backgroundImage,n=/url\(["']?([^"']*)["']?\)/.exec(r),(0,u.isNull)(n)?null:n[1])}function U(e,t){return(0,u.isArray)(e.imgUrl)&&1===e.imgUrl.length&&e.imgUrl[0]||t.backgroundColor}function F(){var e=this.renderData,t=this.fadeData,r=this.options;if((0,u.isNull)(e))return Reflect.apply(_,this,[]);var n=e.originStyle;if(f(n.backgroundColor)&&(!(0,u.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(_,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,u.isNull)(o))return Reflect.apply(_,this,[]);var a=t.backgroundInfo,l=a.width,s=a.height;i.width=l,i.height=s,o.clearRect(0,0,l,s);var c=U(r,n);o.beginPath(),o.fillStyle=c,o.fillRect(0,0,l,s),o.fill(),t.isTransitioning&&!(0,u.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[];var p={resource:i,kind:"background-color",tag:c,width:l,height:s};t.toBeList.push(p),t.run()}function N(){var e=this.fadeData,t=this.renderData,r=this.options;if((0,u.isNull)(t))return Reflect.apply(F,this,[]);var n=t.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,u.isArray)(r.imgUrl))return Reflect.apply(F,this,[]);var i=(0,u.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map(function(e){return(e=e.trim()).endsWith(")")||(e+=")"),e}).filter(function(e){return e.startsWith("rgb")||e.startsWith("#")});if(i.length<2)return Reflect.apply(F,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,u.isNull)(a))return Reflect.apply(F,this,[]);var l=e.backgroundInfo,s=l.width,c=l.height;o.width=s,o.height=c,a.fillStyle="#fff",a.fillRect(0,0,s,c);var f=a.createLinearGradient(0,0,0,c);i.forEach(function(e,t){return f.addColorStop(t/(i.length-1),e)}),a.fillStyle=f,a.fillRect(0,0,s,c),e.isTransitioning&&!(0,u.isEmptyArray)(e.toBeList)?e.toBeList=[e.toBeList[0]]:e.toBeList=[],e.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:c}),e.run()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function B(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if((0,u.isNull)(t))Reflect.apply(N,this,[]);else{var i=t.lastUseStyle,o=n.backgroundInfo,a=o.width,l=o.height,s=C(r,i);if(t.imageSource=s,s){var c=function(e,t,r){var n=new Image(t,r);return n.width=t,n.height=r,n.src=e,n}(s,a,l);c.onload=function(){var e;clearTimeout(n.transparentId),n.isTransitioning&&!(0,u.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(function(e){if(Array.isArray(e))return M(e)}(e=n.toBeList.slice(1).filter(function(e){return"image"===e.kind&&(Math.abs(e.width-a)>2||Math.abs(e.height-l)>2||e.tag!==s)}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):n.toBeList=[],n.toBeList.push({resource:c,width:a,height:l,kind:"image",tag:s}),n.run()},c.onerror=function(){Reflect.apply(N,e,[])},c.crossOrigin=r.crossOrigin}else Reflect.apply(N,this,[])}}function L(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.parentElement;t&&[["background-image","none"],["background-color","transparent"]].forEach(function(e){return t.style.setProperty(e[0],e[1],"important")})}}function X(e){var t=window.getComputedStyle(e),r=e.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:t.backgroundColor,backgroundImage:t.backgroundImage,backgroundSize:t.backgroundSize,backgroundPosition:t.backgroundPosition,backgroundRepeat:t.backgroundRepeat,backgroundClip:t.backgroundClip,backgroundOrigin:t.backgroundOrigin,backgroundAttachment:t.backgroundAttachment,position:t.position,width:parseInt(t.width),height:parseInt(t.height)}}function W(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.parentElement,r=e.originStyle;t.style.setProperty("background-image",r.inlineBackgroundImage),t.style.setProperty("background-color",r.inlineBackgroundColor)}}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function G(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function $(e,t,r){return(t=H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}var q=function(){return e=function e(t,n,i){var o,a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$(this,"quad",null),$(this,"lastRaindropsFallTime",0),$(this,"parentElement",void 0),$(this,"mutationObserver",void 0),$(this,"resizeObserver",void 0),$(this,"renderProgram",void 0),$(this,"imageSource",""),$(this,"dropProgram",void 0),$(this,"updateProgram",void 0),$(this,"textures",[]),$(this,"backgroundTexture",[]),$(this,"textureDelta",void 0),$(this,"framebuffers",[]),$(this,"bufferWriteIndex",0),$(this,"bufferReadIndex",1),$(this,"originStyle",void 0),$(this,"lastUseStyle",void 0),$(this,"events",{}),$(this,"animationFrameId",0),this.parentElement=null!==(o=t.parentElement)&&void 0!==o?o:document.body,Reflect.apply(L,i,[]),this.originStyle=this.lastUseStyle=X(this.parentElement),this.mutationObserver=new MutationObserver(function(e){e.forEach(function(e){if(e.target===a.parentElement&&"attributes"===e.type&&i.options.visible){var t=Object.values(a.lastUseStyle),o=X(a.parentElement),l=Object.values(o);if((0,u.isEmptyArray)(r.difference(t,l)))return;var s=p(o.backgroundImage),c=f(o.backgroundColor);if(s&&c)return;a.lastUseStyle=o,Reflect.apply(n,i,[]),Reflect.apply(L,i,[])}})}),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver(function(e){e.forEach(function(e){e.target===a.parentElement&&Reflect.apply(n,i,[])})}),this.resizeObserver.observe(this.parentElement)},t=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(W,{renderData:this},[]),this.parentElement&&this.events)try{var e,t,r,n=this.parentElement,i=this.events;Object.keys(i).forEach(function(e){return n.removeEventListener&&n.removeEventListener(e,i[e])}),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(e=this.mutationObserver)||void 0===e||e.takeRecords(),null===(t=this.mutationObserver)||void 0===t||t.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}catch(e){}}}],t&&G(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Y(){var e=this.renderData,t=this.fadeData;if(!(0,u.isNull)(e)){var r,n,i,o=e.parentElement,a=window.getComputedStyle(o),l=a.backgroundSize,s=a.backgroundAttachment,c=a.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):J(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var d=t.backgroundInfo||{width:100,height:100},h=d.width,m=d.height;if("cover"===l){var g=Math.max(p.width/h,p.height/m);n=h*g,i=m*g}else if("contain"===l){var v=Math.min(p.width/h,p.height/m);n=h*v,i=m*v}else{var y=l.split(" ");n=y[0]||"",i=y[1]||n,J(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),J(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=m):("auto"===n&&(n=h*(Number(i)/m)),"auto"===i&&(i=m*(Number(n)/h)))}var b=f&&f[0]||"0%",w=f&&f[1]||"0%";b=J(b)?(p.left+(p.width-Number(n))*parseFloat(b)/100).toString():(p.left+parseFloat(b)).toString(),w=J(w)?(p.top+(p.height-Number(i))*parseFloat(w)/100).toString():(p.top+parseFloat(w)).toString(),e.renderProgram.uniforms.topLeft=new Float32Array([-Number(b)/n,-Number(w)/i]),e.renderProgram.uniforms.bottomRight=new Float32Array([e.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,e.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var E=Math.max(this.canvas.width,this.canvas.height);e.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/E,this.canvas.height/E])}}function J(e){return e.endsWith("%")}function V(){var e=this.gl,t=this.renderData;(0,u.isNull)(t)||(e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_FAN,0,4))}function K(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.textures,i=t.backgroundTexture,o=r.perturbance;e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(0,0,this.canvas.width,this.canvas.height),e.enable(e.BLEND),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.useProgram(t.renderProgram.id),Reflect.apply(c,this,[i,0]),Reflect.apply(c,this,[n[0],1]),e.uniform1f(t.renderProgram.locations.perturbance,o),e.uniform2fv(t.renderProgram.locations.topLeft,t.renderProgram.uniforms.topLeft),e.uniform2fv(t.renderProgram.locations.bottomRight,t.renderProgram.uniforms.bottomRight),e.uniform2fv(t.renderProgram.locations.containerRatio,t.renderProgram.uniforms.containerRatio),e.uniform1i(t.renderProgram.locations.samplerBackground,0),e.uniform1i(t.renderProgram.locations.samplerRipples,1),Reflect.apply(V,this,[]),e.disable(e.BLEND)}}function Q(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.bufferWriteIndex,r=e.bufferReadIndex;e.bufferWriteIndex=1-t,e.bufferReadIndex=1-r}}function Z(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.updateProgram,i=t.textures,o=t.framebuffers,a=t.bufferWriteIndex,l=t.bufferReadIndex,s=r.resolution;e.viewport(0,0,s,s),e.bindFramebuffer(e.FRAMEBUFFER,o[a]),Reflect.apply(c,this,[i[l]]),e.useProgram(n.id),Reflect.apply(V,this,[]),Reflect.apply(Q,this,[])}}function ee(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(t)){var i=t.parentElement,o=n.isTransitioning,a=r.running,l=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(Y,this,[]),a?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),o&&this.fade(),Reflect.apply(Z,this,[]),Reflect.apply(K,this,[])):s&&(r.lastRunningState=!1,this.hide()),t.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ee,e,[])})}}function te(e,t,r){var n=this.renderData;if(!(0,u.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,l=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),c=e.clientX-s.left-a,f=e.clientY-s.top-l;this.drop(c,f,t,r)}}function re(){var e=this,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.parentElement,i=t.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(t.lastRaindropsFallTime=Date.now(),Reflect.apply(te,e,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(e){for(var t=r.accelerating;t--;)o(e)},i.touchmove=i.touchstart=function(e){for(var t=e.touches,r=0;r<t.length;r++)o(t[r])},i.mousedown=function(e){return o(e,!0)},Object.keys(i).forEach(function(e){return null==n?void 0:n.addEventListener(e,i[e],{passive:!0})})}}var ne="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function ie(){var e=this.gl,t=this.renderData;if(!(0,u.isNull)(t)){var r=t.textureDelta;t.dropProgram=s(ne,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",e);var n=t.updateProgram=s(ne,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);e.uniform2fv(n.locations.delta,r),t.renderProgram=s("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",e),e.uniform2fv(t.renderProgram.locations.delta,r)}}function oe(){var e=this.gl,t=this.renderData;if(!(0,u.isNull)(t)){var r=t.backgroundTexture=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)}}function ae(e){var t=this.gl,r=this.renderData,n=this.fadeData;if(!(0,u.isNull)(r)){var i=r.backgroundTexture,o=n.backgroundInfo,a=o.width,l=o.height,s=function(e){return(0,u.isZero)(e&e-1)},c=s(a)&&s(l)?t.REPEAT:t.CLAMP_TO_EDGE;t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,c),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,c),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.resource)}}function le(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(t)&&this.config){var i=t.textures,o=t.framebuffers,a=r.resolution,l=this.gl,s=1/a;t.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach(function(e){return l.getExtension(e)});for(var c=this.config.arrayType,f=c?new c(a*a*4):null,p=this.config,d=0;d<2;d++){var h=l.createTexture(),m=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,m),l.bindTexture(l.TEXTURE_2D,h),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,a,a,0,l.RGBA,p.type,f),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),i.push(h),o.push(m)}t.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,t.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(ie,this,[]),Reflect.apply(oe,this,[]),Reflect.apply(B,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(re,this,[]),Reflect.apply(ae,this,[n.lastDrawImage]),t.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ee,e,[])})}}var ue=t(function(e,t,r){e.width=t,e.height=r},1e3);function se(){var e=this.renderData,t=this.fadeData,r=this.canvas;if(!(0,u.isNull)(e)){var n=e.parentElement,i=t.backgroundInfo,o=n.offsetWidth,a=n.offsetHeight;r.width,r.height,o<3||a<3||(i.width=o,i.height=a,ue(r,o,a),Reflect.apply(B,this,[]))}}function ce(){var e=this.renderData,t=this.fadeData;(0,u.isNull)(e)||(e.destroy(),Object.keys(e).forEach(function(t){return e[t]=null}),this.renderData=null),t.destroy(),Object.keys(t).forEach(function(e){return t[e]=null}),this.fadeData=null,this.gl&&(this.gl=null)}function fe(e,t,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,u.isNull)(i)){var l=i.parentElement,s=i.dropProgram,f=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,m=o.resolution,g=l.offsetWidth,v=l.offsetHeight,y=Math.max(g,v);r/=y;var b=new Float32Array([(2*e-g)/y,(v-2*t)/y]);a.viewport(0,0,m,m),a.bindFramebuffer(a.FRAMEBUFFER,p[d]),Reflect.apply(c,this,[f[h]]),a.useProgram(s.id),a.uniform2fv(s.locations.center,b),a.uniform1f(s.locations.radius,r),a.uniform1f(s.locations.strength,n),Reflect.apply(V,this,[]),Reflect.apply(Q,this,[])}}function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function de(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,me(n.key),n)}}function he(e,t,r){return(t=me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e){var t=function(e){if("object"!=pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pe(t)?t:t+""}function ge(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ve(e,t){return e.get(be(e,t))}function ye(e,t,r){return e.set(be(e,t),r),r}function be(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var we=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Oe=new WeakMap,Re=new WeakMap,xe=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Te=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ge(this,we,E.accelerating),ge(this,Ee,E.interactive),ge(this,Se,E.resolution),ge(this,Oe,E.perturbance),ge(this,Re,E.dropRadius),he(this,"imgUrl",E.imgUrl),ge(this,xe,E.idleFluctuations),ge(this,ke,E.raindropsTimeInterval),he(this,"crossOrigin","no-cors"),he(this,"visible",!1),he(this,"running",!1),ge(this,Ae,void 0),he(this,"lastRunningState",!1),this.perturbance=t.perturbance,this.resolution=t.resolution,this.raindropsTimeInterval=t.raindropsTimeInterval,this.accelerating=t.accelerating,this.interactive=t.interactive,this.dropRadius=t.dropRadius,this.imgUrl=t.imgUrl,this.idleFluctuations=t.idleFluctuations,this.running=Boolean(null===(r=t.playingState)||void 0===r||r),this.crossOrigin=t.crossOrigin,this.darkMode=t.darkMode},(t=[{key:"accelerating",get:function(){return ve(we,this)},set:function(e){e>100||e<2||ye(we,this,e)}},{key:"interactive",get:function(){return ve(Ee,this)},set:function(e){(0,u.isBoolean)(e)&&ye(Ee,this,e)}},{key:"resolution",get:function(){return ve(Se,this)},set:function(e){e<100||e>550||ye(Se,this,e)}},{key:"perturbance",get:function(){return ve(Oe,this)},set:function(e){e<1e-4||e>1||ye(Oe,this,e)}},{key:"dropRadius",get:function(){return ve(Re,this)},set:function(e){!isFinite(e)||e<10||ye(Re,this,e)}},{key:"idleFluctuations",get:function(){return ve(xe,this)},set:function(e){(0,u.isBoolean)(e)&&ye(xe,this,e)}},{key:"raindropsTimeInterval",get:function(){return ve(ke,this)},set:function(e){e<10||e>12e3||ye(ke,this,e)}},{key:"playingState",get:function(){return this.running},set:function(e){this.running=Boolean(null==e||e)}},{key:"darkMode",get:function(){return ve(Ae,this)},set:function(e){ye(Ae,this,(0,u.isUndefined)(e)?void 0:Boolean(e))}}])&&de(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Pe(){var e=this.fadeData,t=this.options,r=this.renderData;if((0,u.isNull)(r))return!0;var n=t.imgUrl,i=r.lastUseStyle,o=e.lastDrawImage,a=e.backgroundInfo,l=a.width,s=a.height,c=o.tag,f=o.kind,p=C(t,i),d=o.width===l,h=o.height===s,m=d&&h;if("image"===f&&m&&(0,u.isString)(p)&&p===c)return!0;var g=(0,u.isArray)(n)&&n.join("_")||"";if("linear-gradient"===f&&m&&g===c)return!0;var v=U(t,i);return!("background-color"!==f||!m||c!==v)}function je(){var e=this,t=this.options,r=this.fadeData;(0,u.isUndefined)(r)||(r.transparentId=setTimeout(function(){if(clearTimeout(r.transparentId),r&&r.toBeList)return r.isTransitioning?Reflect.apply(je,e,[]):void(Reflect.apply(Pe,e,[])||r.run())},2*t.raindropsTimeInterval))}function Ie(){var e=this.renderData,t=this.fadeData,r=this.options,n=t.toBeList;if((0,u.isNull)(e))return Reflect.apply(De,this,["还没有准备好,即将退出"]);if((0,u.isEmptyArray)(n))return Reflect.apply(De,this,["由于缺少当前渲染的背景,退出"]);if(0===t.drawProgress&&n.forEach(function(e){}),t.drawProgress>1e3){if(t.lastDrawImage=n.shift(),Reflect.apply(ae,this,[t.lastDrawImage]),(0,u.isEmptyArray)(n)){var i=e.lastUseStyle;((0,u.isNull)(r.imgUrl)||(0,u.isBusinessEmptyString)(r.imgUrl)||(0,u.isZero)(r.imgUrl.length))&&f(i.backgroundColor)&&p(i.backgroundImage)&&Reflect.apply(_,this,[!1])}return Reflect.apply(De,this,["当前执行完毕,开启下次执行"])}var o=t.lastDrawImage,a=t.backgroundInfo;t.drawProgress+=18;var l=document.createElement("canvas"),s=l.getContext("2d");if((0,u.isNull)(s)||(0,u.isNull)(o.resource)||(0,u.isEmptyArray)(n))return Reflect.apply(De,this,"环境值错误");var c=a.width,d=a.height;l.width=c,l.height=d,s.clearRect(0,0,c,d),s.drawImage(o.resource,0,0,c,d),s.globalAlpha=t.drawProgress/1e3,s.drawImage(n[0].resource,0,0,c,d),s.globalAlpha=1;var h={resource:l,width:c,height:d,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ae,this,[h]),n.length>1&&(t.lastDrawImage=h,n.shift(),t.drawProgress=0)}function De(e){this.fadeData.isTransitioning=!1,Reflect.apply(je,this,[])}function _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}function Ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ne(n.key),n)}}function Ue(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fe(e,t,r){return(t=Ne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(e){var t=function(e){if("object"!=_e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=_e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(t)?t:t+""}function Me(e,t){return e.get(Be(e,t))}function Be(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Le=new WeakMap,Xe=new WeakSet,We=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ue(this,r=Xe),r.add(this),Fe(this,"backgroundInfo",{width:0,height:0}),Fe(this,"transparentId",setTimeout(Boolean)),Fe(this,"lastDrawImage",void 0),Fe(this,"toBeList",[]),Fe(this,"drawProgress",0),Fe(this,"isTransitioning",!1),function(e,t){Ue(e,t),t.set(e,void 0)}(this,Le),Fe(this,"isDark",!1);var n,i,o=t.renderData;if((0,u.isNull)(o))n=10,i=10;else{var a=getComputedStyle(o.parentElement);n=parseInt(a.width),i=parseInt(a.height)}this.backgroundInfo={width:n,height:i},this.lastDrawImage={resource:D(n,i),width:n,height:i,kind:"default",tag:""},function(e,t,r){e.set(Be(e,t),r)}(Le,this,window.matchMedia("(prefers-color-scheme: dark)")),this.isDark=Me(Le,this).matches,Me(Le,this).addEventListener("change",Be(Xe,this,ze));var l=this;Object.defineProperty(Me(Le,this),"isDark",{get:function(){return l.isDark},set:function(e){l.isDark=e,Reflect.apply(Pe,t,[])||Reflect.apply(_,t,[!0])}})},(t=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){Me(Le,this).removeEventListener("change",Be(Xe,this,ze)),this.transparentId&&clearTimeout(this.transparentId)}}])&&Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ze(e){this.isDark=e.matches}function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach(function(t){Ke(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function qe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qe(n.key),n)}}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ye=function(){return!!e})()}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function Ve(e,t){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ve(e,t)}function Ke(e,t,r){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(e){var t=function(e){if("object"!=Ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ge(t)?t:t+""}var Ze=function(t){function r(t,n){var i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),Ke(i=function(e,t,r){return t=Je(t),function(e,t){if(t&&("object"==Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ye()?Reflect.construct(t,r||[],Je(e).constructor):t.apply(e,r))}(this,r,[t]),"renderData",null),Ke(i,"options",void 0),Ke(i,"fadeData",void 0),Ke(i,"defaults",E),Ke(i,"initialized",!1),Object.defineProperties(i,{defaults:{value:i.defaults,writable:!1,enumerable:!1,configurable:!1}}),i.options=new Te(He(He({},i.defaults),n));var o=se.bind(i);return i.renderData=new q(t,o,i),i.fadeData=new We(i),(0,u.isFalse)(i.initState)||(0,u.isNull)(t.parentElement)||(0,u.isNull)(i.config)||(0,u.isNull)(i.gl)?i.initState=!1:(function(t){var r=t.parentElement;t.width=r.clientWidth,t.height=r.clientHeight,e(t,{position:"absolute",width:"100%",height:"100%",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(le,i,[])),window.matchMedia("(prefers-color-scheme: dark)"),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ve(e,t)}(r,t),i=r,(o=[{key:"raindropsFall",value:function(){var e=this.renderData,t=this.options,r=this.fadeData;if(!(0,u.isNull)(e)){var i=r.backgroundInfo,o=e.lastRaindropsFallTime,a=t.raindropsTimeInterval,l=t.dropRadius,s=Date.now();if(!(s-o<a)){e.lastRaindropsFallTime=s;var c=function(e){return n(e||1)},f=i.width,p=i.height;this.drop(c(f),c(p),l,.03)}}}},{key:"drop",value:function(e,t,r,n){Reflect.apply(fe,this,[e,t,r,n])}},{key:"fade",value:function(){Reflect.apply(Ie,this,[])}},{key:"destroy",value:function(){Reflect.apply(ce,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(L,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(W,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var e=this.options;e.running=!e.running}},{key:"set",value:function(e,t){"imgUrl"===e?(this.options.imgUrl=t,Reflect.apply(B,this,[])):"darkMode"===e?(this.options.darkMode=t,Reflect.apply(Pe,this,[])||Reflect.apply(_,this,[!0])):this.options[e]=t}}])&&qe(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o}(w)},362:(e,t,r)=>{var n,i;e.exports=(n={isArray:()=>o.isArray,isBoolean:()=>o.isBoolean,isBusinessEmptyString:()=>o.isBusinessEmptyString,isEmptyArray:()=>o.isEmptyArray,isFalse:()=>o.isFalse,isFunction:()=>o.isFunction,isNull:()=>o.isNull,isPlainObject:()=>o.isPlainObject,isString:()=>o.isString,isUndefined:()=>o.isUndefined,isZero:()=>o.isZero,typeOf:()=>o.typeOf},i={},r.d(i,n),i)}},w={};function E(e){var t=w[e];if(void 0!==t)return t.exports;var r=w[e]={exports:{}};return b[e](r,r.exports,E),r.exports}E.d=(e,t)=>{for(var r in t)E.o(t,r)&&!E.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},E.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var S=E(362);function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){var r=d(null),n=d(!0),i=d(!1),o=O(h(!1),2),a=o[0],l=o[1],u=O(h(null),2),s=u[0],c=u[1];function p(){n.current=!0,setTimeout(function(){var e;n.current&&(null===(e=r.current)||void 0===e||e.destroy())},0)}return f(function(){return n.current=!1,(0,S.isNull)(e.current)||i.current||(l(!0),i.current=!0,Promise.resolve().then(E.bind(E,319)).then(function(i){(0,S.isNull)(e.current)||n.current||(r.current=new i.Ripples(e.current,t))}).catch(function(e){c(e)}).finally(function(){l(!1)})),p},[]),{ripples:r,isLoading:a,error:s}}var k=E(319);function A(e,t){var r=d(null);return f(function(){if(!(0,S.isNull)(e.current))return r.current=new k.Ripples(e.current,t),function(){var e;return null===(e=r.current)||void 0===e?void 0:e.destroy()}},[]),r}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function I(e,t,r){return(t=function(e){var t=function(e){if("object"!=T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){var r=d(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach(function(t){I(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t));f(function(){t&&e.current&&Object.keys(e.current.defaults).forEach(function(n){var i,o,a,l=t[n],u=(i=l,o=r.current[n],(0,S.isArray)(i)&&(0,S.isArray)(o)&&(i.length!==o.length||i.some(function(e,t){return e!==o[t]}))||(!(0,S.isArray)(i)||!(0,S.isArray)(o))&&i!==o);e.current&&u&&(r.current[n]=(0,S.isArray)(l)?function(e){if(Array.isArray(e))return P(e)}(a=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t[n],e.current.set(n,l))})},[t])}var _=v.div.withConfig({displayName:"Content",componentId:"sc-1rvy95w-0"})(["position:relative;top:0px;left:0px;z-index:1;width:100%;height:100%;min-width:1px;min-height:1px;contain:layout paint style;will-change:transform,opacity;"]);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}var U=["children","style","option"];function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},F.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(t){B(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function B(e,t,r){return(t=function(e){var t=function(e){if("object"!=C(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==C(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L=u(function(e,t){var r=e.children,n=e.style,i=e.option,o=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,U),a=d(null),u=A(a,i);return D(u,i),p(t,function(){return{toggleState:function(){var e;null===(e=u.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=u.current)||void 0===e||e.pause()},set:function(e){if(!(0,S.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=u.current)||void 0===i||i.set(o,e[o])}}}}),l.createElement(_,F({style:M({backgroundRepeat:"round"},n)},o),l.createElement("canvas",{ref:a,"data-earthnut-ui":"canvas",width:0,height:0}),r)});function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}L.displayName="en-background-ripple";var W=["children","style","option"];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach(function(t){H(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function H(e,t,r){return(t=function(e){var t=function(e){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var q=u(function(e,t){var r=e.children,n=e.style,i=e.option,o=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,W),a=d(null),u=x(a,i).ripples;return D(u,i),p(t,function(){return{toggleState:function(){var e;null===(e=u.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=u.current)||void 0===e||e.pause()},set:function(e){if(!(0,S.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=u.current)||void 0===i||i.set(o,e[o])}}}}),l.createElement(_,z({style:$({backgroundRepeat:"round"},n)},o),l.createElement("canvas",{ref:a,"data-earthnut-ui":"canvas",width:0,height:0}),r)});function Y(){var e=d(void 0);return f(function(){return function(){return e.current&&clearTimeout(e.current)}},[]),e}function J(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n=(0,S.isBoolean)(n)?{immediately:n,once:!1}:(0,S.isPlainObject)(n)?{once:!!(0,S.isBoolean)(n.once)&&n.once,immediately:!!(0,S.isBoolean)(n.immediately)&&n.immediately}:{immediately:!1,once:!1};var i=d({id:0,immediately:null===(t=n.immediately)||void 0===t||t,once:null!==(r=n.once)&&void 0!==r&&r,noun:!1,time:0,cancelTime:0,firstRunEffect:!0,isUnmounted:!0,result:{cancel:function(){var e=i.current.id;e&&window.cancelAnimationFrame(e),i.current.result.canceled=!0},canceled:!1,render:function(){var e=i.current,t=e.result;e.cancelTime=performance.now(),t.cancel(),t.canceled=!1,e.id=window.requestAnimationFrame(a)}}}),o=i.current,a=s(function(t){var r=o.result,n=t-o.cancelTime;o.time+=n<0?16.7:n,e(t,o.time),o.once||r.render()},[e]);return o.immediately&&!o.noun&&o.result.canceled&&(o.noun=!0,o.result.render()),f(function(){o.once||(o.firstRunEffect?(o.result.render(),o.firstRunEffect=!1):o.firstRunEffect||o.result.canceled||o.result.render())},[e]),f(function(){return o.isUnmounted=!1,function(){o.isUnmounted=!0,setTimeout(function(){o.isUnmounted&&o.result.cancel()},0)}},[]),o.result}function V(e){var t=d(!1);return f(function(){var r=e.current;if(r){var n=function(){return t.current=!0},i=function(){return t.current=!1};return r.addEventListener("compositionstart",n),r.addEventListener("compositionend",i),function(){r.removeEventListener("compositionstart",n),r.removeEventListener("compositionend",i)}}},[]),t}q.displayName="en-lazy-background-ripple";const K="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////9zeKVjAAAAA3RSTlP//wDXyg1BAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQImWNkYmBgYGJAIQAAigAKNDhFkwAAAABJRU5ErkJggg==";function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Z(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ee=["loadingSrc","className","src"];function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(null,arguments)}var re=v.img.withConfig({displayName:"image__Content",componentId:"sc-qt83ib-0"})(["margin:0;padding:0;user-select:none;"]),ne=u(function(e,t){var r=e.loadingSrc,n=void 0===r?K:r,i=e.className,o=e.src,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,ee),u=function(e,t){var r=Q(h(K),2),n=r[0],i=r[1],o=Q(h(0),2),a=o[0],l=o[1];return f(function(){l(1),(0,S.isString)(e)||(e=K);var t=new Image;t.onload=function(){l(2),i(e)},t.onerror=function(){i(K),l(4)},t.src=e,t.crossOrigin="anonymous"},[e,t]),{resultSrc:n,loadComplete:a}}(null!=o?o:n),s=u.resultSrc,c=u.loadComplete;return l.createElement(re,te({},a,{ref:t,src:s||n,className:y(1===c&&"loading",i)}))});function ie(e){var t=localStorage.getItem(e);try{return null!=t&&JSON.parse(t)||""}catch(e){return t||""}}function oe(e){return localStorage.removeItem(e)}ne.displayName="en-image";var ae={del:oe,set:function(e,t){localStorage.setItem(e,JSON.stringify(t))},get:ie,getAndDel:function(e){var t=ie(e);return oe(e),t},clear:function(){localStorage.clear()},setSession:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},getSession:function(e){var t=sessionStorage.getItem(e);return null!=t&&JSON.parse(t)||""},delSession:function(e){return sessionStorage.removeItem(e)}},le={get theme(){return ae.get("theme")},set theme(e){["light","dark"].includes(e)?ae.set("theme",e):(0,S.isBusinessEmptyString)(e)&&ae.del("theme")},get token(){return ae.get("token")},set token(e){(0,S.isString)(e)&&!(0,S.isBusinessEmptyString)(e)&&ae.set("token",e)}},ue={getItem:function(e){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e){var t=e.keyItem,r=e.value,n=e.end,i=e.path,o=e.domain,a=e.secure;if(!t||/^(?:expires|max-age|path|domain|secure)$/i.test(t))return!1;var l="";switch((0,S.typeOf)(n)){case"undefined":l="; expires=Fri, 31 Dec 9999 23:59:59 GMT";break;case"number":l=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case"string":l="; expires="+n;break;case"date":l="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(t).concat("=").concat(encodeURIComponent(r)).concat(l).concat(o?"; domain=".concat(o):"").concat(i?"; path=".concat(i):"").concat(a?"; secure":""),!0},deleteItem:function(e,t,r){return!(!e||!this.exist(e)||(document.cookie=encodeURIComponent(e).concat("=; expires=Thu, 01 Jan 1970 00:00:00 GMT").concat(r?"; domain=".concat(r):"").concat(t?"; path=".concat(t):""),0))},exist:function(e){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:1|$)/g,"").split(/\s*(?:=[^;]*)?;\s*/),t=0;t<e.length;t++)e[t]=decodeURIComponent(e[t]);return e}};function se(e){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},se(e)}function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fe(n.key),n)}}function fe(e){var t=function(e){if("object"!=se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==se(t)?t:t+""}function pe(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var de=new WeakSet;function he(e){var t,r;return null!==(t=null===(r=window)||void 0===r?void 0:r.matchMedia(/:/.test(e)&&!/\(|\)/.test(e)?"(".concat(e,")"):e).matches)&&void 0!==t&&t}var me=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}(this,de)},t=[{key:"vibrate",value:function(){var e;null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.vibrate&&window.navigator.vibrate(200)}},{key:"share",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"https://letmiseesee.pages.dev",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"慧土灵核";null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.share&&window.navigator.share({url:t,text:r,title:n})}},{key:"isPhone",value:function(){var e;return!pe(de,this,he).call(this,"any-hover: hover")&&!pe(de,this,he).call(this,"any-pointer: fine")&&(null===(e=window)||void 0===e||null===(e=e.navigator)||void 0===e?void 0:e.maxTouchPoints)>0}},{key:"isSmallScreen",get:function(){return pe(de,this,he).call(this,"max-width: 576px")?"small":pe(de,this,he).call(this,"max-width: 996px")?"middle":"large"}},{key:"isDark",get:function(){return pe(de,this,he).call(this,"prefers-color-scheme: dark")}},{key:"isOrientation",get:function(){var e=(screen.orientation||{}).type||screen.mozOrientation||screen.msOrientation;return"landscape-primary"!==e&&"landscape-secondary"!==e}}],t&&ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ve(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ye=function(){return"light"},be=a({autoColorMode:!0,colorModeClassName:"en-light",colorMode:"light",toggleColorMode:ye,setColorMode:ye,clearColorMode:function(){}});function we(){var e=c(be);return e.setColorMode!==ye&&e.toggleColorMode!==ye||console.warn("use ColorMode 应当在 <ThemeColorModeProvider /> 内部使用"),e}function Ee(e){var t=e.children,r=e.initialTheme,n=ge(h(r),2),i=n[0],o=n[1],a=ge(h(!0),2),u=a[0],s=a[1],c=function(e){var t=!le.theme;t?(ue.deleteItem("theme"),le.theme=""):ue.setItem({keyItem:"theme",value:e}),window.document.documentElement.setAttribute("data-theme",e),s(t)},p=function(e){return["light","dark"].indexOf(e)<0?i:(le.theme=e,e!==i?o(e):c(i),e)};return f(function(){var e=le.theme;s(!e);var t=me.isDark;e?p(e):o(t?"dark":"light")},[]),f(function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(e){return!le.theme&&o(e.matches?"dark":"light")};return e.addEventListener("change",t),function(){return e.removeEventListener("change",t)}},[]),f(function(){c(i)},[i]),l.createElement(be.Provider,{value:{colorMode:i,colorModeClassName:"en-".concat(i),toggleColorMode:function(){return p("light"===i?"dark":"light")},setColorMode:p,clearColorMode:function(){s(!0),o(me.isDark?"dark":"light"),le.theme="",ue.deleteItem("theme")},autoColorMode:u}},t)}var Se,Oe,Re=v.div.withConfig({displayName:"SwitchContent",componentId:"sc-1i8tohq-0"})(["cursor:pointer;position:relative;top:0px;left:0px;color:#000;display:inline-block;width:54px;height:27px;margin:0;padding:0;vertical-align:text-bottom;background-color:transparent;background-image:linear-gradient(to right,rgb(90,90,90),rgba(70,120,240)),radial-gradient( circle closest-corner at 100% 50%,rgb(90,90,90),rgb(90,90,90) 100%,transparent 100% ),radial-gradient( circle closest-corner at 0% 50%,rgba(70,120,240),rgba(70,120,240) 100%,transparent 100% );background-size:40% 50%,20% 50%,20% 50%;background-position:50% 50%,13.25% 50%,85% 50%;background-repeat:no-repeat;overflow:hidden;&::before{content:'';position:absolute;top:10%;width:40%;height:80%;text-align:center;line-height:1.3;font-size:40%;border-radius:50%;transition:all 1s;","}"],function(e){return"left"===e.$type&&m(["left:15%;background-color:rgb(120,120,120);"])||m(["left:45%;background-color:rgba(35,70,247,1);"])}),xe=v.div.withConfig({displayName:"SwitchContainer",componentId:"sc-ixe4ua-0"})(["display:inline-block;padding:4px 12px;"]);function ke(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ae=v.div.withConfig({displayName:"SwitchLabel",componentId:"sc-yl5nc4-0"})(["display:inline-block;vertical-align:super;transition:color 1.28s;",""],function(e){return!0===e.$type&&m(Se||(Se=ke(["\n color: rgb(55,80,210);\n font-weight: 800;\n "])))||m(Oe||(Oe=ke(["\n color: #666;\n "])))}),Te=["value","change","children"];function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pe.apply(null,arguments)}function je(e){var t=e.value,r=e.change,n=e.children,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Te);return l.createElement(xe,null,n&&l.createElement(Ae,{$type:t},n),l.createElement(Re,Pe({$type:t?"right":"left",onClick:function(e){e.preventDefault(),e.stopPropagation(),(0,S.isFunction)(r)&&Reflect.apply(r,null,[e])}},i)))}var Ie=g.details.withConfig({displayName:"Details__DetailsContext",componentId:"sc-qf3efl-0"})(["box-shadow:0px 0px 12px 0px #f033;border-radius:12px;padding:30px;margin:5px;transition:all 0.38s;position:relative;min-height:2rem;max-height:85vh;overflow:auto;&[open]{transition:all 0.68s;padding:0px 10px 10px;box-shadow:0px 0px 12px 4px #0af;summary{transition:all 0.68s;box-shadow:-1px 0px 6px 0px #f366;color:var(--en-text-primary);background-color:var(--en-background-primary);border-radius:0px 0px 18px 18px;}}"]),De=g.summary.withConfig({displayName:"Details__SummaryContext",componentId:"sc-qf3efl-1"})(["position:sticky;position:-webkit-sticky;top:0px;left:10px;z-index:30;padding:15px 10px;"]);function _e(e){var t=e.title,r=e.children;return l.createElement(Ie,null,l.createElement(De,null,t||""),r)}export{L as BackgroundRipple,_e as Details,_e as EnDetails,ne as EnImage,je as EnSwitch,ne as Image,q as LazyBackgroundRipple,je as Switch,Ee as ThemeColorModeProvider,J as useAnimationFrame,we as useColorMode,V as useInputIsComposing,x as useLazyRipples,A as useRipples,Y as useTimeId};
|
|
10
|
-
//# sourceMappingURL=client.mjs.map
|
|
9
|
+
import{setStyle as e}from"a-element-inline-style";import{debounce as t,enArr as r,getRandomInt as n,getRandomString as i}from"a-js-tools";import*as o from"a-type-of-js";import{createContext as a,default as l,forwardRef as u,useCallback as s,useContext as c,useEffect as f,useImperativeHandle as p,useRef as d,useState as h}from"react";import{css as m,default as g,styled as v}from"styled-components";import{xcn as y}from"xcn";var b={319:(o,a,l)=>{l.d(a,{Ripples:()=>Ze});var u=l(362);function s(e,t,r,n){function i(e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,e)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,t)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var l=e+t,s=/uniform (\w+) (\w+)/g;!(0,u.isNull)(o=s.exec(l));){var c=o[2];a.locations[c]=r.getUniformLocation(a.id,c)}return a}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(t||0)),r.bindTexture(r.TEXTURE_2D,e)}function f(e){return"rgba(0, 0, 0, 0)"===e||"#ffffffff"===e||"transport"===e}function p(e){return"none"===e||""===e}function d(){var e=this,t=function(){return e.initState=!1,null};if(!this.gl)return t();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce(function(e,t){var n=r.getExtension(t);return n&&e.push([t,n]),e},[]));if(!n.OES_texture_float)return t();var i=[];function o(e,t,r){var i="OES_texture_"+e,o=i+"_linear",a=o in n;return{type:t,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function g(e,t,r){return t&&m(e.prototype,t),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var b,w=g(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"canvas",void 0),v(this,"gl",void 0),v(this,"config",void 0),v(this,"initState",!0),this.canvas=t;var r=t.getContext("webgl");if((0,u.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(d,this,[])}),E={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0,darkMode:void 0};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R(n.key),n)}}function R(e){var t=function(e){if("object"!=S(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==S(t)?t:t+""}function x(e,t,r){return e.set(A(e,t),r),r}function k(e,t){return e.get(A(e,t))}function A(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function T(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.freeze(E);var j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={list:[],diameter:48,radius:0,cells:0};r.diameter%2!=0&&r.diameter++;var i=r.diameter,o=r.list,a=i/2;r.radius=a,r.cells=Math.pow(i,2);for(var l=0;l<i;l++){o[l]=[];for(var u=0;u<i;u++)o[l][u]=[0,0,0,0]}for(var s=0;s<=a;s++)for(var c=function(){var e=o[s][f],r=Math.ceil(Math.sqrt(Math.pow(s,2)+Math.pow(f,2)))<=a,i=t?10:255,l=t?25:180,u=r?t?160:120:t?160:180,c=r?t?230:160:t?250:240,p=function(){return n(i,l)};e[0]=p(),e[1]=p(),e[2]=p(),e[3]=n(u,c)},f=s;f<=a;f++)c();for(var p=0;p<=a;p++)for(var d=0;d<=p;d++)o[p][d]=o[d][p];for(var h=a;h<i;h++)for(var m=0;m<=a;m++)o[h][m]=o[i-h][m];for(var g=0;g<a;g++)for(var v=a;v<i;v++)o[g][v]=o[g][i-v];for(var y=a;y<i;y++)for(var b=a;b<i;b++)o[y][b]=o[y][i-b];var w=e%i;return r.list=[].concat(T(o.slice(w)),T(o.slice(0,w))),r},I=new(b=new WeakMap,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(this,b,1),t=this,r="data",n=j(),(r=R(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n},(t=[{key:"build",value:function(e){var t,r;k(b,this)>100&&x(b,this,0),this.data=j((x(b,this,(t=k(b,this),r=t++,t)),r),e)}}])&&O(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function D(e,t){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,u.isNull)(i)||(0,u.isNull)(o)?r:(r.width=n.width=e||1,r.height=n.height=t||1,i.clearRect(0,0,e,t),o.clearRect(0,0,e,t),i.globalAlpha=1,i.putImageData(function(e,t){Date.now();for(var r=new ImageData(e||1,t||1),n=r.data,i=I.data,o=i.diameter,a=i.list,l=e*o,u=0;u<n.length;u+=4){var s=u/4%l,c=s%e%o,f=Math.floor(s/e),p=a[c][f];n[u]=p[0],n[u+1]=p[1],n[u+2]=p[2],n[u+3]=p[3]}return r}(e,t),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,e,t),o.drawImage(r,0,0,e||1,t||1),o.globalCompositeOperation="source-over",n)}function _(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.fadeData,n=this.options,o=r.backgroundInfo,a=r.toBeList,l=o.width,u=o.height,s=i({length:8,includeNumbers:!0,includeUppercaseLetters:!0});I.build(null!==(e=n.darkMode)&&void 0!==e?e:r.isDark),a.push({resource:D(l,u),width:l,height:u,kind:"default",tag:s}),t&&r.run()}function C(e,t){var r,n,i=e.imgUrl;return(0,u.isString)(i)&&i||(r=t.backgroundImage,n=/url\(["']?([^"']*)["']?\)/.exec(r),(0,u.isNull)(n)?null:n[1])}function U(e,t){return(0,u.isArray)(e.imgUrl)&&1===e.imgUrl.length&&e.imgUrl[0]||t.backgroundColor}function F(){var e=this.renderData,t=this.fadeData,r=this.options;if((0,u.isNull)(e))return Reflect.apply(_,this,[]);var n=e.originStyle;if(f(n.backgroundColor)&&(!(0,u.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(_,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,u.isNull)(o))return Reflect.apply(_,this,[]);var a=t.backgroundInfo,l=a.width,s=a.height;i.width=l,i.height=s,o.clearRect(0,0,l,s);var c=U(r,n);o.beginPath(),o.fillStyle=c,o.fillRect(0,0,l,s),o.fill(),t.isTransitioning&&!(0,u.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[];var p={resource:i,kind:"background-color",tag:c,width:l,height:s};t.toBeList.push(p),t.run()}function N(){var e=this.fadeData,t=this.renderData,r=this.options;if((0,u.isNull)(t))return Reflect.apply(F,this,[]);var n=t.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,u.isArray)(r.imgUrl))return Reflect.apply(F,this,[]);var i=(0,u.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map(function(e){return(e=e.trim()).endsWith(")")||(e+=")"),e}).filter(function(e){return e.startsWith("rgb")||e.startsWith("#")});if(i.length<2)return Reflect.apply(F,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,u.isNull)(a))return Reflect.apply(F,this,[]);var l=e.backgroundInfo,s=l.width,c=l.height;o.width=s,o.height=c,a.fillStyle="#fff",a.fillRect(0,0,s,c);var f=a.createLinearGradient(0,0,0,c);i.forEach(function(e,t){return f.addColorStop(t/(i.length-1),e)}),a.fillStyle=f,a.fillRect(0,0,s,c),e.isTransitioning&&!(0,u.isEmptyArray)(e.toBeList)?e.toBeList=[e.toBeList[0]]:e.toBeList=[],e.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:c}),e.run()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function B(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if((0,u.isNull)(t))Reflect.apply(N,this,[]);else{var i=t.lastUseStyle,o=n.backgroundInfo,a=o.width,l=o.height,s=C(r,i);if(t.imageSource=s,s){var c=function(e,t,r){var n=new Image(t,r);return n.width=t,n.height=r,n.src=e,n}(s,a,l);c.onload=function(){var e;clearTimeout(n.transparentId),n.isTransitioning&&!(0,u.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(function(e){if(Array.isArray(e))return M(e)}(e=n.toBeList.slice(1).filter(function(e){return"image"===e.kind&&(Math.abs(e.width-a)>2||Math.abs(e.height-l)>2||e.tag!==s)}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):n.toBeList=[],n.toBeList.push({resource:c,width:a,height:l,kind:"image",tag:s}),n.run()},c.onerror=function(){Reflect.apply(N,e,[])},c.crossOrigin=r.crossOrigin}else Reflect.apply(N,this,[])}}function L(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.parentElement;t&&[["background-image","none"],["background-color","transparent"]].forEach(function(e){return t.style.setProperty(e[0],e[1],"important")})}}function X(e){var t=window.getComputedStyle(e),r=e.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:t.backgroundColor,backgroundImage:t.backgroundImage,backgroundSize:t.backgroundSize,backgroundPosition:t.backgroundPosition,backgroundRepeat:t.backgroundRepeat,backgroundClip:t.backgroundClip,backgroundOrigin:t.backgroundOrigin,backgroundAttachment:t.backgroundAttachment,position:t.position,width:parseInt(t.width),height:parseInt(t.height)}}function W(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.parentElement,r=e.originStyle;t.style.setProperty("background-image",r.inlineBackgroundImage),t.style.setProperty("background-color",r.inlineBackgroundColor)}}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function G(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function $(e,t,r){return(t=H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}var q=function(){return e=function e(t,n,i){var o,a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$(this,"quad",null),$(this,"lastRaindropsFallTime",0),$(this,"parentElement",void 0),$(this,"mutationObserver",void 0),$(this,"resizeObserver",void 0),$(this,"renderProgram",void 0),$(this,"imageSource",""),$(this,"dropProgram",void 0),$(this,"updateProgram",void 0),$(this,"textures",[]),$(this,"backgroundTexture",[]),$(this,"textureDelta",void 0),$(this,"framebuffers",[]),$(this,"bufferWriteIndex",0),$(this,"bufferReadIndex",1),$(this,"originStyle",void 0),$(this,"lastUseStyle",void 0),$(this,"events",{}),$(this,"animationFrameId",0),this.parentElement=null!==(o=t.parentElement)&&void 0!==o?o:document.body,Reflect.apply(L,i,[]),this.originStyle=this.lastUseStyle=X(this.parentElement),this.mutationObserver=new MutationObserver(function(e){e.forEach(function(e){if(e.target===a.parentElement&&"attributes"===e.type&&i.options.visible){var t=Object.values(a.lastUseStyle),o=X(a.parentElement),l=Object.values(o);if((0,u.isEmptyArray)(r.difference(t,l)))return;var s=p(o.backgroundImage),c=f(o.backgroundColor);if(s&&c)return;a.lastUseStyle=o,Reflect.apply(n,i,[]),Reflect.apply(L,i,[])}})}),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver(function(e){e.forEach(function(e){e.target===a.parentElement&&Reflect.apply(n,i,[])})}),this.resizeObserver.observe(this.parentElement)},t=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(W,{renderData:this},[]),this.parentElement&&this.events)try{var e,t,r,n=this.parentElement,i=this.events;Object.keys(i).forEach(function(e){return n.removeEventListener&&n.removeEventListener(e,i[e])}),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(e=this.mutationObserver)||void 0===e||e.takeRecords(),null===(t=this.mutationObserver)||void 0===t||t.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}catch(e){}}}],t&&G(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Y(){var e=this.renderData,t=this.fadeData;if(!(0,u.isNull)(e)){var r,n,i,o=e.parentElement,a=window.getComputedStyle(o),l=a.backgroundSize,s=a.backgroundAttachment,c=a.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):J(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var d=t.backgroundInfo||{width:100,height:100},h=d.width,m=d.height;if("cover"===l){var g=Math.max(p.width/h,p.height/m);n=h*g,i=m*g}else if("contain"===l){var v=Math.min(p.width/h,p.height/m);n=h*v,i=m*v}else{var y=l.split(" ");n=y[0]||"",i=y[1]||n,J(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),J(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=m):("auto"===n&&(n=h*(Number(i)/m)),"auto"===i&&(i=m*(Number(n)/h)))}var b=f&&f[0]||"0%",w=f&&f[1]||"0%";b=J(b)?(p.left+(p.width-Number(n))*parseFloat(b)/100).toString():(p.left+parseFloat(b)).toString(),w=J(w)?(p.top+(p.height-Number(i))*parseFloat(w)/100).toString():(p.top+parseFloat(w)).toString(),e.renderProgram.uniforms.topLeft=new Float32Array([-Number(b)/n,-Number(w)/i]),e.renderProgram.uniforms.bottomRight=new Float32Array([e.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,e.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var E=Math.max(this.canvas.width,this.canvas.height);e.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/E,this.canvas.height/E])}}function J(e){return e.endsWith("%")}function V(){var e=this.gl,t=this.renderData;(0,u.isNull)(t)||(e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_FAN,0,4))}function K(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.textures,i=t.backgroundTexture,o=r.perturbance;e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(0,0,this.canvas.width,this.canvas.height),e.enable(e.BLEND),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.useProgram(t.renderProgram.id),Reflect.apply(c,this,[i,0]),Reflect.apply(c,this,[n[0],1]),e.uniform1f(t.renderProgram.locations.perturbance,o),e.uniform2fv(t.renderProgram.locations.topLeft,t.renderProgram.uniforms.topLeft),e.uniform2fv(t.renderProgram.locations.bottomRight,t.renderProgram.uniforms.bottomRight),e.uniform2fv(t.renderProgram.locations.containerRatio,t.renderProgram.uniforms.containerRatio),e.uniform1i(t.renderProgram.locations.samplerBackground,0),e.uniform1i(t.renderProgram.locations.samplerRipples,1),Reflect.apply(V,this,[]),e.disable(e.BLEND)}}function Q(){var e=this.renderData;if(!(0,u.isNull)(e)){var t=e.bufferWriteIndex,r=e.bufferReadIndex;e.bufferWriteIndex=1-t,e.bufferReadIndex=1-r}}function Z(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.updateProgram,i=t.textures,o=t.framebuffers,a=t.bufferWriteIndex,l=t.bufferReadIndex,s=r.resolution;e.viewport(0,0,s,s),e.bindFramebuffer(e.FRAMEBUFFER,o[a]),Reflect.apply(c,this,[i[l]]),e.useProgram(n.id),Reflect.apply(V,this,[]),Reflect.apply(Q,this,[])}}function ee(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(t)){var i=t.parentElement,o=n.isTransitioning,a=r.running,l=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(Y,this,[]),a?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),o&&this.fade(),Reflect.apply(Z,this,[]),Reflect.apply(K,this,[])):s&&(r.lastRunningState=!1,this.hide()),t.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ee,e,[])})}}function te(e,t,r){var n=this.renderData;if(!(0,u.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,l=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),c=e.clientX-s.left-a,f=e.clientY-s.top-l;this.drop(c,f,t,r)}}function re(){var e=this,t=this.renderData,r=this.options;if(!(0,u.isNull)(t)){var n=t.parentElement,i=t.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(t.lastRaindropsFallTime=Date.now(),Reflect.apply(te,e,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(e){for(var t=r.accelerating;t--;)o(e)},i.touchmove=i.touchstart=function(e){for(var t=e.touches,r=0;r<t.length;r++)o(t[r])},i.mousedown=function(e){return o(e,!0)},Object.keys(i).forEach(function(e){return null==n?void 0:n.addEventListener(e,i[e],{passive:!0})})}}var ne="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function ie(){var e=this.gl,t=this.renderData;if(!(0,u.isNull)(t)){var r=t.textureDelta;t.dropProgram=s(ne,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",e);var n=t.updateProgram=s(ne,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);e.uniform2fv(n.locations.delta,r),t.renderProgram=s("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",e),e.uniform2fv(t.renderProgram.locations.delta,r)}}function oe(){var e=this.gl,t=this.renderData;if(!(0,u.isNull)(t)){var r=t.backgroundTexture=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)}}function ae(e){var t=this.gl,r=this.renderData,n=this.fadeData;if(!(0,u.isNull)(r)){var i=r.backgroundTexture,o=n.backgroundInfo,a=o.width,l=o.height,s=function(e){return(0,u.isZero)(e&e-1)},c=s(a)&&s(l)?t.REPEAT:t.CLAMP_TO_EDGE;t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,c),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,c),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.resource)}}function le(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(t)&&this.config){var i=t.textures,o=t.framebuffers,a=r.resolution,l=this.gl,s=1/a;t.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach(function(e){return l.getExtension(e)});for(var c=this.config.arrayType,f=c?new c(a*a*4):null,p=this.config,d=0;d<2;d++){var h=l.createTexture(),m=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,m),l.bindTexture(l.TEXTURE_2D,h),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,a,a,0,l.RGBA,p.type,f),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),i.push(h),o.push(m)}t.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,t.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(ie,this,[]),Reflect.apply(oe,this,[]),Reflect.apply(B,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(re,this,[]),Reflect.apply(ae,this,[n.lastDrawImage]),t.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ee,e,[])})}}var ue=t(function(e,t,r){e.width=t,e.height=r},1e3);function se(){var e=this.renderData,t=this.fadeData,r=this.canvas;if(!(0,u.isNull)(e)){var n=e.parentElement,i=t.backgroundInfo,o=n.offsetWidth,a=n.offsetHeight;r.width,r.height,o<3||a<3||(i.width=o,i.height=a,ue(r,o,a),Reflect.apply(B,this,[]))}}function ce(){var e=this.renderData,t=this.fadeData;(0,u.isNull)(e)||(e.destroy(),Object.keys(e).forEach(function(t){return e[t]=null}),this.renderData=null),t.destroy(),Object.keys(t).forEach(function(e){return t[e]=null}),this.fadeData=null,this.gl&&(this.gl=null)}function fe(e,t,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,u.isNull)(i)){var l=i.parentElement,s=i.dropProgram,f=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,m=o.resolution,g=l.offsetWidth,v=l.offsetHeight,y=Math.max(g,v);r/=y;var b=new Float32Array([(2*e-g)/y,(v-2*t)/y]);a.viewport(0,0,m,m),a.bindFramebuffer(a.FRAMEBUFFER,p[d]),Reflect.apply(c,this,[f[h]]),a.useProgram(s.id),a.uniform2fv(s.locations.center,b),a.uniform1f(s.locations.radius,r),a.uniform1f(s.locations.strength,n),Reflect.apply(V,this,[]),Reflect.apply(Q,this,[])}}function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function de(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,me(n.key),n)}}function he(e,t,r){return(t=me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e){var t=function(e){if("object"!=pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pe(t)?t:t+""}function ge(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ve(e,t){return e.get(be(e,t))}function ye(e,t,r){return e.set(be(e,t),r),r}function be(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var we=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Oe=new WeakMap,Re=new WeakMap,xe=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Te=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ge(this,we,E.accelerating),ge(this,Ee,E.interactive),ge(this,Se,E.resolution),ge(this,Oe,E.perturbance),ge(this,Re,E.dropRadius),he(this,"imgUrl",E.imgUrl),ge(this,xe,E.idleFluctuations),ge(this,ke,E.raindropsTimeInterval),he(this,"crossOrigin","no-cors"),he(this,"visible",!1),he(this,"running",!1),ge(this,Ae,void 0),he(this,"lastRunningState",!1),this.perturbance=t.perturbance,this.resolution=t.resolution,this.raindropsTimeInterval=t.raindropsTimeInterval,this.accelerating=t.accelerating,this.interactive=t.interactive,this.dropRadius=t.dropRadius,this.imgUrl=t.imgUrl,this.idleFluctuations=t.idleFluctuations,this.running=Boolean(null===(r=t.playingState)||void 0===r||r),this.crossOrigin=t.crossOrigin,this.darkMode=t.darkMode},(t=[{key:"accelerating",get:function(){return ve(we,this)},set:function(e){e>100||e<2||ye(we,this,e)}},{key:"interactive",get:function(){return ve(Ee,this)},set:function(e){(0,u.isBoolean)(e)&&ye(Ee,this,e)}},{key:"resolution",get:function(){return ve(Se,this)},set:function(e){e<100||e>550||ye(Se,this,e)}},{key:"perturbance",get:function(){return ve(Oe,this)},set:function(e){e<1e-4||e>1||ye(Oe,this,e)}},{key:"dropRadius",get:function(){return ve(Re,this)},set:function(e){!isFinite(e)||e<10||ye(Re,this,e)}},{key:"idleFluctuations",get:function(){return ve(xe,this)},set:function(e){(0,u.isBoolean)(e)&&ye(xe,this,e)}},{key:"raindropsTimeInterval",get:function(){return ve(ke,this)},set:function(e){e<10||e>12e3||ye(ke,this,e)}},{key:"playingState",get:function(){return this.running},set:function(e){this.running=Boolean(null==e||e)}},{key:"darkMode",get:function(){return ve(Ae,this)},set:function(e){ye(Ae,this,(0,u.isUndefined)(e)?void 0:Boolean(e))}}])&&de(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Pe(){var e=this.fadeData,t=this.options,r=this.renderData;if((0,u.isNull)(r))return!0;var n=t.imgUrl,i=r.lastUseStyle,o=e.lastDrawImage,a=e.backgroundInfo,l=a.width,s=a.height,c=o.tag,f=o.kind,p=C(t,i),d=o.width===l,h=o.height===s,m=d&&h;if("image"===f&&m&&(0,u.isString)(p)&&p===c)return!0;var g=(0,u.isArray)(n)&&n.join("_")||"";if("linear-gradient"===f&&m&&g===c)return!0;var v=U(t,i);return!("background-color"!==f||!m||c!==v)}function je(){var e=this,t=this.options,r=this.fadeData;(0,u.isUndefined)(r)||(r.transparentId=setTimeout(function(){if(clearTimeout(r.transparentId),r&&r.toBeList)return r.isTransitioning?Reflect.apply(je,e,[]):void(Reflect.apply(Pe,e,[])||r.run())},2*t.raindropsTimeInterval))}function Ie(){var e=this.renderData,t=this.fadeData,r=this.options,n=t.toBeList;if((0,u.isNull)(e))return Reflect.apply(De,this,["还没有准备好,即将退出"]);if((0,u.isEmptyArray)(n))return Reflect.apply(De,this,["由于缺少当前渲染的背景,退出"]);if(0===t.drawProgress&&n.forEach(function(e){}),t.drawProgress>1e3){if(t.lastDrawImage=n.shift(),Reflect.apply(ae,this,[t.lastDrawImage]),(0,u.isEmptyArray)(n)){var i=e.lastUseStyle;((0,u.isNull)(r.imgUrl)||(0,u.isBusinessEmptyString)(r.imgUrl)||(0,u.isZero)(r.imgUrl.length))&&f(i.backgroundColor)&&p(i.backgroundImage)&&Reflect.apply(_,this,[!1])}return Reflect.apply(De,this,["当前执行完毕,开启下次执行"])}var o=t.lastDrawImage,a=t.backgroundInfo;t.drawProgress+=18;var l=document.createElement("canvas"),s=l.getContext("2d");if((0,u.isNull)(s)||(0,u.isNull)(o.resource)||(0,u.isEmptyArray)(n))return Reflect.apply(De,this,"环境值错误");var c=a.width,d=a.height;l.width=c,l.height=d,s.clearRect(0,0,c,d),s.drawImage(o.resource,0,0,c,d),s.globalAlpha=t.drawProgress/1e3,s.drawImage(n[0].resource,0,0,c,d),s.globalAlpha=1;var h={resource:l,width:c,height:d,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ae,this,[h]),n.length>1&&(t.lastDrawImage=h,n.shift(),t.drawProgress=0)}function De(e){this.fadeData.isTransitioning=!1,Reflect.apply(je,this,[])}function _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}function Ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ne(n.key),n)}}function Ue(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fe(e,t,r){return(t=Ne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(e){var t=function(e){if("object"!=_e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=_e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(t)?t:t+""}function Me(e,t){return e.get(Be(e,t))}function Be(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Le=new WeakMap,Xe=new WeakSet,We=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ue(this,r=Xe),r.add(this),Fe(this,"backgroundInfo",{width:0,height:0}),Fe(this,"transparentId",setTimeout(Boolean)),Fe(this,"lastDrawImage",void 0),Fe(this,"toBeList",[]),Fe(this,"drawProgress",0),Fe(this,"isTransitioning",!1),function(e,t){Ue(e,t),t.set(e,void 0)}(this,Le),Fe(this,"isDark",!1);var n,i,o=t.renderData;if((0,u.isNull)(o))n=10,i=10;else{var a=getComputedStyle(o.parentElement);n=parseInt(a.width),i=parseInt(a.height)}this.backgroundInfo={width:n,height:i},this.lastDrawImage={resource:D(n,i),width:n,height:i,kind:"default",tag:""},function(e,t,r){e.set(Be(e,t),r)}(Le,this,window.matchMedia("(prefers-color-scheme: dark)")),this.isDark=Me(Le,this).matches,Me(Le,this).addEventListener("change",Be(Xe,this,ze));var l=this;Object.defineProperty(Me(Le,this),"isDark",{get:function(){return l.isDark},set:function(e){l.isDark=e,Reflect.apply(Pe,t,[])||Reflect.apply(_,t,[!0])}})},(t=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){Me(Le,this).removeEventListener("change",Be(Xe,this,ze)),this.transparentId&&clearTimeout(this.transparentId)}}])&&Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ze(e){this.isDark=e.matches}function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach(function(t){Ke(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function qe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qe(n.key),n)}}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ye=function(){return!!e})()}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function Ve(e,t){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ve(e,t)}function Ke(e,t,r){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(e){var t=function(e){if("object"!=Ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ge(t)?t:t+""}var Ze=function(t){function r(t,n){var i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),Ke(i=function(e,t,r){return t=Je(t),function(e,t){if(t&&("object"==Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ye()?Reflect.construct(t,r||[],Je(e).constructor):t.apply(e,r))}(this,r,[t]),"renderData",null),Ke(i,"options",void 0),Ke(i,"fadeData",void 0),Ke(i,"defaults",E),Ke(i,"initialized",!1),Object.defineProperties(i,{defaults:{value:i.defaults,writable:!1,enumerable:!1,configurable:!1}}),i.options=new Te(He(He({},i.defaults),n));var o=se.bind(i);return i.renderData=new q(t,o,i),i.fadeData=new We(i),(0,u.isFalse)(i.initState)||(0,u.isNull)(t.parentElement)||(0,u.isNull)(i.config)||(0,u.isNull)(i.gl)?i.initState=!1:(function(t){var r=t.parentElement;t.width=r.clientWidth,t.height=r.clientHeight,e(t,{position:"absolute",width:"100%",height:"100%",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(le,i,[])),window.matchMedia("(prefers-color-scheme: dark)"),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ve(e,t)}(r,t),i=r,(o=[{key:"raindropsFall",value:function(){var e=this.renderData,t=this.options,r=this.fadeData;if(!(0,u.isNull)(e)){var i=r.backgroundInfo,o=e.lastRaindropsFallTime,a=t.raindropsTimeInterval,l=t.dropRadius,s=Date.now();if(!(s-o<a)){e.lastRaindropsFallTime=s;var c=function(e){return n(e||1)},f=i.width,p=i.height;this.drop(c(f),c(p),l,.03)}}}},{key:"drop",value:function(e,t,r,n){Reflect.apply(fe,this,[e,t,r,n])}},{key:"fade",value:function(){Reflect.apply(Ie,this,[])}},{key:"destroy",value:function(){Reflect.apply(ce,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(L,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(W,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var e=this.options;e.running=!e.running}},{key:"set",value:function(e,t){"imgUrl"===e?(this.options.imgUrl=t,Reflect.apply(B,this,[])):"darkMode"===e?(this.options.darkMode=t,Reflect.apply(Pe,this,[])||Reflect.apply(_,this,[!0])):this.options[e]=t}}])&&qe(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o}(w)},362:(e,t,r)=>{var n,i;e.exports=(n={isArray:()=>o.isArray,isBoolean:()=>o.isBoolean,isBusinessEmptyString:()=>o.isBusinessEmptyString,isEmptyArray:()=>o.isEmptyArray,isFalse:()=>o.isFalse,isFunction:()=>o.isFunction,isNull:()=>o.isNull,isPlainObject:()=>o.isPlainObject,isString:()=>o.isString,isUndefined:()=>o.isUndefined,isZero:()=>o.isZero,typeOf:()=>o.typeOf},i={},r.d(i,n),i)}},w={};function E(e){var t=w[e];if(void 0!==t)return t.exports;var r=w[e]={exports:{}};return b[e](r,r.exports,E),r.exports}E.d=(e,t)=>{for(var r in t)E.o(t,r)&&!E.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},E.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var S=E(362);function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){var r=d(null),n=d(!0),i=d(!1),o=O(h(!1),2),a=o[0],l=o[1],u=O(h(null),2),s=u[0],c=u[1];function p(){n.current=!0,setTimeout(function(){var e;n.current&&(null===(e=r.current)||void 0===e||e.destroy())},0)}return f(function(){return n.current=!1,(0,S.isNull)(e.current)||i.current||(l(!0),i.current=!0,Promise.resolve().then(E.bind(E,319)).then(function(i){(0,S.isNull)(e.current)||n.current||(r.current=new i.Ripples(e.current,t))}).catch(function(e){c(e)}).finally(function(){l(!1)})),p},[]),{ripples:r,isLoading:a,error:s}}var k=E(319);function A(e,t){var r=d(null);return f(function(){if(!(0,S.isNull)(e.current))return r.current=new k.Ripples(e.current,t),function(){var e;return null===(e=r.current)||void 0===e?void 0:e.destroy()}},[]),r}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function I(e,t,r){return(t=function(e){var t=function(e){if("object"!=T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){var r=d(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach(function(t){I(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t));f(function(){t&&e.current&&Object.keys(e.current.defaults).forEach(function(n){var i,o,a,l=t[n],u=(i=l,o=r.current[n],(0,S.isArray)(i)&&(0,S.isArray)(o)&&(i.length!==o.length||i.some(function(e,t){return e!==o[t]}))||(!(0,S.isArray)(i)||!(0,S.isArray)(o))&&i!==o);e.current&&u&&(r.current[n]=(0,S.isArray)(l)?function(e){if(Array.isArray(e))return P(e)}(a=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t[n],e.current.set(n,l))})},[t])}var _=v.div.withConfig({displayName:"Content",componentId:"sc-1rvy95w-0"})(["position:relative;top:0px;left:0px;z-index:1;width:100%;height:100%;min-width:1px;min-height:1px;contain:layout paint style;will-change:transform,opacity;"]);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}var U=["children","style","option"];function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},F.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(t){B(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function B(e,t,r){return(t=function(e){var t=function(e){if("object"!=C(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==C(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L=u(function(e,t){var r=e.children,n=e.style,i=e.option,o=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,U),a=d(null),u=A(a,i);return D(u,i),p(t,function(){return{toggleState:function(){var e;null===(e=u.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=u.current)||void 0===e||e.pause()},set:function(e){if(!(0,S.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=u.current)||void 0===i||i.set(o,e[o])}}}}),l.createElement(_,F({style:M({backgroundRepeat:"round"},n)},o),l.createElement("canvas",{ref:a,"data-earthnut-ui":"canvas",width:0,height:0}),r)});function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}L.displayName="en-background-ripple";var W=["children","style","option"];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach(function(t){H(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function H(e,t,r){return(t=function(e){var t=function(e){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var q=u(function(e,t){var r=e.children,n=e.style,i=e.option,o=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,W),a=d(null),u=x(a,i).ripples;return D(u,i),p(t,function(){return{toggleState:function(){var e;null===(e=u.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=u.current)||void 0===e||e.pause()},set:function(e){if(!(0,S.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=u.current)||void 0===i||i.set(o,e[o])}}}}),l.createElement(_,z({style:$({backgroundRepeat:"round"},n)},o),l.createElement("canvas",{ref:a,"data-earthnut-ui":"canvas",width:0,height:0}),r)});function Y(){var e=d(void 0);return f(function(){return function(){return e.current&&clearTimeout(e.current)}},[]),e}function J(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n=(0,S.isBoolean)(n)?{immediately:n,once:!1}:(0,S.isPlainObject)(n)?{once:!!(0,S.isBoolean)(n.once)&&n.once,immediately:!!(0,S.isBoolean)(n.immediately)&&n.immediately}:{immediately:!1,once:!1};var i=d({id:0,immediately:null===(t=n.immediately)||void 0===t||t,once:null!==(r=n.once)&&void 0!==r&&r,noun:!1,time:0,cancelTime:0,firstRunEffect:!0,isUnmounted:!0,result:{cancel:function(){var e=i.current.id;e&&window.cancelAnimationFrame(e),i.current.result.canceled=!0},canceled:!1,render:function(){var e=i.current,t=e.result;e.cancelTime=performance.now(),t.cancel(),t.canceled=!1,e.id=window.requestAnimationFrame(a)}}}),o=i.current,a=s(function(t){var r=o.result,n=t-o.cancelTime;o.time+=n<0?16.7:n,e(t,o.time),o.once||r.render()},[e]);return o.immediately&&!o.noun&&o.result.canceled&&(o.noun=!0,o.result.render()),f(function(){o.once||(o.firstRunEffect?(o.result.render(),o.firstRunEffect=!1):o.firstRunEffect||o.result.canceled||o.result.render())},[e]),f(function(){return o.isUnmounted=!1,function(){o.isUnmounted=!0,setTimeout(function(){o.isUnmounted&&o.result.cancel()},0)}},[]),o.result}function V(e){var t=d(!1);return f(function(){var r=e.current;if(r){var n=function(){return t.current=!0},i=function(){return t.current=!1};return r.addEventListener("compositionstart",n),r.addEventListener("compositionend",i),function(){r.removeEventListener("compositionstart",n),r.removeEventListener("compositionend",i)}}},[]),t}q.displayName="en-lazy-background-ripple";const K="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////9zeKVjAAAAA3RSTlP//wDXyg1BAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQImWNkYmBgYGJAIQAAigAKNDhFkwAAAABJRU5ErkJggg==";function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Z(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ee=["loadingSrc","className","src"];function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(null,arguments)}var re=v.img.withConfig({displayName:"image__Content",componentId:"sc-qt83ib-0"})(["margin:0;padding:0;user-select:none;"]),ne=u(function(e,t){var r=e.loadingSrc,n=void 0===r?K:r,i=e.className,o=e.src,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,ee),u=function(e,t){var r=Q(h(K),2),n=r[0],i=r[1],o=Q(h(0),2),a=o[0],l=o[1];return f(function(){l(1),(0,S.isString)(e)||(e=K);var t=new Image;t.onload=function(){l(2),i(e)},t.onerror=function(){i(K),l(4)},t.src=e,t.crossOrigin="anonymous"},[e,t]),{resultSrc:n,loadComplete:a}}(null!=o?o:n),s=u.resultSrc,c=u.loadComplete;return l.createElement(re,te({},a,{ref:t,src:s||n,className:y(1===c&&"loading",i)}))});function ie(e){var t=localStorage.getItem(e);try{return null!=t&&JSON.parse(t)||""}catch(e){return t||""}}function oe(e){return localStorage.removeItem(e)}ne.displayName="en-image";var ae={del:oe,set:function(e,t){localStorage.setItem(e,JSON.stringify(t))},get:ie,getAndDel:function(e){var t=ie(e);return oe(e),t},clear:function(){localStorage.clear()},setSession:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},getSession:function(e){var t=sessionStorage.getItem(e);return null!=t&&JSON.parse(t)||""},delSession:function(e){return sessionStorage.removeItem(e)}},le={get theme(){return ae.get("theme")},set theme(e){["light","dark"].includes(e)?ae.set("theme",e):(0,S.isBusinessEmptyString)(e)&&ae.del("theme")},get token(){return ae.get("token")},set token(e){(0,S.isString)(e)&&!(0,S.isBusinessEmptyString)(e)&&ae.set("token",e)}},ue={getItem:function(e){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e){var t=e.keyItem,r=e.value,n=e.end,i=e.path,o=e.domain,a=e.secure;if(!t||/^(?:expires|max-age|path|domain|secure)$/i.test(t))return!1;var l="";switch((0,S.typeOf)(n)){case"undefined":l="; expires=Fri, 31 Dec 9999 23:59:59 GMT";break;case"number":l=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case"string":l="; expires="+n;break;case"date":l="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(t).concat("=").concat(encodeURIComponent(r)).concat(l).concat(o?"; domain=".concat(o):"").concat(i?"; path=".concat(i):"").concat(a?"; secure":""),!0},deleteItem:function(e,t,r){return!(!e||!this.exist(e)||(document.cookie=encodeURIComponent(e).concat("=; expires=Thu, 01 Jan 1970 00:00:00 GMT").concat(r?"; domain=".concat(r):"").concat(t?"; path=".concat(t):""),0))},exist:function(e){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:1|$)/g,"").split(/\s*(?:=[^;]*)?;\s*/),t=0;t<e.length;t++)e[t]=decodeURIComponent(e[t]);return e}};function se(e){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},se(e)}function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fe(n.key),n)}}function fe(e){var t=function(e){if("object"!=se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==se(t)?t:t+""}function pe(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var de=new WeakSet;function he(e){var t,r;return null!==(t=null===(r=window)||void 0===r?void 0:r.matchMedia(/:/.test(e)&&!/\(|\)/.test(e)?"(".concat(e,")"):e).matches)&&void 0!==t&&t}var me=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}(this,de)},t=[{key:"vibrate",value:function(){var e;null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.vibrate&&window.navigator.vibrate(200)}},{key:"share",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"https://letmiseesee.pages.dev",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"慧土灵核";null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.share&&window.navigator.share({url:t,text:r,title:n})}},{key:"isPhone",value:function(){var e;return!pe(de,this,he).call(this,"any-hover: hover")&&!pe(de,this,he).call(this,"any-pointer: fine")&&(null===(e=window)||void 0===e||null===(e=e.navigator)||void 0===e?void 0:e.maxTouchPoints)>0}},{key:"isSmallScreen",get:function(){return pe(de,this,he).call(this,"max-width: 576px")?"small":pe(de,this,he).call(this,"max-width: 996px")?"middle":"large"}},{key:"isDark",get:function(){return pe(de,this,he).call(this,"prefers-color-scheme: dark")}},{key:"isOrientation",get:function(){var e=(screen.orientation||{}).type||screen.mozOrientation||screen.msOrientation;return"landscape-primary"!==e&&"landscape-secondary"!==e}}],t&&ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],u=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ve(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ye=function(){return"light"},be=a({autoColorMode:!0,colorModeClassName:"en-light",colorMode:"light",toggleColorMode:ye,setColorMode:ye,clearColorMode:function(){}});function we(){var e=c(be);return e.setColorMode!==ye&&e.toggleColorMode!==ye||console.warn("use ColorMode 应当在 <ThemeColorModeProvider /> 内部使用"),e}function Ee(e){var t=e.children,r=e.initialTheme,n=ge(h(r),2),i=n[0],o=n[1],a=ge(h(!0),2),u=a[0],s=a[1],c=function(e){var t=!le.theme;t?(ue.deleteItem("theme"),le.theme=""):ue.setItem({keyItem:"theme",value:e}),window.document.documentElement.setAttribute("data-theme",e),s(t)},p=function(e){return["light","dark"].indexOf(e)<0?i:(le.theme=e,e!==i?o(e):c(i),e)};return f(function(){var e=le.theme;s(!e);var t=me.isDark;e?p(e):o(t?"dark":"light")},[]),f(function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(e){return!le.theme&&o(e.matches?"dark":"light")};return e.addEventListener("change",t),function(){return e.removeEventListener("change",t)}},[]),f(function(){c(i)},[i]),l.createElement(be.Provider,{value:{colorMode:i,colorModeClassName:"en-".concat(i),toggleColorMode:function(){return p("light"===i?"dark":"light")},setColorMode:p,clearColorMode:function(){s(!0),o(me.isDark?"dark":"light"),le.theme="",ue.deleteItem("theme")},autoColorMode:u}},t)}var Se,Oe,Re=v.div.withConfig({displayName:"SwitchContent",componentId:"sc-1i8tohq-0"})(["cursor:pointer;position:relative;top:0px;left:0px;color:#000;display:inline-block;width:54px;height:27px;margin:0;padding:0;vertical-align:text-bottom;background-color:transparent;background-image:linear-gradient(to right,rgb(90,90,90),rgba(70,120,240)),radial-gradient( circle closest-corner at 100% 50%,rgb(90,90,90),rgb(90,90,90) 100%,transparent 100% ),radial-gradient( circle closest-corner at 0% 50%,rgba(70,120,240),rgba(70,120,240) 100%,transparent 100% );background-size:40% 50%,20% 50%,20% 50%;background-position:50% 50%,13.25% 50%,85% 50%;background-repeat:no-repeat;overflow:hidden;&::before{content:'';position:absolute;top:10%;width:40%;height:80%;text-align:center;line-height:1.3;font-size:40%;border-radius:50%;transition:all 1s;","}"],function(e){return"left"===e.$type&&m(["left:15%;background-color:rgb(120,120,120);"])||m(["left:45%;background-color:rgba(35,70,247,1);"])}),xe=v.div.withConfig({displayName:"SwitchContainer",componentId:"sc-ixe4ua-0"})(["display:inline-block;padding:4px 12px;"]);function ke(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ae=v.div.withConfig({displayName:"SwitchLabel",componentId:"sc-yl5nc4-0"})(["display:inline-block;vertical-align:super;transition:color 1.28s;",""],function(e){return!0===e.$type&&m(Se||(Se=ke(["\n color: rgb(55,80,210);\n font-weight: 800;\n "])))||m(Oe||(Oe=ke(["\n color: #666;\n "])))}),Te=["value","change","children"];function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pe.apply(null,arguments)}function je(e){var t=e.value,r=e.change,n=e.children,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Te);return l.createElement(xe,null,n&&l.createElement(Ae,{$type:t},n),l.createElement(Re,Pe({$type:t?"right":"left",onClick:function(e){e.preventDefault(),e.stopPropagation(),(0,S.isFunction)(r)&&Reflect.apply(r,null,[e])}},i)))}var Ie=g.details.withConfig({displayName:"Details__DetailsContext",componentId:"sc-qf3efl-0"})(["box-shadow:0px 0px 12px 0px #f033;border-radius:12px;padding:30px;margin:5px;transition:all 0.38s;position:relative;min-height:2rem;max-height:85vh;overflow:auto;&[open]{transition:all 0.68s;padding:0px 10px 10px;box-shadow:0px 0px 12px 4px #0af;summary{transition:all 0.68s;box-shadow:-1px 0px 6px 0px #f366;color:var(--en-text-primary);background-color:var(--en-background-primary);border-radius:0px 0px 18px 18px;}}"]),De=g.summary.withConfig({displayName:"Details__SummaryContext",componentId:"sc-qf3efl-1"})(["position:sticky;position:-webkit-sticky;top:0px;left:10px;z-index:30;padding:15px 10px;"]);function _e(e){var t=e.title,r=e.children,n=e.open;return l.createElement(Ie,{open:n},l.createElement(De,null,t||""),r)}export{L as BackgroundRipple,_e as Details,_e as EnDetails,ne as EnImage,je as EnSwitch,ne as Image,q as LazyBackgroundRipple,je as Switch,Ee as ThemeColorModeProvider,J as useAnimationFrame,we as useColorMode,V as useInputIsComposing,x as useLazyRipples,A as useRipples,Y as useTimeId};
|
package/index.mjs
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
export {
|
|
2
|
+
useLazyRipples,
|
|
3
|
+
BackgroundRipple,
|
|
4
|
+
LazyBackgroundRipple,
|
|
5
|
+
useTimeId,
|
|
6
|
+
useInputIsComposing,
|
|
7
|
+
useRipples,
|
|
8
|
+
Image,
|
|
9
|
+
EnImage,
|
|
10
|
+
useColorMode,
|
|
11
|
+
ThemeColorModeProvider,
|
|
12
|
+
Switch,
|
|
13
|
+
EnSwitch,
|
|
14
|
+
Details,
|
|
15
|
+
EnDetails,
|
|
16
|
+
} from './client.mjs';
|
|
1
17
|
|
|
2
|
-
|
|
3
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
Layout,
|
|
22
|
+
LayoutContent,
|
|
23
|
+
LayoutFooter,
|
|
24
|
+
LayoutHeader,
|
|
25
|
+
LayoutSideBar,
|
|
26
|
+
EnLayout,
|
|
27
|
+
EnLayoutContent,
|
|
28
|
+
EnLayoutFooter,
|
|
29
|
+
EnLayoutHeader,
|
|
30
|
+
EnLayoutSideBar,
|
|
31
|
+
_en,
|
|
32
|
+
en,
|
|
33
|
+
enc,
|
|
34
|
+
} from './server.mjs';
|
package/layoutUtil.mjs
CHANGED
|
@@ -6,5 +6,4 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
"use client";
|
|
9
|
-
import{css as e,styled as t}from"styled-components";var a=t.main.withConfig({displayName:"EnLayoutContent__LayoutContentContainer",componentId:"sc-uah7gw-0"})(["grid-area:content;position:relative;scroll-behavior:smooth;"]),o=t.footer.withConfig({displayName:"EnLayoutContent__LayoutFooterContent",componentId:"sc-uah7gw-1"})(["grid-area:footer;position:relative;height:var(--layout-footer-height);box-shadow:0 -1px 13px 0px #0000001a;overflow:hidden;"]),i=t.nav.withConfig({displayName:"EnLayoutContent__LayoutHeaderContainer",componentId:"sc-uah7gw-2"})(["grid-area:header;position:sticky;top:0px;left:0px;z-index:10;height:var(--layout-header-height);box-shadow:0 4px 13px -3px #0000001a;overflow:hidden;scroll-behavior:smooth;"]),r=t.aside.withConfig({displayName:"EnLayoutContent__LayoutSideBarContainer",componentId:"sc-uah7gw-3"})(["position:sticky;left:0;z-index:8;grid-area:side;overflow-x:hidden;overflow-y:auto;"]),l=t.div.withConfig({displayName:"EnLayoutContent__LayoutContentWrapper",componentId:"sc-uah7gw-4"})(["position:relative;grid-area:content;overflow:auto;"]),h=t.div.withConfig({displayName:"EnLayoutContent",componentId:"sc-uah7gw-5"})(["position:relative;top:0px;height:var(--layout-self-height);width:var(--layout-self-width);overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;"," "," "," "," "," "," "," "," ",""],function(t){var a=t.$layoutType,o=t.$content,i=t.$sidebar;return["simple-all","simple-no-footer","side-right-no-footer","side-right-all","simple-no-header","side-right-no-header"].includes(a)&&e(["& > .","{display:grid;scroll-behavior:smooth;"," "," "," "," "," & > .","{top:var(--layout-header-height);"," "," ","}}"],o,["simple-all","side-right-all"].includes(a)&&e(["grid-template-rows:max( 100%,calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height)) ) auto;min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );"]),["simple-no-footer","side-right-no-footer"].includes(a)&&e(["grid-template-rows:max(100%,calc(var(--layout-height) - var(--layout-header-height))) auto;min-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-header","side-right-no-header"].includes(a)&&e(["grid-template-rows:max(100%,calc(var(--layout-height) - var(--layout-footer-height))) auto;"]),["simple-all","simple-no-header","simple-no-footer"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side content' '. content';"]),["side-right-all","side-right-no-header","side-right-no-footer"].includes(a)&&e(["grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:'content side' 'content .';"]),i,["simple-all","side-right-all"].includes(a)&&e(["min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );max-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-footer","side-right-no-footer"].includes(a)&&e(["min-height:calc(var(--layout-height) - var(--layout-header-height));max-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-header","side-right-no-header"].includes(a)&&e(["top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height);"]))},function(t){var a=t.$layoutType,o=t.$content,i=t.$sidebar;return["side-full-all","side-right-full-all","side-full-no-footer","side-right-full-no-footer","side-full-no-header","side-right-full-no-header"].includes(a)&&e(["display:grid;grid-template-rows:100%;gap:0px;"," "," & > .","{height:100%;}& > .","{height:100%;overflow:auto;grid-area:container;display:grid;scroll-behavior:smooth;"," "," ","}"],["side-full-no-footer","side-full-all","side-full-no-header"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side container';"]),["side-right-full-no-footer","side-right-full-all","side-right-full-no-header"].includes(a)&&e(["grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:'container side';"]),i,o,["side-full-all","side-right-full-all"].includes(a)&&e(["grid-template-rows:var(--layout-header-height) auto var(--layout-footer-height);grid-template-areas:'header' 'content' 'footer';"]),["side-full-no-footer","side-right-full-no-footer"].includes(a)&&e(["grid-template-rows:var(--layout-header-height) auto;grid-template-areas:'header' 'content';"]),["side-full-no-header","side-right-full-no-header"].includes(a)&&e(["grid-template-rows:auto var(--layout-footer-height);grid-template-areas:'content' 'footer';"]))},function(t){var a=t.$headerNoSticky,o=t.$header,i=t.$layoutType,r=t.$content,l=t.$sidebar;return a&&e(["& > .",",& > ."," > .","{position:relative;z-index:2;}",""],o,r,o,["simple-all","side-right-all","simple-no-footer","side-right-no-footer"].includes(i)&&e(["& > ."," > .","{top:0;"," "," max-height:var(--layout-height);}"],r,l,["side-right-no-footer","simple-no-footer"].includes(i)&&e(["min-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-all","side-right-all"].includes(i)&&e(["min-height:calc( var(--layout-height) - var(--layout-footer-height) - var(--layout-header-height) );"])))},function(t){var a=t.$layoutType,o=t.$content;return"no-side"===a&&e(["& > .","{scroll-behavior:smooth;min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );}"],o)},function(t){return"only-footer"===t.$layoutType&&e(["display:grid;grid-template-rows:auto var(--layout-footer-height);grid-template-columns:1fr;gap:0px;grid-template-areas:'content' 'footer';"])},function(t){return"only-header"===t.$layoutType&&e(["display:grid;grid-template-rows:var(--layout-header-height) auto;grid-template-columns:1fr;gap:0px;grid-template-areas:'header' 'content';"])},function(t){var a=t.$layoutType,o=t.$sidebar;return["simple-only-side","side-right-only-side","side-full-only-side","side-right-full-only-side"].includes(a)&&e(["display:grid;grid-template-rows:max(100%,var(--layout-height)) auto;gap:0px;& > .","{top:0;}"],o)},function(t){var a=t.$layoutType;return["simple-only-side","side-full-only-side"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side content' '. content';"])},function(t){var a=t.$layoutType;return("side-right-full-only-side"===a||"side-right-only-side"===a)&&e(["grid-template-areas:'content side' 'content .';grid-template-columns:auto var(--layout-side-bar-width);"])});export{h as EnLayoutContent,a as LayoutContentContainer,l as LayoutContentWrapper,o as LayoutFooterContent,i as LayoutHeaderContainer,r as LayoutSideBarContainer};
|
|
10
|
-
//# sourceMappingURL=layoutUtil.mjs.map
|
|
9
|
+
import{css as e,styled as t}from"styled-components";var a=t.main.withConfig({displayName:"EnLayoutContent__LayoutContentContainer",componentId:"sc-uah7gw-0"})(["grid-area:content;position:relative;scroll-behavior:smooth;"]),o=t.footer.withConfig({displayName:"EnLayoutContent__LayoutFooterContent",componentId:"sc-uah7gw-1"})(["grid-area:footer;position:relative;height:var(--layout-footer-height);box-shadow:0 -1px 13px 0px #0000001a;overflow:hidden;"]),i=t.nav.withConfig({displayName:"EnLayoutContent__LayoutHeaderContainer",componentId:"sc-uah7gw-2"})(["grid-area:header;position:sticky;top:0px;left:0px;z-index:10;height:var(--layout-header-height);box-shadow:0 4px 13px -3px #0000001a;overflow:hidden;scroll-behavior:smooth;"]),r=t.aside.withConfig({displayName:"EnLayoutContent__LayoutSideBarContainer",componentId:"sc-uah7gw-3"})(["position:sticky;left:0;z-index:8;grid-area:side;overflow-x:hidden;overflow-y:auto;"]),l=t.div.withConfig({displayName:"EnLayoutContent__LayoutContentWrapper",componentId:"sc-uah7gw-4"})(["position:relative;grid-area:content;overflow:auto;"]),h=t.div.withConfig({displayName:"EnLayoutContent",componentId:"sc-uah7gw-5"})(["position:relative;top:0px;height:var(--layout-self-height);width:var(--layout-self-width);overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;"," "," "," "," "," "," "," "," ",""],function(t){var a=t.$layoutType,o=t.$content,i=t.$sidebar;return["simple-all","simple-no-footer","side-right-no-footer","side-right-all","simple-no-header","side-right-no-header"].includes(a)&&e(["& > .","{display:grid;scroll-behavior:smooth;"," "," "," "," "," & > .","{top:var(--layout-header-height);"," "," ","}}"],o,["simple-all","side-right-all"].includes(a)&&e(["grid-template-rows:max( 100%,calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height)) ) auto;min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );"]),["simple-no-footer","side-right-no-footer"].includes(a)&&e(["grid-template-rows:max(100%,calc(var(--layout-height) - var(--layout-header-height))) auto;min-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-header","side-right-no-header"].includes(a)&&e(["grid-template-rows:max(100%,calc(var(--layout-height) - var(--layout-footer-height))) auto;"]),["simple-all","simple-no-header","simple-no-footer"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side content' '. content';"]),["side-right-all","side-right-no-header","side-right-no-footer"].includes(a)&&e(["grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:'content side' 'content .';"]),i,["simple-all","side-right-all"].includes(a)&&e(["min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );max-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-footer","side-right-no-footer"].includes(a)&&e(["min-height:calc(var(--layout-height) - var(--layout-header-height));max-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-no-header","side-right-no-header"].includes(a)&&e(["top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height);"]))},function(t){var a=t.$layoutType,o=t.$content,i=t.$sidebar;return["side-full-all","side-right-full-all","side-full-no-footer","side-right-full-no-footer","side-full-no-header","side-right-full-no-header"].includes(a)&&e(["display:grid;grid-template-rows:100%;gap:0px;"," "," & > .","{height:100%;}& > .","{height:100%;overflow:auto;grid-area:container;display:grid;scroll-behavior:smooth;"," "," ","}"],["side-full-no-footer","side-full-all","side-full-no-header"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side container';"]),["side-right-full-no-footer","side-right-full-all","side-right-full-no-header"].includes(a)&&e(["grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:'container side';"]),i,o,["side-full-all","side-right-full-all"].includes(a)&&e(["grid-template-rows:var(--layout-header-height) auto var(--layout-footer-height);grid-template-areas:'header' 'content' 'footer';"]),["side-full-no-footer","side-right-full-no-footer"].includes(a)&&e(["grid-template-rows:var(--layout-header-height) auto;grid-template-areas:'header' 'content';"]),["side-full-no-header","side-right-full-no-header"].includes(a)&&e(["grid-template-rows:auto var(--layout-footer-height);grid-template-areas:'content' 'footer';"]))},function(t){var a=t.$headerNoSticky,o=t.$header,i=t.$layoutType,r=t.$content,l=t.$sidebar;return a&&e(["& > .",",& > ."," > .","{position:relative;z-index:2;}",""],o,r,o,["simple-all","side-right-all","simple-no-footer","side-right-no-footer"].includes(i)&&e(["& > ."," > .","{top:0;"," "," max-height:var(--layout-height);}"],r,l,["side-right-no-footer","simple-no-footer"].includes(i)&&e(["min-height:calc(var(--layout-height) - var(--layout-header-height));"]),["simple-all","side-right-all"].includes(i)&&e(["min-height:calc( var(--layout-height) - var(--layout-footer-height) - var(--layout-header-height) );"])))},function(t){var a=t.$layoutType,o=t.$content;return"no-side"===a&&e(["& > .","{scroll-behavior:smooth;min-height:calc( var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height) );}"],o)},function(t){return"only-footer"===t.$layoutType&&e(["display:grid;grid-template-rows:auto var(--layout-footer-height);grid-template-columns:1fr;gap:0px;grid-template-areas:'content' 'footer';"])},function(t){return"only-header"===t.$layoutType&&e(["display:grid;grid-template-rows:var(--layout-header-height) auto;grid-template-columns:1fr;gap:0px;grid-template-areas:'header' 'content';"])},function(t){var a=t.$layoutType,o=t.$sidebar;return["simple-only-side","side-right-only-side","side-full-only-side","side-right-full-only-side"].includes(a)&&e(["display:grid;grid-template-rows:max(100%,var(--layout-height)) auto;gap:0px;& > .","{top:0;}"],o)},function(t){var a=t.$layoutType;return["simple-only-side","side-full-only-side"].includes(a)&&e(["grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:'side content' '. content';"])},function(t){var a=t.$layoutType;return("side-right-full-only-side"===a||"side-right-only-side"===a)&&e(["grid-template-areas:'content side' 'content .';grid-template-columns:auto var(--layout-side-bar-width);"])});export{h as EnLayoutContent,a as LayoutContentContainer,l as LayoutContentWrapper,o as LayoutFooterContent,i as LayoutHeaderContainer,r as LayoutSideBarContainer};
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"name": "oops-ui",
|
|
11
|
-
"version": "1.1.
|
|
11
|
+
"version": "1.1.1",
|
|
12
12
|
"description": "一个 earthnut 的 react ui,既然可以使用 oops-ui 导入,建议使用 enr ",
|
|
13
13
|
"overrides": {
|
|
14
14
|
"css-loader": "6.11.0"
|
|
@@ -23,25 +23,25 @@
|
|
|
23
23
|
"styles",
|
|
24
24
|
"type",
|
|
25
25
|
"client.mjs",
|
|
26
|
-
"client.mjs.map",
|
|
27
26
|
"index.mjs",
|
|
28
27
|
"layoutUtil.mjs",
|
|
29
|
-
"
|
|
30
|
-
"server.mjs",
|
|
31
|
-
"server.mjs.map"
|
|
28
|
+
"server.mjs"
|
|
32
29
|
],
|
|
33
30
|
"exports": {
|
|
34
31
|
".": {
|
|
35
32
|
"types": "./type/index.d.ts",
|
|
36
|
-
"import": "./index.mjs"
|
|
33
|
+
"import": "./index.mjs",
|
|
34
|
+
"default": "./index.mjs"
|
|
37
35
|
},
|
|
38
36
|
"./client": {
|
|
39
37
|
"types": "./type/index.client.d.ts",
|
|
40
|
-
"import": "./client.mjs"
|
|
38
|
+
"import": "./client.mjs",
|
|
39
|
+
"default": "./client.mjs"
|
|
41
40
|
},
|
|
42
41
|
"./server": {
|
|
43
42
|
"types": "./type/index.server.d.ts",
|
|
44
|
-
"import": "./server.mjs"
|
|
43
|
+
"import": "./server.mjs",
|
|
44
|
+
"default": "./server.mjs"
|
|
45
45
|
},
|
|
46
46
|
"./scss": "./styles/common.scss",
|
|
47
47
|
"./css": "./styles/common.css",
|
|
@@ -73,5 +73,6 @@
|
|
|
73
73
|
"react": ">= 17",
|
|
74
74
|
"react-dom": ">= 17",
|
|
75
75
|
"styled-components": ">= 6"
|
|
76
|
-
}
|
|
76
|
+
},
|
|
77
|
+
"sideEffects": false
|
|
77
78
|
}
|
package/server.mjs
CHANGED
|
@@ -4,5 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2025 earthnut.dev
|
|
5
5
|
* 请在项目根参看详细许可证明
|
|
6
6
|
*/
|
|
7
|
-
import{xcn as e}from"xcn";import{Children as t,Fragment as r,cloneElement as n,default as a,forwardRef as o,isValidElement as l}from"react";import{EnLayoutContent as i,LayoutContentContainer as s,LayoutContentWrapper as u,LayoutFooterContent as c,LayoutHeaderContainer as f,LayoutSideBarContainer as y}from"./layoutUtil.mjs";import{isNumber as p,isString as m}from"a-type-of-js";var d={};function h(){return e.apply(void 0,arguments)}d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var v=["className","children","height","noSticky"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(null,arguments)}var O=o(function(t,r){var n=t.className,o=t.children,l=(t.height,t.noSticky,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,v));return a.createElement(f,b({ref:r,className:e(["en-layout-header"],n)},l,{"data-enr-ui":"layout-header"}),o)});O.displayName="LayoutHeader";var g=["className","width","right","full"];function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(null,arguments)}var j=o(function(t,r){var n=t.className,o=(t.width,t.right,t.full,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,g));return a.createElement(y,w({className:e("en-layout-side",n),ref:r},o,{"data-enr-ui":"layout-side-bar"}))});j.displayName="LayoutSideBar";var N=["className"];function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P.apply(null,arguments)}var E=o(function(t,r){var n=t.className,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,N);return a.createElement(s,P({ref:r,className:e("en-layout-main",n)},o,{"data-enr-ui":"layout-content"}))});E.displayName="LayoutContent";var S=["className","height"];function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L.apply(null,arguments)}var x=o(function(t,r){var n=t.className,o=(t.height,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,S));return a.createElement(c,L({ref:r},o,{className:e("en-layout-footer",n),"data-enr-ui":"layout-footer"}))});function C(e){return p(e)||parseInt(e)===Number(e)?e+"px":e||0}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}x.displayName="LayoutFooter";var $=["className","children","style","width","height","classes"];function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach(function(t){B(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function B(e,t,r){return(t=function(e){var t=function(e){if("object"!=F(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==F(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W(e){return p(e)?e>0&&e<=1?"".concat(100*e,"%"):e:/^0\.\d+$/.test(e)?"".concat(100*parseFloat(e),"%"):e}var D=o(function(o,s){var c,f,y,p,d=o.className,h=o.children,v=o.style,b=o.width,g=void 0===b?"100%":b,w=o.height,N=void 0===w?"100%":w,P=o.classes,S=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(o,$),L=t.count(h),F="simple",I=!1,B=!1,T=!1,A=!1,R=!1,U=150,V="2.8rem",q="2rem",z="en-layout-header",G="en-layout-content",J="en-layout-main",K="en-layout-sidebar",M="en-layout-footer";1===L&&t.forEach(h,function(e){var n;if(l(e)){var a,o=t.only(e);l(a=o)&&a.type===r&&(h=t.toArray(null==e||null===(n=e.props)||void 0===n?void 0:n.children))}}),g=W(g),N=W(N),t.forEach(h,function(t){if(l(t))if(B||t.type!==O)if(T||t.type!==j)if(A||t.type!==E)if(A||t.type!==D){if(!R&&t.type===x){var r=t;q=r.props.height||q,p=n(r,{className:e(M,r.props.className)}),R=!0}}else{var o=t;y=a.createElement(u,{"data-enr-ui":"layout-content",className:e(J,"en-layout-main")},o),A=!0}else y=n(t,{className:e(J,t.props.className)}),A=!0;else{var i=t,s=i.props;U=s.width||U,F=s.right&&s.full?"side-right-full":s.right?"side-right":s.full?"side-full":"simple",f=n(i,{className:e(K,i.props.className)}),T=!0}else{var m,d=t,h=d.props;V=h.height||V,I=null!==(m=h.noSticky)&&void 0!==m&&m,c=n(d,{className:e(z,d.props.className)}),B=!0}});var Q=B&&T&&A&&R?"".concat(F,"-all"):B&&A&&T?"".concat(F,"-no-footer"):T&&A&&R?"".concat(F,"-no-header"):B&&A&&R?"no-side":A&&R?"only-footer":A&&B?"only-header":A&&T?"".concat(F,"-only-side"):"simple",X=k({layoutHeight:g,layoutWith:N,sideBarWidth:U,headerHeight:V,footerHeight:q},S.theme||{});"side-full-only-side"===Q?Q="simple-only-side":"side-right-full-only-side"===Q&&(Q="side-right-only-side");var Y=/-only-side$/.test(Q),Z=/^side.*full/.test(Q);return a.createElement(i,H({ref:s,$headerNoSticky:I,$layoutType:Q,$header:z,$sidebar:K,$main:J,$content:G,$footer:M,className:e(d,P),style:k({"--layout-self-width":C(g),"--layout-self-height":C(N),"--layout-width":C(m(g)&&g.endsWith("%")?"100%":g),"--layout-height":C(m(N)&&N.endsWith("%")?"100%":N),"--layout-side-bar-width":C(U),"--layout-header-height":C(V),"--layout-footer-height":C(q)},v),theme:X},S,{"data-enr-ui":"layout","data-enr-layout-type":Q}),Y?a.createElement(a.Fragment,null,f," ",y):Z?a.createElement(a.Fragment,null,f,a.createElement("div",{className:e(G),"data-enr-ui":"layout-side-full-container"},c,y,p)):a.createElement(a.Fragment,null,c,a.createElement("div",{className:e(G),"data-enr-ui":"layout-side-no-full-content"},f,y),p))});D.displayName="Layout";export{D as EnLayout,E as EnLayoutContent,x as EnLayoutFooter,O as EnLayoutHeader,j as EnLayoutSideBar,D as Layout,E as LayoutContent,x as LayoutFooter,O as LayoutHeader,j as LayoutSideBar,h as _en,h as en,h as enc};
|
|
8
|
-
//# sourceMappingURL=server.mjs.map
|
|
7
|
+
import{xcn as e}from"xcn";import{Children as t,Fragment as r,cloneElement as n,default as a,forwardRef as o,isValidElement as l}from"react";import{EnLayoutContent as i,LayoutContentContainer as s,LayoutContentWrapper as u,LayoutFooterContent as c,LayoutHeaderContainer as f,LayoutSideBarContainer as y}from"./layoutUtil.mjs";import{isNumber as p,isString as m}from"a-type-of-js";var d={};function h(){return e.apply(void 0,arguments)}d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var v=["className","children","height","noSticky"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(null,arguments)}var O=o(function(t,r){var n=t.className,o=t.children,l=(t.height,t.noSticky,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,v));return a.createElement(f,b({ref:r,className:e(["en-layout-header"],n)},l,{"data-enr-ui":"layout-header"}),o)});O.displayName="LayoutHeader";var g=["className","width","right","full"];function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(null,arguments)}var j=o(function(t,r){var n=t.className,o=(t.width,t.right,t.full,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,g));return a.createElement(y,w({className:e("en-layout-side",n),ref:r},o,{"data-enr-ui":"layout-side-bar"}))});j.displayName="LayoutSideBar";var N=["className"];function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P.apply(null,arguments)}var E=o(function(t,r){var n=t.className,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,N);return a.createElement(s,P({ref:r,className:e("en-layout-main",n)},o,{"data-enr-ui":"layout-content"}))});E.displayName="LayoutContent";var S=["className","height"];function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L.apply(null,arguments)}var x=o(function(t,r){var n=t.className,o=(t.height,function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,S));return a.createElement(c,L({ref:r},o,{className:e("en-layout-footer",n),"data-enr-ui":"layout-footer"}))});function C(e){return p(e)||parseInt(e)===Number(e)?e+"px":e||0}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}x.displayName="LayoutFooter";var $=["className","children","style","width","height","classes"];function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach(function(t){B(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function B(e,t,r){return(t=function(e){var t=function(e){if("object"!=F(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==F(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W(e){return p(e)?e>0&&e<=1?"".concat(100*e,"%"):e:/^0\.\d+$/.test(e)?"".concat(100*parseFloat(e),"%"):e}var D=o(function(o,s){var c,f,y,p,d=o.className,h=o.children,v=o.style,b=o.width,g=void 0===b?"100%":b,w=o.height,N=void 0===w?"100%":w,P=o.classes,S=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(o,$),L=t.count(h),F="simple",I=!1,B=!1,T=!1,A=!1,R=!1,U=150,V="2.8rem",q="2rem",z="en-layout-header",G="en-layout-content",J="en-layout-main",K="en-layout-sidebar",M="en-layout-footer";1===L&&t.forEach(h,function(e){var n;if(l(e)){var a,o=t.only(e);l(a=o)&&a.type===r&&(h=t.toArray(null==e||null===(n=e.props)||void 0===n?void 0:n.children))}}),g=W(g),N=W(N),t.forEach(h,function(t){if(l(t))if(B||t.type!==O)if(T||t.type!==j)if(A||t.type!==E)if(A||t.type!==D){if(!R&&t.type===x){var r=t;q=r.props.height||q,p=n(r,{className:e(M,r.props.className)}),R=!0}}else{var o=t;y=a.createElement(u,{"data-enr-ui":"layout-content",className:e(J,"en-layout-main")},o),A=!0}else y=n(t,{className:e(J,t.props.className)}),A=!0;else{var i=t,s=i.props;U=s.width||U,F=s.right&&s.full?"side-right-full":s.right?"side-right":s.full?"side-full":"simple",f=n(i,{className:e(K,i.props.className)}),T=!0}else{var m,d=t,h=d.props;V=h.height||V,I=null!==(m=h.noSticky)&&void 0!==m&&m,c=n(d,{className:e(z,d.props.className)}),B=!0}});var Q=B&&T&&A&&R?"".concat(F,"-all"):B&&A&&T?"".concat(F,"-no-footer"):T&&A&&R?"".concat(F,"-no-header"):B&&A&&R?"no-side":A&&R?"only-footer":A&&B?"only-header":A&&T?"".concat(F,"-only-side"):"simple",X=k({layoutHeight:g,layoutWith:N,sideBarWidth:U,headerHeight:V,footerHeight:q},S.theme||{});"side-full-only-side"===Q?Q="simple-only-side":"side-right-full-only-side"===Q&&(Q="side-right-only-side");var Y=/-only-side$/.test(Q),Z=/^side.*full/.test(Q);return a.createElement(i,H({ref:s,$headerNoSticky:I,$layoutType:Q,$header:z,$sidebar:K,$main:J,$content:G,$footer:M,className:e(d,P),style:k({"--layout-self-width":C(g),"--layout-self-height":C(N),"--layout-width":C(m(g)&&g.endsWith("%")?"100%":g),"--layout-height":C(m(N)&&N.endsWith("%")?"100%":N),"--layout-side-bar-width":C(U),"--layout-header-height":C(V),"--layout-footer-height":C(q)},v),theme:X},S,{"data-enr-ui":"layout","data-enr-layout-type":Q}),Y?a.createElement(a.Fragment,null,f," ",y):Z?a.createElement(a.Fragment,null,f,a.createElement("div",{className:e(G),"data-enr-ui":"layout-side-full-container"},c,y,p)):a.createElement(a.Fragment,null,c,a.createElement("div",{className:e(G),"data-enr-ui":"layout-side-no-full-content"},f,y),p))});D.displayName="Layout";export{D as EnLayout,E as EnLayoutContent,x as EnLayoutFooter,O as EnLayoutHeader,j as EnLayoutSideBar,D as Layout,E as LayoutContent,x as LayoutFooter,O as LayoutHeader,j as LayoutSideBar,h as _en,h as en,h as enc};
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
export type DetailsProps = {
|
|
8
8
|
title?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
+
open?: boolean;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
13
14
|
* @param DetailsProps
|
|
15
|
+
* @param DetailsProps.open 是否默认展开
|
|
14
16
|
* @param DetailsProps.children 子组件
|
|
15
17
|
* @param DetailsProps.title 标题
|
|
16
18
|
* @returns
|
|
17
19
|
*/
|
|
18
|
-
export declare function Details({ title, children }: DetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function Details({ title, children, open }: DetailsProps): import("react/jsx-runtime").JSX.Element;
|
package/type/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
* Copyright (c) 2025 earthnut.dev
|
|
5
5
|
* 请在项目根参看详细许可证明
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export { useLazyRipples, BackgroundRipple, LazyBackgroundRipple, useTimeId, useInputIsComposing, useRipples, Image, EnImage, useColorMode, ThemeColorModeProvider, Switch, EnSwitch, Details, EnDetails, } from './index.client';
|
|
8
|
+
export type { UseAnimationFrameResult, AnimationFrameOption, Ripples, BackgroundRipplesProps, RipplesOptions, RippleImgUrl, LayoutProps, LayoutSideBarProps, LayoutHeaderProps, LayoutFooterProps, EnImageProps, ColorMode, ThemeContextType, ThemeColorModeProviderProps, } from './index.client';
|
|
9
|
+
export { Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSideBar, EnLayout, EnLayoutContent, EnLayoutFooter, EnLayoutHeader, EnLayoutSideBar, _en, en, enc, } from './index.server';
|