diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index bd20d1f9b2dddb8d5e8cec4e5d7aa66bc6fbc7c0..ae799e83116cdcd212fd4474e4c1141faab7359e 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -13,4 +13,4 @@ * limitations under the License. */ -(()=>{"use strict";var e={904:(e,t)=>{var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.ETS},784:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen hml and css failed"]])},117:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},862:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r,n){super(),this.tagName=e,this.params=t,this.content=r,this.properties=n}setParams(e){this.params=e}}t.Tag=o},623:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(519),o=r(51);class i{constructor(e){this.cache=e}visit(e){e instanceof n.Tag&&this.genTag(e)}static getMethodGen(e){return void 0===i.instance?i.instance=new i(e):i.instance.setCache(e),i.instance}setCache(e){this.cache=e}genParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(o.TokenClass.LBRA,o.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,o.TokenClass.COLON,o.TokenClass.SPACE,r),t++,t{this.cache.concat(n,o.TokenClass.COLON,o.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(o.TokenClass.RBRA)),null!==e.properties&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),e.properties.forEach(((e,t)=>{this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(o.TokenClass.PROPERTY_START,t,o.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,o.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent())}}t.ASTNodeGenerator=i,i.instance=void 0},413:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(519),o=r(973);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const i=new Map,s=new n.Tag(e.type,t,r,i);if(o.parseVisualModel(e,s),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return s.content=r,s}}},459:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.genETS=void 0;const n=r(623),o=r(862);t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),t.cache.toString()}},435:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(459);t.StringWriter=class{genETS(e){return n.genETS(e)}}},51:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{function r(e){return(...t)=>t.lengtht.property.has(e))),o=r(((e,t,r)=>r.type===e&&r.property.has(t))),i=r(((e,t,r)=>{const n=t.property.get(e);void 0!==n&&r.properties.set(f(e),"'"+n+"'")}));function s(e){return void 0===e||""===e}const a=r(((e,t,r)=>{const n=t.property.get(e);s(n)||r.properties.set(f(e),n)})),c=r(((e,t,r)=>{const n=t.property.get(e);s(n)||r.properties.set(f(e),n)})),l=r(((e,t,r,n)=>{const o=r.property.get(e);s(o)||n.properties.set(f(e),y(t,o))})),p=r(((e,t,r)=>{const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(f(e),"'"+n+"'")})),d=r(((e,t,r)=>{const n=t.property.get(e);!s(n)&&r.params instanceof Map&&r.params.set(f(e),n)})),h=r(((e,t,r,n)=>{const o=r.property.get(e);!s(o)&&n.params instanceof Map&&n.params.set(f(e),y(t,o))})),u=r(((e,t,r)=>{let n=t.property.get(e);s(n)||(n=m(n),r.properties.set(f(e),n))}));function g([e,...t]){return(null==e?void 0:e.toUpperCase())+t.join("")}function f(e){const t=e.split("-");let r=t[0];for(let e=1;e{const o=r.property.get(e);if(s(o)||!(n.params instanceof Map))return;let i=y(t,o);"flex-start"===o?i=t+"Start":"flex-end"===o&&(i=t+"End"),n.params.set(f(e),i)})),E=[[n("width"),i("width")],[n("height"),i("height")],[function(e){return e.property.has("constraint-size-min-width")||e.property.has("constraint-size-max-width")||e.property.has("constraint-size-min-height")||e.property.has("constraint-size-min-height")},function(e,t){const r=new Map,n=e.property.get("constraint-size-min-width"),o=e.property.get("constraint-size-max-width"),i=e.property.get("constraint-size-min-height"),s=e.property.get("constraint-size-max-height");v("minWidth",n,r),v("maxWidth",o,r),v("minHeight",i,r),v("maxHeight",s,r),r.size>0&&t.properties.set("constraintSize",r)}],[n("align"),l("align","Alignment.")],[n("direction"),l("direction","Direction.")],[function(e){return e.property.has("left")||e.property.has("top")},function(e,t){const r=e.property.get("position"),n=e.property.get("left"),o=e.property.get("top");s(n)&&s(o)||t.properties.set("absolute"===r?"position":"offset",new Map([["x","'"+(null!=n?n:"0")+"'"],["y","'"+(null!=o?o:"0")+"'"]]))}],[n("aspect-ratio"),a("aspect-ratio")],[n("display-priority"),a("display-priority")],[n("flex-basis"),i("flex-basis")],[n("flex-grow"),a("flex-grow")],[n("flex-shrink"),a("flex-shrink")],[n("align-self"),l("align-self","ItemAlign.")],[n("border-style"),l("border-style","BorderStyle.")],[n("border-width"),i("border-width")],[n("border-color"),u("border-color")],[n("border-radius"),i("border-radius")],[n("background-color"),u("background-color")],[n("opacity"),a("opacity")],[n("visibility"),l("visibility","Visibility.")],[n("enabled"),c("enabled")],[n("font-color"),u("font-color")],[n("font-size"),i("font-size")],[n("font-style"),l("font-style","FontStyle.")],[n("font-weight"),function(e,t){const r=e.property.get("font-weight");s(r)||t.properties.set("fontWeight",["lighter","normal","regular","medium","bold","bolder"].includes(r)?y("FontWeight.",r):r)}],[n("font-family"),i("font-family")],[function(e){return e.property.has("margin")||e.property.has("margin-left")||e.property.has("margin-top")||e.property.has("margin-right")||e.property.has("margin-bottom")},function(e,t){var r,n,o,i;const s=new Map,a=e.property.get("margin"),c=null!==(r=e.property.get("margin-top"))&&void 0!==r?r:a,l=null!==(n=e.property.get("margin-bottom"))&&void 0!==n?n:a,p=null!==(o=e.property.get("margin-left"))&&void 0!==o?o:a,d=null!==(i=e.property.get("margin-right"))&&void 0!==i?i:a;v("top",c,s),v("bottom",l,s),v("left",p,s),v("right",d,s),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.property.has("padding")||e.property.has("padding-left")||e.property.has("padding-top")||e.property.has("padding-right")||e.property.has("padding-bottom")},function(e,t){var r,n,o,i;const s=new Map,a=e.property.get("padding"),c=null!==(r=e.property.get("padding-top"))&&void 0!==r?r:a,l=null!==(n=e.property.get("padding-bottom"))&&void 0!==n?n:a,p=null!==(o=e.property.get("padding-left"))&&void 0!==o?o:a,d=null!==(i=e.property.get("padding-right"))&&void 0!==i?i:a;v("top",c,s),v("bottom",l,s),v("left",p,s),v("right",d,s),s.size>0&&t.properties.set("padding",s)}],[o("button","label"),function(e,t){const r=e.property.get("label");"string"==typeof r&&t.setParams("'"+r+"'")}],[o("button","type"),l("type","ButtonType.")],[o("button","state-effect"),c("state-effect")],[o("divider","vertical"),c("vertical")],[o("divider","color"),u("color")],[o("divider","stroke-width"),i("stroke-width")],[o("divider","line-cap"),l("line-cap","LineCapStyle.")],[o("image","src"),function(e,t){const r=e.property.get("src");"string"==typeof r&&t.setParams(function(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?"'"+e+"'":e}(r))}],[o("image","alt"),i("alt")],[o("image","object-fit"),l("object-fit","ImageFit.")],[o("image","object-repeat"),l("object-repeat","ImageRepeat.")],[o("image","interpolation"),l("interpolation","ImageInterpolation.")],[o("image","render-mode"),l("render-mode","ImageRenderMode.")],[function(e){return e.property.has("source-size-width")||e.property.has("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");if(s(r)&&s(n))return;r="0"===r||s(r)?"0":r.substring(0,r.length-2),n="0"===n||s(n)?"0":n.substring(0,n.length-2);const o=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",o)}],[function(e){return"progress"===e.type&&(e.property.has("value")||e.property.has("total")||e.property.has("style"))},function(e,t){var r;t.params instanceof Map&&t.params.set("value",null!==(r=e.property.get("value"))&&void 0!==r?r:"0")}],[o("progress","total"),d("total")],[o("progress","style"),h("style","ProgressStyle.")],[o("progress","color"),u("color")],[o("slider","value"),d("value")],[o("slider","min"),d("min")],[o("slider","max"),d("max")],[o("slider","step"),d("step")],[o("slider","style"),h("style","SliderStyle.")],[o("slider","block-color"),u("block-color")],[o("slider","track-color"),u("track-color")],[o("slider","selected-color"),u("selected-color")],[o("slider","show-steps"),c("show-steps")],[o("slider","show-tips"),c("show-tips")],[o("text","content"),function(e,t){const r=e.property.get("content");"string"==typeof r&&t.setParams("`"+r+"`")}],[o("text","text-align"),l("text-align","TextAlign.")],[o("text","text-overflow"),function(e,t){const r=e.property.get("text-overflow");s(r)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+g(r)]]))}],[o("text","max-lines"),a("max-lines")],[o("text","line-height"),i("line-height")],[function(e){return"text"===e.type&&(e.property.has("decoration-type")||e.property.has("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.property.get("decoration-color");if(s(r)&&s(n))return;const o=new Map([["type",s(r)?"TextDecorationType.None":"TextDecorationType."+g(r)]]);t.properties.set("decoration",o),s(n)||o.set("color",m(n))}],[o("text","baseline-offset"),i("baseline-offset")],[o("text","text-case"),l("text-case","TextCase.")],[o("column","space"),p("space")],[o("column","align-items-column"),function(e,t){const r=e.property.get("align-items-column");if(s(r))return;let n=y("HorizontalAlign.",r);"flex-start"===r?n="HorizontalAlign.Start":"flex-end"===r&&(n="HorizontalAlign.End"),t.properties.set("alignItems",n)}],[o("row","space"),p("space")],[o("row","align-items-row"),function(e,t){const r=e.property.get("align-items-row");if(s(r))return;let n=y("VerticalAlign.",r);"flex-start"===r?n="VerticalAlign.Top":"flex-end"===r&&(n="VerticalAlign.Bottom"),t.properties.set("alignItems",n)}],[o("flex","flex-direction"),function(e,t){const r=e.property.get("flex-direction");!s(r)&&t.params instanceof Map&&t.params.set("direction",y("FlexDirection.",r))}],[o("flex","wrap"),function(e,t){const r=e.property.get("wrap");if(s(r)||!(t.params instanceof Map))return;let n=y("FlexWrap.",r);"nowrap"===r&&(n="FlexWrap.NoWrap"),t.params.set("wrap",n)}],[o("flex","justify-content"),T("justify-content","FlexAlign.")],[o("flex","align-items-flex"),function(e,t){const r=e.property.get("align-items-flex");if(s(r)||!(t.params instanceof Map))return;let n=y("ItemAlign.",r);"flex-start"===r?n="ItemAlign.Start":"flex-end"===r&&(n="ItemAlign.End"),t.params.set("alignItems",n)}],[o("flex","align-content"),T("align-content","FlexAlign.")],[o("list","space"),d("space")],[o("list","initial-index"),d("initial-index")],[o("list","list-direction"),l("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.property.has("divider-stroke-width")||e.property.has("divider-color")||e.property.has("divider-start-margin")||e.property.has("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=new Map([["strokeWidth","'"+(null!=r?r:"0")+"'"]]),o=e.property.get("divider-color"),i=e.property.get("divider-start-margin"),a=e.property.get("divider-end-margin");s(o)||n.set("color",m(o)),s(i)||n.set("startMargin","'"+i+"'"),s(a)||n.set("endMargin","'"+a+"'"),t.properties.set("divider",n)}],[o("list","edit-mode"),c("edit-mode")],[o("list","edge-effect"),l("edge-effect","EdgeEffect.")],[o("list","chain-animation"),c("chain-animation")],[o("list-item","sticky"),l("sticky","Sticky.")],[o("list-item","editable"),c("editable")],[o("swiper","index"),a("index")],[o("swiper","auto-play"),c("auto-play")],[o("swiper","interval"),a("interval")],[o("swiper","indicator"),c("indicator")],[o("swiper","loop"),c("loop")],[o("swiper","duration"),a("duration")],[o("swiper","vertical"),c("vertical")],[o("swiper","item-space"),i("item-space")]]},945:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r){this.action=e,this.params=t,this.want=r}}},891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=void 0;const n=r(933),o=r(945),i=r(904),s={document:{VisualVersion:"12",type:"ETS"},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel};t.getInstance=function(){return s},t.setInstance=function(e){for(const t in s)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=e[t]);const t=s.document.type;i.setDomain("ETS"===t?i.Domain.ETS:"FORM"===t?i.Domain.FORM:i.Domain.FA)}},977:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.deserialize=t.serialize=void 0;const n=r(933),o=r(891);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return JSON.stringify(null!=t?t:o.getInstance(),i,4)},t.deserialize=function(e){const t=JSON.parse(e,s);o.setInstance(t)},t.replacer=i,t.reviver=s},933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.mediaProperty=void 0,this.property=void 0!==e.property?e.property:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}var n={};(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(784),o=r(891),i=r(977),s=r(413),a=r(435);e.genETS=function(e){const r={ets:"",errorType:"",errorMessage:""};!function(e,t){try{i.deserialize(e);const r=o.getInstance().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===r)t.errorType="versionError";else{const e=r.match(n);(null===e||parseInt(e[1])>12)&&(t.errorType="versionError")}}catch(e){t.errorType="fileError"}}(e,r);try{const e=function(e){let t="";const r=new s.ETSBridge,n=e.accept(r),o=(new a.StringWriter).genETS(n);return t=r.getErrorCount()>0?"error":o,t}(o.getInstance().visualModel);"error"===e&&(r.errorType="codegenError"),r.ets=e}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.ets=""),r}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=32,u=128,l=1/0,f=9007199254740991,p=NaN,d=4294967295,h=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",v="[object Date]",_="[object Error]",T="[object Function]",w="[object GeneratorFunction]",b="[object Map]",E="[object Number]",C="[object Object]",P="[object Promise]",S="[object RegExp]",k="[object Set]",A="[object String]",M="[object Symbol]",x="[object WeakMap]",I="[object ArrayBuffer]",N="[object DataView]",O="[object Float32Array]",R="[object Float64Array]",z="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",W="[object Uint8Array]",L="[object Uint8ClampedArray]",F="[object Uint16Array]",V="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Q=/[&<>"']/g,q=RegExp(G.source),H=RegExp(Q.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,Te=/['\n\r\u2028\u2029\\]/g,we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",be="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+Ce+"]",Se="["+we+"]",ke="\\d+",Ae="["+be+"]",Me="[^\\ud800-\\udfff"+Ce+ke+"\\u2700-\\u27bf"+be+Ee+"]",xe="\\ud83c[\\udffb-\\udfff]",Ie="[^\\ud800-\\udfff]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Re="["+Ee+"]",ze="(?:"+Ae+"|"+Me+")",De="(?:"+Re+"|"+Me+")",je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Le="(?:"+Se+"|"+xe+")?",Fe="[\\ufe0e\\ufe0f]?",Ve=Fe+Le+"(?:\\u200d(?:"+[Ie,Ne,Oe].join("|")+")"+Fe+Le+")*",Be="(?:"+["[\\u2700-\\u27bf]",Ne,Oe].join("|")+")"+Ve,Ue="(?:"+[Ie+Se+"?",Se,Ne,Oe,"[\\ud800-\\udfff]"].join("|")+")",$e=RegExp("['’]","g"),Ge=RegExp(Se,"g"),Qe=RegExp(xe+"(?="+xe+")|"+Ue+Ve,"g"),qe=RegExp([Re+"?"+Ae+"+"+je+"(?="+[Pe,Re,"$"].join("|")+")",De+"+"+We+"(?="+[Pe,Re+ze,"$"].join("|")+")",Re+"?"+ze+"+"+je,Re+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Be].join("|"),"g"),He=RegExp("[\\u200d\\ud800-\\udfff"+we+"\\ufe0e\\ufe0f]"),Ye=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ke=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Je=-1,Ze={};Ze[O]=Ze[R]=Ze[z]=Ze[D]=Ze[j]=Ze[W]=Ze[L]=Ze[F]=Ze[V]=!0,Ze[g]=Ze[y]=Ze[I]=Ze[m]=Ze[N]=Ze[v]=Ze[_]=Ze[T]=Ze[b]=Ze[E]=Ze[C]=Ze[S]=Ze[k]=Ze[A]=Ze[x]=!1;var Xe={};Xe[g]=Xe[y]=Xe[I]=Xe[N]=Xe[m]=Xe[v]=Xe[O]=Xe[R]=Xe[z]=Xe[D]=Xe[j]=Xe[b]=Xe[E]=Xe[C]=Xe[S]=Xe[k]=Xe[A]=Xe[M]=Xe[W]=Xe[L]=Xe[F]=Xe[V]=!0,Xe[_]=Xe[T]=Xe[x]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,nt=parseInt,rt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,it="object"==typeof self&&self&&self.Object===Object&&self,ot=rt||it||Function("return this")(),at=t&&!t.nodeType&&t,st=at&&e&&!e.nodeType&&e,ct=st&&st.exports===at,ut=ct&&rt.process,lt=function(){try{return st&&st.require&&st.require("util").types||ut&&ut.binding&&ut.binding("util")}catch(e){}}(),ft=lt&<.isArrayBuffer,pt=lt&<.isDate,dt=lt&<.isMap,ht=lt&<.isRegExp,gt=lt&<.isSet,yt=lt&<.isTypedArray;function mt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function vt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Ct(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function qt(e,t){for(var n=e.length;n--&&Ot(t,e[n],0)>-1;);return n}function Ht(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Yt=Wt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Kt=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Jt(e){return"\\"+et[e]}function Zt(e){return He.test(e)}function Xt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function en(e,t){return function(n){return e(t(n))}}function tn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),un=function e(t){var n,r=(t=null==t?ot:un.defaults(ot.Object(),t,un.pick(ot,Ke))).Array,ie=t.Date,we=t.Error,be=t.Function,Ee=t.Math,Ce=t.Object,Pe=t.RegExp,Se=t.String,ke=t.TypeError,Ae=r.prototype,Me=be.prototype,xe=Ce.prototype,Ie=t["__core-js_shared__"],Ne=Me.toString,Oe=xe.hasOwnProperty,Re=0,ze=(n=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=xe.toString,je=Ne.call(Ce),We=ot._,Le=Pe("^"+Ne.call(Oe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ct?t.Buffer:i,Ve=t.Symbol,Be=t.Uint8Array,Ue=Fe?Fe.allocUnsafe:i,Qe=en(Ce.getPrototypeOf,Ce),He=Ce.create,et=xe.propertyIsEnumerable,rt=Ae.splice,it=Ve?Ve.isConcatSpreadable:i,at=Ve?Ve.iterator:i,st=Ve?Ve.toStringTag:i,ut=function(){try{var e=uo(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ot.clearTimeout&&t.clearTimeout,xt=ie&&ie.now!==ot.Date.now&&ie.now,Wt=t.setTimeout!==ot.setTimeout&&t.setTimeout,ln=Ee.ceil,fn=Ee.floor,pn=Ce.getOwnPropertySymbols,dn=Fe?Fe.isBuffer:i,hn=t.isFinite,gn=Ae.join,yn=en(Ce.keys,Ce),mn=Ee.max,vn=Ee.min,_n=ie.now,Tn=t.parseInt,wn=Ee.random,bn=Ae.reverse,En=uo(t,"DataView"),Cn=uo(t,"Map"),Pn=uo(t,"Promise"),Sn=uo(t,"Set"),kn=uo(t,"WeakMap"),An=uo(Ce,"create"),Mn=kn&&new kn,xn={},In=Lo(En),Nn=Lo(Cn),On=Lo(Pn),Rn=Lo(Sn),zn=Lo(kn),Dn=Ve?Ve.prototype:i,jn=Dn?Dn.valueOf:i,Wn=Dn?Dn.toString:i;function Ln(e){if(ns(e)&&!Ga(e)&&!(e instanceof Un)){if(e instanceof Bn)return e;if(Oe.call(e,"__wrapped__"))return Fo(e)}return new Bn(e)}var Fn=function(){function e(){}return function(t){if(!ts(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Vn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!ts(e))return e;var f=Ga(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!c)return ki(e,s)}else{var p=po(e),d=p==T||p==w;if(Ya(e))return wi(e,c);if(p==C||p==g||d&&!o){if(s=u||d?{}:go(e),!c)return u?function(e,t){return Ai(e,fo(e),t)}(e,function(e,t){return e&&Ai(t,Os(t),e)}(s,e)):function(e,t){return Ai(e,lo(e),t)}(e,rr(s,e))}else{if(!Xe[p])return o?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case I:return bi(e);case m:case v:return new i(+e);case N:return function(e,t){var n=t?bi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case O:case R:case z:case D:case j:case W:case L:case F:case V:return Ei(e,n);case b:case k:return new i;case E:case A:return new i(e);case S:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return r=e,jn?Ce(jn.call(r)):{}}}(e,p,c)}}a||(a=new Hn);var h=a.get(e);if(h)return h;a.set(e,s),ss(e)?e.forEach((function(r){s.add(sr(r,t,n,r,e,a))})):rs(e)&&e.forEach((function(r,i){s.set(i,sr(r,t,n,i,e,a))}));var y=f?i:(l?u?no:to:u?Os:Ns)(e);return _t(y||e,(function(r,i){y&&(r=e[i=r]),er(s,i,sr(r,t,n,i,e,a))})),s}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new ke(o);return xo((function(){e.apply(i,n)}),t)}function lr(e,t,n,r){var i=-1,o=Et,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=Pt(t,Ut(n))),r?(o=Ct,a=!1):t.length>=200&&(o=Gt,a=!1,t=new qn(t));e:for(;++i-1},Gn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Qn.prototype.clear=function(){this.size=0,this.__data__={hash:new $n,map:new(Cn||Gn),string:new $n}},Qn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Qn.prototype.get=function(e){return so(this,e).get(e)},Qn.prototype.has=function(e){return so(this,e).has(e)},Qn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Hn.prototype.get=function(e){return this.__data__.get(e)},Hn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Gn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qn(r)}return n.set(e,t),this.size=n.size,this};var fr=Ii(_r),pr=Ii(Tr,!0);function dr(e,t){var n=!0;return fr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function hr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?yr(s,t-1,n,r,i):St(i,s):r||(i[i.length]=s)}return i}var mr=Ni(),vr=Ni(!0);function _r(e,t){return e&&mr(e,t,Ns)}function Tr(e,t){return e&&vr(e,t,Ns)}function wr(e,t){return bt(t,(function(t){return Za(e[t])}))}function br(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&nt}function Sr(e,t){return null!=e&&Oe.call(e,t)}function kr(e,t){return null!=e&&t in Ce(e)}function Ar(e,t,n){for(var o=n?Ct:Et,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,f=[];c--;){var p=e[c];c&&t&&(p=Pt(p,Ut(t))),l=vn(p.length,l),u[c]=!n&&(t||a>=120&&p.length>=120)?new qn(c&&p):i}p=e[0];var d=-1,h=u[0];e:for(;++d=s?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Ur(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&rt.call(s,c,1),rt.call(e,c,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?rt.call(e,i,1):ui(e,i)}}return e}function Qr(e,t){return e+fn(wn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=fn(t/2))&&(e+=e)}while(t);return n}function Hr(e,t){return Io(Po(e,t,ic),e+"")}function Yr(e){return Kn(Vs(e))}function Kr(e,t){var n=Vs(e);return Ro(n,ar(t,0,n.length))}function Jr(e,t,n,r){if(!ts(e))return e;for(var o=-1,a=(t=mi(t,e)).length,s=a-1,c=e;null!=c&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a=200){var u=t?null:qi(e);if(u)return nn(u);a=!1,i=Gt,c=new qn}else c=t?[]:s;e:for(;++r=r?e:ti(e,t,n)}var Ti=lt||function(e){return ot.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=Ue?Ue(n):new e.constructor(n);return e.copy(r),r}function bi(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function Ei(e,t){var n=t?bi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,c=null===t,u=t==t,l=us(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!l&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&vo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=Ce(t);++r-1?o[a?t[s]:s]:i}}function ji(e){return eo((function(t){var n=t.length,r=n,a=Bn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new ke(o);if(a&&!c&&"wrapper"==io(s))var c=new Bn([],!0)}for(r=c?r:n;++r1&&_.reverse(),d&&fc))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var p=-1,d=!0,h=2&n?new qn:i;for(a.set(e,t),a.set(t,e);++p-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(h,(function(n){var r="_."+n[0];t&n[1]&&!Et(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=_n(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ro(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,aa(e,n)}));function da(e){var t=Ln(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var ga=eo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ya=Mi((function(e,t,n){Oe.call(e,n)?++e[n]:ir(e,n,1)})),ma=Di($o),va=Di(Go);function _a(e,t){return(Ga(e)?_t:fr)(e,ao(t,3))}function Ta(e,t){return(Ga(e)?Tt:pr)(e,ao(t,3))}var wa=Mi((function(e,t,n){Oe.call(e,n)?e[n].push(t):ir(e,n,[t])})),ba=Hr((function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return fr(e,(function(e){a[++i]=o?mt(t,e,n):Mr(e,t,n)})),a})),Ea=Mi((function(e,t,n){ir(e,n,t)}));function Ca(e,t){return(Ga(e)?Pt:jr)(e,ao(t,3))}var Pa=Mi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Sa=Hr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&vo(e,t[0],t[1])?t=[]:n>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,yr(t,1),[])})),ka=xt||function(){return ot.Date.now()};function Aa(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Yi(e,u,i,i,i,i,t)}function Ma(e,t){var n;if("function"!=typeof t)throw new ke(o);return e=gs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var xa=Hr((function(e,t,n){var r=1;if(n.length){var i=tn(n,oo(xa));r|=c}return Yi(e,r,t,n,i)})),Ia=Hr((function(e,t,n){var r=3;if(n.length){var i=tn(n,oo(Ia));r|=c}return Yi(t,r,e,n,i)}));function Na(e,t,n){var r,a,s,c,u,l,f=0,p=!1,d=!1,h=!0;if("function"!=typeof e)throw new ke(o);function g(t){var n=r,o=a;return r=a=i,f=t,c=e.apply(o,n)}function y(e){return f=e,u=xo(v,t),p?g(e):c}function m(e){var n=e-l;return l===i||n>=t||n<0||d&&e-f>=s}function v(){var e=ka();if(m(e))return _(e);u=xo(v,function(e){var n=t-(e-l);return d?vn(n,s-(e-f)):n}(e))}function _(e){return u=i,h&&r?g(e):(r=a=i,c)}function T(){var e=ka(),n=m(e);if(r=arguments,a=this,l=e,n){if(u===i)return y(l);if(d)return Ti(u),u=xo(v,t),g(l)}return u===i&&(u=xo(v,t)),c}return t=ms(t)||0,ts(n)&&(p=!!n.leading,s=(d="maxWait"in n)?mn(ms(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),T.cancel=function(){u!==i&&Ti(u),f=0,r=l=a=u=i},T.flush=function(){return u===i?c:_(ka())},T}var Oa=Hr((function(e,t){return ur(e,1,t)})),Ra=Hr((function(e,t,n){return ur(e,ms(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(za.Cache||Qn),n}function Da(e){if("function"!=typeof e)throw new ke(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Qn;var ja=vi((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Pt(t[0],Ut(ao())):Pt(yr(t,1),Ut(ao()))).length;return Hr((function(r){for(var i=-1,o=vn(r.length,n);++i=t})),$a=xr(function(){return arguments}())?xr:function(e){return ns(e)&&Oe.call(e,"callee")&&!et.call(e,"callee")},Ga=r.isArray,Qa=ft?Ut(ft):function(e){return ns(e)&&Cr(e)==I};function qa(e){return null!=e&&es(e.length)&&!Za(e)}function Ha(e){return ns(e)&&qa(e)}var Ya=dn||mc,Ka=pt?Ut(pt):function(e){return ns(e)&&Cr(e)==v};function Ja(e){if(!ns(e))return!1;var t=Cr(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Za(e){if(!ts(e))return!1;var t=Cr(e);return t==T||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==gs(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var rs=dt?Ut(dt):function(e){return ns(e)&&po(e)==b};function is(e){return"number"==typeof e||ns(e)&&Cr(e)==E}function os(e){if(!ns(e)||Cr(e)!=C)return!1;var t=Qe(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==je}var as=ht?Ut(ht):function(e){return ns(e)&&Cr(e)==S},ss=gt?Ut(gt):function(e){return ns(e)&&po(e)==k};function cs(e){return"string"==typeof e||!Ga(e)&&ns(e)&&Cr(e)==A}function us(e){return"symbol"==typeof e||ns(e)&&Cr(e)==M}var ls=yt?Ut(yt):function(e){return ns(e)&&es(e.length)&&!!Ze[Cr(e)]},fs=$i(Dr),ps=$i((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(qa(e))return cs(e)?an(e):ki(e);if(at&&e[at])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[at]());var t=po(e);return(t==b?Xt:t==k?nn:Vs)(e)}function hs(e){return e?(e=ms(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?ar(gs(e),0,d):0}function ms(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Bt(e);var n=he.test(e);return n||ye.test(e)?nt(e.slice(2),n?2:8):de.test(e)?p:+e}function vs(e){return Ai(e,Os(e))}function _s(e){return null==e?"":si(e)}var Ts=xi((function(e,t){if(bo(t)||qa(t))Ai(t,Ns(t),e);else for(var n in t)Oe.call(t,n)&&er(e,n,t[n])})),ws=xi((function(e,t){Ai(t,Os(t),e)})),bs=xi((function(e,t,n,r){Ai(t,Os(t),e,r)})),Es=xi((function(e,t,n,r){Ai(t,Ns(t),e,r)})),Cs=eo(or),Ps=Hr((function(e,t){e=Ce(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&vo(t[0],t[1],o)&&(r=1);++n1),t})),Ai(e,no(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)ui(n,t[i]);return n})),js=eo((function(e,t){return null==e?{}:function(e,t){return Ur(e,t,(function(t,n){return As(e,n)}))}(e,t)}));function Ws(e,t){if(null==e)return{};var n=Pt(no(e),(function(e){return[e]}));return t=ao(t),Ur(e,n,(function(e,n){return t(e,n[0])}))}var Ls=Hi(Ns),Fs=Hi(Os);function Vs(e){return null==e?[]:$t(e,Ns(e))}var Bs=Ri((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Js(_s(e).toLowerCase())}function $s(e){return(e=_s(e))&&e.replace(ve,Yt).replace(Ge,"")}var Gs=Ri((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Qs=Ri((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),qs=Oi("toLowerCase"),Hs=Ri((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ys=Ri((function(e,t,n){return e+(n?" ":"")+Js(t)})),Ks=Ri((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Oi("toUpperCase");function Zs(e,t,n){return e=_s(e),(t=n?i:t)===i?function(e){return Ye.test(e)}(e)?function(e){return e.match(qe)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Xs=Hr((function(e,t){try{return mt(e,i,t)}catch(e){return Ja(e)?e:new we(e)}})),ec=eo((function(e,t){return _t(t,(function(t){t=Wo(t),ir(e,t,xa(e[t],e))})),e}));function tc(e){return function(){return e}}var nc=ji(),rc=ji(!0);function ic(e){return e}function oc(e){return Rr("function"==typeof e?e:sr(e,1))}var ac=Hr((function(e,t){return function(n){return Mr(n,e,t)}})),sc=Hr((function(e,t){return function(n){return Mr(e,n,t)}}));function cc(e,t,n){var r=Ns(t),i=wr(t,r);null!=n||ts(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ns(t)));var o=!(ts(n)&&"chain"in n&&!n.chain),a=Za(e);return _t(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=ki(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,St([this.value()],arguments))})})),e}function uc(){}var lc=Vi(Pt),fc=Vi(wt),pc=Vi(Mt);function dc(e){return _o(e)?jt(Wo(e)):function(e){return function(t){return br(t,e)}}(e)}var hc=Ui(),gc=Ui(!0);function yc(){return[]}function mc(){return!1}var vc,_c=Fi((function(e,t){return e+t}),0),Tc=Qi("ceil"),wc=Fi((function(e,t){return e/t}),1),bc=Qi("floor"),Ec=Fi((function(e,t){return e*t}),1),Cc=Qi("round"),Pc=Fi((function(e,t){return e-t}),0);return Ln.after=function(e,t){if("function"!=typeof t)throw new ke(o);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Aa,Ln.assign=Ts,Ln.assignIn=ws,Ln.assignInWith=bs,Ln.assignWith=Es,Ln.at=Cs,Ln.before=Ma,Ln.bind=xa,Ln.bindAll=ec,Ln.bindKey=Ia,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},Ln.chain=da,Ln.chunk=function(e,t,n){t=(n?vo(e,t,n):t===i)?1:mn(gs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,c=r(ln(o/t));ao?0:o+n),(r=r===i||r>o?o:gs(r))<0&&(r+=o),r=n>r?0:ys(r);n>>0)?(e=_s(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=si(t))&&Zt(e)?_i(an(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new ke(o);return t=null==t?0:mn(gs(t),0),Hr((function(n){var r=n[t],i=_i(n,0,t);return r&&St(i,r),mt(e,this,i)}))},Ln.tail=function(e){var t=null==e?0:e.length;return t?ti(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?ti(e,0,(t=n||t===i?1:gs(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ti(e,(t=r-(t=n||t===i?1:gs(t)))<0?0:t,r):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?fi(e,ao(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?fi(e,ao(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new ke(o);return ts(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Na(e,t,{leading:r,maxWait:t,trailing:i})},Ln.thru=ha,Ln.toArray=ds,Ln.toPairs=Ls,Ln.toPairsIn=Fs,Ln.toPath=function(e){return Ga(e)?Pt(e,Wo):us(e)?[e]:ki(jo(_s(e)))},Ln.toPlainObject=vs,Ln.transform=function(e,t,n){var r=Ga(e),i=r||Ya(e)||ls(e);if(t=ao(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:ts(e)&&Za(o)?Fn(Qe(e)):{}}return(i?_t:_r)(e,(function(e,r,i){return t(n,e,r,i)})),n},Ln.unary=function(e){return Aa(e,1)},Ln.union=na,Ln.unionBy=ra,Ln.unionWith=ia,Ln.uniq=function(e){return e&&e.length?ci(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?ci(e,ao(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ci(e,i,t):[]},Ln.unset=function(e,t){return null==e||ui(e,t)},Ln.unzip=oa,Ln.unzipWith=aa,Ln.update=function(e,t,n){return null==e?e:li(e,t,yi(n))},Ln.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:li(e,t,yi(n),r)},Ln.values=Vs,Ln.valuesIn=function(e){return null==e?[]:$t(e,Os(e))},Ln.without=sa,Ln.words=Zs,Ln.wrap=function(e,t){return Wa(yi(t),e)},Ln.xor=ca,Ln.xorBy=ua,Ln.xorWith=la,Ln.zip=fa,Ln.zipObject=function(e,t){return hi(e||[],t||[],er)},Ln.zipObjectDeep=function(e,t){return hi(e||[],t||[],Jr)},Ln.zipWith=pa,Ln.entries=Ls,Ln.entriesIn=Fs,Ln.extend=ws,Ln.extendWith=bs,cc(Ln,Ln),Ln.add=_c,Ln.attempt=Xs,Ln.camelCase=Bs,Ln.capitalize=Us,Ln.ceil=Tc,Ln.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ms(n))==n?n:0),t!==i&&(t=(t=ms(t))==t?t:0),ar(ms(e),t,n)},Ln.clone=function(e){return sr(e,4)},Ln.cloneDeep=function(e){return sr(e,5)},Ln.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Ln.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Ln.conformsTo=function(e,t){return null==t||cr(e,t,Ns(t))},Ln.deburr=$s,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=wc,Ln.endsWith=function(e,t,n){e=_s(e),t=si(t);var r=e.length,o=n=n===i?r:ar(gs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Ln.eq=Va,Ln.escape=function(e){return(e=_s(e))&&H.test(e)?e.replace(Q,Kt):e},Ln.escapeRegExp=function(e){return(e=_s(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Ln.every=function(e,t,n){var r=Ga(e)?wt:dr;return n&&vo(e,t,n)&&(t=i),r(e,ao(t,3))},Ln.find=ma,Ln.findIndex=$o,Ln.findKey=function(e,t){return It(e,ao(t,3),_r)},Ln.findLast=va,Ln.findLastIndex=Go,Ln.findLastKey=function(e,t){return It(e,ao(t,3),Tr)},Ln.floor=bc,Ln.forEach=_a,Ln.forEachRight=Ta,Ln.forIn=function(e,t){return null==e?e:mr(e,ao(t,3),Os)},Ln.forInRight=function(e,t){return null==e?e:vr(e,ao(t,3),Os)},Ln.forOwn=function(e,t){return e&&_r(e,ao(t,3))},Ln.forOwnRight=function(e,t){return e&&Tr(e,ao(t,3))},Ln.get=ks,Ln.gt=Ba,Ln.gte=Ua,Ln.has=function(e,t){return null!=e&&ho(e,t,Sr)},Ln.hasIn=As,Ln.head=qo,Ln.identity=ic,Ln.includes=function(e,t,n,r){e=qa(e)?e:Vs(e),n=n&&!r?gs(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),cs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ot(e,t,n)>-1},Ln.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:gs(n);return i<0&&(i=mn(r+i,0)),Ot(e,t,i)},Ln.inRange=function(e,t,n){return t=hs(t),n===i?(n=t,t=0):n=hs(n),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=f},Ln.isSet=ss,Ln.isString=cs,Ln.isSymbol=us,Ln.isTypedArray=ls,Ln.isUndefined=function(e){return e===i},Ln.isWeakMap=function(e){return ns(e)&&po(e)==x},Ln.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Cr(e)},Ln.join=function(e,t){return null==e?"":gn.call(e,t)},Ln.kebabCase=Gs,Ln.last=Jo,Ln.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=gs(n))<0?mn(r+o,0):vn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Nt(e,zt,o,!0)},Ln.lowerCase=Qs,Ln.lowerFirst=qs,Ln.lt=fs,Ln.lte=ps,Ln.max=function(e){return e&&e.length?hr(e,ic,Pr):i},Ln.maxBy=function(e,t){return e&&e.length?hr(e,ao(t,2),Pr):i},Ln.mean=function(e){return Dt(e,ic)},Ln.meanBy=function(e,t){return Dt(e,ao(t,2))},Ln.min=function(e){return e&&e.length?hr(e,ic,Dr):i},Ln.minBy=function(e,t){return e&&e.length?hr(e,ao(t,2),Dr):i},Ln.stubArray=yc,Ln.stubFalse=mc,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=Ec,Ln.nth=function(e,t){return e&&e.length?Vr(e,gs(t)):i},Ln.noConflict=function(){return ot._===this&&(ot._=We),this},Ln.noop=uc,Ln.now=ka,Ln.pad=function(e,t,n){e=_s(e);var r=(t=gs(t))?on(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Bi(fn(i),n)+e+Bi(ln(i),n)},Ln.padEnd=function(e,t,n){e=_s(e);var r=(t=gs(t))?on(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=wn();return vn(e+o*(t-e+tt("1e-"+((o+"").length-1))),t)}return Qr(e,t)},Ln.reduce=function(e,t,n){var r=Ga(e)?kt:Lt,i=arguments.length<3;return r(e,ao(t,4),n,i,fr)},Ln.reduceRight=function(e,t,n){var r=Ga(e)?At:Lt,i=arguments.length<3;return r(e,ao(t,4),n,i,pr)},Ln.repeat=function(e,t,n){return t=(n?vo(e,t,n):t===i)?1:gs(t),qr(_s(e),t)},Ln.replace=function(){var e=arguments,t=_s(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++rf)return[];var n=d,r=vn(e,d);t=ao(t),e-=d;for(var i=Vt(r,t);++n=a)return e;var c=n-on(r);if(c<1)return r;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var l,f=u;for(o.global||(o=Pe(o.source,_s(pe.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var p=l.index;u=u.slice(0,p===i?c:p)}}else if(e.indexOf(si(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},Ln.unescape=function(e){return(e=_s(e))&&q.test(e)?e.replace(G,cn):e},Ln.uniqueId=function(e){var t=++Re;return _s(e)+t},Ln.upperCase=Ks,Ln.upperFirst=Js,Ln.each=_a,Ln.eachRight=Ta,Ln.first=qo,cc(Ln,(vc={},_r(Ln,(function(e,t){Oe.call(Ln.prototype,t)||(vc[t]=e)})),vc),{chain:!1}),Ln.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ln[e].placeholder=Ln})),_t(["drop","take"],(function(e,t){Un.prototype[e]=function(n){n=n===i?1:mn(gs(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=vn(n,r.__takeCount__):r.__views__.push({size:vn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),_t(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ao(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),_t(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}})),_t(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(ic)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Hr((function(e,t){return"function"==typeof e?new Un(this):this.map((function(n){return Mr(n,e,t)}))})),Un.prototype.reject=function(e){return this.filter(Da(ao(e)))},Un.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(d)},_r(Un.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Ln[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Ln.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof Un,u=s[0],l=c||Ga(t),f=function(e){var t=o.apply(Ln,St([e],s));return r&&p?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=a&&!p,g=c&&!d;if(!a&&l){t=g?t:new Un(this);var y=e.apply(t,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,p)}return h&&g?e.apply(this,s):(y=this.thru(f),h?r?y.value()[0]:y.value():y)})})),_t(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),_r(Un.prototype,(function(e,t){var n=Ln[t];if(n){var r=n.name+"";Oe.call(xn,r)||(xn[r]=[]),xn[r].push({name:t,func:n})}})),xn[Wi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Vn;){var r=Fo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:ha,args:[ta],thisArg:i}),new Bn(t,this.__chain__)}return this.thru(ta)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,at&&(Ln.prototype[at]=function(){return this}),Ln}();ot._=un,(r=function(){return un}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},904:(e,t)=>{"use strict";var n;let r;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(n||(n={})),t.Domain=n,t.setDomain=e=>{r=e},t.getDomain=()=>null!=r?r:n.FA},784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const r=n(117);class i extends r.ASTNode{constructor(e,t,n,r,i){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=n,this.properties=r,this.forEachObj=i,this.ifBoolean=null}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,n)=>{var r;this.mediaKeyProperty.has(n)||this.mediaKeyProperty.set(n,new Map),null===(r=this.mediaKeyProperty.get(n))||void 0===r||r.set(e,t)}))}setDefaultValue(e,t,n="undefined"){this.defaultValue.set(e,[n,t])}}t.Tag=i},623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const r=n(519),i=n(862),o=n(51),a=n(294);class s{constructor(e){this.cache=e,this.etsImport=new i.Cache(" ",1),this.etsVariable=new i.Cache(" ",1),this.etsFunction=new i.Cache(" ",1),this.aboutToAppear=new i.Cache(" ",2),this.needMediaQuery=!0}visit(e){e instanceof r.Tag&&(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e))}static getMethodGen(e){return void 0===s.instance?s.instance=new s(e):s.instance.setCache(e),s.instance}setCache(e){this.cache=e,this.etsImport=new i.Cache(" ",1),this.etsVariable=new i.Cache(" ",1),this.etsFunction=new i.Cache(" ",1),this.aboutToAppear=new i.Cache(" ",2),this.needMediaQuery=!0}genParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(o.TokenClass.LBRA,o.TokenClass.SPACE);let t=0;e.forEach(((n,r)=>{this.cache.concat(r,o.TokenClass.COLON,o.TokenClass.SPACE,n),t++,t{this.cache.concat(r,o.TokenClass.COLON,o.TokenClass.SPACE,n),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(o.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(o.TokenClass.PROPERTY_START,t,o.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,o.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;if(void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)){const t="item",n="idx";this.cache.concat("ForEach",o.TokenClass.TAG_START,e.forEachObj.for.toString(),o.TokenClass.COMMA,o.TokenClass.NEW_LINE),this.cache.concat(o.TokenClass.TAG_START,t,o.TokenClass.COLON," any",o.TokenClass.COMMA," ",n,o.TokenClass.COLON," number",o.TokenClass.TAG_END," => ",o.TokenClass.LBRA,o.TokenClass.NEW_LINE)}}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(o.TokenClass.RBRA),void 0!==e.forEachObj.key&&null!==e.forEachObj.key&&(this.cache.concat(o.TokenClass.COMMA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(e.forEachObj.key.toString()),this.cache.indentOff()),this.cache.concat(o.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",o.TokenClass.SPACE,o.TokenClass.TAG_START,e.ifBoolean.toString(),o.TokenClass.TAG_END,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.concat(o.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,n=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,n),0===t.size&&0===n.size)return;const r=(0,a.getUniqueName)("mediaQuery"),s=(0,a.getUniqueName)("initForMediaQuery"),c=(0,a.getUniqueName)("mediaQueryCb"),u=(0,a.getUniqueName)("saveMediaQueryResult"),l=(0,a.getUniqueName)("updateForMediaQuery"),f=new i.Cache(o.TokenClass.INDENT,1),p=new i.Cache(o.TokenClass.INDENT,1),d=new i.Cache(o.TokenClass.INDENT,1),h=new i.Cache(o.TokenClass.INDENT,1),g=new i.Cache(o.TokenClass.INDENT,1),y=new i.Cache(o.TokenClass.INDENT,1),m=new i.Cache(o.TokenClass.INDENT,1),v=new i.Cache(o.TokenClass.INDENT,2);this.genVariableDeclare(n,f),this.genMediaQueryCb(c,p),this.genMediaQueryListener(t,d,h),this.genInitFuc(s,n,g),this.genMediaQueryCbFnc(u,l,t,y),this.genUpdateFnc(l,s,t,m),this.genAboutToAppear(c,u,t,v),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",r," from '@ohos.mediaquery'"),this.aboutToAppear.concat(v.toString()),this.etsVariable.concat(f.toString(),p.toString(),d.toString(),h.toString()),this.etsFunction.concat(y.toString(),o.TokenClass.NEW_LINE,g.toString(),o.TokenClass.NEW_LINE,m.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genVariableDeclare(e,t){e.forEach(((e,n)=>{t.concat(o.TokenClass.DECORATOR_STATE,o.TokenClass.SPACE,n.slice(5),o.TokenClass.COLON,o.TokenClass.SPACE,e[1],o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,o.TokenClass.UNDEFINED,o.TokenClass.NEW_LINE)}))}genMediaQueryCb(e,t){t.concat(e,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,o.TokenClass.NULL,o.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,n){const r=(0,a.getUniqueName)("mediaQuery");e.forEach(((e,i)=>{const s=(0,a.getUniqueName)(this.getMediaQueryVariableName(i));t.concat(s,o.TokenClass.COLON,o.TokenClass.SPACE,o.TokenClass.BOOLEAN,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,o.TokenClass.FALSE,o.TokenClass.NEW_LINE),n.concat(`listener_${s}`,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,r,o.TokenClass.PROPERTY_START,"matchMediaSync",o.TokenClass.TAG_START,`'${i}'`,o.TokenClass.TAG_END,o.TokenClass.NEW_LINE)}))}genInitFuc(e,t,n){n.concat(e,o.TokenClass.TAG_START,o.TokenClass.TAG_END,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),n.indentOn(),n.incIndent(),t.forEach(((e,t)=>{n.concat(t,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,e[0],o.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,n,r){const i=Array.from(n.entries());r.concat(e,o.TokenClass.TAG_START,"mediaQueryResult",o.TokenClass.TAG_END,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),r.incIndent(),r.concat(o.TokenClass.SWITCH,o.TokenClass.SPACE,o.TokenClass.TAG_START,"mediaQueryResult.media",o.TokenClass.TAG_END,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),r.incIndent();for(let e=0;e{const n=(0,a.getUniqueName)(this.getMediaQueryVariableName(t));r.concat(o.TokenClass.IF,o.TokenClass.SPACE,o.TokenClass.TAG_START,o.TokenClass.THIS,o.TokenClass.PROPERTY_START,n,o.TokenClass.TAG_END,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),r.incIndent(),e.forEach(((e,t)=>{r.concat(t,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,e,o.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)}genAboutToAppear(e,t,n,r){let i=1;r.concat(o.TokenClass.THIS,o.TokenClass.PROPERTY_START,e,o.TokenClass.SPACE,o.TokenClass.ASSIGN,o.TokenClass.SPACE,o.TokenClass.THIS,o.TokenClass.PROPERTY_START,`${t}.bind(this)`,o.TokenClass.NEW_LINE),n.forEach(((t,s)=>{const c=`listener_${(0,a.getUniqueName)(this.getMediaQueryVariableName(s))}`;r.indentOn(),r.concat(o.TokenClass.THIS,o.TokenClass.PROPERTY_START,c,o.TokenClass.PROPERTY_START,`on('change', this.${e})`),i0?e.mediaParams:e.params}getProperties(e){const t=new Map;return e.properties.forEach(((e,n)=>{t.set(n,e)})),e.mediaProperties.forEach(((e,n)=>{t.set(n,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,n)=>{t.set(n,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,n)=>{var r;const i=null!==(r=t.get(n))&&void 0!==r?r:new Map;e.forEach(((e,t)=>{i.set(t,e)})),t.set(n,i)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",n="orientation: ",r=e.substring(e.indexOf(t),e.length),i=r.substring(t.length,r.indexOf(")")),o=e.substring(e.indexOf(n),e.length),a=o.substring(n.length,o.indexOf(")"));return`${i}${a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=s,s.instance=void 0},413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const r=n(519),i=n(973),o=n(497);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let n=null;const a=new Map,s=new r.Tag(e.type,t,n,a,null);if((0,i.parseVisualModel)(e,s),(0,o.parseMediaVisualModel)(e,s),e.children.length>0){n=[];for(const t of e.children)n.push(t.accept(this))}return s.content=n,s}}},459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genETS=void 0;const r=n(623),i=n(862);t.genETS=function(e){const t=r.ASTNodeGenerator.getMethodGen(new i.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}}},435:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const r=n(459);t.StringWriter=class{genETS(e){return(0,r.genETS)(e)}}},51:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(n=t.TokenClass||(t.TokenClass={}))[n.IDENTIFIER=0]="IDENTIFIER",n[n.STRING_LITERAL=1]="STRING_LITERAL",n[n.NUMBER=2]="NUMBER",n[n.CHARACTER=3]="CHARACTER",n[n.EOF=4]="EOF",n[n.INVALID=5]="INVALID",n.EMPTY_DATA="empty",n.ASSIGN="=",n.INDENT=" ",n.NEW_LINE="\n",n.CARRIAGE_RETURN="\r",n.SPACE=" ",n.LQUOTE="'",n.RQUOTE="'",n.TAG_START="(",n.TAG_END=")",n.EMPTY_TAG_END="/>",n.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const r=n(294),i=n(973),o=(0,i.curry)(((e,t)=>t.hasMediaProperty(e))),a=(0,i.curry)(((e,t,n)=>n.type===e&&n.hasMediaProperty(t)));function s(e,t,n){const r=t.get(n);return void 0!==r&&r.has(e)}function c(e){return`'${e}'`}function u(e){return isNaN(Number(e))?(0,i.getEtsEnumValue)("FontWeight.",e):e}function l(e){let t=(0,i.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function f(e){return"TextOverflow."+(0,i.firstUpperCase)(e)}function p(e,t,n){var r,o;const a=new Map,s=null!==(r=e.mediaProperty)&&void 0!==r?r:new Map,c=null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map;return s.forEach(((e,r)=>{let o=e.get(t);const s=e.get(n);(0,i.isEmptyOrUndefined)(o)&&(0,i.isEmptyOrUndefined)(s)||(o="0"===o||(0,i.isEmptyOrUndefined)(o)?"0":o.substring(0,o.length-2),a.set(r,o))})),c.forEach(((e,n)=>{const r=e.get(t);(0,i.isEmptyOrUndefined)(r)||a.set(n,r)})),a}function d(e,t){const n=e.get("left"),r=e.get("top"),o=t.get("left"),a=t.get("top");let s="undefined",c="undefined";return(0,i.isEmptyOrUndefined)(n)&&(0,i.isEmptyOrUndefined)(r)||(s=`'${null!=n?n:0}'`,c=`'${null!=r?r:0}'`),(0,i.isEmptyOrUndefined)(o)&&(0,i.isEmptyOrUndefined)(a)||(s=null!=o?o:s,c=null!=a?a:c),{leftValue:s,topValue:c}}function h(e,t){e.forEach(((e,n)=>{"undefined"!==e&&t.set(n,"undefined")}))}function g(e,t){var n,r;const i=new Map,o=t.split("-")[0];return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((n,r)=>{var a,s,u,l;const f=n.get(o),p=null===(s=null===(a=e.dynamicMediaProperty)||void 0===a?void 0:a.get(r))||void 0===s?void 0:s.get(o),d=null!==(l=null!==(u=n.get(t))&&void 0!==u?u:p)&&void 0!==l?l:f;void 0!==d&&i.set(r,c(d))})),(null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map).forEach(((e,n)=>{var r;const a=e.get(o),s=null!==(r=e.get(t))&&void 0!==r?r:a;void 0!==s&&i.set(n,s)})),i}function y(e,t,n){var r,o;const a=new Map;return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{let o=e.get(t);(0,i.isEmptyOrUndefined)(o)||("function"==typeof n&&(o=n(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,n)=>{let r=e.get(t);void 0===r||"content"!==t&&"label"!==t||(r=""===r?"''":(0,i.getContentName)(r)),(0,i.isEmptyOrUndefined)(r)||a.set(n,r)})),a}function m(e,t){const n=`this.${(0,i.getEtsPropName)(e)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,r.getUniqueId)(n)}`}function v(e,t,n){const r=e.property.get(t),o=e.dynamicProperty.get(t);let a="undefined";return(0,i.isEmptyOrUndefined)(r)||(a="function"==typeof n?n(r):r,a=(0,i.isEmptyOrUndefined)(a)?"undefined":a),(0,i.isEmptyOrUndefined)(o)||(a=o),a}const _=(0,i.curry)(((e,t,n)=>{const r=y(t,e,c);if(0===r.size)return;const o=v(t,e,c),a=m(t.id,e);n.setDefaultValue(a,"string",o),n.setMediaProperty(a,r),n.mediaProperties.set((0,i.getEtsPropName)(e),a)})),T=(0,i.curry)(((e,t,n)=>{const r=y(t,e);if(0===r.size)return;const o=v(t,e),a=m(t.id,e);n.setDefaultValue(a,"number",o),n.setMediaProperty(a,r),n.mediaProperties.set((0,i.getEtsPropName)(e),a)})),w=(0,i.curry)(((e,t,n)=>{const r=y(t,e);if(0===r.size)return;const o=v(t,e),a=m(t.id,e);n.setDefaultValue(a,"boolean",o),n.setMediaProperty(a,r),n.mediaProperties.set((0,i.getEtsPropName)(e),a)})),b=(0,i.curry)(((e,t,n,r)=>{const o=y(n,e,(0,i.curry)(i.getEtsEnumValue)(t));if(0===o.size)return;const a=v(n,e,(0,i.curry)(i.getEtsEnumValue)(t)),s=m(n.id,e);r.setDefaultValue(s,t.replace(".",""),a),r.setMediaProperty(s,o),r.mediaProperties.set((0,i.getEtsPropName)(e),s)})),E=(0,i.curry)(((e,t,n)=>{const r=y(t,e,c);if(!(n.mediaParams instanceof Map)||0===r.size)return;const o=v(t,e,c),a=m(t.id,e);n.setDefaultValue(a,"string",o),n.setMediaProperty(a,r),n.mediaParams.set((0,i.getEtsPropName)(e),a)})),C=(0,i.curry)(((e,t,n)=>{const r=y(t,e);if(!(n.mediaParams instanceof Map)||0===r.size)return;const o=v(t,e),a=m(t.id,e);n.setDefaultValue(a,"number",o),n.setMediaProperty(a,r),n.mediaParams.set((0,i.getEtsPropName)(e),a)})),P=(0,i.curry)(((e,t,n,r)=>{const o=y(n,e,(0,i.curry)(i.getEtsEnumValue)(t));if(!(r.mediaParams instanceof Map)||0===o.size)return;const a=v(n,e,(0,i.curry)(i.getEtsEnumValue)(t)),s=m(n.id,e);r.setDefaultValue(s,t.replace(".",""),a),r.setMediaProperty(s,o),r.mediaParams.set((0,i.getEtsPropName)(e),s)})),S=(0,i.curry)(((e,t,n)=>{const r=y(t,e,i.dealWithColor);if(0===r.size)return;const o=v(t,e,i.dealWithColor),a=m(t.id,e);n.setDefaultValue(a,"Color | string",o),n.setMediaProperty(a,r),n.mediaProperties.set((0,i.getEtsPropName)(e),a)}));function k(e,t,n,r=!1){(0,i.isEmptyOrUndefined)(t)||n.set(e,r?t:`'${t}'`)}t.parseMediaVisualModel=function(e,t){!function(e,t){var n;const r=null!==(n=e.dynamicProperty.get("for"))&&void 0!==n?n:"[1]",i=y(e,"for");if(0===i.size)return;const o=m(e.id,"for"),a={for:o,key:e.dynamicProperty.get("keyGenerator")};t.setDefaultValue(o,"any[]",r),t.setMediaProperty(o,i),t.setForEachObj(a)}(e,t),function(e,t){const n=y(e,"if");if(0===n.size)return;const r=v(e,"if"),i=m(e.id,"if");t.setDefaultValue(i,"boolean",r),t.setMediaProperty(i,n),t.setIfBoolean(i)}(e,t);for(const n of N)("boolean"==typeof n[0]||n[0](e))&&n[1](e,t)};const A=(0,i.curry)(((e,t,n)=>{const r=new Map,o=t.property.get(e),a=t.dynamicProperty.get(e),s=null!=a?a:o,u=["top","bottom","left","right"];let l=0;for(const o of u){const a=`${e}-${o}`,u=t.property.get(a),f=t.dynamicProperty.get(a),p=g(t,a);let d=(0,i.isEmptyOrUndefined)(s)?"undefined":c(s);if((0,i.isEmptyOrUndefined)(u)||(d=c(u)),(0,i.isEmptyOrUndefined)(f)||(d=f),p.size>0){const e=m(t.id,a);n.setDefaultValue(e,"string",d),n.setMediaProperty(e,p),k(o,e,r,!0),l++}else k(o,d,r,!0)}l>0&&n.mediaProperties.set(e,r)})),M=(0,i.curry)(((e,t,n,r)=>{const o=y(n,e,l);if(!(r.mediaParams instanceof Map)||0===o.size)return;const a=v(n,e,l),s=m(n.id,e);r.setDefaultValue(s,t.replace(".",""),a),r.setMediaProperty(s,o),r.mediaParams.set((0,i.getEtsPropName)(e),s)})),x=(0,i.curry)(((e,t)=>t.type===e));t.isMediaProperty=function(e,t){return!s(e,I,"common")&&!s(e,I,t)&&!s(e,I,"events")};const I=new Map([["common",new Set(["keyGenerator"])],["events",new Set([...i.events])]]),N=[...[[o("width"),_("width")],[o("height"),_("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const n=new Map,r=["min-width","max-width","min-height","max-height"];for(const o of r){const r=`constraint-size-${o}`,a=y(e,r,c),s=v(e,r,c);if(a.size>0){const c=m(e.id,r);t.setDefaultValue(c,"string",s),t.setMediaProperty(c,a),k((0,i.getEtsPropName)(o),c,n,!0)}}n.size>0&&t.mediaProperties.set("constraintSize",n)}],[o("align"),b("align","Alignment.")],[o("direction"),b("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var n;const r=null!==(n=e.property.get("position"))&&void 0!==n?n:"relative",{leftValue:i,topValue:o}=d(e.property,e.dynamicProperty),{mediaPositionLeft:a,mediaPositionTop:s,mediaOffsetLeft:c,mediaOffsetTop:u}=function(e){var t,n;const r=new Map,i=new Map,o=new Map,a=new Map,s=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,c=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map,u=new Set;for(const[e]of s)u.add(e);for(const[e]of c)u.add(e);return u.forEach((t=>{var n,s,c,u;const l=null!==(s=null===(n=e.mediaProperty)||void 0===n?void 0:n.get(t))&&void 0!==s?s:new Map,f=null!==(u=null===(c=e.dynamicMediaProperty)||void 0===c?void 0:c.get(t))&&void 0!==u?u:new Map,p=l.get("position"),{leftValue:h,topValue:g}=d(l,f);"absolute"===p?("undefined"!==h&&r.set(t,h),"undefined"!==g&&i.set(t,g)):("undefined"!==h&&o.set(t,h),"undefined"!==g&&a.set(t,g))})),{mediaPositionLeft:r,mediaPositionTop:i,mediaOffsetLeft:o,mediaOffsetTop:a}}(e),l=a.size>0||s.size>0||"absolute"===r,f=c.size>0||u.size>0||"relative"===r,p=m(e.id,"positionLeft"),g=m(e.id,"positionTop"),y=m(e.id,"offsetLeft"),v=m(e.id,"offsetTop");if(0!==a.size||0!==s.size||0!==u.size||0!==c.size){if(l&&f&&(h(a,c),h(c,a),h(s,u),h(u,s)),l){const e="absolute"===r?i:"undefined",n="absolute"===r?o:"undefined";t.setDefaultValue(p,"string",e),t.setDefaultValue(g,"string",n),t.setMediaProperty(p,a),t.setMediaProperty(g,s),t.mediaProperties.set("position",new Map([["x",p],["y",g]]))}if(f){const e="relative"===r?i:"undefined",n="relative"===r?o:"undefined";t.setDefaultValue(y,"string",e),t.setDefaultValue(v,"string",n),t.setMediaProperty(y,c),t.setMediaProperty(v,u),t.mediaProperties.set("offset",new Map([["x",y],["y",v]]))}}}],[o("aspect-ratio"),T("aspect-ratio")],[o("display-priority"),T("display-priority")],[o("flex-basis"),_("flex-basis")],[o("flex-grow"),T("flex-grow")],[o("flex-shrink"),T("flex-shrink")],[o("align-self"),function(e,t){const n=y(e,"align-self",i.dealWithAlignSelf);if(0===n.size)return;const r=v(e,"align-self",i.dealWithAlignSelf),o=m(e.id,"align-self");t.setDefaultValue(o,"ItemAlign",r),t.setMediaProperty(o,n),t.mediaProperties.set("alignSelf",o)}],[o("border-style"),b("border-style","BorderStyle.")],[o("border-width"),_("border-width")],[o("border-color"),S("border-color")],[o("border-radius"),_("border-radius")],[o("background-color"),S("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const n=e.property.get("background-image-src"),r=e.property.get("background-image-repeat"),o=e.dynamicProperty.get("background-image-src"),a=e.dynamicProperty.get("background-image-repeat"),s=y(e,"background-image-src",i.dealWithSrc),c=y(e,"background-image-repeat",i.dealWithBackgroundRepeat);if(0===s.size&&0===c.size)return;let u=(0,i.dealWithSrc)(null!=n?n:"");if((0,i.isEmptyOrUndefined)(o)||(u=o),s.size>0){const n=m(e.id,"background-image-src");t.setDefaultValue(n,"string",u),t.setMediaProperty(n,s),u=n}let l="undefined";if(!(0,i.isEmptyOrUndefined)(r)){const e=(0,i.dealWithBackgroundRepeat)(r);null!=e&&""!==e&&(l=e)}if((0,i.isEmptyOrUndefined)(a)||(l=a),c.size>0){const n=m(e.id,"background-image-repeat");t.setDefaultValue(n,"string",l),t.setMediaProperty(n,c),l=n}t.mediaProperties.set("backgroundImage",u+", "+l)}],[o("background-image-size"),function(e,t){const n=y(e,"background-image-size",i.dealWithBackgroundImageSize);if(0===n.size)return;const r=v(e,"background-image-size",i.dealWithBackgroundImageSize),o=m(e.id,"background-image-size");t.setDefaultValue(o,"{ width?: string | number, height?: string | number } | ImageSize",r),t.setMediaProperty(o,n),t.mediaProperties.set("backgroundImageSize",o)}],[o("background-image-position"),function(e,t){const n=y(e,"background-image-position",i.dealWithBackgroundImagePosition);if(0===n.size)return;const r=v(e,"background-image-position",i.dealWithBackgroundImagePosition),o=m(e.id,"background-image-position");t.setDefaultValue(o,"{ x?: number | string, y?: number | string } | Alignment",r),t.setMediaProperty(o,n),t.mediaProperties.set("backgroundImagePosition",o)}],[o("opacity"),T("opacity")],[o("visibility"),b("visibility","Visibility.")],[o("enabled"),w("enabled")],[o("font-color"),S("font-color")],[o("font-size"),_("font-size")],[o("font-style"),b("font-style","FontStyle.")],[o("font-weight"),function(e,t){const n=y(e,"font-weight",i.dealWithFontWeight);if(0===n.size)return;const r=v(e,"font-weight",i.dealWithFontWeight),o=m(e.id,"font-weight");t.setDefaultValue(o,"FontWeight | string",r),t.setMediaProperty(o,n),t.mediaProperties.set("fontWeight",o)}],[o("font-family"),_("font-family")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},A("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},A("padding")]],[a("button","label"),function(e,t){const n=e.property.get("label"),r=e.dynamicProperty.get("label"),o=y(e,"label",(e=>`\`${e}\``));if(0===o.size)return;let a="undefined";(0,i.isEmptyOrUndefined)(n)||(a=`\`${n}\``),(0,i.isEmptyOrUndefined)(r)||(a=(0,i.getContentName)(a));const s=m(e.id,"label");t.setDefaultValue(s,"string",a),t.setMediaProperty(s,o),t.setMediaParams(s)}],[a("button","type"),b("type","ButtonType.")],[a("button","state-effect"),w("state-effect")],[a("divider","vertical"),w("vertical")],[a("divider","color"),S("color")],[a("divider","stroke-width"),_("stroke-width")],[a("divider","line-cap"),b("line-cap","LineCapStyle.")],[x("image"),function(e,t){var n;const r=null!==(n=e.property.get("src"))&&void 0!==n?n:"",o=e.dynamicProperty.get("src"),a=y(e,"src",c);if(0===a.size)return;let s=(0,i.dealWithSrc)(r);(0,i.isEmptyOrUndefined)(o)||(s=o);const u=m(e.id,"src");t.setDefaultValue(u,"string",s),t.setMediaProperty(u,a),t.setMediaParams(u)}],[a("image","alt"),_("alt")],[a("image","object-fit"),b("object-fit","ImageFit.")],[a("image","object-repeat"),b("object-repeat","ImageRepeat.")],[a("image","interpolation"),b("interpolation","ImageInterpolation.")],[a("image","render-mode"),b("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let n=e.property.get("source-size-width"),r=e.property.get("source-size-height");const o=e.dynamicProperty.get("source-size-width"),a=e.dynamicProperty.get("source-size-height"),s=p(e,"source-size-width","source-size-height"),c=p(e,"source-size-height","source-size-width");if(0===s.size)return;n="0"===n||(0,i.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),r="0"===r||(0,i.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),(0,i.isEmptyOrUndefined)(o)||(n=o),(0,i.isEmptyOrUndefined)(a)||(r=a);const u=m(e.id,"source-size-width"),l=m(e.id,"source-size-height");t.setDefaultValue(u,"number",n),t.setDefaultValue(l,"number",r),t.setMediaProperty(u,s),t.setMediaProperty(l,c);const f=new Map([["width",u],["height",l]]);t.mediaProperties.set("sourceSize",f)}],[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const n=e.property.get("value"),r=e.dynamicProperty.get("value"),o=y(e,"value");if(!(t.mediaParams instanceof Map)||0===o.size)return;let a=null!=n?n:"0";(0,i.isEmptyOrUndefined)(r)||(a=r);const s=m(e.id,"value");t.setDefaultValue(s,"number",a),t.setMediaProperty(s,o),t.mediaParams.set("value",s)}],[a("progress","total"),C("total")],[a("progress","style"),P("style","ProgressStyle.")],[a("progress","color"),S("color")],[a("slider","value"),C("value")],[a("slider","min"),C("min")],[a("slider","max"),C("max")],[a("slider","step"),C("step")],[a("slider","style"),P("style","SliderStyle.")],[a("slider","block-color"),S("block-color")],[a("slider","track-color"),S("track-color")],[a("slider","selected-color"),S("selected-color")],[a("slider","show-steps"),w("show-steps")],[a("slider","show-tips"),w("show-tips")],[a("text","content"),function(e,t){const n=e.property.get("content"),r=e.dynamicProperty.get("content"),o=y(e,"content",(e=>`\`${e}\``));if(0===o.size)return;let a="''";(0,i.isEmptyOrUndefined)(n)||(a=`\`${n}\``),(0,i.isEmptyOrUndefined)(r)||(a=(0,i.getContentName)(r));const s=m(e.id,"content");t.setDefaultValue(s,"string",a),t.setMediaProperty(s,o),t.setMediaParams(s)}],[a("text","text-align"),b("text-align","TextAlign.")],[a("text","text-overflow"),function(e,t){const n=y(e,"text-overflow",f);if(0===n.size)return;const r=v(e,"text-overflow",f),i=m(e.id,"text-overflow");t.setDefaultValue(i,"TextOverflow",r),t.setMediaProperty(i,n),t.mediaProperties.set("textOverflow",new Map([["overflow",i]]))}],[a("text","max-lines"),T("max-lines")],[a("text","line-height"),_("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const n=y(e,"decoration-type",(0,i.curry)(i.getEtsEnumValue)("TextDecorationType.")),r=y(e,"decoration-color",i.dealWithColor);if(0===n.size&&0===r.size)return;let o=v(e,"decoration-type",(0,i.curry)(i.getEtsEnumValue)("TextDecorationType.")),a=v(e,"decoration-color",i.dealWithColor);if(n.size>0){const r=m(e.id,"decoration-type");t.setDefaultValue(r,"TextDecorationType",o),t.setMediaProperty(r,n),o=r}if(r.size>0){const n=m(e.id,"decoration-color");t.setDefaultValue(n,"Color | string",a),t.setMediaProperty(n,r),a=n}const s=new Map([["type",o]]);t.mediaProperties.set("decoration",s),"undefined"!==a&&s.set("color",a)}],[a("text","baseline-offset"),_("baseline-offset")],[a("text","text-case"),b("text-case","TextCase.")],[a("column","space"),E("space")],[a("column","align-items-column"),function(e,t){const n=y(e,"align-items-column",i.dealWithColumnAlignItems);if(0===n.size)return;const r=v(e,"align-items-column",i.dealWithColumnAlignItems),o=m(e.id,"align-items-column");t.setDefaultValue(o,"HorizontalAlign",r),t.setMediaProperty(o,n),t.mediaProperties.set("alignItems",o)}],[a("row","space"),E("space")],[a("row","align-items-row"),function(e,t){const n=y(e,"align-items-row",i.dealWithRowAlignItems);if(0===n.size)return;const r=v(e,"align-items-row",i.dealWithRowAlignItems),o=m(e.id,"align-items-row");t.setDefaultValue(o,"VerticalAlign",r),t.setMediaProperty(o,n),t.mediaProperties.set("alignItems",o)}],[a("flex","flex-direction"),function(e,t){const n=y(e,"flex-direction",(0,i.curry)(i.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const r=v(e,"flex-direction",(0,i.curry)(i.getEtsEnumValue)("FlexDirection.")),o=m(e.id,"flex-direction");t.setDefaultValue(o,"FlexDirection",r),t.setMediaProperty(o,n),t.mediaParams.set("direction",o)}],[a("flex","wrap"),function(e,t){const n=y(e,"wrap",i.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===n.size)return;const r=v(e,"wrap",i.dealWithWrap),o=m(e.id,"wrap");t.setDefaultValue(o,"FlexWrap",r),t.setMediaProperty(o,n),t.mediaParams.set("wrap",o)}],[a("flex","justify-content"),M("justify-content","FlexAlign.")],[a("flex","align-items-flex"),function(e,t){const n=y(e,"align-items-flex",i.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===n.size)return;const r=v(e,"align-items-flex",i.dealWithFlexAlignItems),o=m(e.id,"align-items-flex");t.setDefaultValue(o,"ItemAlign",r),t.setMediaProperty(o,n),t.mediaParams.set("alignItems",o)}],[a("flex","align-content"),M("align-content","FlexAlign.")],[a("list","space-list"),function(e,t){const n=y(e,"space-list");if(!(t.mediaParams instanceof Map)||0===n.size)return;const r=v(e,"space-list"),i=m(e.id,"space-list");t.setDefaultValue(i,"number",r),t.setMediaProperty(i,n),t.mediaParams.set("space",i)}],[a("list","initial-index"),C("initial-index")],[a("list","list-direction"),b("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const n=[["divider-stroke-width",c],["divider-color",i.dealWithColor],["divider-start-margin",c],["divider-end-margin",c]];let r=0;const o=new Map;for(const[a,s]of n){const n=y(e,a,s),c=(0,i.getEtsPropName)(a.replace("divider-",""));let u=v(e,a,s);if("undefined"===u&&"divider-stroke-width"===a&&(u="0"),n.size>0){const i=m(e.id,a);t.setDefaultValue(i,"string",u),t.setMediaProperty(i,n),u=i,r++}o.set(c,u)}r>0&&t.mediaProperties.set("divider",o)}],[a("list","edit-mode"),w("edit-mode")],[a("list","edge-effect"),b("edge-effect","EdgeEffect.")],[a("list","chain-animation"),w("chain-animation")],[a("list-item","sticky"),b("sticky","Sticky.")],[a("list-item","editable"),w("editable")],[a("swiper","index"),T("index")],[a("swiper","auto-play"),w("auto-play")],[a("swiper","interval"),T("interval")],[a("swiper","indicator"),w("indicator")],[a("swiper","loop"),w("loop")],[a("swiper","duration"),T("duration")],[a("swiper","vertical"),w("vertical")],[a("swiper","item-space"),_("item-space")],[a("swiper","cached-count"),T("cached-count")],[a("swiper","disable-swipe"),w("disable-swipe")],[a("text-input","placeholder"),E("placeholder")],[a("text-input","textInput-type"),function(e,t){const n=y(e,"textInput-type",(0,i.curry)(i.getEtsEnumValue)("InputType."));if(0===n.size)return;const r=v(e,"textInput-type",(0,i.curry)(i.getEtsEnumValue)("InputType.")),o=m(e.id,"textInput-type");t.setDefaultValue(o,"InputType",r),t.setMediaProperty(o,n),t.mediaProperties.set("type",o)}],[a("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const n=[["size","string | number",c],["weight","number | FontWeight",u],["family","string",c],["style","FontStyle",(0,i.curry)(i.getEtsEnumValue)("FontStyle.")]];let r=0;const o=new Map;for(const[i,a,s]of n){const n=`placeholderFont-${i}`,c=y(e,n,s);let u=v(e,n,s);if(c.size>0){const i=m(e.id,n);t.setDefaultValue(i,a,u),t.setMediaProperty(i,c),u=i,r++}o.set(i,u)}r>0&&t.mediaProperties.set("placeholderFont",o)}],[a("text-input","enterKeyType"),b("enterKeyType","EnterKeyType.")],[a("text-input","caretColor"),S("caretColor")],[a("text-input","maxLength"),T("maxLength")]]},973:(e,t)=>{"use strict";function n(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),i=n(((e,t,n)=>n.type===e&&(n.property.has(t)||n.dynamicProperty.has(t))));function o(e,t,n){const r=t.dynamicProperty.get(e);return void 0!==r&&""!==r.trim()&&(n.properties.set(m(e),r),!0)}const a=n(((e,t,n)=>{if(o(e,t,n))return;const r=t.property.get(e);void 0!==r&&n.properties.set(m(e),`'${r}'`)}));function s(e){return void 0===e||""===e}t.isEmptyOrUndefined=s;const c=n(((e,t,n)=>{if(o(e,t,n))return;const r=t.property.get(e);s(r)||n.properties.set(m(e),r)})),u=n(((e,t,n)=>{if(o(e,t,n))return;const r=t.property.get(e);s(r)||n.properties.set(m(e),r)})),l=n(((e,t,n,r)=>{if(o(e,n,r))return;const i=n.property.get(e);s(i)||r.properties.set(m(e),v(t,i))}));function f(e,t,n){const r=t.dynamicProperty.get(e);return void 0!==r&&""!==r.trim()&&n.params instanceof Map&&(n.params.set(m(e),r),!0)}const p=n(((e,t,n)=>{if(f(e,t,n))return;const r=t.property.get(e);void 0!==r&&n.params instanceof Map&&n.params.set(m(e),`'${r}'`)})),d=n(((e,t,n)=>{if(f(e,t,n))return;const r=t.property.get(e);!s(r)&&n.params instanceof Map&&n.params.set(m(e),r)})),h=n(((e,t,n,r)=>{if(f(e,n,r))return;const i=n.property.get(e);!s(i)&&r.params instanceof Map&&r.params.set(m(e),v(t,i))})),g=n(((e,t,n)=>{if(o(e,t,n))return;let r=t.property.get(e);s(r)||(r=_(r),n.properties.set(m(e),r))}));function y([e,...t]){return(null==e?void 0:e.toUpperCase())+t.join("")}function m(e){const t=e.split("-");let n=t[0];for(let e=1;ee[0].toUpperCase()+e.slice(1))).join(""));const r=void 0!==e.dynamicProperty.get("for")?{for:e.dynamicProperty.get("for"),key:e.dynamicProperty.get("keyGenerator")}:null;n.setForEachObj(r);const i=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===i?n.setIfBoolean(null):n.setIfBoolean(i);for(const t of N)("boolean"==typeof t[0]||t[0](e))&&t[1](e,n);!function(e,n){for(let r of t.events){const t=e.property.get(r);"onDisappear"===r&&(r="onDisAppear"),void 0!==t&&""!==t&&n.properties.set(r,t)}}(e,n)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged"],t.firstUpperCase=y,t.getEtsPropName=m,t.getEtsEnumValue=v,t.dealWithColor=_;const w=n(((e,t,n,r)=>{if(!(r.params instanceof Map))return;const i=n.dynamicProperty.get(e);if(!s(i))return void r.params.set(m(e),i);const o=n.property.get(e);if(s(o))return;let a=v(t,o);"flex-start"===o?a=t+"Start":"flex-end"===o&&(a=t+"End"),r.params.set(m(e),a)})),b=n(((e,t)=>t.type===e));function E(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?`'${e}'`:e}function C(e){let t=v("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function P(e){let t=v("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function S(e){let t=v("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t}function k(e){let t=v("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}function A(e){let t=v("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function M(e){return["lighter","normal","regular","medium","bold","bolder"].includes(e)?v("FontWeight.",e):e}function x(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return v("ImageRepeat.",t)}function I(e){return e.startsWith("$r(")?e:`\`\${${e}}\``}t.dealWithSrc=E,t.dealWithAlignSelf=C,t.dealWithFlexAlignItems=P,t.dealWithWrap=S,t.dealWithRowAlignItems=k,t.dealWithColumnAlignItems=A,t.dealWithFontWeight=M,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: '${t[1]}', y: '${t[4]}' }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return v("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: '${t[1]}', height: '${t[5]}' }`:`{ width: '${t[1]}' }`:void 0},t.dealWithBackgroundRepeat=x,t.getContentName=I;const N=[[r("width"),a("width")],[r("height"),a("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const n=new Map,r=e.getProperty("constraint-size-min-width"),i=e.getProperty("constraint-size-max-width"),o=e.getProperty("constraint-size-min-height"),a=e.getProperty("constraint-size-max-height");T("minWidth",r,n,e.dynamicProperty.has("constraint-size-min-width")),T("maxWidth",i,n,e.dynamicProperty.has("constraint-size-max-width")),T("minHeight",o,n,e.dynamicProperty.has("constraint-size-min-height")),T("maxHeight",a,n,e.dynamicProperty.has("constraint-size-max-height")),n.size>0&&t.properties.set("constraintSize",n)}],[r("align"),l("align","Alignment.")],[r("direction"),l("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const n="absolute"===e.property.get("position")?"position":"offset",r=e.property.get("left"),i=e.property.get("top"),o=e.dynamicProperty.get("left"),a=e.dynamicProperty.get("top");if(s(o)&&s(a)&&s(r)&&s(i))return;const c=new Map([["x",`'${null!=r?r:"0"}'`],["y",`'${null!=i?i:"0"}'`]]);s(o)||c.set("x",o),s(a)||c.set("y",a),t.properties.set(n,c)}],[r("aspect-ratio"),c("aspect-ratio")],[r("display-priority"),c("display-priority")],[r("flex-basis"),a("flex-basis")],[r("flex-grow"),c("flex-grow")],[r("flex-shrink"),c("flex-shrink")],[r("align-self"),function(e,t){const n=e.dynamicProperty.get("align-self");if(!s(n))return void t.properties.set("alignSelf",n);const r=e.property.get("align-self");if(s(r))return;const i=C(r);t.properties.set("alignSelf",i)}],[r("border-style"),l("border-style","BorderStyle.")],[r("border-width"),a("border-width")],[r("border-color"),g("border-color")],[r("border-radius"),a("border-radius")],[r("background-color"),g("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const n=e.getProperty("background-image-src"),r=e.getProperty("background-image-repeat");if(s(n)&&s(r))return;let i=E(null!=n?n:"");if(!s(r)){const e=x(r);null!=e&&""!==e&&(i=i+", "+e)}t.properties.set("backgroundImage",i)}],[r("background-image-size"),function(e,t){const n=e.getProperty("background-image-size");if(s(n))return;if(new Set(["Cover","Contain","Auto"]).has(n))return void t.properties.set("backgroundImageSize",v("ImageSize.",n));const r=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==r&&(void 0!==r[5]?t.properties.set("backgroundImageSize",new Map([["width",`'${r[1]}'`],["height",`'${r[5]}'`]])):t.properties.set("backgroundImageSize",new Map([["width",`'${r[1]}'`]])))}],[r("background-image-position"),function(e,t){const n=e.getProperty("background-image-position");if(s(n))return;if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(n))return void t.properties.set("backgroundImagePosition","Alignment."+n);const r=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==r&&t.properties.set("backgroundImagePosition",new Map([["x",`'${r[1]}'`],["y",`'${r[4]}'`]]))}],[r("opacity"),c("opacity")],[r("visibility"),l("visibility","Visibility.")],[r("enabled"),u("enabled")],[r("font-color"),g("font-color")],[r("font-size"),a("font-size")],[r("font-style"),l("font-style","FontStyle.")],[r("font-weight"),function(e,t){const n=e.getProperty("font-weight");if(s(n))return;const r=M(n);t.properties.set("fontWeight",r)}],[r("font-family"),a("font-family")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var n,r,i,o;const a=new Map,s=e.getProperty("margin"),c=null!==(n=e.getProperty("margin-top"))&&void 0!==n?n:s,u=null!==(r=e.getProperty("margin-bottom"))&&void 0!==r?r:s,l=null!==(i=e.getProperty("margin-left"))&&void 0!==i?i:s,f=null!==(o=e.getProperty("margin-right"))&&void 0!==o?o:s,p=e.property.has("margin-top"),d=e.property.has("margin-bottom"),h=e.property.has("margin-left"),g=e.property.has("margin-right"),y=e.dynamicProperty.has("margin"),m=e.dynamicProperty.has("margin-top"),v=e.dynamicProperty.has("margin-bottom"),_=e.dynamicProperty.has("margin-left"),w=e.dynamicProperty.has("margin-right");T("top",c,a,m||!p&&y),T("bottom",u,a,v||!d&&y),T("left",l,a,_||!h&&y),T("right",f,a,w||!g&&y),a.size>0&&t.properties.set("margin",a)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var n,r,i,o;const a=new Map,s=e.getProperty("padding"),c=null!==(n=e.getProperty("padding-top"))&&void 0!==n?n:s,u=null!==(r=e.getProperty("padding-bottom"))&&void 0!==r?r:s,l=null!==(i=e.getProperty("padding-left"))&&void 0!==i?i:s,f=null!==(o=e.getProperty("padding-right"))&&void 0!==o?o:s,p=e.property.has("padding-top"),d=e.property.has("padding-bottom"),h=e.property.has("padding-left"),g=e.property.has("padding-right"),y=e.dynamicProperty.has("padding"),m=e.dynamicProperty.has("padding-top"),v=e.dynamicProperty.has("padding-bottom"),_=e.dynamicProperty.has("padding-left"),w=e.dynamicProperty.has("padding-right");T("top",c,a,m||!p&&y),T("bottom",u,a,v||!d&&y),T("left",l,a,_||!h&&y),T("right",f,a,w||!g&&y),a.size>0&&t.properties.set("padding",a)}],[i("button","label"),function(e,t){const n=e.dynamicProperty.get("label");if(!s(n))return void t.setParams(I(n));const r=e.property.get("label");"string"==typeof r&&t.setParams(`\`${r}\``)}],[i("button","type"),l("type","ButtonType.")],[i("button","state-effect"),u("state-effect")],[i("divider","vertical"),u("vertical")],[i("divider","color"),g("color")],[i("divider","stroke-width"),a("stroke-width")],[i("divider","line-cap"),l("line-cap","LineCapStyle.")],[b("image"),function(e,t){var n;const r=e.dynamicProperty.get("src");if(!s(r))return void t.setParams(r);const i=null!==(n=e.property.get("src"))&&void 0!==n?n:"";t.setParams(E(i))}],[i("image","alt"),a("alt")],[i("image","object-fit"),l("object-fit","ImageFit.")],[i("image","object-repeat"),l("object-repeat","ImageRepeat.")],[i("image","interpolation"),l("interpolation","ImageInterpolation.")],[i("image","render-mode"),l("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let n=e.getProperty("source-size-width"),r=e.getProperty("source-size-height");if(s(n)&&s(r))return;const i=e.dynamicProperty.has("source-size-width"),o=e.dynamicProperty.has("source-size-height");n="0"===n||s(n)?"0":i?n:n.substring(0,n.length-2),r="0"===r||s(r)?"0":o?r:r.substring(0,r.length-2);const a=new Map([["width",n],["height",r]]);t.properties.set("sourceSize",a)}],[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var n;f("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(n=e.getProperty("value"))&&void 0!==n?n:"0")}],[i("progress","total"),d("total")],[i("progress","style"),h("style","ProgressStyle.")],[i("progress","color"),g("color")],[i("slider","value"),d("value")],[i("slider","min"),d("min")],[i("slider","max"),d("max")],[i("slider","step"),d("step")],[i("slider","style"),h("style","SliderStyle.")],[i("slider","block-color"),g("block-color")],[i("slider","track-color"),g("track-color")],[i("slider","selected-color"),g("selected-color")],[i("slider","show-steps"),u("show-steps")],[i("slider","show-tips"),u("show-tips")],[i("text","content"),function(e,t){const n=e.property.get("content"),r=e.dynamicProperty.get("content");s(r)?"string"==typeof n&&t.setParams(`\`${n}\``):t.setParams(I(r))}],[i("text","text-align"),l("text-align","TextAlign.")],[i("text","text-overflow"),function(e,t){const n=e.dynamicProperty.get("text-overflow");if(!s(n))return void t.properties.set("textOverflow",new Map([["overflow",n]]));const r=e.property.get("text-overflow");s(r)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+y(r)]]))}],[i("text","max-lines"),c("max-lines")],[i("text","line-height"),a("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const n=e.property.get("decoration-type"),r=e.dynamicProperty.get("decoration-type"),i=e.property.get("decoration-color"),o=e.dynamicProperty.get("decoration-color");if(s(n)&&s(i)&&s(r)&&s(o))return;const a=new Map;s(r)?a.set("type",s(n)?"TextDecorationType.None":v("TextDecorationType.",n)):a.set("type",r),t.properties.set("decoration",a),s(o)?s(i)||a.set("color",_(i)):a.set("color",o)}],[i("text","baseline-offset"),a("baseline-offset")],[i("text","text-case"),l("text-case","TextCase.")],[i("column","space"),p("space")],[i("column","align-items-column"),function(e,t){const n=e.dynamicProperty.get("align-items-column");if(!s(n))return void t.properties.set("alignItems",n);const r=e.property.get("align-items-column");if(s(r))return;const i=A(r);t.properties.set("alignItems",i)}],[i("row","space"),p("space")],[i("row","align-items-row"),function(e,t){const n=e.dynamicProperty.get("align-items-row");if(!s(n))return void t.properties.set("alignItems",n);const r=e.property.get("align-items-row");if(s(r))return;const i=k(r);t.properties.set("alignItems",i)}],[i("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const n=e.dynamicProperty.get("flex-direction");if(!s(n))return void t.params.set("direction",n);const r=e.property.get("flex-direction");s(r)||t.params.set("direction",v("FlexDirection.",r))}],[i("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const n=e.dynamicProperty.get("wrap");if(!s(n))return void t.params.set("wrap",n);const r=e.property.get("wrap");if(s(r))return;const i=S(r);t.params.set("wrap",i)}],[i("flex","justify-content"),w("justify-content","FlexAlign.")],[i("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const n=e.dynamicProperty.get("align-items-flex");if(!s(n))return void t.params.set("alignItems",n);const r=e.property.get("align-items-flex");if(s(r))return;const i=P(r);t.params.set("alignItems",i)}],[i("flex","align-content"),w("align-content","FlexAlign.")],[i("list","space-list"),function(e,t){const n=e.dynamicProperty.get("space-list");if(void 0!==n&&""!==n.trim()&&t.params instanceof Map)return void t.params.set("space",n);const r=e.getProperty("space-list");!s(r)&&t.params instanceof Map&&t.params.set("space",r)}],[i("list","initial-index"),d("initial-index")],[i("list","list-direction"),l("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const n=e.property.get("divider-stroke-width"),r=e.dynamicProperty.get("divider-stroke-width"),i=new Map([["strokeWidth",`'${null!=n?n:"0"}'`]]);s(r)||i.set("strokeWidth",r);const o=e.property.get("divider-color"),a=e.dynamicProperty.get("divider-color"),c=e.property.get("divider-start-margin"),u=e.dynamicProperty.get("divider-start-margin"),l=e.property.get("divider-end-margin"),f=e.dynamicProperty.get("divider-end-margin");s(a)?s(o)||i.set("color",_(o)):i.set("color",a),s(u)?s(c)||i.set("startMargin",`'${c}'`):i.set("startMargin",u),s(f)?s(l)||i.set("endMargin",`'${l}'`):i.set("endMargin",f),t.properties.set("divider",i)}],[i("list","edit-mode"),u("edit-mode")],[i("list","edge-effect"),l("edge-effect","EdgeEffect.")],[i("list","chain-animation"),u("chain-animation")],[i("list-item","sticky"),l("sticky","Sticky.")],[i("list-item","editable"),u("editable")],[i("swiper","index"),c("index")],[i("swiper","auto-play"),u("auto-play")],[i("swiper","interval"),c("interval")],[i("swiper","indicator"),u("indicator")],[i("swiper","loop"),u("loop")],[i("swiper","duration"),c("duration")],[i("swiper","vertical"),u("vertical")],[i("swiper","item-space"),a("item-space")],[i("swiper","cached-count"),c("cached-count")],[i("swiper","disable-swipe"),u("disable-swipe")],[i("text-input","placeholder"),p("placeholder")],[i("text-input","textInput-type"),function(e,t){const n=e.dynamicProperty.get("textInput-type");if(!s(n))return void t.properties.set("type",n);const r=e.property.get("textInput-type");s(r)||t.properties.set("type","InputType."+r)}],[i("text-input","placeholderColor"),g("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const n=e.property.get("placeholderFont-size"),r=e.dynamicProperty.get("placeholderFont-size"),i=e.property.get("placeholderFont-weight"),o=e.dynamicProperty.get("placeholderFont-weight"),a=e.property.get("placeholderFont-family"),c=e.dynamicProperty.get("placeholderFont-family"),u=e.property.get("placeholderFont-style"),l=e.dynamicProperty.get("placeholderFont-style"),f=new Map;s(r)?f.set("size",s(n)?30:parseInt(n)):f.set("size",r),s(o)?s(i)?f.set("weight",400):f.set("weight",isNaN(Number(i))?v("FontWeight.",i):i):f.set("weight",o),s(c)?f.set("family",s(a)?"'sans-serif'":`'${a}'`):f.set("family",c),s(l)?f.set("style",s(u)?"FontStyle.Normal":v("FontStyle.",u)):f.set("style",l),t.properties.set("placeholderFont",f)}],[i("text-input","enterKeyType"),l("enterKeyType","EnterKeyType.")],[i("text-input","caretColor"),g("caretColor")],[i("text-input","maxLength"),c("maxLength")]]},243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const r=n(117);class i extends r.ASTNode{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.content=n}}t.Tag=i;class o extends r.ASTNode{constructor(e,t,n,r){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=n,this.mediaQuery=r}}t.Style=o},573:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const r=n(243),i=n(334);class o{constructor(e){this.cache=e}visit(e){e instanceof r.Tag?this.genTag(e):e instanceof r.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===o.instance?o.instance=new o(e):o.instance.setCache(e),o.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(i.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let n="";for(const t of e)n+='"'===t?""":"\n"===t?" ":t;this.cache.concat(i.TokenClass.SPACE,t,i.TokenClass.ASSIGN,i.TokenClass.LQUOTE,n,i.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(i.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(i.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const n of e.content)t+="<"===n?"<":n;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(i.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(i.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn());this.cache.concat(i.TokenClass.END_TAG_START,e.tagName,i.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(i.TokenClass.SPACE,e.mediaQuery,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(i.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,i.TokenClass.COLON,i.TokenClass.SPACE,e,i.TokenClass.SEMICOLON,i.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(i.TokenClass.RBRA,i.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(i.TokenClass.RBRA,i.TokenClass.NEW_LINE)),this.cache.concat(i.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=o,o.instance=void 0},844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const r=n(243),i=n(571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let n="";for(let[r,o]of e.property)(0,i.isAttribute)(r,e.type)?("string"!=typeof o&&(o=JSON.stringify(o)),t.set(r,o)):(0,i.isContent)(r)&&(n=o);if(e.children.length>0){n=[];for(const t of e.children)n.push(t.accept(this))}const o=new r.Tag(e.type,t,n);return"wrapper"===t.get("id")?new r.Tag("div",new Map,[o]):o}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const n=t=>{const n=new Map;for(const[r,o]of t)(0,i.isStyle)(r,e.type)&&n.set(r,o);return n},o=n(e.property);o.size>0&&this.styles.push(new r.Style("IDStyle",e.id,o)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,i)=>{const o=n(t);o.size>0&&this.styles.push(new r.Style("IDStyle",e.id,o,i))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},55:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const r=n(573),i=n(862);t.genFAHML=function(e){const t=r.ASTNodeGenerator.getMethodGen(new i.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=r.ASTNodeGenerator.getMethodGen(new i.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},571:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const r=n(904),i=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],o=["font-size","font-family","font-style","font-weight"],a=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...o],s=["allow-scale","text-decoration","color",...o],c=["text-color","allow-scale","icon-width","icon-height","radius",...o],u=["texton-color","textoff-color","text-padding","allow-scale",...o],l=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...o],f=["text-color","allow-scale","letter-spacing",...o];t.styleMap=new Map([["common",new Set([...i])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...a])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...c])],["switch",new Set([...u])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...l])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...f])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const p=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])]]),h=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])]]);function g(e,t,n){const r=t.get(n);return void 0!==r&&r.has(e)}function y(e,n){return g(e,t.styleMap,"common")||g(e,t.styleMap,n)}function m(e,t){return(0,r.getDomain)()===r.Domain.ETS?g(e,h,"common")||g(e,h,t):v(e,t)||_(e,t)}function v(e,t){return g(e,p,"common")||g(e,p,t)}function _(e,t){return g(e,d,"common")||g(e,d,t)}t.isStyle=y,t.isAttribute=m,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!y(e,t)&&!m(e,t)},t.isData=v,t.isEvent=_},334:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(n=t.TokenClass||(t.TokenClass={}))[n.IDENTIFIER=0]="IDENTIFIER",n[n.STRING_LITERAL=1]="STRING_LITERAL",n[n.NUMBER=2]="NUMBER",n[n.CHARACTER=3]="CHARACTER",n[n.EOF=4]="EOF",n[n.INVALID=5]="INVALID",n.EMPTY_DATA="empty",n.ASSIGN="=",n.NEW_LINE="\n",n.CARRIAGE_RETURN="\r",n.INDENT=" ",n.SPACE=" ",n.LQUOTE='"',n.RQUOTE='"',n.TAG_START="<",n.TAG_END=">",n.EMPTY_TAG_END="/>",n.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},294:(e,t)=>{"use strict";function n(e){const t=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let n="";for(let t=0;t=4&&(n=n.substr(n.length/2-2,4)),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0,t.getDataName=function(e){if("string"==typeof e&&e.startsWith("{{")&&e.endsWith("}}"))return e.substring(2,e.length-2)},t.removeFromArray=function(e,t){const n=[...e];return t.forEach((e=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)})),n},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`}},207:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const r=n(891),i=n(945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,n,r){const o=new Map;void 0!==n&&Object.keys(n).forEach((e=>{o.set(e,n[e])}));const a=new Map;void 0!==r&&Object.keys(r).forEach((e=>{a.set(e,r[e])})),this.getFormModel().actions.set(e,new i.FormAction(t,o,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const n=void 0===e.params?e.params:this.objectToMap(e.params),r=void 0===e.want?e.want:this.objectToMap(e.want),o=new i.FormAction(e.actionType,n,r);this.getFormModel().actions.set(t,o)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var n,r;const o=null!==(n=this.getFormModel().actions.get(e))&&void 0!==n?n:new i.FormAction(e),a=null!==(r=o.params)&&void 0!==r?r:new Map;Object.keys(t).forEach((e=>{a.set(e,t[e])})),o.params=a},removeActionParam(e,t){var n;const r=this.getFormModel().actions.get(e);null===(n=null==r?void 0:r.params)||void 0===n||n.delete(t)},getFormModel:()=>(0,r.getInstance)().formData,codegenToJson:function(){const e=(0,r.getInstance)().formData,t=this.mapToObject(e.data),n={actions:{},data:{}};return n.data=t,e.actions.forEach(((e,t)=>{n.actions[t]={},n.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(n.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(n.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(n,null,4)},clear(){(0,r.getInstance)().formData.data.clear(),(0,r.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((n,r)=>{t.set(n,e[n])})),t}}},945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,n){this.action=e,this.params=t,this.want=n}}},509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const r=n(891),i=n(933),o=n(571),a=n(282),s=n(945),c=n(977),u=new Map;function l(e){u.set("textMap",new Map);const t=f(null!=e?e:(0,r.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(h(u))})}function f(e){const t=Array.from(e.property).filter((t=>(0,o.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const n=Array.from(e.property).filter((t=>(0,o.isStyle)(t[0],e.type)));let r=a.TagTypeMap.get(e.type);void 0===r&&(r="Base");let i=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof i){const t=u.get("textMap");t instanceof Map&&t.set(e.id,i)}i=e.children.map((e=>f(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:n,type:r,content:i}}function p(e,t){let n;if(t instanceof Map){const r=t.get("textMap");r instanceof Map&&(n=r.get(e.id))}const r=new i.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof n&&r.property.set("content",n),r.property.delete("id"),"string"==typeof e.content&&r.property.set("content",e.content),Array.isArray(e.content)&&(r.children=e.content.map((e=>p(e,t)))),r}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[n,r]of e)t.set(n,d(r));return t}return e}function h(e){if(e instanceof Map){const t=["$$map"];for(const[n,r]of e)t.push([n,h(r)]);return t}return e}t.serializeForVersion1=l,t.visualToRootContent=function(e){try{return l(JSON.parse(e,c.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),n=JSON.parse(t.content);let r='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(r=JSON.parse(t.extraData));const i=p(n,d(r));return i.property.has("flex-direction")||i.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:i,formData:new s.FormModel},c.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),n=JSON.parse(t.content);let i='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(i=JSON.parse(t.extraData)),(0,r.getInstance)().visualModel=p(n,d(i)),(0,r.getInstance)().visualModel.property.has("flex-direction")||(0,r.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=void 0;const r=n(933),i=n(945),o=n(904),a={document:{VisualVersion:"12",type:"FA"},visualModel:new r.VisualModel({type:"div",id:"wrapper"}),formData:new i.FormModel};t.getInstance=function(){return a},t.setInstance=function(e){for(const t in a)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=e[t]);const t=a.document.type;(0,o.setDomain)("ETS"===t?o.Domain.ETS:"FORM"===t?o.Domain.FORM:o.Domain.FA)}},977:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.deserialize=t.serialize=void 0;const r=n(933),i=n(891),o=n(509);function a(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof r.VisualModel){const e=new r.VisualModel({type:"none"}),n={};for(const r in e)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return{dataType:"VisualModel",value:n}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new r.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,o.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,i.getInstance)(),a,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,o.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,i.setInstance)(t)},t.replacer=a,t.reviver=s},933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const n="-visual";t.VisualModel=class{constructor(e){if(this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(n)&&(e.type=e.type.substring(0,e.type.length-n.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(784),i=n(891),o=n(977),a=n(844),s=n(55),c=n(207),u=n(413),l=n(435),f=n(486),p={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function d(e,n){var r;try{(0,o.deserialize)(e);const t=(0,i.getInstance)().document.VisualVersion,r=/^([1-9]+[0-9]*)$/;if(void 0===t)n.errorType="versionError";else{const e=t.match(r);(null===e||parseInt(e[1])>12)&&(n.errorType="versionError")}}catch(e){n.errorType="fileError"}""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed")}e.genHmlAndCss=function(e){const n={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(d(e,n),""!==n.errorType)return n.hmlCss.hml="",n.hmlCss.css="",n;try{const e=function(e){const t={hml:"",css:"",json:""},n=new a.HMLBridge,r=e.accept(n),i=(0,s.genFAHML)(r);t.hml=n.getErrorCount()>0?"error":i;const o=new a.CSSBridge,c=e.accept(o),u=(0,s.genFACSS)(c);return t.css=o.getErrorCount()>0?"error":u,t}((0,i.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(n.errorType="codegenError"),n.hmlCss=e,"FORM"===(0,i.getInstance)().document.type&&(n.hmlCss.json=c.formManager.codegenToJson())}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=t.errorMap.get(n.errorType),n.hmlCss.hml="",n.hmlCss.css=""),n},e.genETS=function(e){var n;const r={ets:(0,f.cloneDeep)(p),errorType:"",errorMessage:""};if(d(e,r),""!==r.errorType)return r.ets=(0,f.cloneDeep)(p),r;try{const e=function(e){const t=new u.ETSBridge,n=e.accept(t),r=(new l.StringWriter).genETS(n);return t.getErrorCount()>0?"error":r}((0,i.getInstance)().visualModel);"error"===e&&(r.errorType="codegenError"),r.ets=e}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed",r.ets=(0,f.cloneDeep)(p)),r}})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/compiler/components/web.json b/compiler/components/web.json index 4cb5105b83bcf749f2287b7548af205e5f3688a6..be881ee057b67f1a0522feaecffc33d5519de02a 100644 --- a/compiler/components/web.json +++ b/compiler/components/web.json @@ -7,6 +7,6 @@ "onPageEnd", "onPageBegin", "onProgressChange", "onTitleReceive", "onGeolocationHide", "onGeolocationShow", "onRequestSelected", "javaScriptAccess", "fileAccess", "onAlert", "onBeforeUnload", "onlineImageAccess", "domStorageAccess", "imageAccess", "mixedMode", "zoomAccess", "geolocationAccess", "javaScriptProxy", - "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart" + "userAgent", "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart" ] } \ No newline at end of file diff --git a/compiler/main.js b/compiler/main.js index aa25d1a8b5df60a8ad647e0e21c7d24ab7d2965a..a6ecac25d28f78ab1817f57d88c5a5cdffd67e5a 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -34,7 +34,8 @@ const staticPreviewPage = process.env.aceStaticPreview; const abilityConfig = { abilityType: process.env.abilityType || 'page', abilityEntryFile: null, - projectAbilityPath: [] + projectAbilityPath: [], + testRunnerFile: [] }; const projectConfig = {}; const resources = { @@ -61,10 +62,13 @@ function loadEntryObj(projectConfig) { initProjectConfig(projectConfig); if (process.env.aceManifestPath) { setEntryFile(projectConfig); + setFaTestRunnerFile(projectConfig); } if (process.env.aceModuleJsonPath) { setAbilityPages(projectConfig) + setStageTestRunnerFile(projectConfig); } + if(staticPreviewPage) { projectConfig.entryObj['./' + staticPreviewPage] = projectConfig.projectPath + path.sep + staticPreviewPage + '.ets?entry'; @@ -147,6 +151,38 @@ function setAbilityPages(projectConfig) { } } +function setFaTestRunnerFile(projectConfig) { + const index =projectConfig.projectPath.split(path.sep).join('/').lastIndexOf('\/'); + const testRunnerPath = path.resolve(projectConfig.projectPath.substring(0,index + 1), "TestRunner"); + if (fs.existsSync(testRunnerPath)) { + const testRunnerFiles = []; + readFile(testRunnerPath, testRunnerFiles); + testRunnerFiles.forEach((item) => { + if (/\.(ts|js)$/.test(item)) { + const relativePath = path.relative(testRunnerPath, item).replace(/\.(ts|js)$/, ''); + projectConfig.entryObj["../TestRunner/" + relativePath] = item; + abilityConfig.testRunnerFile.push(item); + } + }) + } +} + +function setStageTestRunnerFile(projectConfig) { + const index =projectConfig.projectPath.split(path.sep).join('/').lastIndexOf('\/'); + const testRunnerPath = path.resolve(projectConfig.projectPath, "TestRunner"); + if (fs.existsSync(testRunnerPath)) { + const testRunnerFiles = []; + readFile(testRunnerPath, testRunnerFiles); + testRunnerFiles.forEach((item) => { + if (/\.(ts|js)$/.test(item)) { + const relativePath = path.relative(testRunnerPath, item).replace(/\.(ts|js)$/, ''); + projectConfig.entryObj["./TestRunner/" + relativePath] = item; + abilityConfig.testRunnerFile.push(item); + } + }) + } +} + function setAbilityFile(projectConfig, abilityPages) { abilityPages.forEach(abilityPath => { if (abilityPath && fs.existsSync(path.resolve(projectConfig.projectPath, '../', abilityPath))) { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 2acba62299d9d81131c222cfa7747e1cc6f63557..6935aeac10f6faf52329dce8a00a8d30f26f9554 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -199,3 +199,6 @@ export const $$_NEW_VALUE: string = 'newValue'; export const INTERFACE_NAME_SUFFIX:string = '_Params'; export const OBSERVED_PROPERTY_ABSTRACT:string = 'ObservedPropertyAbstract'; + +export const SUPERVISUAL: string = './supervisual'; +export const SUPERVISUAL_SOURCEMAP_EXT: string = '.visual.js.map'; diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index bab5b8c242306f5fdf39ebf82b8872ff6d08576a..9f8eeeb16df2b8db940c6ad12f95a62f3721c6d0 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -15,6 +15,8 @@ import ts from 'typescript'; import fs from 'fs'; +import path from 'path'; +import { SourceMapGenerator } from 'source-map'; import { ReplaceResult, @@ -26,12 +28,20 @@ import { import { LogType, LogInfo, - emitLogInfo + emitLogInfo, + mkDir } from './utils'; -import { BUILD_ON } from './pre_define'; +import { + BUILD_ON, + SUPERVISUAL, + SUPERVISUAL_SOURCEMAP_EXT +} from './pre_define'; import { projectConfig } from '../main.js'; import { genETS } from '../codegen/codegen_ets.js'; +const visualMap: Map = new Map(); +const slotMap: Map = new Map(); + function preProcess(source: string): string { process.env.compiler = BUILD_ON; if (/\.ets$/.test(this.resourcePath)) { @@ -39,7 +49,7 @@ function preProcess(source: string): string { let newContent: string = result.content; const log: LogInfo[] = result.log.concat(validateUISyntax(source, newContent, this.resourcePath, this.resourceQuery)); - newContent = parseVisual(this.resourcePath, newContent, log); + newContent = parseVisual(this.resourcePath, this.resourceQuery, newContent, log, source); if (log.length) { emitLogInfo(this, log); } @@ -49,28 +59,48 @@ function preProcess(source: string): string { } } -function parseVisual(resourcePath: string, content: string, log: LogInfo[]): string { - if (componentCollection.entryComponent && projectConfig.aceSuperVisualPath) { - const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, - ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); - if (sourceFile.statements) { - sourceFile.statements.forEach(statement => { - content = parseStatement(statement, content, log, resourcePath); - }); - } +function parseVisual(resourcePath: string, resourceQuery: string, content: string, + log: LogInfo[], source: string): string { + if (!componentCollection.entryComponent || !projectConfig.aceSuperVisualPath) { + return content; } - return content; + const visualPath: string = findVisualFile(resourcePath); + if (!visualPath || !fs.existsSync(visualPath)) { + return content; + } + const visualContent: any = getVisualContent(visualPath, log); + if (!visualContent) { + return content; + } + visualMap.clear(); + slotMap.clear(); + const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, + ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + let newContent: string = content; + if (sourceFile.statements) { + sourceFile.statements.forEach(statement => { + newContent = parseStatement(statement, newContent, log, visualContent); + }); + } + const result: ReplaceResult = sourceReplace(newContent, resourcePath); + newContent = result.content; + const resultLog: LogInfo[] = result.log.concat(validateUISyntax(source, newContent, + resourcePath, resourceQuery)); + log.concat(resultLog); + if (!log.length) { + generateSourceMapForNewAndOriEtsFile(resourcePath, source); + } + return newContent; } function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], - resourcePath: string): string { + visualContent: any): string { if (statement.kind === ts.SyntaxKind.ClassDeclaration && statement.name && statement.name.getText() === componentCollection.entryComponent) { - const visualPath: string = findVisualFile(resourcePath); - if (visualPath && fs.existsSync(visualPath) && statement.members) { + if (statement.members) { statement.members.forEach(member => { if (member.kind && member.kind === ts.SyntaxKind.MethodDeclaration) { - content = parseMember(member, content, log, visualPath); + content = parseMember(statement, member, content, log, visualContent); } }); } @@ -78,16 +108,13 @@ function parseStatement(statement: ts.Statement, content: string, log: LogInfo[] return content; } -function parseMember(member: ts.MethodDeclaration, content: string, log: LogInfo[], - visualPath: string): string { +function parseMember(statement: ts.Statement, member: ts.MethodDeclaration, content: string, + log: LogInfo[], visualContent: any): string { + let newContent: string = content; if (member.name && member.name.getText() === 'build') { - const buildBody: string = content.substring(member.pos, member.end); + const buildBody: string = member.getText(); if (buildBody.replace(/\ +/g, '').replace(/[\r\n]/g, '') === 'build(){}') { - const visualContent: string = getVisualContent(visualPath, log, member.pos); - if (visualContent) { - content = content.replace(buildBody, '\nbuild() {\n' + - visualContent + '}\n'); - } + newContent = insertVisualCode(statement, member, visualContent, newContent); } else { log.push({ type: LogType.ERROR, @@ -97,7 +124,146 @@ function parseMember(member: ts.MethodDeclaration, content: string, log: LogInfo }); } } - return content; + return newContent; +} + +function insertVisualCode(statement: ts.Statement, member: ts.MethodDeclaration, + visualContent: any, content: string): string { + let newContent: string = content; + newContent = insertImport(visualContent, newContent); + newContent = insertVarAndFunc(member, visualContent, newContent, content); + newContent = insertBuild(member, visualContent, newContent, content); + newContent = insertAboutToAppear(statement, member, visualContent, newContent, content); + return newContent; +} + +function insertImport(visualContent: any, content: string): string { + if (!visualContent.etsImport) { + return content; + } + const mediaQueryImport: string = visualContent.etsImport + '\n'; + const newContent: string = mediaQueryImport + content; + slotMap.set(0, mediaQueryImport.length); + visualMap.set(0, mediaQueryImport.split('\n').length - 1); + return newContent; +} + +function insertVarAndFunc(build: ts.MethodDeclaration, visualContent: any, + content: string, oriContent: string): string { + const visualVarAndFunc: string = (visualContent.etsVariable ?? '') + + (visualContent.etsFunction ?? ''); + return visualVarAndFunc ? insertVisualCodeBeforePos(build, '\n' + visualVarAndFunc, content, + oriContent) : content; +} + +function insertBuild(build: ts.MethodDeclaration, visualContent: any, content: string, + oriContent: string): string { + return visualContent.build ? insertVisualCodeAfterPos(build.body, + '\n' + visualContent.build + '\n', content, oriContent) : content; +} + +function insertAboutToAppear(statement: ts.Statement, build: ts.MethodDeclaration, + visualContent: any, content: string, oriContent: string): string { + if (!visualContent.aboutToAppear) { + return content; + } + for (const member of statement.members) { + const hasAboutToAppear: boolean = member.kind && member.kind === ts.SyntaxKind.MethodDeclaration + && member.name && member.name.getText() === 'aboutToAppear'; + if (hasAboutToAppear) { + return insertVisualCodeAfterPos(member.body, '\n' + visualContent.aboutToAppear, content, + oriContent); + } + } + + const aboutToAppearFunc: string = '\n aboutToAppear() {\n' + visualContent.aboutToAppear + + ' }\n'; + return insertVisualCodeBeforePos(build, aboutToAppearFunc, content, oriContent); +} + +function insertVisualCodeAfterPos(member: ts.Block, visualContent: string, content: string, + oriContent: string): string { + const contentBeforePos: string = oriContent.substring(0, member.getStart() + 1); + const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; + const visualLines: number = visualContent.split('\n').length - 1; + const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); + visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : + visualLines); + + let newPos: number = member.getStart() + 1; + for (const [key, value] of slotMap) { + if (member.getStart() >= key) { + newPos += value; + } + } + + const newContent: string = content.substring(0, newPos) + visualContent + + content.substring(newPos); + slotMap.set(member.getStart(), visualContent.length); + return newContent; +} + +function insertVisualCodeBeforePos(member: ts.MethodDeclaration, visualContent: string, + content: string, oriContent: string): string { + const contentBeforePos: string = oriContent.substring(0, member.pos); + const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; + const visualLines: number = visualContent.split('\n').length - 1; + const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); + visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : + visualLines); + let newPos: number = member.pos; + for (const [key, value] of slotMap) { + if (member.pos >= key) { + newPos += value; + } + } + const newContent: string = content.substring(0, newPos) + visualContent + + content.substring(newPos); + slotMap.set(member.pos, visualContent.length); + return newContent; +} + +function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: string) { + if (!process.env.cachePath) { + return; + } + const sourcemap: SourceMapGenerator = new SourceMapGenerator({ + file: resourcePath + }); + const lines: Array = content.split('\n'); + const originEtsFileLines: number = lines.length; + for (let l: number = 1; l <= originEtsFileLines; l++) { + let newEtsFileLineNumber: number = l; + for (const [originEtsFileLineNumber, visualLines] of visualMap) { + if (l > originEtsFileLineNumber) { + newEtsFileLineNumber += visualLines; + } + } + sourcemap.addMapping({ + generated: { + line: newEtsFileLineNumber, + column: 0 + }, + source: resourcePath, + original: { + line: l, + column: 0 + } + }); + } + const visualMapName: string = path.parse(resourcePath).name + SUPERVISUAL_SOURCEMAP_EXT; + const visualDirPath: string = path.parse(resourcePath).dir; + const etsDirPath: string = path.parse(projectConfig.projectPath).dir; + const visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + + visualDirPath.replace(etsDirPath, '')); + if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { + mkDir(visualMapDirPath); + } + fs.writeFile(path.resolve(visualMapDirPath, visualMapName), sourcemap.toString(), (err) => { + if (err) { + return console.error('ERROR: Failed to write visual.js.map'); + } + }); } function findVisualFile(filePath: string): string { @@ -106,13 +272,12 @@ function findVisualFile(filePath: string): string { return visualPath; } -function getVisualContent(visualPath: string, log: LogInfo[], pos: number): string { +function getVisualContent(visualPath: string, log: LogInfo[]): any { const parseContent: any = genETS(fs.readFileSync(visualPath, 'utf-8')); if (parseContent && parseContent.errorType && parseContent.errorType !== '') { log.push({ type: LogType.ERROR, - message: parseContent.message, - pos: pos + message: parseContent.message }); } return parseContent ? parseContent.ets : null; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 12582c352218a5df133b2ac765620488416a2d8b..d8db918fd416a9323798ec6d057af6ac9af0115c 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -623,14 +623,13 @@ function processDragStartBuilder(node: ts.CallExpression): ts.CallExpression { for (let i = 0; i < node.arguments[0].body.statements.length; i++) { // @ts-ignore let statement: ts.Statement = node.arguments[0].body.statements[i]; - checkStatement(statement); - newStatements.push(statement); - node = ts.factory.updateCallExpression(node, node.expression, node.typeArguments, [ts.factory.updateArrowFunction( - // @ts-ignore - node.arguments[0], undefined, undefined, node.arguments[0].parameters, node.arguments[0].type, - // @ts-ignore - node.arguments[0].equalsGreaterThanToken, ts.factory.updateBlock(node.arguments[0].body, newStatements))]); + newStatements.push(checkStatement(statement)); } + node = ts.factory.updateCallExpression(node, node.expression, node.typeArguments, [ts.factory.updateArrowFunction( + // @ts-ignore + node.arguments[0], undefined, undefined, node.arguments[0].parameters, node.arguments[0].type, + // @ts-ignore + node.arguments[0].equalsGreaterThanToken, ts.factory.updateBlock(node.arguments[0].body, newStatements))]); } return node; } @@ -640,7 +639,7 @@ function isNodeFunction(node: ts.CallExpression): boolean { ts.isBlock(node.arguments[0].body); } -function checkStatement(statement: ts.Statement): void { +function checkStatement(statement: ts.Statement): ts.Statement { if (ts.isReturnStatement(statement)) { if (ts.isObjectLiteralExpression(statement.expression)) { const newProperties: ts.ObjectLiteralElementLike[] = []; @@ -649,10 +648,12 @@ function checkStatement(statement: ts.Statement): void { checkProperty(property); newProperties.push(property); } - statement = ts.factory.createReturnStatement(ts.factory.createObjectLiteralExpression(newProperties)); + return ts.factory.createReturnStatement(ts.factory.createObjectLiteralExpression(newProperties)); } else { - statement = ts.factory.updateReturnStatement(statement, parseBuilderNode(statement.expression)); + return ts.factory.updateReturnStatement(statement, parseBuilderNode(statement.expression)); } + } else { + return statement; } } diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index fb0269ad4b64546e0c524cee5e380250a612b012..8e80ed3f6cb6e46c44b3ce4e41bfd37b7e15ba88 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -59,7 +59,7 @@ module.exports = function resultProcess(source: string, map: any): void { resetLog(); } } - if ([abilityConfig.abilityEntryFile].concat(abilityConfig.projectAbilityPath).includes(this.resourcePath)) { + if ([abilityConfig.abilityEntryFile].concat(abilityConfig.projectAbilityPath).concat(abilityConfig.testRunnerFile).includes(this.resourcePath)) { source = source.replace(/exports\.default/, 'globalThis.exports.default'); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index c7a7700bbf4cc6e5436220aa60a69f42568229be..7f083c3996e25155cb9f28c25c8061b05b8901bd 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -199,10 +199,10 @@ function copyFile(inputFile: string, outputFile: string): void { } } -function mkDir(path_: string): void { +export function mkDir(path_: string): void { const parent: string = path.join(path_, '..'); if (!(fs.existsSync(parent) && !fs.statSync(parent).isFile())) { mkDir(parent); } fs.mkdirSync(path_); -} +}