@amoy/components
Advanced tools
Comparing version 1.0.43 to 1.0.44
@@ -1,5 +0,6 @@ | ||
- [1.0.43] | ||
- [1.0.44] | ||
- 完善 class / attr,新增 hasClass / removeAttribute / attr 方法; | ||
- 修复修改 scale 导致子元素样式错位的问题; | ||
- 修复模板中,定位属性重复没有被移除的问题; | ||
- 调整字体属性继承的问题,修复 removeClass 导致子级重绘错误的问题; | ||
- 修复缩放值对子元素失效的问题; | ||
@@ -6,0 +7,0 @@ - 优化代码,调整项目结构; |
@@ -1,2 +0,2 @@ | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("pixi.js")):"function"==typeof define&&define.amd?define(["exports","pixi.js"],a):a((e=e||self).components={},e.PIXI)}(this,function(e,S){"use strict";function a(n){return n.callbacks={},n.on=function(e,a){return e&&a&&(n.hasOwnProperty("callbacks")||n.callbacks||(n.callbacks={}),e.split(" ").map(function(e){(t=n.callbacks)[e]||(t[e]=[]),n.callbacks[e].push(a)})),n;var t},n.emit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.shift().split(" ").map(function(e){var a=null!==n.callbacks&&n.callbacks[e]||[];a.length&&a.map(function(e){e&&e.apply(n,t)})}),n},n.off=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];0===e.length?n.callbacks={}:e.shift().split(" ").map(function(e){return delete n.callbacks[e]});return n},n}function c(e){var a,t,n={},r=n.toString,l=n.hasOwnProperty,i=l.toString,u=i.call(Object);return!(!e||"[object Object]"!==r.call(e))&&(!(a=Object.getPrototypeOf(e))||"function"==typeof(t=l.call(a,"constructor")&&a.constructor)&&i.call(t)===u)}function h(){for(var e,a,t,n,r,l,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=arguments[0]||{},s=1,m=arguments.length,v=!1;for("boolean"==typeof o&&(v=o,o=arguments[s]||{},s++),"object"!=typeof o&&"function"!=typeof o&&(o={}),s===m&&(o=this,s--);s<m;s++)if(null!==(e=arguments[s]))for(a in e)if(e.hasOwnProperty(a)){if(r=o[a],o===(n=e[a]))continue;v&&n&&(c(n)||(l=Array.isArray(n)))?(t=l?(l=!1,r&&Array.isArray(r)?r:[]):r&&c(r)?r:{},o[a]=h(v,t,n)):void 0!==n&&(o[a]=n)}return o}function d(e,a){if("object"==typeof e)for(var t in e){if(e.hasOwnProperty(t))a(t,e[t])}}function m(e){var a={},t=a.toString.call(e);return null==e?e+"":("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" ").forEach(function(e){a["[object "+e+"]"]=e.toLowerCase()}),"object"==typeof e||"function"==typeof e?a[t]||"object":typeof e)}function j(e){if(e.getGlobalBounds&&e.layout){var a=e.getGlobalBounds(),t=a.width,n=a.height,r=e.layout.realScale,l=r.x,i=r.y,u=e.layout.style,o=u.anchor,s=void 0===o?{x:.5,y:.5}:o,m=u.scale,v=void 0===m?{x:1,y:1}:m,c=t/l*v.x,h=n/i*v.y;return{x:-c*s.x,y:-h*s.y,width:c,height:h}}return null}var O=function(e,a){if("object"!==m(e))return e;for(var t=e,n=a.split("."),r=0,l=n.length;r<l;r++){var i=n[r];if(i){if(!t[i]){t=void 0;break}t=t[i]}}return t};function p(e){throw Error("[@amoy/components]Error: "+e+";")}var i=function(){return(i=Object.assign||function(e){for(var a,t=1,n=arguments.length;t<n;t++)for(var r in a=arguments[t])Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e}).apply(this,arguments)};var s=function(e){return e instanceof S.Container&&!(e instanceof S.Sprite)&&!(e instanceof S.Graphics)};function n(u){function v(e){if("string"!=typeof e)return e;var a=e.trim(),t=Math.PI/180;if(a.endsWith("deg")){var n=a.split("deg")[0];return parseFloat(n)*t}return parseFloat(a)}function o(e,a){return(a=a.trim()).endsWith("px")?parseInt(a):a.endsWith("%")?e*parseInt(a)/100:parseInt(a)/u}function h(e,a){var t=0;return"string"==typeof a&&(t=o(e,a)),"number"==typeof a&&(t=a/u),Math.round(t)}function c(e,a,t){if(["number","string"].includes(typeof t)){var n=0;if("number"==typeof t)n=t/u;else if(t.includes(":")){var r=t.split(":"),l=r[0],i=r[1];switch(l.trim()){case"left":case"top":n=o(e,i);break;case"right":case"bottom":n=e-a,n-=o(e,i);break;case"center":n=(e-a)/2,n+=o(e,i)}}else n="center"===t?(e-a)/2:o(e,t);return Math.round(n)}throw p("value must be number or string")}function r(e){for(var a={x:e.scale.x,y:e.scale.y},t=e.parent;t;)a.x*=t.scale.x,a.y*=t.scale.y,t=t.parent;return a}function l(e){if(s(e))return function e(a){return a.parent?a.isWorld?{width:window.innerWidth,height:window.innerHeight}:0<a.width&&0<a.height?{width:a.width,height:a.height}:s(a.parent)?e(a.parent):{width:a.parent.width,height:a.parent.height}:{width:window.innerWidth,height:window.innerHeight}}(e);var a=O(e,"layout.pixilayout.width")||e.width,t=O(e,"layout.pixilayout.height")||e.height;if(e.parent){var n=r(e.parent);return{width:~~(a*n.x),height:~~(t*n.y)}}return{width:a,height:t}}function d(e){return["sprite","animatedsprite"].includes(e.type)&&e._texture?e._texture.width/e._texture.height:1}function g(e,a){for(var t=0,n=0;n<a.length;n++){var r=a[n],l=e[r];if(void 0!==l){if(["x","y"].includes(r)){t=l;break}if(r.includes("center")){t="center: "+l;break}t=r+": "+l;break}}return t}return void 0===u&&(u=1),{rotation:v,length:h,pos:c,actualScale:r,actualSize:l,getRatio:d,elementSize:function(e,a,t){var n=a.width,r=a.height,l=function(e){switch(e.type){case"animatedsprite":case"sprite":return e._texture;case"view":return{width:500,height:500};case"text":if(O(e,"layout.container")){var a=e.layout.container;return{width:a.width,height:a.height}}return{width:1,height:1};default:return{width:1,height:1}}}(e),i=l.width,u=l.height,o=t.width,s=t.height,m=d(e),v=i,c=u;return n?(v=h(o,n),r?c=h(s,r):m&&(c=v/m)):r&&(v=(c=h(s,r))*m),{width:Math.round(v),height:Math.round(c)}},elementPos:function(e,a,t){var n=a.rotation,r=void 0===n?0:n,l=g(a,["x","left","centerX","right"]),i=g(a,["y","top","centerY","bottom"]),u=t.width,o=t.height,s=e.width,m=e.height;return{x:c(u,s,l),y:c(o,m,i),rotation:v(r)}},container:function(e){var a=l(e),t=a.width,n=a.height;return{element:e,width:t,height:n,ratio:t/n,scale:r(e)}},rlayout2pixilayout:function(e,a,t){var n=e.width,r=e.height,l=e.scale,i=e.element,u=l.x,o=l.y,s=t.width,m=t.height,v=t.x,c=t.y;return v+=s*a.x,c+=m*a.y,i.anchor?(v-=n*i.anchor.x,c-=r*i.anchor.y):i.pivot&&(v-=n*i.pivot.x,c-=r*i.pivot.y),s/=u,m/=o,v/=u,c/=o,{width:Math.round(s),height:Math.round(m),x:Math.round(v),y:Math.round(c),rotation:t.rotation}},pixilayout2rlayout:function(e,a,t){var n=e.width,r=e.height,l=e.scale,i=l.x,u=l.y,o=e.element,s=t.width,m=t.height,v=t.x,c=t.y;return s*=i,m*=u,v*=i,c*=u,o.anchor?(v+=n*o.anchor.x,c+=r*o.anchor.y):o.pivot&&(v+=n*o.pivot.x,c+=r*o.pivot.y),v-=s*a.x,c-=m*a.y,{width:Math.round(s),height:Math.round(m),x:Math.round(v),y:Math.round(c),rotation:t.rotation}}}}function r(e){switch(e.target.type){case"rect":!function(e){var a=e.pixilayout,t=e.target,n=e.transform,r=a.x,l=a.y,i=a.width,u=a.height,o=a.rotation;if(D(e)){var s=O(e,"style")||{},m=s.backgroundColor,v=void 0===m?16777215:m,c=s.borderWidth,h=void 0===c?0:c,d=s.borderColor,g=void 0===d?0:d,y=s.borderRadius,p=void 0===y?0:y,F=n.length(i,h),f=n.length(i,p),E=i-F,C=u-F,A=t.pivot,b=A.x,B=A.y;t.clear(),t.beginFill(v),t.lineStyle(F,g,1),i/2<=f?t.drawEllipse(0,0,E/2,C/2):0<f?t.drawRoundedRect(-E*b,-C*B,E,C,f):t.drawRect(-E*b,-C*B,E,C),t.endFill()}t.x!==r&&(t.x=r);t.y!==l&&(t.y=l);t.rotation!==o&&(t.rotation=o)}(e);break;case"circle":!function(e){var a=e.pixilayout,t=e.target,n=e.transform,r=a.x,l=a.y,i=a.width,u=a.height;if(D(e)){var o=O(e,"style")||{},s=o.backgroundColor,m=void 0===s?16777215:s,v=o.borderWidth,c=void 0===v?0:v,h=o.borderColor,d=void 0===h?0:h,g=n.length(i,c),y=i-g,p=u-g;t.clear(),t.beginFill(m),t.lineStyle(g,d,1),t.drawEllipse(0,0,y/2,p/2),t.endFill()}t.x!==r&&(t.x=r);t.y!==l&&(t.y=l)}(e);break;case"text":!function(e){var a=e.target,t=e.pixilayout,n=t.x,r=t.y,l=t.width,i=t.height,u=t.rotation,o=e.style.content,s=void 0===o?"":o;a.style=new S.TextStyle(e.textStyle),a.text=s,a.width!==l&&(a.width=l);a.height!==i&&(a.height=i);a.x!==n&&(a.x=n);a.y!==r&&(a.y=r);a.rotation!==u&&(a.rotation=u)}(e);break;case"animatedsprite":var a=e.target,t=e.style,n=void 0===t?{}:t,r=n.animatedLoop,l=void 0===r||r,i=n.animatedSpeed,u=void 0===i?60:i;+u&&(a.animationSpeed=1<=+u?1/60*+u:+u),a.loop=!!l,a.replay=function(){return a.gotoAndPlay(0)},a.play();case"sprite":case"view":default:!function(e){var a=e.target,t=e.pixilayout,n=t.width,r=t.height,l=t.x,i=t.y,u=t.rotation;a.width!==n&&(a.width=n);a.height!==r&&(a.height=r);a.x!==l&&(a.x=l);a.y!==i&&(a.y=i);a.rotation!==u&&(a.rotation=u)}(e)}}var D=function(e){return e.styleHasChanged(["width","height","borderWidth","borderColor","backgroundColor"])};var l=(t.prototype.render=function(e){var a=this;if(e){var t=this.target,n=this.style;this.container=this.transform.container(e),t.scale.x=1,t.scale.y=1,"text"===t.type&&(this.style=this.textInheritStyle(this.style)),this._setLayout(),this._fixRender(),this.initScale={x:t.scale.x,y:t.scale.y};var r=n.scale||{x:1,y:1};this.setScale(r),["update","mounted"].map(function(e){a.config.Component.emit(e,{instance:a.target,style:a.style})})}else!function(e){console.warn("[@amoy/components]Warn: "+e+";")}("layout.render must have a container.")},t.prototype.update=function(e,a){void 0===e&&(e={});var t=this.config,n=this.target;if(this.container){var r=a||{},l=r.refreshStyle,i=void 0!==l&&l,u=r.updateChild,o=void 0===u||u,s=r.replaceStyle,m=void 0!==s&&s;t.Component.emit("beforeUpdate",e),"text"===n.type&&(e=this.textInheritStyle(e)),i&&this.updateStyle(),this.extendStyle(e,m),this.initScale||(n.scale.x=1,n.scale.y=1),this._setLayout(),this.initScale||(this.initScale={x:n.scale.x,y:n.scale.y}),this.setScale({x:1,y:1}),o&&this.updateChild(a);var v=this.style.scale;return v&&this.setScale(v),t.Component.emit("update",{instance:this.target,style:this.style}),n}},t.prototype._getRlayout=function(){var e,a=this.target,t=this.container,n=this.rlayout;return!n||this.styleHasChanged(["width","height","content","backgroundImage"])?e=this.transform.elementSize(a,this.style,t):n&&(e={width:n.width,height:n.height}),"text"===a.type&&(e=this.fixTextSize(e)),h(e,this.transform.elementPos(e,this.style,t))},t.prototype._setLayout=function(){var e=this.target,a=this.style,t=this.container,n=a.anchor||{x:.5,y:.5};this.rlayout=this._getRlayout(),this.pixilayout=this.transform.rlayout2pixilayout(t,n,this.rlayout),e[e.anchor?"anchor":"pivot"].set(n.x,n.y),r(this)},t.prototype.updateChild=function(a){var e=O(this.target,"children");e.length&&e.map(function(e){e.layout&&(e.layout.refreshContianer(),e.layout.update({},a))})},t.prototype.fixTextSize=function(e){var a=this.style,t=this.transform,n=this.container,r=n.width,l=n.height,i=a.content,u=void 0===i?"":i;(a=h({},this.styleFromParent,a)).breakWords=!0,a.wordWrap=!0,a.wordWrapWidth=e.width,a.color&&(a.fill=a.color),a.fontSize&&(a.fontSize=t.length(r,a.fontSize)),a.lineHeight&&(a.lineHeight=t.length(l,a.lineHeight)),this.textStyle=new S.TextStyle(a);var o=new S.Text(""+u,this.textStyle);return{width:o.width,height:o.height}},t.prototype._fixRender=function(){var e=this;if(["sprite","view","animatedsprite"].includes(this.target.type)&&!this.target.texture.valid){var a=!1;this.target.texture.on("update",function(){a||(e.update(),a=!0)})}else this.target.children.length&&this.updateChild()},t.prototype.hasHorPosAttr=function(e){return e.hasOwnProperty("left")||e.hasOwnProperty("right")||e.hasOwnProperty("centerX")},t.prototype.hasVerPosAttr=function(e){return e.hasOwnProperty("top")||e.hasOwnProperty("bottom")||e.hasOwnProperty("centerY")},t.prototype.styleDiff=function(t,a,n){var r=[];return a&&(d(a,function(e,a){n?r.push(e):t[e]!==a&&r.push(e)}),d(t,function(e){a[e]||r.push(e)})),r},t.prototype.extendStyle=function(e,a){var t=this;if(void 0===a&&(a=!1),this.styleDiffPool=this.styleDiff(this.style,e,a),a)this.style.content&&!e.content&&(e.content=this.style.content),this.style=e;else{var n=["left","right","centerX"],r=["top","bottom","centerY"];Object.keys(e).map(function(a){[n,r].map(function(e){e.includes(a)&&e.map(function(e){return delete t.style[e]})})}),h(!0,this.style,e)}},t.prototype.styleHasChanged=function(e){for(var a=!1,t=0;t<e.length;t++){var n=e[t];if(this.styleDiffPool.includes(n)){a=!0;break}}return a},t.prototype._inheritStyle=function(){var r={},e=this.container,l=O(e,"element.layout.style");if(l){["fontSize","color","lineHeight","fontWeight","fontStyle","fontFamily"].map(function(e){l[e]&&(r["color"===e?"fill":e]=l[e])});var a=function(e,a){var t=l[e];if(t){var n=r["textAlign"===e?"horPos":"verPos"]={};"number"==typeof t?n[a[0]]=+t:a.concat("center").includes(t)&&(n["center"===t?a[1]:t]=0)}};a("textAlign",["left","centerX","right"]),a("textJustify",["top","centerY","bottom"])}return r},t.prototype.textInheritStyle=function(e){var a=this._inheritStyle(),t=a.horPos,n=a.verPos,r=function(e,a){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)a.indexOf(n[r])<0&&(t[n[r]]=e[n[r]])}return t}(a,["horPos","verPos"]);return this.hasHorPosAttr(this.style)||(e=h(e,t)),this.hasVerPosAttr(this.style)||(e=h(e,n)),h(e,r),e},t.prototype.refreshContianer=function(){var e=this.container?this.container.element:this.target.parent;this.container=this.transform.container(e)},t.prototype.setScale=function(e){var a=this.target,t=this.initScale;a.scale.set(t.x*e.x,t.y*e.y),"view"===a.type?this.realScale={x:this.rlayout.width/500,y:this.rlayout.height/500}:this.realScale=this.transform.actualScale(a)},t.prototype.appendTo=function(e,a){return void 0===a&&(a=!0),e&&e.addChild?(e.addChild(this.target),a&&this.render(e)):p("the container is not exsit!"),this.target},t.prototype.append=function(e,a){return void 0===a&&(a=!0),e.layout.appendTo(this.target,a),this.target},t.prototype._addChildAt=function(e,a,t){e.addChildAt&&(e.addChildAt(a,t),a.layout.render(e))},t.prototype._addSibling=function(e,a){if(this.container&&O(e,"layout")){var t=this.container.element,n=e,r=t.getChildIndex(this.target)+a;this._addChildAt(t,n,r)}},t.prototype._insertSibling=function(e,a){var t=O(e,"layout.container.element");if(t){var n=e,r=this.target,l=t.getChildIndex(n)+a;this._addChildAt(t,r,l)}},t.prototype._isMe=function(e,a,t){var n=O(e,"layout.container.element");if(n){var r=n.getChildIndex(e)+t;if(n.children[r]===a)return!0}return!1},t.prototype.before=function(e){return this._isMe(this.target,e,-1)||this._addSibling(e,0),this.target},t.prototype.after=function(e){return this._isMe(this.target,e,1)||this._addSibling(e,1),this.target},t.prototype.insertBefore=function(e){return this._isMe(e,this.target,-1)||this._insertSibling(e,0),this.target},t.prototype.insertAfter=function(e){return this._isMe(e,this.target,1)||this._insertSibling(e,1),this.target},t.prototype.remove=function(){var e=O(this,"container.element");return e?e.removeChild(this.target):this.target.destroy&&this.target.destroy(),this.target},t.prototype.updateStyle=function(){var e=this.target,a=this.style,t=this.container,n=a.anchor||{x:.5,y:.5},r=e.width,l=e.height,i=e.x,u=e.y,o=e.rotation;this.pixilayout={width:r,height:l,x:i,y:u,rotation:o};var s=this.transform.pixilayout2rlayout(t,n,this.pixilayout);this.rlayout=s,this.style.left=s.x,this.style.top=s.y,this.style.width=s.width,this.style.height=s.height,this.style.rotation=s.rotation},t.prototype.transformStyle=function(e){var a=this.target,t=this.container,n=h({},this.style,e),r=n.anchor,l=void 0===r?{x:.5,y:.5}:r,i=this.transform.elementSize(a,n,t);"text"===a.type&&(i=this.fixTextSize(i));var u=h(i,this.transform.elementPos(i,e,t));return this.transform.rlayout2pixilayout(t,l,u)},t.prototype.getStyle=function(e){return e?this.style[e]:this.style},t);function t(e,a,t){void 0===a&&(a={}),this.style={},this.target=e,this.config=t,this.transform=n(t.uiDesignRatio),this.extendStyle(a,!0)}var u,o=[{value:"#B0171F",name:"indian red"},{value:"#DC143C",css:!0,name:"crimson"},{value:"#FFB6C1",css:!0,name:"lightpink"},{value:"#FFAEB9",name:"lightpink 1"},{value:"#EEA2AD",name:"lightpink 2"},{value:"#CD8C95",name:"lightpink 3"},{value:"#8B5F65",name:"lightpink 4"},{value:"#FFC0CB",css:!0,name:"pink"},{value:"#FFB5C5",name:"pink 1"},{value:"#EEA9B8",name:"pink 2"},{value:"#CD919E",name:"pink 3"},{value:"#8B636C",name:"pink 4"},{value:"#DB7093",css:!0,name:"palevioletred"},{value:"#FF82AB",name:"palevioletred 1"},{value:"#EE799F",name:"palevioletred 2"},{value:"#CD6889",name:"palevioletred 3"},{value:"#8B475D",name:"palevioletred 4"},{value:"#FFF0F5",name:"lavenderblush 1"},{value:"#FFF0F5",css:!0,name:"lavenderblush"},{value:"#EEE0E5",name:"lavenderblush 2"},{value:"#CDC1C5",name:"lavenderblush 3"},{value:"#8B8386",name:"lavenderblush 4"},{value:"#FF3E96",name:"violetred 1"},{value:"#EE3A8C",name:"violetred 2"},{value:"#CD3278",name:"violetred 3"},{value:"#8B2252",name:"violetred 4"},{value:"#FF69B4",css:!0,name:"hotpink"},{value:"#FF6EB4",name:"hotpink 1"},{value:"#EE6AA7",name:"hotpink 2"},{value:"#CD6090",name:"hotpink 3"},{value:"#8B3A62",name:"hotpink 4"},{value:"#872657",name:"raspberry"},{value:"#FF1493",name:"deeppink 1"},{value:"#FF1493",css:!0,name:"deeppink"},{value:"#EE1289",name:"deeppink 2"},{value:"#CD1076",name:"deeppink 3"},{value:"#8B0A50",name:"deeppink 4"},{value:"#FF34B3",name:"maroon 1"},{value:"#EE30A7",name:"maroon 2"},{value:"#CD2990",name:"maroon 3"},{value:"#8B1C62",name:"maroon 4"},{value:"#C71585",css:!0,name:"mediumvioletred"},{value:"#D02090",name:"violetred"},{value:"#DA70D6",css:!0,name:"orchid"},{value:"#FF83FA",name:"orchid 1"},{value:"#EE7AE9",name:"orchid 2"},{value:"#CD69C9",name:"orchid 3"},{value:"#8B4789",name:"orchid 4"},{value:"#D8BFD8",css:!0,name:"thistle"},{value:"#FFE1FF",name:"thistle 1"},{value:"#EED2EE",name:"thistle 2"},{value:"#CDB5CD",name:"thistle 3"},{value:"#8B7B8B",name:"thistle 4"},{value:"#FFBBFF",name:"plum 1"},{value:"#EEAEEE",name:"plum 2"},{value:"#CD96CD",name:"plum 3"},{value:"#8B668B",name:"plum 4"},{value:"#DDA0DD",css:!0,name:"plum"},{value:"#EE82EE",css:!0,name:"violet"},{value:"#FF00FF",vga:!0,name:"magenta"},{value:"#FF00FF",vga:!0,css:!0,name:"fuchsia"},{value:"#EE00EE",name:"magenta 2"},{value:"#CD00CD",name:"magenta 3"},{value:"#8B008B",name:"magenta 4"},{value:"#8B008B",css:!0,name:"darkmagenta"},{value:"#800080",vga:!0,css:!0,name:"purple"},{value:"#BA55D3",css:!0,name:"mediumorchid"},{value:"#E066FF",name:"mediumorchid 1"},{value:"#D15FEE",name:"mediumorchid 2"},{value:"#B452CD",name:"mediumorchid 3"},{value:"#7A378B",name:"mediumorchid 4"},{value:"#9400D3",css:!0,name:"darkviolet"},{value:"#9932CC",css:!0,name:"darkorchid"},{value:"#BF3EFF",name:"darkorchid 1"},{value:"#B23AEE",name:"darkorchid 2"},{value:"#9A32CD",name:"darkorchid 3"},{value:"#68228B",name:"darkorchid 4"},{value:"#4B0082",css:!0,name:"indigo"},{value:"#8A2BE2",css:!0,name:"blueviolet"},{value:"#9B30FF",name:"purple 1"},{value:"#912CEE",name:"purple 2"},{value:"#7D26CD",name:"purple 3"},{value:"#551A8B",name:"purple 4"},{value:"#9370DB",css:!0,name:"mediumpurple"},{value:"#AB82FF",name:"mediumpurple 1"},{value:"#9F79EE",name:"mediumpurple 2"},{value:"#8968CD",name:"mediumpurple 3"},{value:"#5D478B",name:"mediumpurple 4"},{value:"#483D8B",css:!0,name:"darkslateblue"},{value:"#8470FF",name:"lightslateblue"},{value:"#7B68EE",css:!0,name:"mediumslateblue"},{value:"#6A5ACD",css:!0,name:"slateblue"},{value:"#836FFF",name:"slateblue 1"},{value:"#7A67EE",name:"slateblue 2"},{value:"#6959CD",name:"slateblue 3"},{value:"#473C8B",name:"slateblue 4"},{value:"#F8F8FF",css:!0,name:"ghostwhite"},{value:"#E6E6FA",css:!0,name:"lavender"},{value:"#0000FF",vga:!0,css:!0,name:"blue"},{value:"#0000EE",name:"blue 2"},{value:"#0000CD",name:"blue 3"},{value:"#0000CD",css:!0,name:"mediumblue"},{value:"#00008B",name:"blue 4"},{value:"#00008B",css:!0,name:"darkblue"},{value:"#000080",vga:!0,css:!0,name:"navy"},{value:"#191970",css:!0,name:"midnightblue"},{value:"#3D59AB",name:"cobalt"},{value:"#4169E1",css:!0,name:"royalblue"},{value:"#4876FF",name:"royalblue 1"},{value:"#436EEE",name:"royalblue 2"},{value:"#3A5FCD",name:"royalblue 3"},{value:"#27408B",name:"royalblue 4"},{value:"#6495ED",css:!0,name:"cornflowerblue"},{value:"#B0C4DE",css:!0,name:"lightsteelblue"},{value:"#CAE1FF",name:"lightsteelblue 1"},{value:"#BCD2EE",name:"lightsteelblue 2"},{value:"#A2B5CD",name:"lightsteelblue 3"},{value:"#6E7B8B",name:"lightsteelblue 4"},{value:"#778899",css:!0,name:"lightslategray"},{value:"#708090",css:!0,name:"slategray"},{value:"#C6E2FF",name:"slategray 1"},{value:"#B9D3EE",name:"slategray 2"},{value:"#9FB6CD",name:"slategray 3"},{value:"#6C7B8B",name:"slategray 4"},{value:"#1E90FF",name:"dodgerblue 1"},{value:"#1E90FF",css:!0,name:"dodgerblue"},{value:"#1C86EE",name:"dodgerblue 2"},{value:"#1874CD",name:"dodgerblue 3"},{value:"#104E8B",name:"dodgerblue 4"},{value:"#F0F8FF",css:!0,name:"aliceblue"},{value:"#4682B4",css:!0,name:"steelblue"},{value:"#63B8FF",name:"steelblue 1"},{value:"#5CACEE",name:"steelblue 2"},{value:"#4F94CD",name:"steelblue 3"},{value:"#36648B",name:"steelblue 4"},{value:"#87CEFA",css:!0,name:"lightskyblue"},{value:"#B0E2FF",name:"lightskyblue 1"},{value:"#A4D3EE",name:"lightskyblue 2"},{value:"#8DB6CD",name:"lightskyblue 3"},{value:"#607B8B",name:"lightskyblue 4"},{value:"#87CEFF",name:"skyblue 1"},{value:"#7EC0EE",name:"skyblue 2"},{value:"#6CA6CD",name:"skyblue 3"},{value:"#4A708B",name:"skyblue 4"},{value:"#87CEEB",css:!0,name:"skyblue"},{value:"#00BFFF",name:"deepskyblue 1"},{value:"#00BFFF",css:!0,name:"deepskyblue"},{value:"#00B2EE",name:"deepskyblue 2"},{value:"#009ACD",name:"deepskyblue 3"},{value:"#00688B",name:"deepskyblue 4"},{value:"#33A1C9",name:"peacock"},{value:"#ADD8E6",css:!0,name:"lightblue"},{value:"#BFEFFF",name:"lightblue 1"},{value:"#B2DFEE",name:"lightblue 2"},{value:"#9AC0CD",name:"lightblue 3"},{value:"#68838B",name:"lightblue 4"},{value:"#B0E0E6",css:!0,name:"powderblue"},{value:"#98F5FF",name:"cadetblue 1"},{value:"#8EE5EE",name:"cadetblue 2"},{value:"#7AC5CD",name:"cadetblue 3"},{value:"#53868B",name:"cadetblue 4"},{value:"#00F5FF",name:"turquoise 1"},{value:"#00E5EE",name:"turquoise 2"},{value:"#00C5CD",name:"turquoise 3"},{value:"#00868B",name:"turquoise 4"},{value:"#5F9EA0",css:!0,name:"cadetblue"},{value:"#00CED1",css:!0,name:"darkturquoise"},{value:"#F0FFFF",name:"azure 1"},{value:"#F0FFFF",css:!0,name:"azure"},{value:"#E0EEEE",name:"azure 2"},{value:"#C1CDCD",name:"azure 3"},{value:"#838B8B",name:"azure 4"},{value:"#E0FFFF",name:"lightcyan 1"},{value:"#E0FFFF",css:!0,name:"lightcyan"},{value:"#D1EEEE",name:"lightcyan 2"},{value:"#B4CDCD",name:"lightcyan 3"},{value:"#7A8B8B",name:"lightcyan 4"},{value:"#BBFFFF",name:"paleturquoise 1"},{value:"#AEEEEE",name:"paleturquoise 2"},{value:"#AEEEEE",css:!0,name:"paleturquoise"},{value:"#96CDCD",name:"paleturquoise 3"},{value:"#668B8B",name:"paleturquoise 4"},{value:"#2F4F4F",css:!0,name:"darkslategray"},{value:"#97FFFF",name:"darkslategray 1"},{value:"#8DEEEE",name:"darkslategray 2"},{value:"#79CDCD",name:"darkslategray 3"},{value:"#528B8B",name:"darkslategray 4"},{value:"#00FFFF",name:"cyan"},{value:"#00FFFF",css:!0,name:"aqua"},{value:"#00EEEE",name:"cyan 2"},{value:"#00CDCD",name:"cyan 3"},{value:"#008B8B",name:"cyan 4"},{value:"#008B8B",css:!0,name:"darkcyan"},{value:"#008080",vga:!0,css:!0,name:"teal"},{value:"#48D1CC",css:!0,name:"mediumturquoise"},{value:"#20B2AA",css:!0,name:"lightseagreen"},{value:"#03A89E",name:"manganeseblue"},{value:"#40E0D0",css:!0,name:"turquoise"},{value:"#808A87",name:"coldgrey"},{value:"#00C78C",name:"turquoiseblue"},{value:"#7FFFD4",name:"aquamarine 1"},{value:"#7FFFD4",css:!0,name:"aquamarine"},{value:"#76EEC6",name:"aquamarine 2"},{value:"#66CDAA",name:"aquamarine 3"},{value:"#66CDAA",css:!0,name:"mediumaquamarine"},{value:"#458B74",name:"aquamarine 4"},{value:"#00FA9A",css:!0,name:"mediumspringgreen"},{value:"#F5FFFA",css:!0,name:"mintcream"},{value:"#00FF7F",css:!0,name:"springgreen"},{value:"#00EE76",name:"springgreen 1"},{value:"#00CD66",name:"springgreen 2"},{value:"#008B45",name:"springgreen 3"},{value:"#3CB371",css:!0,name:"mediumseagreen"},{value:"#54FF9F",name:"seagreen 1"},{value:"#4EEE94",name:"seagreen 2"},{value:"#43CD80",name:"seagreen 3"},{value:"#2E8B57",name:"seagreen 4"},{value:"#2E8B57",css:!0,name:"seagreen"},{value:"#00C957",name:"emeraldgreen"},{value:"#BDFCC9",name:"mint"},{value:"#3D9140",name:"cobaltgreen"},{value:"#F0FFF0",name:"honeydew 1"},{value:"#F0FFF0",css:!0,name:"honeydew"},{value:"#E0EEE0",name:"honeydew 2"},{value:"#C1CDC1",name:"honeydew 3"},{value:"#838B83",name:"honeydew 4"},{value:"#8FBC8F",css:!0,name:"darkseagreen"},{value:"#C1FFC1",name:"darkseagreen 1"},{value:"#B4EEB4",name:"darkseagreen 2"},{value:"#9BCD9B",name:"darkseagreen 3"},{value:"#698B69",name:"darkseagreen 4"},{value:"#98FB98",css:!0,name:"palegreen"},{value:"#9AFF9A",name:"palegreen 1"},{value:"#90EE90",name:"palegreen 2"},{value:"#90EE90",css:!0,name:"lightgreen"},{value:"#7CCD7C",name:"palegreen 3"},{value:"#548B54",name:"palegreen 4"},{value:"#32CD32",css:!0,name:"limegreen"},{value:"#228B22",css:!0,name:"forestgreen"},{value:"#00FF00",vga:!0,name:"green 1"},{value:"#00FF00",vga:!0,css:!0,name:"lime"},{value:"#00EE00",name:"green 2"},{value:"#00CD00",name:"green 3"},{value:"#008B00",name:"green 4"},{value:"#008000",vga:!0,css:!0,name:"green"},{value:"#006400",css:!0,name:"darkgreen"},{value:"#308014",name:"sapgreen"},{value:"#7CFC00",css:!0,name:"lawngreen"},{value:"#7FFF00",name:"chartreuse 1"},{value:"#7FFF00",css:!0,name:"chartreuse"},{value:"#76EE00",name:"chartreuse 2"},{value:"#66CD00",name:"chartreuse 3"},{value:"#458B00",name:"chartreuse 4"},{value:"#ADFF2F",css:!0,name:"greenyellow"},{value:"#CAFF70",name:"darkolivegreen 1"},{value:"#BCEE68",name:"darkolivegreen 2"},{value:"#A2CD5A",name:"darkolivegreen 3"},{value:"#6E8B3D",name:"darkolivegreen 4"},{value:"#556B2F",css:!0,name:"darkolivegreen"},{value:"#6B8E23",css:!0,name:"olivedrab"},{value:"#C0FF3E",name:"olivedrab 1"},{value:"#B3EE3A",name:"olivedrab 2"},{value:"#9ACD32",name:"olivedrab 3"},{value:"#9ACD32",css:!0,name:"yellowgreen"},{value:"#698B22",name:"olivedrab 4"},{value:"#FFFFF0",name:"ivory 1"},{value:"#FFFFF0",css:!0,name:"ivory"},{value:"#EEEEE0",name:"ivory 2"},{value:"#CDCDC1",name:"ivory 3"},{value:"#8B8B83",name:"ivory 4"},{value:"#F5F5DC",css:!0,name:"beige"},{value:"#FFFFE0",name:"lightyellow 1"},{value:"#FFFFE0",css:!0,name:"lightyellow"},{value:"#EEEED1",name:"lightyellow 2"},{value:"#CDCDB4",name:"lightyellow 3"},{value:"#8B8B7A",name:"lightyellow 4"},{value:"#FAFAD2",css:!0,name:"lightgoldenrodyellow"},{value:"#FFFF00",vga:!0,name:"yellow 1"},{value:"#FFFF00",vga:!0,css:!0,name:"yellow"},{value:"#EEEE00",name:"yellow 2"},{value:"#CDCD00",name:"yellow 3"},{value:"#8B8B00",name:"yellow 4"},{value:"#808069",name:"warmgrey"},{value:"#808000",vga:!0,css:!0,name:"olive"},{value:"#BDB76B",css:!0,name:"darkkhaki"},{value:"#FFF68F",name:"khaki 1"},{value:"#EEE685",name:"khaki 2"},{value:"#CDC673",name:"khaki 3"},{value:"#8B864E",name:"khaki 4"},{value:"#F0E68C",css:!0,name:"khaki"},{value:"#EEE8AA",css:!0,name:"palegoldenrod"},{value:"#FFFACD",name:"lemonchiffon 1"},{value:"#FFFACD",css:!0,name:"lemonchiffon"},{value:"#EEE9BF",name:"lemonchiffon 2"},{value:"#CDC9A5",name:"lemonchiffon 3"},{value:"#8B8970",name:"lemonchiffon 4"},{value:"#FFEC8B",name:"lightgoldenrod 1"},{value:"#EEDC82",name:"lightgoldenrod 2"},{value:"#CDBE70",name:"lightgoldenrod 3"},{value:"#8B814C",name:"lightgoldenrod 4"},{value:"#E3CF57",name:"banana"},{value:"#FFD700",name:"gold 1"},{value:"#FFD700",css:!0,name:"gold"},{value:"#EEC900",name:"gold 2"},{value:"#CDAD00",name:"gold 3"},{value:"#8B7500",name:"gold 4"},{value:"#FFF8DC",name:"cornsilk 1"},{value:"#FFF8DC",css:!0,name:"cornsilk"},{value:"#EEE8CD",name:"cornsilk 2"},{value:"#CDC8B1",name:"cornsilk 3"},{value:"#8B8878",name:"cornsilk 4"},{value:"#DAA520",css:!0,name:"goldenrod"},{value:"#FFC125",name:"goldenrod 1"},{value:"#EEB422",name:"goldenrod 2"},{value:"#CD9B1D",name:"goldenrod 3"},{value:"#8B6914",name:"goldenrod 4"},{value:"#B8860B",css:!0,name:"darkgoldenrod"},{value:"#FFB90F",name:"darkgoldenrod 1"},{value:"#EEAD0E",name:"darkgoldenrod 2"},{value:"#CD950C",name:"darkgoldenrod 3"},{value:"#8B6508",name:"darkgoldenrod 4"},{value:"#FFA500",name:"orange 1"},{value:"#FF8000",css:!0,name:"orange"},{value:"#EE9A00",name:"orange 2"},{value:"#CD8500",name:"orange 3"},{value:"#8B5A00",name:"orange 4"},{value:"#FFFAF0",css:!0,name:"floralwhite"},{value:"#FDF5E6",css:!0,name:"oldlace"},{value:"#F5DEB3",css:!0,name:"wheat"},{value:"#FFE7BA",name:"wheat 1"},{value:"#EED8AE",name:"wheat 2"},{value:"#CDBA96",name:"wheat 3"},{value:"#8B7E66",name:"wheat 4"},{value:"#FFE4B5",css:!0,name:"moccasin"},{value:"#FFEFD5",css:!0,name:"papayawhip"},{value:"#FFEBCD",css:!0,name:"blanchedalmond"},{value:"#FFDEAD",name:"navajowhite 1"},{value:"#FFDEAD",css:!0,name:"navajowhite"},{value:"#EECFA1",name:"navajowhite 2"},{value:"#CDB38B",name:"navajowhite 3"},{value:"#8B795E",name:"navajowhite 4"},{value:"#FCE6C9",name:"eggshell"},{value:"#D2B48C",css:!0,name:"tan"},{value:"#9C661F",name:"brick"},{value:"#FF9912",name:"cadmiumyellow"},{value:"#FAEBD7",css:!0,name:"antiquewhite"},{value:"#FFEFDB",name:"antiquewhite 1"},{value:"#EEDFCC",name:"antiquewhite 2"},{value:"#CDC0B0",name:"antiquewhite 3"},{value:"#8B8378",name:"antiquewhite 4"},{value:"#DEB887",css:!0,name:"burlywood"},{value:"#FFD39B",name:"burlywood 1"},{value:"#EEC591",name:"burlywood 2"},{value:"#CDAA7D",name:"burlywood 3"},{value:"#8B7355",name:"burlywood 4"},{value:"#FFE4C4",name:"bisque 1"},{value:"#FFE4C4",css:!0,name:"bisque"},{value:"#EED5B7",name:"bisque 2"},{value:"#CDB79E",name:"bisque 3"},{value:"#8B7D6B",name:"bisque 4"},{value:"#E3A869",name:"melon"},{value:"#ED9121",name:"carrot"},{value:"#FF8C00",css:!0,name:"darkorange"},{value:"#FF7F00",name:"darkorange 1"},{value:"#EE7600",name:"darkorange 2"},{value:"#CD6600",name:"darkorange 3"},{value:"#8B4500",name:"darkorange 4"},{value:"#FFA54F",name:"tan 1"},{value:"#EE9A49",name:"tan 2"},{value:"#CD853F",name:"tan 3"},{value:"#CD853F",css:!0,name:"peru"},{value:"#8B5A2B",name:"tan 4"},{value:"#FAF0E6",css:!0,name:"linen"},{value:"#FFDAB9",name:"peachpuff 1"},{value:"#FFDAB9",css:!0,name:"peachpuff"},{value:"#EECBAD",name:"peachpuff 2"},{value:"#CDAF95",name:"peachpuff 3"},{value:"#8B7765",name:"peachpuff 4"},{value:"#FFF5EE",name:"seashell 1"},{value:"#FFF5EE",css:!0,name:"seashell"},{value:"#EEE5DE",name:"seashell 2"},{value:"#CDC5BF",name:"seashell 3"},{value:"#8B8682",name:"seashell 4"},{value:"#F4A460",css:!0,name:"sandybrown"},{value:"#C76114",name:"rawsienna"},{value:"#D2691E",css:!0,name:"chocolate"},{value:"#FF7F24",name:"chocolate 1"},{value:"#EE7621",name:"chocolate 2"},{value:"#CD661D",name:"chocolate 3"},{value:"#8B4513",name:"chocolate 4"},{value:"#8B4513",css:!0,name:"saddlebrown"},{value:"#292421",name:"ivoryblack"},{value:"#FF7D40",name:"flesh"},{value:"#FF6103",name:"cadmiumorange"},{value:"#8A360F",name:"burntsienna"},{value:"#A0522D",css:!0,name:"sienna"},{value:"#FF8247",name:"sienna 1"},{value:"#EE7942",name:"sienna 2"},{value:"#CD6839",name:"sienna 3"},{value:"#8B4726",name:"sienna 4"},{value:"#FFA07A",name:"lightsalmon 1"},{value:"#FFA07A",css:!0,name:"lightsalmon"},{value:"#EE9572",name:"lightsalmon 2"},{value:"#CD8162",name:"lightsalmon 3"},{value:"#8B5742",name:"lightsalmon 4"},{value:"#FF7F50",css:!0,name:"coral"},{value:"#FF4500",name:"orangered 1"},{value:"#FF4500",css:!0,name:"orangered"},{value:"#EE4000",name:"orangered 2"},{value:"#CD3700",name:"orangered 3"},{value:"#8B2500",name:"orangered 4"},{value:"#5E2612",name:"sepia"},{value:"#E9967A",css:!0,name:"darksalmon"},{value:"#FF8C69",name:"salmon 1"},{value:"#EE8262",name:"salmon 2"},{value:"#CD7054",name:"salmon 3"},{value:"#8B4C39",name:"salmon 4"},{value:"#FF7256",name:"coral 1"},{value:"#EE6A50",name:"coral 2"},{value:"#CD5B45",name:"coral 3"},{value:"#8B3E2F",name:"coral 4"},{value:"#8A3324",name:"burntumber"},{value:"#FF6347",name:"tomato 1"},{value:"#FF6347",css:!0,name:"tomato"},{value:"#EE5C42",name:"tomato 2"},{value:"#CD4F39",name:"tomato 3"},{value:"#8B3626",name:"tomato 4"},{value:"#FA8072",css:!0,name:"salmon"},{value:"#FFE4E1",name:"mistyrose 1"},{value:"#FFE4E1",css:!0,name:"mistyrose"},{value:"#EED5D2",name:"mistyrose 2"},{value:"#CDB7B5",name:"mistyrose 3"},{value:"#8B7D7B",name:"mistyrose 4"},{value:"#FFFAFA",name:"snow 1"},{value:"#FFFAFA",css:!0,name:"snow"},{value:"#EEE9E9",name:"snow 2"},{value:"#CDC9C9",name:"snow 3"},{value:"#8B8989",name:"snow 4"},{value:"#BC8F8F",css:!0,name:"rosybrown"},{value:"#FFC1C1",name:"rosybrown 1"},{value:"#EEB4B4",name:"rosybrown 2"},{value:"#CD9B9B",name:"rosybrown 3"},{value:"#8B6969",name:"rosybrown 4"},{value:"#F08080",css:!0,name:"lightcoral"},{value:"#CD5C5C",css:!0,name:"indianred"},{value:"#FF6A6A",name:"indianred 1"},{value:"#EE6363",name:"indianred 2"},{value:"#8B3A3A",name:"indianred 4"},{value:"#CD5555",name:"indianred 3"},{value:"#A52A2A",css:!0,name:"brown"},{value:"#FF4040",name:"brown 1"},{value:"#EE3B3B",name:"brown 2"},{value:"#CD3333",name:"brown 3"},{value:"#8B2323",name:"brown 4"},{value:"#B22222",css:!0,name:"firebrick"},{value:"#FF3030",name:"firebrick 1"},{value:"#EE2C2C",name:"firebrick 2"},{value:"#CD2626",name:"firebrick 3"},{value:"#8B1A1A",name:"firebrick 4"},{value:"#FF0000",vga:!0,name:"red 1"},{value:"#FF0000",vga:!0,css:!0,name:"red"},{value:"#EE0000",name:"red 2"},{value:"#CD0000",name:"red 3"},{value:"#8B0000",name:"red 4"},{value:"#8B0000",css:!0,name:"darkred"},{value:"#800000",vga:!0,css:!0,name:"maroon"},{value:"#8E388E",name:"sgi beet"},{value:"#7171C6",name:"sgi slateblue"},{value:"#7D9EC0",name:"sgi lightblue"},{value:"#388E8E",name:"sgi teal"},{value:"#71C671",name:"sgi chartreuse"},{value:"#8E8E38",name:"sgi olivedrab"},{value:"#C5C1AA",name:"sgi brightgray"},{value:"#C67171",name:"sgi salmon"},{value:"#555555",name:"sgi darkgray"},{value:"#1E1E1E",name:"sgi gray 12"},{value:"#282828",name:"sgi gray 16"},{value:"#515151",name:"sgi gray 32"},{value:"#5B5B5B",name:"sgi gray 36"},{value:"#848484",name:"sgi gray 52"},{value:"#8E8E8E",name:"sgi gray 56"},{value:"#AAAAAA",name:"sgi lightgray"},{value:"#B7B7B7",name:"sgi gray 72"},{value:"#C1C1C1",name:"sgi gray 76"},{value:"#EAEAEA",name:"sgi gray 92"},{value:"#F4F4F4",name:"sgi gray 96"},{value:"#FFFFFF",vga:!0,css:!0,name:"white"},{value:"#F5F5F5",name:"white smoke"},{value:"#F5F5F5",name:"gray 96"},{value:"#DCDCDC",css:!0,name:"gainsboro"},{value:"#D3D3D3",css:!0,name:"lightgrey"},{value:"#C0C0C0",vga:!0,css:!0,name:"silver"},{value:"#A9A9A9",css:!0,name:"darkgray"},{value:"#808080",vga:!0,css:!0,name:"gray"},{value:"#696969",css:!0,name:"dimgray"},{value:"#696969",name:"gray 42"},{value:"#000000",vga:!0,css:!0,name:"black"},{value:"#FCFCFC",name:"gray 99"},{value:"#FAFAFA",name:"gray 98"},{value:"#F7F7F7",name:"gray 97"},{value:"#F2F2F2",name:"gray 95"},{value:"#F0F0F0",name:"gray 94"},{value:"#EDEDED",name:"gray 93"},{value:"#EBEBEB",name:"gray 92"},{value:"#E8E8E8",name:"gray 91"},{value:"#E5E5E5",name:"gray 90"},{value:"#E3E3E3",name:"gray 89"},{value:"#E0E0E0",name:"gray 88"},{value:"#DEDEDE",name:"gray 87"},{value:"#DBDBDB",name:"gray 86"},{value:"#D9D9D9",name:"gray 85"},{value:"#D6D6D6",name:"gray 84"},{value:"#D4D4D4",name:"gray 83"},{value:"#D1D1D1",name:"gray 82"},{value:"#CFCFCF",name:"gray 81"},{value:"#CCCCCC",name:"gray 80"},{value:"#C9C9C9",name:"gray 79"},{value:"#C7C7C7",name:"gray 78"},{value:"#C4C4C4",name:"gray 77"},{value:"#C2C2C2",name:"gray 76"},{value:"#BFBFBF",name:"gray 75"},{value:"#BDBDBD",name:"gray 74"},{value:"#BABABA",name:"gray 73"},{value:"#B8B8B8",name:"gray 72"},{value:"#B5B5B5",name:"gray 71"},{value:"#B3B3B3",name:"gray 70"},{value:"#B0B0B0",name:"gray 69"},{value:"#ADADAD",name:"gray 68"},{value:"#ABABAB",name:"gray 67"},{value:"#A8A8A8",name:"gray 66"},{value:"#A6A6A6",name:"gray 65"},{value:"#A3A3A3",name:"gray 64"},{value:"#A1A1A1",name:"gray 63"},{value:"#9E9E9E",name:"gray 62"},{value:"#9C9C9C",name:"gray 61"},{value:"#999999",name:"gray 60"},{value:"#969696",name:"gray 59"},{value:"#949494",name:"gray 58"},{value:"#919191",name:"gray 57"},{value:"#8F8F8F",name:"gray 56"},{value:"#8C8C8C",name:"gray 55"},{value:"#8A8A8A",name:"gray 54"},{value:"#878787",name:"gray 53"},{value:"#858585",name:"gray 52"},{value:"#828282",name:"gray 51"},{value:"#7F7F7F",name:"gray 50"},{value:"#7D7D7D",name:"gray 49"},{value:"#7A7A7A",name:"gray 48"},{value:"#787878",name:"gray 47"},{value:"#757575",name:"gray 46"},{value:"#737373",name:"gray 45"},{value:"#707070",name:"gray 44"},{value:"#6E6E6E",name:"gray 43"},{value:"#666666",name:"gray 40"},{value:"#636363",name:"gray 39"},{value:"#616161",name:"gray 38"},{value:"#5E5E5E",name:"gray 37"},{value:"#5C5C5C",name:"gray 36"},{value:"#595959",name:"gray 35"},{value:"#575757",name:"gray 34"},{value:"#545454",name:"gray 33"},{value:"#525252",name:"gray 32"},{value:"#4F4F4F",name:"gray 31"},{value:"#4D4D4D",name:"gray 30"},{value:"#4A4A4A",name:"gray 29"},{value:"#474747",name:"gray 28"},{value:"#454545",name:"gray 27"},{value:"#424242",name:"gray 26"},{value:"#404040",name:"gray 25"},{value:"#3D3D3D",name:"gray 24"},{value:"#3B3B3B",name:"gray 23"},{value:"#383838",name:"gray 22"},{value:"#363636",name:"gray 21"},{value:"#333333",name:"gray 20"},{value:"#303030",name:"gray 19"},{value:"#2E2E2E",name:"gray 18"},{value:"#2B2B2B",name:"gray 17"},{value:"#292929",name:"gray 16"},{value:"#262626",name:"gray 15"},{value:"#242424",name:"gray 14"},{value:"#212121",name:"gray 13"},{value:"#1F1F1F",name:"gray 12"},{value:"#1C1C1C",name:"gray 11"},{value:"#1A1A1A",name:"gray 10"},{value:"#171717",name:"gray 9"},{value:"#141414",name:"gray 8"},{value:"#121212",name:"gray 7"},{value:"#0F0F0F",name:"gray 6"},{value:"#0D0D0D",name:"gray 5"},{value:"#0A0A0A",name:"gray 4"},{value:"#080808",name:"gray 3"},{value:"#050505",name:"gray 2"},{value:"#030303",name:"gray 1"},{value:"#F5F5F5",css:!0,name:"whitesmoke"}],v=(function(t){var e=o.filter(function(e){return!!e.css}),n=o.filter(function(e){return!!e.vga});t.exports=function(e){var a=t.exports.get(e);return a&&a.value},t.exports.get=function(a){return a=(a=a||"").trim().toLowerCase(),o.filter(function(e){return e.name.toLowerCase()===a}).pop()},t.exports.all=t.exports.get.all=function(){return o},t.exports.get.css=function(a){return a?(a=(a=a||"").trim().toLowerCase(),e.filter(function(e){return e.name.toLowerCase()===a}).pop()):e},t.exports.get.vga=function(a){return a?(a=(a=a||"").trim().toLowerCase(),n.filter(function(e){return e.name.toLowerCase()===a}).pop()):n}}(u={exports:{}},u.exports),u.exports);v.get,v.all;function g(e,a){switch(m(e)){case"number":return{x:e,y:e};case"string":var t=e.split(/(\s|,)/).filter(function(e){return e.trim()&&function(e){return e===+e}(+e)}),n=t[0],r=t[1];return{x:+n,y:+(void 0===r?n:r)};case"array":return{x:+e[0],y:+e[1]};case"object":return{x:e.x||a.x,y:e.y||a.y};default:return a}}var y,F,f=[function(a){a.on("beforeCreated beforeUpdate",function(n){"object"==typeof n&&(["backgroundColor","borderColor","text.color","text.fill"].map(function(e){var a=O(n,e);if("string"==typeof a){var t=S.utils.string2hex(a.includes("#")||a.startsWith("0x")?a:v.get(a).value);t&&function(e,a,t){if("object"!==m(e))p("setValue tar muse be a object!");else{var n=a.trim().indexOf(".");if(0<n&&n<a.length-1){for(var r=a.trim().split("."),l=e,i="",u=0,o=r.length-1;u<o;u++){var s=r[u];"object"==typeof l[s]?l=l[s]:void 0===l[s]&&(i=s)}i?p("the key("+i+") is not in tar obj!"):l[r[r.length-1]]=t}else e[a.replace(/\./g,"")]=t}}(n,e,t)}}),"string"==typeof n.backgroundFrame&&(n.backgroundFrame=n.backgroundFrame.split(/\s/).map(function(e){return+e})),n.anchor&&(n.anchor=g(n.anchor,{x:.5,y:.5})),n.scale&&(n.scale=g(n.scale,{x:1,y:1})))}),a.on("beforeCreated",function(e){a.debug&&!e.borderWidth&&(e.borderWidth="1px")})},function(r){r.on("created",function(e){var a=e.instance,t=e.style,n=e.uiDesignRatio;a.layout=new l(a,t,{uiDesignRatio:n,Component:r}),function(a,e,t){var n=O(a,e);t.map(function(t){"string"==typeof t?a[t]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return n[t].apply(n,e)}:"object"==typeof t&&d(t,function(e,t){a[e]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return n[t].apply(n,e)}})})}(a,"layout",["transformStyle","append","appendTo","before","after","insertBefore","insertAfter","remove",{setStyle:"update"},"getStyle"])})},function(e){e.on("init",function(){e.pixiComponents.map(function(e){e.prototype.getRelativeBounds=function(){if(this.layout)return this.layout.rlayout},e.prototype.getRealBounds=function(){if(this.layout)return this.layout.pixilayout},e.prototype.getGlobalBounds=function(){for(var e=this.layout.rlayout,a=e.x,t=e.y,n=e.width,r=e.height,l=this.parent;l;){var i=this.getRelativeBounds();i?(a+=i.x,t+=i.y):(a+=l.x,t+=l.y),l=l.parent}return{x:Math.round(a),y:Math.round(t),width:Math.round(n),height:Math.round(r)}}})})},function(e){e.on("update",function(e){var a=e.instance,t=e.style;if((!a.layout.newStyle||a.layout.newStyle.backgroundColor)&&O(t,"backgroundColor")&&["sprite","view","animatedsprite"].includes(a.type)){var n=j(a);if(n){var r=n.x,l=n.y,i=n.width,u=n.height,o=function(e){e.beginFill(t.backgroundColor),e.drawRect(r,l,i,u),e.endFill()};if(a._background)a._background.clear(),o(a._background);else{var s=new S.Graphics;s.name="background-color",o(s),a.addChildAt(s,0),a._background=s}}}})},function(e){e.on("update",function(e){var a=e.instance,t=e.style;if(O(a,"layout.newStyle.overflow")){var n=t.borderRadius,r=void 0===n?0:n,l=t.overflow,i=j(a);if(l&&i){var u=a.getGlobalBounds().width,o=a.layout.transform.length(u,r),s=i.x,m=i.y,v=i.width,c=i.height;if(a.mask&&"overflow"===a.mask.name&&(a.mask.destroy(),a.mask=null),!(o&&0<o)){var h=new S.Graphics;h.beginFill(),u/2<=o?h.drawCircle(0,0,v/2):h.drawRoundedRect(s,m,v,c,o),h.endFill(),h.name="overflow",a.addChildAt(h,0),a.mask=h}}}})},function(e){e.on("update",function(e){var a=e.instance,t=e.style,n=O(a,"layout.newStyle");if(!n||n.borderWidth||n.borderRadius){var r=t.borderWidth,l=void 0===r?0:r,i=t.borderColor,u=void 0===i?0:i,o=t.borderRadius,s=void 0===o?0:o,m=t.anchor,v=void 0===m?{x:.5,y:.5}:m,c=j(a);if(c&&["view","sprite","animatedsprite","text"].includes(a.type)){var h=a.layout,d=h.realScale,g=h.transform,y=a.getGlobalBounds().width,p=g.length(y,l)/d.x,F=g.length(y,s),f=c.x,E=c.y,C=c.width,A=c.height;if(a._border&&"border"===a._border.name&&(a._border.destroy(),a._border=null),0<p){var b=new S.Graphics,B=C-p,D=A-p,w=-C*v.x,x=-A*v.y;b.lineStyle(p,u,1),y/2<=F?b.drawCircle(0,0,B/2):0<F?b.drawRoundedRect(w,x,B,D,F):b.drawRect(w,x,B,D),b.name="border",a.addChildAt(b,a._background?1:0),a._border=b}if(a.mask&&"border-mask"===a.mask.name&&(a.mask.destroy(),a.mask=null),F&&0<F){var k=new S.Graphics;k.beginFill(16777215),y/2<=F?k.drawCircle(0,0,C/2):k.drawRoundedRect(f,E,C,A,F+p/2),k.endFill(),k.name="border-mask",a.addChildAt(k,0),a.mask=k}}}})}],E=((F=C).use=function(e){var a=this;(Array.isArray(e)?e:[e]).map(function(e){return e(a)})},C.prototype.createElement=function(e,a){F.emit("beforeCreated",a);var t=this.createInstance(e,a);t.type=e.toLowerCase();var n=a.opacity,r=a.zIndex;return n&&(t.alpha=n),r&&(t.zIndex=r),F.emit("created beforeMounted",{instance:t,style:a,uiDesignRatio:this.uiDesignRatio}),t},C.prototype.createInstance=function(e,a){var t=a.backgroundColor,n=void 0===t?16777215:t,r=a.backgroundImage,l=void 0===r?this.transparentTexture:r,i=a.backgroundFrame,u=a.animatedFrames,o=a.content,s=void 0===o?"":o;switch(e.toLowerCase()){case"rect":return(m=new S.Graphics).beginFill(n),m.drawRect(0,0,1,1),m.endFill(),m;case"circle":var m;return(m=new S.Graphics).beginFill(n),m.drawEllipse(0,0,1,1),m.endFill(),m;case"text":return new S.Text(String(s));case"animatedsprite":if(u)return new S.AnimatedSprite(u,!0);p("animatedsprite should have the animations frames(texture array)!");case"view":a.width||(a.width="100%"),a.height||(a.height="100%");case"sprite":default:var v=l instanceof S.Texture?l:S.Texture.from(l);if(i){var c=i,h=c[0],d=c[1],g=c[2],y=c[3];4===i.length?v.frame=new S.Rectangle(h,d,g,y):p("backgroundFrame is error!")}return new S.Sprite(v)}},C.pixiComponents=[S.Graphics,S.Sprite,S.Text],C=F=function(e,a,t,n){var r,l=arguments.length,i=l<3?a:null===n?n=Object.getOwnPropertyDescriptor(a,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,a,t,n);else for(var u=e.length-1;0<=u;u--)(r=e[u])&&(i=(l<3?r(i):3<l?r(a,t,i):r(a,t))||i);return 3<l&&i&&Object.defineProperty(a,t,i),i}([(y=f,function(a){(Array.isArray(y)?y:[y]).map(function(e){if("function"!=typeof e)throw Error("[@amoy/components]error: addon "+y+" must be a function;");e(a)})}),a],C));function C(e){var a=e.uiDesignWidth,t=e.debug;this.uiDesignRatio=a/window.innerWidth,this.transparentTexture=S.Texture.from("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0AQMAAADxGE3JAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAADVJREFUeNrtwTEBAAAAwiD7p/ZZDGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOX0AAAEidG8rAAAAAElFTkSuQmCC"),F.debug=t,F.emit("init",e)}var A={uiDesignWidth:window.innerWidth,debug:!1},b=new E(A),B=function(e,a){return void 0===a&&(a={}),b.createElement("AnimatedSprite",h(a,{animatedFrames:e}))},w=function(e,a){return void 0===a&&(a={}),b.createElement("Sprite",h(a,{backgroundImage:e}))},x=function(e){return void 0===e&&(e={}),b.createElement("View",e)},k=function(e){return void 0===e&&(e={}),b.createElement("Rect",e)},R=function(e){return void 0===e&&(e={}),b.createElement("Circle",e)},_=function(e,a){return void 0===a&&(a={}),b.createElement("Text",h(a,{content:e}))},P={},q=function(e){return(e+"").replace(/[_|-]\D/g,function(e){return e.charAt(1).toUpperCase()})};function M(e){var a={};if(e&&"string"==typeof e)for(var t=e.trim().split(/;|,/),n=0,r=t.length;n<r;n++)if(t[n]){var l=t[n].split(/:|=/);a[l[0].trim()]=l[1].replace(/'|"/g,"").trim()}return a}function T(e,a){return void 0===a&&(a={}),"string"==typeof e&&e.includes("data.")?a[e.split("data.")[1].trim()]:e}var W=["left","right","centerX"],I=["top","bottom","centerY"];function z(t,e){return Object.keys(e).map(function(a){[W,I].map(function(e){e.includes(a)&&e.map(function(e){return delete t[e]})})}),h(!0,t,e),t}function G(e,a){void 0===a&&(a="");var t={};return e&&e.trim().split(" ").map(function(e){z(t,function(e){var a=typeof P[e];return"string"==a?M(P[e]):"object"==a?P[e]:{}}(a+e))}),t}function L(e,a){var t=e.name,n=e.attrs,r=void 0===n?{}:n,l=r.style,i=r.className,u=r.id,o=r.class,s=M(l),m=G(t),v=G(i||o,"."),c=G(u,"#");return function(t,n){return d(t,function(e,a){t[e]=T(a,n)}),t}(function(t){return d(t,function(e,a){(e.includes("_")||e.includes("-"))&&(t[q(e)]=a,delete t[e])}),t}([m,v,c,s,function(e,a,t){var n={};return[e,a,t].map(function(t){d(t,function(e,a){e.includes("--important")&&(n[e.replace("--important","")]=a,delete t[e])})}),n}(m,v,c)].reduce(function(e,a){return z(e,a)},{})),a)}function H(e,a){return{clsKey:e.class?"class":e.className?"className":null,clsArr:a.split(" ")}}function N(e){var a=this.node.attrs,t=H(a,e),n=t.clsKey,r=t.clsArr,l=!1;return n?r.map(function(e){a[n].includes(e)||(a[n]+=" "+e,l=!0)}):(a.class=e,l=!0),l&&(h(!0,this,this.node.attrs),this.setStyle(L(this.node))),this}function V(e){var a=this.node.attrs,t=H(a,e),n=t.clsKey,r=t.clsArr,l=!1;if(n){var i=[];r.map(function(e){a[n].includes(e)&&i.push(!0)}),i.length===r.length&&(l=!0)}return l}function X(e){var a=this,t=this.node.attrs,n=H(t,e),r=n.clsKey,l=n.clsArr,i=!1;return r&&l.map(function(e){V.bind(a)(e)&&(t[r]=t[r].replace(e,""),i=!0)}),i&&(h(!0,this,this.node.attrs),this.setStyle(L(this.node),{replaceStyle:!0})),this}var U={addClass:N,removeClass:X,hasClass:V,toggleClass:function(e){var a=this;return H(this.node.attrs,e).clsArr.map(function(e){V.bind(a)(e)?X.bind(a)(e):N.bind(a)(e)}),this}};function Y(e,a){return a&&(this.node.attrs[e]=a,h(!0,this,this.node.attrs),["class","className","id"].includes(e)&&this.setStyle(L(this.node))),this}function K(e){return"string"==typeof e?this.node.attrs[e]||this[e]:this.node.attrs}var Q={setAttribute:Y,getAttribute:K,removeAttribute:function(e){return"string"==typeof e&&(delete this.node.attrs[e],delete this[e]),this},attr:function(e,a){return a?Y.bind(this)(e,a):K.bind(this)(e)}},J=/([\w-]+)|['"]{1}([^'"]*)['"]{1}/g,Z=Object.create?Object.create(null):{};Z.area=!0,Z.base=!0,Z.br=!0,Z.col=!0,Z.embed=!0,Z.hr=!0,Z.img=!0,Z.input=!0,Z.keygen=!0,Z.link=!0,Z.menuitem=!0,Z.meta=!0,Z.param=!0,Z.source=!0,Z.track=!0,Z.wbr=!0;var $=/<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>/g,ee=Object.create?Object.create(null):{};function ae(o,s){s||(s={}),s.components||(s.components=ee);var m,v=[],c=-1,h=[],d={},g=!1;return o.replace($,function(e,a){if(g){if(e!=="</"+m.name+">")return;g=!1}var t,n="/"!==e.charAt(1),r=a+e.length,l=o.charAt(r);if(n&&(c++,"tag"===(m=function(a){var t,n=0,r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]};return a.replace(J,function(e){n%2?t=e:0===n?(!Z[e]&&"/"!==a.charAt(a.length-2)||(r.voidElement=!0),r.name=e):r.attrs[t]=e.replace(/['"]/g,""),n++}),r}(e)).type&&s.components[m.name]&&(m.type="component",g=!0),m.voidElement||g||!l||"<"===l||m.children.push({type:"text",content:o.slice(r,o.indexOf("<",r))}),d[m.tagName]=m,0===c&&v.push(m),(t=h[c-1])&&t.children.push(m),h[c]=m),(!n||m.voidElement)&&(c--,!g&&"<"!==l&&l)){t=-1===c?v:h[c].children;var i=o.indexOf("<",r),u=o.slice(r,-1===i?void 0:i);/^\s*$/.test(u)||t.push({type:"text",content:u})}}),v}function te(e,a){var t=null;if("tag"===e.type){var n=L(e,a),r=T(O(e,"attrs.src"),a);switch(e.name.toLowerCase()){case"sprite":case"image":t=w(r,n);break;case"animated-sprite":case"animated-image":case"animatedsprite":case"animatedimage":t=B(r,n);break;case"text":case"txt":var l="";e.children.map(function(e){"text"===e.type&&(l+=e.content)}),t=_(l,n);break;case"view":case"div":t=x(n);break;case"rect":case"rectangle":t=k(n);break;case"circle":t=R(n)}}else"text"===e.type&&e.content.trim()&&((t=_(e.content.trim())).isAutoText=!0);return h(!0,t,i({},Q,U),i({node:e},e.attrs)),t}e.AnimatedSprite=B,e.Circle=R,e.Rect=k,e.Sprite=w,e.Text=_,e.View=x,e.configComponents=function(e){e&&(b=new E(h(A,e)))},e.render=function(e,t,n){if("string"==typeof e){var a=ae(e);if(a&&a.length){var r=[];return a.map(function(e){var a=te(e,n);!function t(e,n,r){"text"!==n.type&&O(e,"children.length")&&e.children.map(function(e){var a=te(e,r);a&&(t(e,a),a.appendTo(n,!1))})}(e,a,n),t&&t.addChild?(a.appendTo(t),r.push(a)):p("mountedRoot is invalid, it should be a pixi element")}),1<r.length?r:r[0]}p("Parse template error, Please check the template string")}else p("the template should be string")},e.style=function(e){!function(a){"object"==typeof a&&Object.keys(a).map(function(e){P[e]=a[e]})}(e)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("pixi.js")):"function"==typeof define&&define.amd?define(["exports","pixi.js"],a):a((e=e||self).components={},e.PIXI)}(this,function(e,S){"use strict";function a(n){return n.callbacks={},n.on=function(e,a){return e&&a&&(n.hasOwnProperty("callbacks")||n.callbacks||(n.callbacks={}),e.split(" ").map(function(e){(t=n.callbacks)[e]||(t[e]=[]),n.callbacks[e].push(a)})),n;var t},n.emit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.shift().split(" ").map(function(e){var a=null!==n.callbacks&&n.callbacks[e]||[];a.length&&a.map(function(e){e&&e.apply(n,t)})}),n},n.off=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];0===e.length?n.callbacks={}:e.shift().split(" ").map(function(e){return delete n.callbacks[e]});return n},n}function c(e){var a,t,n={},r=n.toString,l=n.hasOwnProperty,i=l.toString,u=i.call(Object);return!(!e||"[object Object]"!==r.call(e))&&(!(a=Object.getPrototypeOf(e))||"function"==typeof(t=l.call(a,"constructor")&&a.constructor)&&i.call(t)===u)}function h(){for(var e,a,t,n,r,l,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=arguments[0]||{},s=1,m=arguments.length,v=!1;for("boolean"==typeof o&&(v=o,o=arguments[s]||{},s++),"object"!=typeof o&&"function"!=typeof o&&(o={}),s===m&&(o=this,s--);s<m;s++)if(null!==(e=arguments[s]))for(a in e)if(e.hasOwnProperty(a)){if(r=o[a],o===(n=e[a]))continue;v&&n&&(c(n)||(l=Array.isArray(n)))?(t=l?(l=!1,r&&Array.isArray(r)?r:[]):r&&c(r)?r:{},o[a]=h(v,t,n)):void 0!==n&&(o[a]=n)}return o}function d(e,a){if("object"==typeof e)for(var t in e){if(e.hasOwnProperty(t))a(t,e[t])}}function m(e){var a={},t=a.toString.call(e);return null==e?e+"":("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" ").forEach(function(e){a["[object "+e+"]"]=e.toLowerCase()}),"object"==typeof e||"function"==typeof e?a[t]||"object":typeof e)}function j(e){if(e.getGlobalBounds&&e.layout){var a=e.getGlobalBounds(),t=a.width,n=a.height,r=e.layout.realScale,l=r.x,i=r.y,u=e.layout.style,o=u.anchor,s=void 0===o?{x:.5,y:.5}:o,m=u.scale,v=void 0===m?{x:1,y:1}:m,c=t/l*v.x,h=n/i*v.y;return{x:-c*s.x,y:-h*s.y,width:c,height:h}}return null}var R=function(e,a){if("object"!==m(e))return e;for(var t=e,n=a.split("."),r=0,l=n.length;r<l;r++){var i=n[r];if(i){if(!t[i]){t=void 0;break}t=t[i]}}return t};function p(e){throw Error("[@amoy/components]Error: "+e+";")}var i=function(){return(i=Object.assign||function(e){for(var a,t=1,n=arguments.length;t<n;t++)for(var r in a=arguments[t])Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e}).apply(this,arguments)};var n={},g=function(e){return(e+"").replace(/[_|-]\D/g,function(e){return e.charAt(1).toUpperCase()})};function y(e){var a={};if(e&&"string"==typeof e)for(var t=e.trim().split(/;|,/),n=0,r=t.length;n<r;n++)if(t[n]){var l=t[n].split(/:|=/);a[l[0].trim()]=l[1].replace(/'|"/g,"").trim()}return a}function F(e,a){return void 0===a&&(a={}),"string"==typeof e&&e.includes("data.")?a[e.split("data.")[1].trim()]:e}var r=["left","right","centerX"],l=["top","bottom","centerY"];function f(t,e){return Object.keys(e).map(function(a){[r,l].map(function(e){e.includes(a)&&e.map(function(e){return delete t[e]})})}),h(!0,t,e),t}function E(e,a){void 0===a&&(a="");var t={};return e&&e.trim().split(" ").map(function(e){f(t,function(e){var a=typeof n[e];return"string"==a?y(n[e]):"object"==a?n[e]:{}}(a+e))}),t}function u(e,a){var t=e.name,n=e.attrs,r=void 0===n?{}:n,l=r.style,i=r.className,u=r.id,o=r.class,s=y(l),m=E(t),v=E(i||o,"."),c=E(u,"#");return function(t,n){return d(t,function(e,a){t[e]=F(a,n)}),t}(function(t){return d(t,function(e,a){(e.includes("_")||e.includes("-"))&&(t[g(e)]=a,delete t[e])}),t}([m,v,c,s,function(e,a,t){var n={};return[e,a,t].map(function(t){d(t,function(e,a){e.includes("--important")&&(n[e.replace("--important","")]=a,delete t[e])})}),n}(m,v,c)].reduce(function(e,a){return f(e,a)},{})),a)}var s=function(e){return e instanceof S.Container&&!(e instanceof S.Sprite)&&!(e instanceof S.Graphics)};function o(u){function v(e){if("string"!=typeof e)return e;var a=e.trim(),t=Math.PI/180;if(a.endsWith("deg")){var n=a.split("deg")[0];return parseFloat(n)*t}return parseFloat(a)}function o(e,a){return(a=a.trim()).endsWith("px")?parseInt(a):a.endsWith("%")?e*parseInt(a)/100:parseInt(a)/u}function h(e,a){var t=0;return"string"==typeof a&&(t=o(e,a)),"number"==typeof a&&(t=a/u),Math.round(t)}function c(e,a,t){if(["number","string"].includes(typeof t)){var n=0;if("number"==typeof t)n=t/u;else if(t.includes(":")){var r=t.split(":"),l=r[0],i=r[1];switch(l.trim()){case"left":case"top":n=o(e,i);break;case"right":case"bottom":n=e-a,n-=o(e,i);break;case"center":n=(e-a)/2,n+=o(e,i)}}else n="center"===t?(e-a)/2:o(e,t);return Math.round(n)}throw p("value must be number or string")}function r(e){for(var a={x:e.scale.x,y:e.scale.y},t=e.parent;t;)a.x*=t.scale.x,a.y*=t.scale.y,t=t.parent;return a}function l(e){if(s(e))return function e(a){return a.parent?a.isWorld?{width:window.innerWidth,height:window.innerHeight}:0<a.width&&0<a.height?{width:a.width,height:a.height}:s(a.parent)?e(a.parent):{width:a.parent.width,height:a.parent.height}:{width:window.innerWidth,height:window.innerHeight}}(e);var a=R(e,"layout.pixilayout.width")||e.width,t=R(e,"layout.pixilayout.height")||e.height;if(e.parent){var n=r(e.parent);return{width:~~(a*n.x),height:~~(t*n.y)}}return{width:a,height:t}}function d(e){return["sprite","animatedsprite"].includes(e.type)&&e._texture?e._texture.width/e._texture.height:1}function g(e,a){for(var t=0,n=0;n<a.length;n++){var r=a[n],l=e[r];if(void 0!==l){if(["x","y"].includes(r)){t=l;break}if(r.includes("center")){t="center: "+l;break}t=r+": "+l;break}}return t}return void 0===u&&(u=1),{rotation:v,length:h,pos:c,actualScale:r,actualSize:l,getRatio:d,elementSize:function(e,a,t){var n=a.width,r=a.height,l=function(e){switch(e.type){case"animatedsprite":case"sprite":return e._texture;case"view":return{width:500,height:500};case"text":if(R(e,"layout.container")){var a=e.layout.container;return{width:a.width,height:a.height}}return{width:1,height:1};default:return{width:1,height:1}}}(e),i=l.width,u=l.height,o=t.width,s=t.height,m=d(e),v=i,c=u;return n?(v=h(o,n),r?c=h(s,r):m&&(c=v/m)):r&&(v=(c=h(s,r))*m),{width:Math.round(v),height:Math.round(c)}},elementPos:function(e,a,t){var n=a.rotation,r=void 0===n?0:n,l=g(a,["x","left","centerX","right"]),i=g(a,["y","top","centerY","bottom"]),u=t.width,o=t.height,s=e.width,m=e.height;return{x:c(u,s,l),y:c(o,m,i),rotation:v(r)}},container:function(e){var a=l(e),t=a.width,n=a.height;return{element:e,width:t,height:n,ratio:t/n,scale:r(e)}},rlayout2pixilayout:function(e,a,t){var n=e.width,r=e.height,l=e.scale,i=e.element,u=l.x,o=l.y,s=t.width,m=t.height,v=t.x,c=t.y;return v+=s*a.x,c+=m*a.y,i.anchor?(v-=n*i.anchor.x,c-=r*i.anchor.y):i.pivot&&(v-=n*i.pivot.x,c-=r*i.pivot.y),s/=u,m/=o,v/=u,c/=o,{width:Math.round(s),height:Math.round(m),x:Math.round(v),y:Math.round(c),rotation:t.rotation}},pixilayout2rlayout:function(e,a,t){var n=e.width,r=e.height,l=e.scale,i=l.x,u=l.y,o=e.element,s=t.width,m=t.height,v=t.x,c=t.y;return s*=i,m*=u,v*=i,c*=u,o.anchor?(v+=n*o.anchor.x,c+=r*o.anchor.y):o.pivot&&(v+=n*o.pivot.x,c+=r*o.pivot.y),v-=s*a.x,c-=m*a.y,{width:Math.round(s),height:Math.round(m),x:Math.round(v),y:Math.round(c),rotation:t.rotation}}}}function v(e){switch(e.target.type){case"rect":!function(e){var a=e.pixilayout,t=e.target,n=e.transform,r=a.x,l=a.y,i=a.width,u=a.height,o=a.rotation;if(D(e)){var s=R(e,"style")||{},m=s.backgroundColor,v=void 0===m?16777215:m,c=s.borderWidth,h=void 0===c?0:c,d=s.borderColor,g=void 0===d?0:d,y=s.borderRadius,p=void 0===y?0:y,F=n.length(i,h),f=n.length(i,p),E=i-F,C=u-F,A=t.pivot,b=A.x,B=A.y;t.clear(),t.beginFill(v),t.lineStyle(F,g,1),i/2<=f?t.drawEllipse(0,0,E/2,C/2):0<f?t.drawRoundedRect(-E*b,-C*B,E,C,f):t.drawRect(-E*b,-C*B,E,C),t.endFill()}t.x!==r&&(t.x=r);t.y!==l&&(t.y=l);t.rotation!==o&&(t.rotation=o)}(e);break;case"circle":!function(e){var a=e.pixilayout,t=e.target,n=e.transform,r=a.x,l=a.y,i=a.width,u=a.height;if(D(e)){var o=R(e,"style")||{},s=o.backgroundColor,m=void 0===s?16777215:s,v=o.borderWidth,c=void 0===v?0:v,h=o.borderColor,d=void 0===h?0:h,g=n.length(i,c),y=i-g,p=u-g;t.clear(),t.beginFill(m),t.lineStyle(g,d,1),t.drawEllipse(0,0,y/2,p/2),t.endFill()}t.x!==r&&(t.x=r);t.y!==l&&(t.y=l)}(e);break;case"text":!function(e){var a=e.target,t=e.pixilayout,n=t.x,r=t.y,l=t.width,i=t.height,u=t.rotation,o=e.style.content,s=void 0===o?"":o;a.style=new S.TextStyle(e.textStyle),a.text=s,a.width!==l&&(a.width=l);a.height!==i&&(a.height=i);a.x!==n&&(a.x=n);a.y!==r&&(a.y=r);a.rotation!==u&&(a.rotation=u)}(e);break;case"animatedsprite":var a=e.target,t=e.style,n=void 0===t?{}:t,r=n.animatedLoop,l=void 0===r||r,i=n.animatedSpeed,u=void 0===i?60:i;+u&&(a.animationSpeed=1<=+u?1/60*+u:+u),a.loop=!!l,a.replay=function(){return a.gotoAndPlay(0)},a.play();case"sprite":case"view":default:!function(e){var a=e.target,t=e.pixilayout,n=t.width,r=t.height,l=t.x,i=t.y,u=t.rotation;a.width!==n&&(a.width=n);a.height!==r&&(a.height=r);a.x!==l&&(a.x=l);a.y!==i&&(a.y=i);a.rotation!==u&&(a.rotation=u)}(e)}}var D=function(e){return e.styleHasChanged(["width","height","borderWidth","borderColor","backgroundColor"])};var C=(t.prototype.render=function(e){var a=this;if(e){var t=this.target,n=this.style;this.container=this.transform.container(e),t.scale.x=1,t.scale.y=1,"text"===t.type&&this.textInheritStyle(),this._setLayout(),this._fixRender(),this.initScale={x:t.scale.x,y:t.scale.y};var r=n.scale||{x:1,y:1};this.setScale(r),["update","mounted"].map(function(e){a.config.Component.emit(e,{instance:a.target,style:a.style})})}else!function(e){console.warn("[@amoy/components]Warn: "+e+";")}("layout.render must have a container.")},t.prototype.update=function(e,a){void 0===e&&(e={});var t=this.config,n=this.target;if(this.container){var r=a||{},l=r.refreshStyle,i=void 0!==l&&l,u=r.updateChild,o=void 0===u||u,s=r.replaceStyle,m=void 0!==s&&s;t.Component.emit("beforeUpdate",e),"text"===n.type&&this.textInheritStyle(),i&&this.updateStyle(),this.mergeStyle(e,m),this.initScale||(n.scale.x=1,n.scale.y=1),this._setLayout(),this.initScale||(this.initScale={x:n.scale.x,y:n.scale.y}),this.setScale({x:1,y:1}),o&&this.updateChild();var v=this.style.scale;return v&&this.setScale(v),t.Component.emit("update",{instance:this.target,style:this.style}),n}},t.prototype._getRlayout=function(){var e,a=this.target,t=this.container,n=this.rlayout;!n||this.styleHasChanged(["width","height","content","backgroundImage"])?e=this.transform.elementSize(a,this.style,t):n&&(e={width:n.width,height:n.height});var r=this.style;if("text"===a.type){e=this.fixTextSize(e);var l=this.styleFromParent,i=l.horPos,u=void 0===i?{}:i,o=l.verPos;r=[u,void 0===o?{}:o,this.style].reduce(function(e,a){return f(e,a)},{})}return h(e,this.transform.elementPos(e,r,t))},t.prototype._setLayout=function(){var e=this.target,a=this.style,t=this.container,n=a.anchor||{x:.5,y:.5};this.rlayout=this._getRlayout(),this.pixilayout=this.transform.rlayout2pixilayout(t,n,this.rlayout),e[e.anchor?"anchor":"pivot"].set(n.x,n.y),v(this)},t.prototype.updateChild=function(){var e=R(this.target,"children");e.length&&e.map(function(e){e.layout&&(e.layout.refreshContianer(),e.layout.update())})},t.prototype.fixTextSize=function(e){var a=this.style,t=this.transform,n=this.container,r=n.width,l=n.height,i=a.content,u=void 0===i?"":i;(a=h({},this.styleFromParent,a)).breakWords=!0,a.wordWrap=!0,a.wordWrapWidth=e.width,a.color&&(a.fill=a.color),a.fontSize&&(a.fontSize=t.length(r,a.fontSize)),a.lineHeight&&(a.lineHeight=t.length(l,a.lineHeight)),this.textStyle=new S.TextStyle(a);var o=new S.Text(""+u,this.textStyle);return{width:o.width,height:o.height}},t.prototype._fixRender=function(){var e=this;if(["sprite","view","animatedsprite"].includes(this.target.type)&&!this.target.texture.valid){var a=!1;this.target.texture.on("update",function(){a||(e.update(),a=!0)})}else this.target.children.length&&this.updateChild()},t.prototype.hasHorPosAttr=function(e){return e.hasOwnProperty("left")||e.hasOwnProperty("right")||e.hasOwnProperty("centerX")},t.prototype.hasVerPosAttr=function(e){return e.hasOwnProperty("top")||e.hasOwnProperty("bottom")||e.hasOwnProperty("centerY")},t.prototype.styleDiff=function(t,a,n){var r=[];return a&&(d(a,function(e,a){n?r.push(e):t[e]!==a&&r.push(e)}),d(t,function(e){a[e]||r.push(e)})),r},t.prototype.mergeStyle=function(e,a){void 0===a&&(a=!1),this.styleDiffPool=this.styleDiff(this.style,e,a),a?(this.style.content&&!e.content&&(e.content=this.style.content),this.style=e):this.style=f(this.style,e)},t.prototype.styleHasChanged=function(e){for(var a=!1,t=0;t<e.length;t++){var n=e[t];if(this.styleDiffPool.includes(n)){a=!0;break}}return a},t.prototype._inheritStyle=function(){var r={},e=this.container,l=R(e,"element.layout.style");if(l){["fontSize","color","lineHeight","fontWeight","fontStyle","fontFamily"].map(function(e){l[e]&&(r["color"===e?"fill":e]=l[e])});var a=function(e,a){var t=l[e];if(t){var n=r["textAlign"===e?"horPos":"verPos"]={};"number"==typeof t?n[a[0]]=+t:a.concat("center").includes(t)&&(n["center"===t?a[1]:t]=0)}};a("textAlign",["left","centerX","right"]),a("textJustify",["top","centerY","bottom"])}return r},t.prototype.textInheritStyle=function(){this.styleFromParent=this._inheritStyle()},t.prototype.refreshContianer=function(){var e=this.container?this.container.element:this.target.parent;this.container=this.transform.container(e)},t.prototype.setScale=function(e){var a=this.target,t=this.initScale;a.scale.set(t.x*e.x,t.y*e.y),"view"===a.type?this.realScale={x:this.rlayout.width/500,y:this.rlayout.height/500}:this.realScale=this.transform.actualScale(a)},t.prototype.appendTo=function(e,a){return void 0===a&&(a=!0),e&&e.addChild?(e.addChild(this.target),a&&this.render(e)):p("the container is not exsit!"),this.target},t.prototype.append=function(e,a){return void 0===a&&(a=!0),e.layout.appendTo(this.target,a),this.target},t.prototype._addChildAt=function(e,a,t){e.addChildAt&&(e.addChildAt(a,t),a.layout.render(e))},t.prototype._addSibling=function(e,a){if(this.container&&R(e,"layout")){var t=this.container.element,n=e,r=t.getChildIndex(this.target)+a;this._addChildAt(t,n,r)}},t.prototype._insertSibling=function(e,a){var t=R(e,"layout.container.element");if(t){var n=e,r=this.target,l=t.getChildIndex(n)+a;this._addChildAt(t,r,l)}},t.prototype._isMe=function(e,a,t){var n=R(e,"layout.container.element");if(n){var r=n.getChildIndex(e)+t;if(n.children[r]===a)return!0}return!1},t.prototype.before=function(e){return this._isMe(this.target,e,-1)||this._addSibling(e,0),this.target},t.prototype.after=function(e){return this._isMe(this.target,e,1)||this._addSibling(e,1),this.target},t.prototype.insertBefore=function(e){return this._isMe(e,this.target,-1)||this._insertSibling(e,0),this.target},t.prototype.insertAfter=function(e){return this._isMe(e,this.target,1)||this._insertSibling(e,1),this.target},t.prototype.remove=function(){var e=R(this,"container.element");return e?e.removeChild(this.target):this.target.destroy&&this.target.destroy(),this.target},t.prototype.updateStyle=function(){var e=this.target,a=this.style,t=this.container,n=a.anchor||{x:.5,y:.5},r=e.width,l=e.height,i=e.x,u=e.y,o=e.rotation;this.pixilayout={width:r,height:l,x:i,y:u,rotation:o};var s=this.transform.pixilayout2rlayout(t,n,this.pixilayout);this.rlayout=s,this.style.left=s.x,this.style.top=s.y,this.style.width=s.width,this.style.height=s.height,this.style.rotation=s.rotation},t.prototype.transformStyle=function(e){var a=this.target,t=this.container,n=h({},this.style,e),r=n.anchor,l=void 0===r?{x:.5,y:.5}:r,i=this.transform.elementSize(a,n,t);"text"===a.type&&(i=this.fixTextSize(i));var u=h(i,this.transform.elementPos(i,e,t));return this.transform.rlayout2pixilayout(t,l,u)},t.prototype.getStyle=function(e){return e?this.style[e]:this.style},t);function t(e,a,t){void 0===a&&(a={}),this.style={},this.target=e,this.config=t,this.transform=o(t.uiDesignRatio),this.mergeStyle(a,!0)}var A,b=[{value:"#B0171F",name:"indian red"},{value:"#DC143C",css:!0,name:"crimson"},{value:"#FFB6C1",css:!0,name:"lightpink"},{value:"#FFAEB9",name:"lightpink 1"},{value:"#EEA2AD",name:"lightpink 2"},{value:"#CD8C95",name:"lightpink 3"},{value:"#8B5F65",name:"lightpink 4"},{value:"#FFC0CB",css:!0,name:"pink"},{value:"#FFB5C5",name:"pink 1"},{value:"#EEA9B8",name:"pink 2"},{value:"#CD919E",name:"pink 3"},{value:"#8B636C",name:"pink 4"},{value:"#DB7093",css:!0,name:"palevioletred"},{value:"#FF82AB",name:"palevioletred 1"},{value:"#EE799F",name:"palevioletred 2"},{value:"#CD6889",name:"palevioletred 3"},{value:"#8B475D",name:"palevioletred 4"},{value:"#FFF0F5",name:"lavenderblush 1"},{value:"#FFF0F5",css:!0,name:"lavenderblush"},{value:"#EEE0E5",name:"lavenderblush 2"},{value:"#CDC1C5",name:"lavenderblush 3"},{value:"#8B8386",name:"lavenderblush 4"},{value:"#FF3E96",name:"violetred 1"},{value:"#EE3A8C",name:"violetred 2"},{value:"#CD3278",name:"violetred 3"},{value:"#8B2252",name:"violetred 4"},{value:"#FF69B4",css:!0,name:"hotpink"},{value:"#FF6EB4",name:"hotpink 1"},{value:"#EE6AA7",name:"hotpink 2"},{value:"#CD6090",name:"hotpink 3"},{value:"#8B3A62",name:"hotpink 4"},{value:"#872657",name:"raspberry"},{value:"#FF1493",name:"deeppink 1"},{value:"#FF1493",css:!0,name:"deeppink"},{value:"#EE1289",name:"deeppink 2"},{value:"#CD1076",name:"deeppink 3"},{value:"#8B0A50",name:"deeppink 4"},{value:"#FF34B3",name:"maroon 1"},{value:"#EE30A7",name:"maroon 2"},{value:"#CD2990",name:"maroon 3"},{value:"#8B1C62",name:"maroon 4"},{value:"#C71585",css:!0,name:"mediumvioletred"},{value:"#D02090",name:"violetred"},{value:"#DA70D6",css:!0,name:"orchid"},{value:"#FF83FA",name:"orchid 1"},{value:"#EE7AE9",name:"orchid 2"},{value:"#CD69C9",name:"orchid 3"},{value:"#8B4789",name:"orchid 4"},{value:"#D8BFD8",css:!0,name:"thistle"},{value:"#FFE1FF",name:"thistle 1"},{value:"#EED2EE",name:"thistle 2"},{value:"#CDB5CD",name:"thistle 3"},{value:"#8B7B8B",name:"thistle 4"},{value:"#FFBBFF",name:"plum 1"},{value:"#EEAEEE",name:"plum 2"},{value:"#CD96CD",name:"plum 3"},{value:"#8B668B",name:"plum 4"},{value:"#DDA0DD",css:!0,name:"plum"},{value:"#EE82EE",css:!0,name:"violet"},{value:"#FF00FF",vga:!0,name:"magenta"},{value:"#FF00FF",vga:!0,css:!0,name:"fuchsia"},{value:"#EE00EE",name:"magenta 2"},{value:"#CD00CD",name:"magenta 3"},{value:"#8B008B",name:"magenta 4"},{value:"#8B008B",css:!0,name:"darkmagenta"},{value:"#800080",vga:!0,css:!0,name:"purple"},{value:"#BA55D3",css:!0,name:"mediumorchid"},{value:"#E066FF",name:"mediumorchid 1"},{value:"#D15FEE",name:"mediumorchid 2"},{value:"#B452CD",name:"mediumorchid 3"},{value:"#7A378B",name:"mediumorchid 4"},{value:"#9400D3",css:!0,name:"darkviolet"},{value:"#9932CC",css:!0,name:"darkorchid"},{value:"#BF3EFF",name:"darkorchid 1"},{value:"#B23AEE",name:"darkorchid 2"},{value:"#9A32CD",name:"darkorchid 3"},{value:"#68228B",name:"darkorchid 4"},{value:"#4B0082",css:!0,name:"indigo"},{value:"#8A2BE2",css:!0,name:"blueviolet"},{value:"#9B30FF",name:"purple 1"},{value:"#912CEE",name:"purple 2"},{value:"#7D26CD",name:"purple 3"},{value:"#551A8B",name:"purple 4"},{value:"#9370DB",css:!0,name:"mediumpurple"},{value:"#AB82FF",name:"mediumpurple 1"},{value:"#9F79EE",name:"mediumpurple 2"},{value:"#8968CD",name:"mediumpurple 3"},{value:"#5D478B",name:"mediumpurple 4"},{value:"#483D8B",css:!0,name:"darkslateblue"},{value:"#8470FF",name:"lightslateblue"},{value:"#7B68EE",css:!0,name:"mediumslateblue"},{value:"#6A5ACD",css:!0,name:"slateblue"},{value:"#836FFF",name:"slateblue 1"},{value:"#7A67EE",name:"slateblue 2"},{value:"#6959CD",name:"slateblue 3"},{value:"#473C8B",name:"slateblue 4"},{value:"#F8F8FF",css:!0,name:"ghostwhite"},{value:"#E6E6FA",css:!0,name:"lavender"},{value:"#0000FF",vga:!0,css:!0,name:"blue"},{value:"#0000EE",name:"blue 2"},{value:"#0000CD",name:"blue 3"},{value:"#0000CD",css:!0,name:"mediumblue"},{value:"#00008B",name:"blue 4"},{value:"#00008B",css:!0,name:"darkblue"},{value:"#000080",vga:!0,css:!0,name:"navy"},{value:"#191970",css:!0,name:"midnightblue"},{value:"#3D59AB",name:"cobalt"},{value:"#4169E1",css:!0,name:"royalblue"},{value:"#4876FF",name:"royalblue 1"},{value:"#436EEE",name:"royalblue 2"},{value:"#3A5FCD",name:"royalblue 3"},{value:"#27408B",name:"royalblue 4"},{value:"#6495ED",css:!0,name:"cornflowerblue"},{value:"#B0C4DE",css:!0,name:"lightsteelblue"},{value:"#CAE1FF",name:"lightsteelblue 1"},{value:"#BCD2EE",name:"lightsteelblue 2"},{value:"#A2B5CD",name:"lightsteelblue 3"},{value:"#6E7B8B",name:"lightsteelblue 4"},{value:"#778899",css:!0,name:"lightslategray"},{value:"#708090",css:!0,name:"slategray"},{value:"#C6E2FF",name:"slategray 1"},{value:"#B9D3EE",name:"slategray 2"},{value:"#9FB6CD",name:"slategray 3"},{value:"#6C7B8B",name:"slategray 4"},{value:"#1E90FF",name:"dodgerblue 1"},{value:"#1E90FF",css:!0,name:"dodgerblue"},{value:"#1C86EE",name:"dodgerblue 2"},{value:"#1874CD",name:"dodgerblue 3"},{value:"#104E8B",name:"dodgerblue 4"},{value:"#F0F8FF",css:!0,name:"aliceblue"},{value:"#4682B4",css:!0,name:"steelblue"},{value:"#63B8FF",name:"steelblue 1"},{value:"#5CACEE",name:"steelblue 2"},{value:"#4F94CD",name:"steelblue 3"},{value:"#36648B",name:"steelblue 4"},{value:"#87CEFA",css:!0,name:"lightskyblue"},{value:"#B0E2FF",name:"lightskyblue 1"},{value:"#A4D3EE",name:"lightskyblue 2"},{value:"#8DB6CD",name:"lightskyblue 3"},{value:"#607B8B",name:"lightskyblue 4"},{value:"#87CEFF",name:"skyblue 1"},{value:"#7EC0EE",name:"skyblue 2"},{value:"#6CA6CD",name:"skyblue 3"},{value:"#4A708B",name:"skyblue 4"},{value:"#87CEEB",css:!0,name:"skyblue"},{value:"#00BFFF",name:"deepskyblue 1"},{value:"#00BFFF",css:!0,name:"deepskyblue"},{value:"#00B2EE",name:"deepskyblue 2"},{value:"#009ACD",name:"deepskyblue 3"},{value:"#00688B",name:"deepskyblue 4"},{value:"#33A1C9",name:"peacock"},{value:"#ADD8E6",css:!0,name:"lightblue"},{value:"#BFEFFF",name:"lightblue 1"},{value:"#B2DFEE",name:"lightblue 2"},{value:"#9AC0CD",name:"lightblue 3"},{value:"#68838B",name:"lightblue 4"},{value:"#B0E0E6",css:!0,name:"powderblue"},{value:"#98F5FF",name:"cadetblue 1"},{value:"#8EE5EE",name:"cadetblue 2"},{value:"#7AC5CD",name:"cadetblue 3"},{value:"#53868B",name:"cadetblue 4"},{value:"#00F5FF",name:"turquoise 1"},{value:"#00E5EE",name:"turquoise 2"},{value:"#00C5CD",name:"turquoise 3"},{value:"#00868B",name:"turquoise 4"},{value:"#5F9EA0",css:!0,name:"cadetblue"},{value:"#00CED1",css:!0,name:"darkturquoise"},{value:"#F0FFFF",name:"azure 1"},{value:"#F0FFFF",css:!0,name:"azure"},{value:"#E0EEEE",name:"azure 2"},{value:"#C1CDCD",name:"azure 3"},{value:"#838B8B",name:"azure 4"},{value:"#E0FFFF",name:"lightcyan 1"},{value:"#E0FFFF",css:!0,name:"lightcyan"},{value:"#D1EEEE",name:"lightcyan 2"},{value:"#B4CDCD",name:"lightcyan 3"},{value:"#7A8B8B",name:"lightcyan 4"},{value:"#BBFFFF",name:"paleturquoise 1"},{value:"#AEEEEE",name:"paleturquoise 2"},{value:"#AEEEEE",css:!0,name:"paleturquoise"},{value:"#96CDCD",name:"paleturquoise 3"},{value:"#668B8B",name:"paleturquoise 4"},{value:"#2F4F4F",css:!0,name:"darkslategray"},{value:"#97FFFF",name:"darkslategray 1"},{value:"#8DEEEE",name:"darkslategray 2"},{value:"#79CDCD",name:"darkslategray 3"},{value:"#528B8B",name:"darkslategray 4"},{value:"#00FFFF",name:"cyan"},{value:"#00FFFF",css:!0,name:"aqua"},{value:"#00EEEE",name:"cyan 2"},{value:"#00CDCD",name:"cyan 3"},{value:"#008B8B",name:"cyan 4"},{value:"#008B8B",css:!0,name:"darkcyan"},{value:"#008080",vga:!0,css:!0,name:"teal"},{value:"#48D1CC",css:!0,name:"mediumturquoise"},{value:"#20B2AA",css:!0,name:"lightseagreen"},{value:"#03A89E",name:"manganeseblue"},{value:"#40E0D0",css:!0,name:"turquoise"},{value:"#808A87",name:"coldgrey"},{value:"#00C78C",name:"turquoiseblue"},{value:"#7FFFD4",name:"aquamarine 1"},{value:"#7FFFD4",css:!0,name:"aquamarine"},{value:"#76EEC6",name:"aquamarine 2"},{value:"#66CDAA",name:"aquamarine 3"},{value:"#66CDAA",css:!0,name:"mediumaquamarine"},{value:"#458B74",name:"aquamarine 4"},{value:"#00FA9A",css:!0,name:"mediumspringgreen"},{value:"#F5FFFA",css:!0,name:"mintcream"},{value:"#00FF7F",css:!0,name:"springgreen"},{value:"#00EE76",name:"springgreen 1"},{value:"#00CD66",name:"springgreen 2"},{value:"#008B45",name:"springgreen 3"},{value:"#3CB371",css:!0,name:"mediumseagreen"},{value:"#54FF9F",name:"seagreen 1"},{value:"#4EEE94",name:"seagreen 2"},{value:"#43CD80",name:"seagreen 3"},{value:"#2E8B57",name:"seagreen 4"},{value:"#2E8B57",css:!0,name:"seagreen"},{value:"#00C957",name:"emeraldgreen"},{value:"#BDFCC9",name:"mint"},{value:"#3D9140",name:"cobaltgreen"},{value:"#F0FFF0",name:"honeydew 1"},{value:"#F0FFF0",css:!0,name:"honeydew"},{value:"#E0EEE0",name:"honeydew 2"},{value:"#C1CDC1",name:"honeydew 3"},{value:"#838B83",name:"honeydew 4"},{value:"#8FBC8F",css:!0,name:"darkseagreen"},{value:"#C1FFC1",name:"darkseagreen 1"},{value:"#B4EEB4",name:"darkseagreen 2"},{value:"#9BCD9B",name:"darkseagreen 3"},{value:"#698B69",name:"darkseagreen 4"},{value:"#98FB98",css:!0,name:"palegreen"},{value:"#9AFF9A",name:"palegreen 1"},{value:"#90EE90",name:"palegreen 2"},{value:"#90EE90",css:!0,name:"lightgreen"},{value:"#7CCD7C",name:"palegreen 3"},{value:"#548B54",name:"palegreen 4"},{value:"#32CD32",css:!0,name:"limegreen"},{value:"#228B22",css:!0,name:"forestgreen"},{value:"#00FF00",vga:!0,name:"green 1"},{value:"#00FF00",vga:!0,css:!0,name:"lime"},{value:"#00EE00",name:"green 2"},{value:"#00CD00",name:"green 3"},{value:"#008B00",name:"green 4"},{value:"#008000",vga:!0,css:!0,name:"green"},{value:"#006400",css:!0,name:"darkgreen"},{value:"#308014",name:"sapgreen"},{value:"#7CFC00",css:!0,name:"lawngreen"},{value:"#7FFF00",name:"chartreuse 1"},{value:"#7FFF00",css:!0,name:"chartreuse"},{value:"#76EE00",name:"chartreuse 2"},{value:"#66CD00",name:"chartreuse 3"},{value:"#458B00",name:"chartreuse 4"},{value:"#ADFF2F",css:!0,name:"greenyellow"},{value:"#CAFF70",name:"darkolivegreen 1"},{value:"#BCEE68",name:"darkolivegreen 2"},{value:"#A2CD5A",name:"darkolivegreen 3"},{value:"#6E8B3D",name:"darkolivegreen 4"},{value:"#556B2F",css:!0,name:"darkolivegreen"},{value:"#6B8E23",css:!0,name:"olivedrab"},{value:"#C0FF3E",name:"olivedrab 1"},{value:"#B3EE3A",name:"olivedrab 2"},{value:"#9ACD32",name:"olivedrab 3"},{value:"#9ACD32",css:!0,name:"yellowgreen"},{value:"#698B22",name:"olivedrab 4"},{value:"#FFFFF0",name:"ivory 1"},{value:"#FFFFF0",css:!0,name:"ivory"},{value:"#EEEEE0",name:"ivory 2"},{value:"#CDCDC1",name:"ivory 3"},{value:"#8B8B83",name:"ivory 4"},{value:"#F5F5DC",css:!0,name:"beige"},{value:"#FFFFE0",name:"lightyellow 1"},{value:"#FFFFE0",css:!0,name:"lightyellow"},{value:"#EEEED1",name:"lightyellow 2"},{value:"#CDCDB4",name:"lightyellow 3"},{value:"#8B8B7A",name:"lightyellow 4"},{value:"#FAFAD2",css:!0,name:"lightgoldenrodyellow"},{value:"#FFFF00",vga:!0,name:"yellow 1"},{value:"#FFFF00",vga:!0,css:!0,name:"yellow"},{value:"#EEEE00",name:"yellow 2"},{value:"#CDCD00",name:"yellow 3"},{value:"#8B8B00",name:"yellow 4"},{value:"#808069",name:"warmgrey"},{value:"#808000",vga:!0,css:!0,name:"olive"},{value:"#BDB76B",css:!0,name:"darkkhaki"},{value:"#FFF68F",name:"khaki 1"},{value:"#EEE685",name:"khaki 2"},{value:"#CDC673",name:"khaki 3"},{value:"#8B864E",name:"khaki 4"},{value:"#F0E68C",css:!0,name:"khaki"},{value:"#EEE8AA",css:!0,name:"palegoldenrod"},{value:"#FFFACD",name:"lemonchiffon 1"},{value:"#FFFACD",css:!0,name:"lemonchiffon"},{value:"#EEE9BF",name:"lemonchiffon 2"},{value:"#CDC9A5",name:"lemonchiffon 3"},{value:"#8B8970",name:"lemonchiffon 4"},{value:"#FFEC8B",name:"lightgoldenrod 1"},{value:"#EEDC82",name:"lightgoldenrod 2"},{value:"#CDBE70",name:"lightgoldenrod 3"},{value:"#8B814C",name:"lightgoldenrod 4"},{value:"#E3CF57",name:"banana"},{value:"#FFD700",name:"gold 1"},{value:"#FFD700",css:!0,name:"gold"},{value:"#EEC900",name:"gold 2"},{value:"#CDAD00",name:"gold 3"},{value:"#8B7500",name:"gold 4"},{value:"#FFF8DC",name:"cornsilk 1"},{value:"#FFF8DC",css:!0,name:"cornsilk"},{value:"#EEE8CD",name:"cornsilk 2"},{value:"#CDC8B1",name:"cornsilk 3"},{value:"#8B8878",name:"cornsilk 4"},{value:"#DAA520",css:!0,name:"goldenrod"},{value:"#FFC125",name:"goldenrod 1"},{value:"#EEB422",name:"goldenrod 2"},{value:"#CD9B1D",name:"goldenrod 3"},{value:"#8B6914",name:"goldenrod 4"},{value:"#B8860B",css:!0,name:"darkgoldenrod"},{value:"#FFB90F",name:"darkgoldenrod 1"},{value:"#EEAD0E",name:"darkgoldenrod 2"},{value:"#CD950C",name:"darkgoldenrod 3"},{value:"#8B6508",name:"darkgoldenrod 4"},{value:"#FFA500",name:"orange 1"},{value:"#FF8000",css:!0,name:"orange"},{value:"#EE9A00",name:"orange 2"},{value:"#CD8500",name:"orange 3"},{value:"#8B5A00",name:"orange 4"},{value:"#FFFAF0",css:!0,name:"floralwhite"},{value:"#FDF5E6",css:!0,name:"oldlace"},{value:"#F5DEB3",css:!0,name:"wheat"},{value:"#FFE7BA",name:"wheat 1"},{value:"#EED8AE",name:"wheat 2"},{value:"#CDBA96",name:"wheat 3"},{value:"#8B7E66",name:"wheat 4"},{value:"#FFE4B5",css:!0,name:"moccasin"},{value:"#FFEFD5",css:!0,name:"papayawhip"},{value:"#FFEBCD",css:!0,name:"blanchedalmond"},{value:"#FFDEAD",name:"navajowhite 1"},{value:"#FFDEAD",css:!0,name:"navajowhite"},{value:"#EECFA1",name:"navajowhite 2"},{value:"#CDB38B",name:"navajowhite 3"},{value:"#8B795E",name:"navajowhite 4"},{value:"#FCE6C9",name:"eggshell"},{value:"#D2B48C",css:!0,name:"tan"},{value:"#9C661F",name:"brick"},{value:"#FF9912",name:"cadmiumyellow"},{value:"#FAEBD7",css:!0,name:"antiquewhite"},{value:"#FFEFDB",name:"antiquewhite 1"},{value:"#EEDFCC",name:"antiquewhite 2"},{value:"#CDC0B0",name:"antiquewhite 3"},{value:"#8B8378",name:"antiquewhite 4"},{value:"#DEB887",css:!0,name:"burlywood"},{value:"#FFD39B",name:"burlywood 1"},{value:"#EEC591",name:"burlywood 2"},{value:"#CDAA7D",name:"burlywood 3"},{value:"#8B7355",name:"burlywood 4"},{value:"#FFE4C4",name:"bisque 1"},{value:"#FFE4C4",css:!0,name:"bisque"},{value:"#EED5B7",name:"bisque 2"},{value:"#CDB79E",name:"bisque 3"},{value:"#8B7D6B",name:"bisque 4"},{value:"#E3A869",name:"melon"},{value:"#ED9121",name:"carrot"},{value:"#FF8C00",css:!0,name:"darkorange"},{value:"#FF7F00",name:"darkorange 1"},{value:"#EE7600",name:"darkorange 2"},{value:"#CD6600",name:"darkorange 3"},{value:"#8B4500",name:"darkorange 4"},{value:"#FFA54F",name:"tan 1"},{value:"#EE9A49",name:"tan 2"},{value:"#CD853F",name:"tan 3"},{value:"#CD853F",css:!0,name:"peru"},{value:"#8B5A2B",name:"tan 4"},{value:"#FAF0E6",css:!0,name:"linen"},{value:"#FFDAB9",name:"peachpuff 1"},{value:"#FFDAB9",css:!0,name:"peachpuff"},{value:"#EECBAD",name:"peachpuff 2"},{value:"#CDAF95",name:"peachpuff 3"},{value:"#8B7765",name:"peachpuff 4"},{value:"#FFF5EE",name:"seashell 1"},{value:"#FFF5EE",css:!0,name:"seashell"},{value:"#EEE5DE",name:"seashell 2"},{value:"#CDC5BF",name:"seashell 3"},{value:"#8B8682",name:"seashell 4"},{value:"#F4A460",css:!0,name:"sandybrown"},{value:"#C76114",name:"rawsienna"},{value:"#D2691E",css:!0,name:"chocolate"},{value:"#FF7F24",name:"chocolate 1"},{value:"#EE7621",name:"chocolate 2"},{value:"#CD661D",name:"chocolate 3"},{value:"#8B4513",name:"chocolate 4"},{value:"#8B4513",css:!0,name:"saddlebrown"},{value:"#292421",name:"ivoryblack"},{value:"#FF7D40",name:"flesh"},{value:"#FF6103",name:"cadmiumorange"},{value:"#8A360F",name:"burntsienna"},{value:"#A0522D",css:!0,name:"sienna"},{value:"#FF8247",name:"sienna 1"},{value:"#EE7942",name:"sienna 2"},{value:"#CD6839",name:"sienna 3"},{value:"#8B4726",name:"sienna 4"},{value:"#FFA07A",name:"lightsalmon 1"},{value:"#FFA07A",css:!0,name:"lightsalmon"},{value:"#EE9572",name:"lightsalmon 2"},{value:"#CD8162",name:"lightsalmon 3"},{value:"#8B5742",name:"lightsalmon 4"},{value:"#FF7F50",css:!0,name:"coral"},{value:"#FF4500",name:"orangered 1"},{value:"#FF4500",css:!0,name:"orangered"},{value:"#EE4000",name:"orangered 2"},{value:"#CD3700",name:"orangered 3"},{value:"#8B2500",name:"orangered 4"},{value:"#5E2612",name:"sepia"},{value:"#E9967A",css:!0,name:"darksalmon"},{value:"#FF8C69",name:"salmon 1"},{value:"#EE8262",name:"salmon 2"},{value:"#CD7054",name:"salmon 3"},{value:"#8B4C39",name:"salmon 4"},{value:"#FF7256",name:"coral 1"},{value:"#EE6A50",name:"coral 2"},{value:"#CD5B45",name:"coral 3"},{value:"#8B3E2F",name:"coral 4"},{value:"#8A3324",name:"burntumber"},{value:"#FF6347",name:"tomato 1"},{value:"#FF6347",css:!0,name:"tomato"},{value:"#EE5C42",name:"tomato 2"},{value:"#CD4F39",name:"tomato 3"},{value:"#8B3626",name:"tomato 4"},{value:"#FA8072",css:!0,name:"salmon"},{value:"#FFE4E1",name:"mistyrose 1"},{value:"#FFE4E1",css:!0,name:"mistyrose"},{value:"#EED5D2",name:"mistyrose 2"},{value:"#CDB7B5",name:"mistyrose 3"},{value:"#8B7D7B",name:"mistyrose 4"},{value:"#FFFAFA",name:"snow 1"},{value:"#FFFAFA",css:!0,name:"snow"},{value:"#EEE9E9",name:"snow 2"},{value:"#CDC9C9",name:"snow 3"},{value:"#8B8989",name:"snow 4"},{value:"#BC8F8F",css:!0,name:"rosybrown"},{value:"#FFC1C1",name:"rosybrown 1"},{value:"#EEB4B4",name:"rosybrown 2"},{value:"#CD9B9B",name:"rosybrown 3"},{value:"#8B6969",name:"rosybrown 4"},{value:"#F08080",css:!0,name:"lightcoral"},{value:"#CD5C5C",css:!0,name:"indianred"},{value:"#FF6A6A",name:"indianred 1"},{value:"#EE6363",name:"indianred 2"},{value:"#8B3A3A",name:"indianred 4"},{value:"#CD5555",name:"indianred 3"},{value:"#A52A2A",css:!0,name:"brown"},{value:"#FF4040",name:"brown 1"},{value:"#EE3B3B",name:"brown 2"},{value:"#CD3333",name:"brown 3"},{value:"#8B2323",name:"brown 4"},{value:"#B22222",css:!0,name:"firebrick"},{value:"#FF3030",name:"firebrick 1"},{value:"#EE2C2C",name:"firebrick 2"},{value:"#CD2626",name:"firebrick 3"},{value:"#8B1A1A",name:"firebrick 4"},{value:"#FF0000",vga:!0,name:"red 1"},{value:"#FF0000",vga:!0,css:!0,name:"red"},{value:"#EE0000",name:"red 2"},{value:"#CD0000",name:"red 3"},{value:"#8B0000",name:"red 4"},{value:"#8B0000",css:!0,name:"darkred"},{value:"#800000",vga:!0,css:!0,name:"maroon"},{value:"#8E388E",name:"sgi beet"},{value:"#7171C6",name:"sgi slateblue"},{value:"#7D9EC0",name:"sgi lightblue"},{value:"#388E8E",name:"sgi teal"},{value:"#71C671",name:"sgi chartreuse"},{value:"#8E8E38",name:"sgi olivedrab"},{value:"#C5C1AA",name:"sgi brightgray"},{value:"#C67171",name:"sgi salmon"},{value:"#555555",name:"sgi darkgray"},{value:"#1E1E1E",name:"sgi gray 12"},{value:"#282828",name:"sgi gray 16"},{value:"#515151",name:"sgi gray 32"},{value:"#5B5B5B",name:"sgi gray 36"},{value:"#848484",name:"sgi gray 52"},{value:"#8E8E8E",name:"sgi gray 56"},{value:"#AAAAAA",name:"sgi lightgray"},{value:"#B7B7B7",name:"sgi gray 72"},{value:"#C1C1C1",name:"sgi gray 76"},{value:"#EAEAEA",name:"sgi gray 92"},{value:"#F4F4F4",name:"sgi gray 96"},{value:"#FFFFFF",vga:!0,css:!0,name:"white"},{value:"#F5F5F5",name:"white smoke"},{value:"#F5F5F5",name:"gray 96"},{value:"#DCDCDC",css:!0,name:"gainsboro"},{value:"#D3D3D3",css:!0,name:"lightgrey"},{value:"#C0C0C0",vga:!0,css:!0,name:"silver"},{value:"#A9A9A9",css:!0,name:"darkgray"},{value:"#808080",vga:!0,css:!0,name:"gray"},{value:"#696969",css:!0,name:"dimgray"},{value:"#696969",name:"gray 42"},{value:"#000000",vga:!0,css:!0,name:"black"},{value:"#FCFCFC",name:"gray 99"},{value:"#FAFAFA",name:"gray 98"},{value:"#F7F7F7",name:"gray 97"},{value:"#F2F2F2",name:"gray 95"},{value:"#F0F0F0",name:"gray 94"},{value:"#EDEDED",name:"gray 93"},{value:"#EBEBEB",name:"gray 92"},{value:"#E8E8E8",name:"gray 91"},{value:"#E5E5E5",name:"gray 90"},{value:"#E3E3E3",name:"gray 89"},{value:"#E0E0E0",name:"gray 88"},{value:"#DEDEDE",name:"gray 87"},{value:"#DBDBDB",name:"gray 86"},{value:"#D9D9D9",name:"gray 85"},{value:"#D6D6D6",name:"gray 84"},{value:"#D4D4D4",name:"gray 83"},{value:"#D1D1D1",name:"gray 82"},{value:"#CFCFCF",name:"gray 81"},{value:"#CCCCCC",name:"gray 80"},{value:"#C9C9C9",name:"gray 79"},{value:"#C7C7C7",name:"gray 78"},{value:"#C4C4C4",name:"gray 77"},{value:"#C2C2C2",name:"gray 76"},{value:"#BFBFBF",name:"gray 75"},{value:"#BDBDBD",name:"gray 74"},{value:"#BABABA",name:"gray 73"},{value:"#B8B8B8",name:"gray 72"},{value:"#B5B5B5",name:"gray 71"},{value:"#B3B3B3",name:"gray 70"},{value:"#B0B0B0",name:"gray 69"},{value:"#ADADAD",name:"gray 68"},{value:"#ABABAB",name:"gray 67"},{value:"#A8A8A8",name:"gray 66"},{value:"#A6A6A6",name:"gray 65"},{value:"#A3A3A3",name:"gray 64"},{value:"#A1A1A1",name:"gray 63"},{value:"#9E9E9E",name:"gray 62"},{value:"#9C9C9C",name:"gray 61"},{value:"#999999",name:"gray 60"},{value:"#969696",name:"gray 59"},{value:"#949494",name:"gray 58"},{value:"#919191",name:"gray 57"},{value:"#8F8F8F",name:"gray 56"},{value:"#8C8C8C",name:"gray 55"},{value:"#8A8A8A",name:"gray 54"},{value:"#878787",name:"gray 53"},{value:"#858585",name:"gray 52"},{value:"#828282",name:"gray 51"},{value:"#7F7F7F",name:"gray 50"},{value:"#7D7D7D",name:"gray 49"},{value:"#7A7A7A",name:"gray 48"},{value:"#787878",name:"gray 47"},{value:"#757575",name:"gray 46"},{value:"#737373",name:"gray 45"},{value:"#707070",name:"gray 44"},{value:"#6E6E6E",name:"gray 43"},{value:"#666666",name:"gray 40"},{value:"#636363",name:"gray 39"},{value:"#616161",name:"gray 38"},{value:"#5E5E5E",name:"gray 37"},{value:"#5C5C5C",name:"gray 36"},{value:"#595959",name:"gray 35"},{value:"#575757",name:"gray 34"},{value:"#545454",name:"gray 33"},{value:"#525252",name:"gray 32"},{value:"#4F4F4F",name:"gray 31"},{value:"#4D4D4D",name:"gray 30"},{value:"#4A4A4A",name:"gray 29"},{value:"#474747",name:"gray 28"},{value:"#454545",name:"gray 27"},{value:"#424242",name:"gray 26"},{value:"#404040",name:"gray 25"},{value:"#3D3D3D",name:"gray 24"},{value:"#3B3B3B",name:"gray 23"},{value:"#383838",name:"gray 22"},{value:"#363636",name:"gray 21"},{value:"#333333",name:"gray 20"},{value:"#303030",name:"gray 19"},{value:"#2E2E2E",name:"gray 18"},{value:"#2B2B2B",name:"gray 17"},{value:"#292929",name:"gray 16"},{value:"#262626",name:"gray 15"},{value:"#242424",name:"gray 14"},{value:"#212121",name:"gray 13"},{value:"#1F1F1F",name:"gray 12"},{value:"#1C1C1C",name:"gray 11"},{value:"#1A1A1A",name:"gray 10"},{value:"#171717",name:"gray 9"},{value:"#141414",name:"gray 8"},{value:"#121212",name:"gray 7"},{value:"#0F0F0F",name:"gray 6"},{value:"#0D0D0D",name:"gray 5"},{value:"#0A0A0A",name:"gray 4"},{value:"#080808",name:"gray 3"},{value:"#050505",name:"gray 2"},{value:"#030303",name:"gray 1"},{value:"#F5F5F5",css:!0,name:"whitesmoke"}],B=(function(t){var e=b.filter(function(e){return!!e.css}),n=b.filter(function(e){return!!e.vga});t.exports=function(e){var a=t.exports.get(e);return a&&a.value},t.exports.get=function(a){return a=(a=a||"").trim().toLowerCase(),b.filter(function(e){return e.name.toLowerCase()===a}).pop()},t.exports.all=t.exports.get.all=function(){return b},t.exports.get.css=function(a){return a?(a=(a=a||"").trim().toLowerCase(),e.filter(function(e){return e.name.toLowerCase()===a}).pop()):e},t.exports.get.vga=function(a){return a?(a=(a=a||"").trim().toLowerCase(),n.filter(function(e){return e.name.toLowerCase()===a}).pop()):n}}(A={exports:{}},A.exports),A.exports);B.get,B.all;function w(e,a){switch(m(e)){case"number":return{x:e,y:e};case"string":var t=e.split(/(\s|,)/).filter(function(e){return e.trim()&&function(e){return e===+e}(+e)}),n=t[0],r=t[1];return{x:+n,y:+(void 0===r?n:r)};case"array":return{x:+e[0],y:+e[1]};case"object":return{x:e.x||a.x,y:e.y||a.y};default:return a}}var x,k,_=[function(a){a.on("beforeCreated beforeUpdate",function(n){"object"==typeof n&&(["backgroundColor","borderColor","text.color","text.fill"].map(function(e){var a=R(n,e);if("string"==typeof a){var t=S.utils.string2hex(a.includes("#")||a.startsWith("0x")?a:B.get(a).value);t&&function(e,a,t){if("object"!==m(e))p("setValue tar muse be a object!");else{var n=a.trim().indexOf(".");if(0<n&&n<a.length-1){for(var r=a.trim().split("."),l=e,i="",u=0,o=r.length-1;u<o;u++){var s=r[u];"object"==typeof l[s]?l=l[s]:void 0===l[s]&&(i=s)}i?p("the key("+i+") is not in tar obj!"):l[r[r.length-1]]=t}else e[a.replace(/\./g,"")]=t}}(n,e,t)}}),"string"==typeof n.backgroundFrame&&(n.backgroundFrame=n.backgroundFrame.split(/\s/).map(function(e){return+e})),n.anchor&&(n.anchor=w(n.anchor,{x:.5,y:.5})),n.scale&&(n.scale=w(n.scale,{x:1,y:1})))}),a.on("beforeCreated",function(e){a.debug&&!e.borderWidth&&(e.borderWidth="1px")})},function(r){r.on("created",function(e){var a=e.instance,t=e.style,n=e.uiDesignRatio;a.layout=new C(a,t,{uiDesignRatio:n,Component:r}),function(a,e,t){var n=R(a,e);t.map(function(t){"string"==typeof t?a[t]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return n[t].apply(n,e)}:"object"==typeof t&&d(t,function(e,t){a[e]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return n[t].apply(n,e)}})})}(a,"layout",["transformStyle","append","appendTo","before","after","insertBefore","insertAfter","remove",{setStyle:"update"},"getStyle"])})},function(e){e.on("init",function(){e.pixiComponents.map(function(e){e.prototype.getRelativeBounds=function(){if(this.layout)return this.layout.rlayout},e.prototype.getRealBounds=function(){if(this.layout)return this.layout.pixilayout},e.prototype.getGlobalBounds=function(){for(var e=this.layout.rlayout,a=e.x,t=e.y,n=e.width,r=e.height,l=this.parent;l;){var i=this.getRelativeBounds();i?(a+=i.x,t+=i.y):(a+=l.x,t+=l.y),l=l.parent}return{x:Math.round(a),y:Math.round(t),width:Math.round(n),height:Math.round(r)}}})})},function(e){e.on("update",function(e){var a=e.instance,t=e.style;if((!a.layout.newStyle||a.layout.newStyle.backgroundColor)&&R(t,"backgroundColor")&&["sprite","view","animatedsprite"].includes(a.type)){var n=j(a);if(n){var r=n.x,l=n.y,i=n.width,u=n.height,o=function(e){e.beginFill(t.backgroundColor),e.drawRect(r,l,i,u),e.endFill()};if(a._background)a._background.clear(),o(a._background);else{var s=new S.Graphics;s.name="background-color",o(s),a.addChildAt(s,0),a._background=s}}}})},function(e){e.on("update",function(e){var a=e.instance,t=e.style;if(R(a,"layout.newStyle.overflow")){var n=t.borderRadius,r=void 0===n?0:n,l=t.overflow,i=j(a);if(l&&i){var u=a.getGlobalBounds().width,o=a.layout.transform.length(u,r),s=i.x,m=i.y,v=i.width,c=i.height;if(a.mask&&"overflow"===a.mask.name&&(a.mask.destroy(),a.mask=null),!(o&&0<o)){var h=new S.Graphics;h.beginFill(),u/2<=o?h.drawCircle(0,0,v/2):h.drawRoundedRect(s,m,v,c,o),h.endFill(),h.name="overflow",a.addChildAt(h,0),a.mask=h}}}})},function(e){e.on("update",function(e){var a=e.instance,t=e.style,n=R(a,"layout.newStyle");if(!n||n.borderWidth||n.borderRadius){var r=t.borderWidth,l=void 0===r?0:r,i=t.borderColor,u=void 0===i?0:i,o=t.borderRadius,s=void 0===o?0:o,m=t.anchor,v=void 0===m?{x:.5,y:.5}:m,c=j(a);if(c&&["view","sprite","animatedsprite","text"].includes(a.type)){var h=a.layout,d=h.realScale,g=h.transform,y=a.getGlobalBounds().width,p=g.length(y,l)/d.x,F=g.length(y,s),f=c.x,E=c.y,C=c.width,A=c.height;if(a._border&&"border"===a._border.name&&(a._border.destroy(),a._border=null),0<p){var b=new S.Graphics,B=C-p,D=A-p,w=-C*v.x,x=-A*v.y;b.lineStyle(p,u,1),y/2<=F?b.drawCircle(0,0,B/2):0<F?b.drawRoundedRect(w,x,B,D,F):b.drawRect(w,x,B,D),b.name="border",a.addChildAt(b,a._background?1:0),a._border=b}if(a.mask&&"border-mask"===a.mask.name&&(a.mask.destroy(),a.mask=null),F&&0<F){var k=new S.Graphics;k.beginFill(16777215),y/2<=F?k.drawCircle(0,0,C/2):k.drawRoundedRect(f,E,C,A,F+p/2),k.endFill(),k.name="border-mask",a.addChildAt(k,0),a.mask=k}}}})}],O=((k=P).use=function(e){var a=this;(Array.isArray(e)?e:[e]).map(function(e){return e(a)})},P.prototype.createElement=function(e,a){k.emit("beforeCreated",a);var t=this.createInstance(e,a);t.type=e.toLowerCase();var n=a.opacity,r=a.zIndex;return n&&(t.alpha=n),r&&(t.zIndex=r),k.emit("created beforeMounted",{instance:t,style:a,uiDesignRatio:this.uiDesignRatio}),t},P.prototype.createInstance=function(e,a){var t=a.backgroundColor,n=void 0===t?16777215:t,r=a.backgroundImage,l=void 0===r?this.transparentTexture:r,i=a.backgroundFrame,u=a.animatedFrames,o=a.content,s=void 0===o?"":o;switch(e.toLowerCase()){case"rect":return(m=new S.Graphics).beginFill(n),m.drawRect(0,0,1,1),m.endFill(),m;case"circle":var m;return(m=new S.Graphics).beginFill(n),m.drawEllipse(0,0,1,1),m.endFill(),m;case"text":return new S.Text(String(s));case"animatedsprite":if(u)return new S.AnimatedSprite(u,!0);p("animatedsprite should have the animations frames(texture array)!");case"view":a.width||(a.width="100%"),a.height||(a.height="100%");case"sprite":default:var v=l instanceof S.Texture?l:S.Texture.from(l);if(i){var c=i,h=c[0],d=c[1],g=c[2],y=c[3];4===i.length?v.frame=new S.Rectangle(h,d,g,y):p("backgroundFrame is error!")}return new S.Sprite(v)}},P.pixiComponents=[S.Graphics,S.Sprite,S.Text],P=k=function(e,a,t,n){var r,l=arguments.length,i=l<3?a:null===n?n=Object.getOwnPropertyDescriptor(a,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,a,t,n);else for(var u=e.length-1;0<=u;u--)(r=e[u])&&(i=(l<3?r(i):3<l?r(a,t,i):r(a,t))||i);return 3<l&&i&&Object.defineProperty(a,t,i),i}([(x=_,function(a){(Array.isArray(x)?x:[x]).map(function(e){if("function"!=typeof e)throw Error("[@amoy/components]error: addon "+x+" must be a function;");e(a)})}),a],P));function P(e){var a=e.uiDesignWidth,t=e.debug;this.uiDesignRatio=a/window.innerWidth,this.transparentTexture=S.Texture.from("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0AQMAAADxGE3JAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAADVJREFUeNrtwTEBAAAAwiD7p/ZZDGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOX0AAAEidG8rAAAAAElFTkSuQmCC"),k.debug=t,k.emit("init",e)}var q={uiDesignWidth:window.innerWidth,debug:!1},M=new O(q),T=function(e,a){return void 0===a&&(a={}),M.createElement("AnimatedSprite",h(a,{animatedFrames:e}))},W=function(e,a){return void 0===a&&(a={}),M.createElement("Sprite",h(a,{backgroundImage:e}))},I=function(e){return void 0===e&&(e={}),M.createElement("View",e)},z=function(e){return void 0===e&&(e={}),M.createElement("Rect",e)},G=function(e){return void 0===e&&(e={}),M.createElement("Circle",e)},L=function(e,a){return void 0===a&&(a={}),M.createElement("Text",h(a,{content:e}))};function H(e,a){return{clsKey:e.class?"class":e.className?"className":null,clsArr:a.split(" ")}}function N(e){var a=this.node.attrs,t=H(a,e),n=t.clsKey,r=t.clsArr,l=!1;return n?r.map(function(e){a[n].includes(e)||(a[n]+=" "+e,l=!0)}):(a.class=e,l=!0),l&&(h(!0,this,this.node.attrs),this.setStyle(u(this.node))),this}function U(e){var a=this.node.attrs,t=H(a,e),n=t.clsKey,r=t.clsArr,l=!1;if(n){var i=[];r.map(function(e){a[n].includes(e)&&i.push(!0)}),i.length===r.length&&(l=!0)}return l}function V(e){var a=this,t=this.node.attrs,n=H(t,e),r=n.clsKey,l=n.clsArr,i=!1;return r&&l.map(function(e){U.bind(a)(e)&&(t[r]=t[r].replace(e,""),i=!0)}),i&&(h(!0,this,this.node.attrs),this.setStyle(u(this.node),{replaceStyle:!0})),this}var X={addClass:N,removeClass:V,hasClass:U,toggleClass:function(e){var a=this;return H(this.node.attrs,e).clsArr.map(function(e){U.bind(a)(e)?V.bind(a)(e):N.bind(a)(e)}),this}};function K(e,a){return a&&(this.node.attrs[e]=a,h(!0,this,this.node.attrs),["class","className","id"].includes(e)&&this.setStyle(u(this.node))),this}function Y(e){return"string"==typeof e?this.node.attrs[e]||this[e]:this.node.attrs}var Q={setAttribute:K,getAttribute:Y,removeAttribute:function(e){return"string"==typeof e&&(delete this.node.attrs[e],delete this[e]),this},attr:function(e,a){return void 0!==a?K.bind(this)(e,a):Y.bind(this)(e)}},J=/([\w-]+)|['"]{1}([^'"]*)['"]{1}/g,Z=Object.create?Object.create(null):{};Z.area=!0,Z.base=!0,Z.br=!0,Z.col=!0,Z.embed=!0,Z.hr=!0,Z.img=!0,Z.input=!0,Z.keygen=!0,Z.link=!0,Z.menuitem=!0,Z.meta=!0,Z.param=!0,Z.source=!0,Z.track=!0,Z.wbr=!0;var $=/<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>/g,ee=Object.create?Object.create(null):{};function ae(o,s){s||(s={}),s.components||(s.components=ee);var m,v=[],c=-1,h=[],d={},g=!1;return o.replace($,function(e,a){if(g){if(e!=="</"+m.name+">")return;g=!1}var t,n="/"!==e.charAt(1),r=a+e.length,l=o.charAt(r);if(n&&(c++,"tag"===(m=function(a){var t,n=0,r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]};return a.replace(J,function(e){n%2?t=e:0===n?(!Z[e]&&"/"!==a.charAt(a.length-2)||(r.voidElement=!0),r.name=e):r.attrs[t]=e.replace(/['"]/g,""),n++}),r}(e)).type&&s.components[m.name]&&(m.type="component",g=!0),m.voidElement||g||!l||"<"===l||m.children.push({type:"text",content:o.slice(r,o.indexOf("<",r))}),d[m.tagName]=m,0===c&&v.push(m),(t=h[c-1])&&t.children.push(m),h[c]=m),(!n||m.voidElement)&&(c--,!g&&"<"!==l&&l)){t=-1===c?v:h[c].children;var i=o.indexOf("<",r),u=o.slice(r,-1===i?void 0:i);/^\s*$/.test(u)||t.push({type:"text",content:u})}}),v}function te(e,a){var t=null;if("tag"===e.type){var n=u(e,a),r=F(R(e,"attrs.src"),a);switch(e.name.toLowerCase()){case"sprite":case"image":t=W(r,n);break;case"animated-sprite":case"animated-image":case"animatedsprite":case"animatedimage":t=T(r,n);break;case"text":case"txt":var l="";e.children.map(function(e){"text"===e.type&&(l+=e.content)}),t=L(l,n);break;case"view":case"div":t=I(n);break;case"rect":case"rectangle":t=z(n);break;case"circle":t=G(n)}}else"text"===e.type&&e.content.trim()&&((t=L(e.content.trim())).isAutoText=!0);return h(!0,t,i({},Q,X),i({node:e},e.attrs)),t}e.AnimatedSprite=T,e.Circle=G,e.Rect=z,e.Sprite=W,e.Text=L,e.View=I,e.configComponents=function(e){e&&(M=new O(h(q,e)))},e.render=function(e,t,n){if("string"==typeof e){var a=ae(e);if(a&&a.length){var r=[];return a.map(function(e){var a=te(e,n);!function t(e,n,r){"text"!==n.type&&R(e,"children.length")&&e.children.map(function(e){var a=te(e,r);a&&(t(e,a),a.appendTo(n,!1))})}(e,a,n),t&&t.addChild?(a.appendTo(t),r.push(a)):p("mountedRoot is invalid, it should be a pixi element")}),1<r.length?r:r[0]}p("Parse template error, Please check the template string")}else p("the template should be string")},e.style=function(e){!function(a){"object"==typeof a&&Object.keys(a).map(function(e){n[e]=a[e]})}(e)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=components.min.js.map |
@@ -44,7 +44,8 @@ import * as PIXI from "pixi.js" | ||
top: 50, | ||
left: 100, | ||
scale: '-1 1', | ||
right: 0, | ||
// scale: '-1 1', | ||
borderWidth: 1, | ||
}, | ||
".scale": { | ||
// "scale": .5, | ||
"scale": .8, | ||
'left--important': 0, | ||
@@ -125,8 +126,6 @@ }, | ||
const scene = render(` | ||
<div style="width: 400; height: 400; left: 0; bottom: 0; border-width: 1;"> | ||
<image className="sprite" src="rabit1">Sprite</image> | ||
</div> | ||
<view style="width: 300; height: 200; right: 0; top: 0; border-width: 1;"> | ||
</view> | ||
<rect className="sprite scale"> | ||
Sprite | ||
<image src="rect" style="width: 50; left: 10; top: 10;" /> | ||
</rect> | ||
`, game.stage, { | ||
@@ -139,7 +138,13 @@ frames: resources.json.spritesheet.animations.success_frame, | ||
// 子级错误 | ||
const sprite = scene[0].children[1] | ||
const sprite = scene | ||
const view1 = scene[0] | ||
const view2 = scene[1] | ||
console.log('----appendTo----') | ||
sprite.removeClass('scale') | ||
// setTimeout(() => { | ||
// console.log(sprite.appendTo(view1).removeClass('scale')) | ||
// }, 4000) | ||
console.log('----appendTo----') | ||
console.log(sprite.appendTo(view2).addClass('scale')) | ||
// console.log(sprite) | ||
@@ -146,0 +151,0 @@ // console.log(scene.children[0].addClass('scale')) |
import * as PIXI from 'pixi.js' | ||
import { extend, getValue, error, warn, mountApi, forin } from '../../utils' | ||
import { extendStyle } from '../../components/style' | ||
import { transform } from './transform' | ||
@@ -43,3 +44,3 @@ import { patch } from './patch' | ||
// 初始化设置 style | ||
this.extendStyle(style, true) | ||
this.mergeStyle(style, true) | ||
} | ||
@@ -61,3 +62,3 @@ /* | ||
if (target['type'] === 'text') { | ||
this.style = this.textInheritStyle(this.style) | ||
this.textInheritStyle() | ||
} | ||
@@ -101,3 +102,3 @@ | ||
if (target['type'] === 'text') { | ||
newStyle = this.textInheritStyle(newStyle) | ||
this.textInheritStyle() | ||
} | ||
@@ -111,3 +112,3 @@ | ||
// 合并 style | ||
this.extendStyle(newStyle, replaceStyle) | ||
this.mergeStyle(newStyle, replaceStyle) | ||
@@ -133,3 +134,3 @@ if (!this.initScale) { | ||
// 当修改可能影响子级的布局时,更新子级 | ||
updateChild && this.updateChild(options) | ||
updateChild && this.updateChild() | ||
@@ -163,8 +164,12 @@ // 设置缩放 | ||
} | ||
let _posStyle = this.style | ||
if (target['type'] === 'text') { | ||
size = this.fixTextSize(size) | ||
const { horPos = {}, verPos = {} } = this.styleFromParent | ||
_posStyle = [horPos, verPos, this.style].reduce((s1, s2) => extendStyle(s1, s2), {}) | ||
} | ||
// 位置 | ||
const pos = this.transform.elementPos(size, this.style, container) | ||
const pos = this.transform.elementPos(size, _posStyle, container) | ||
return extend(size, pos) | ||
@@ -176,3 +181,3 @@ } | ||
const anchor = (style.anchor || { x: .5, y: .5 }) as Layout.point | ||
// 计算布局 | ||
@@ -191,3 +196,3 @@ this.rlayout = this._getRlayout() | ||
// 重绘子级 | ||
public updateChild(options?) { | ||
public updateChild() { | ||
const children = getValue(this.target, 'children') | ||
@@ -198,3 +203,3 @@ if (children.length) { | ||
child.layout.refreshContianer() | ||
child.layout.update({}, options) | ||
child.layout.update() | ||
} | ||
@@ -293,3 +298,3 @@ }) | ||
// 合并 style | ||
private extendStyle(newStyle, replaceStyle: boolean = false) { | ||
private mergeStyle(newStyle, replaceStyle: boolean = false) { | ||
this.styleDiffPool = this.styleDiff(this.style, newStyle, replaceStyle) | ||
@@ -302,15 +307,3 @@ if (replaceStyle) { | ||
} else { | ||
const horAttrs = ['left', 'right', 'centerX'] | ||
const verAttrs = ['top', 'bottom', 'centerY'] | ||
// 避免同时出现同类布局属性 | ||
// 如 left: 0 / centerX: 0 | ||
Object.keys(newStyle).map((newKey: string) => { | ||
[horAttrs, verAttrs].map((attrs) => { | ||
if (attrs.includes(newKey)) { | ||
attrs.map((attr) => delete this.style[attr]) | ||
} | ||
}) | ||
}) | ||
extend(true, this.style, newStyle) | ||
this.style = extendStyle(this.style, newStyle) | ||
} | ||
@@ -367,13 +360,4 @@ } | ||
// 继承属性 | ||
private textInheritStyle(newStyle) { | ||
const styleFromParent = this._inheritStyle() | ||
const { horPos, verPos, ...rest } = styleFromParent | ||
if (!this.hasHorPosAttr(this.style)) { | ||
newStyle = extend(newStyle, horPos) | ||
} | ||
if (!this.hasVerPosAttr(this.style)) { | ||
newStyle = extend(newStyle, verPos) | ||
} | ||
extend(newStyle, rest) | ||
return newStyle | ||
private textInheritStyle() { | ||
this.styleFromParent = this._inheritStyle() | ||
} | ||
@@ -380,0 +364,0 @@ |
@@ -32,3 +32,3 @@ import { extend } from '../../utils' | ||
function attr(this: any, key?: string, value?: any) { | ||
if (value) { | ||
if (value !== undefined) { | ||
return setAttribute.bind(this)(key, value) | ||
@@ -35,0 +35,0 @@ } else { |
@@ -65,3 +65,2 @@ import { extend } from '../../utils' | ||
} | ||
if (changed) { | ||
@@ -68,0 +67,0 @@ extend(true, this, this.node.attrs) |
@@ -59,3 +59,3 @@ import { extend, forin } from '../../utils' | ||
const verAttrs = ['top', 'bottom', 'centerY'] | ||
function extendStyle(style1, style2) { | ||
export function extendStyle(style1, style2) { | ||
// 避免同时出现同类布局属性 | ||
@@ -62,0 +62,0 @@ // 如 left: 0 / centerX: 0 |
{ | ||
"name": "@amoy/components", | ||
"version": "1.0.43", | ||
"version": "1.0.44", | ||
"description": "components", | ||
@@ -5,0 +5,0 @@ "types": "./lib/types.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10032902
50859