@shijiu/jsview 2.2.35 → 2.2.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,23 @@
1
- /* eslint-disable */ import{parseGIF as e,decompressFrames as t}from"gifuct-js";void 0===window.Forge?(window.Forge={},console.log("Define forge browser")):console.log("Define using JsView forge engine-js");var i,s,n,r,a,o,l,h,c,u,d,g,f,m,p,y=window.Forge;function T(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}class _{static ToString(e){switch(e){case _.UnknownError:return"UnknownError("+e+")";case _.UnimplementedError:return"UnimplementedError("+e+")";case _.UnsupportedError:return"UnsupportedError("+e+")";case _.NotFoundError:return"NotFoundError("+e+")";case _.InvalidArgument:return"InvalidArgument("+e+")";case _.BadArgumentSize:return"BadArgumentSize("+e+")";case _.InvalidElement:return"InvalidElement("+e+")";case _.BadElementType:return"BadElementType("+e+")";case _.CssStyleNotExists:return"CssStyleNotExists("+e+")";case _.CssStyleNotChanged:return"CssStyleNotChanged("+e+")";case _.CssStyleBadType:return"CssStyleBadType("+e+")";case _.CssClassNotChanged:return"CssClassNotChanged("+e+")";case _.ForgeInsertView:return"ForgeInsertView("+e+")";default:return"UnknownError("+e+")"}}static GetFormattedMethod(e){var t,i;t=e.indexOf(" ")+1,i=e.indexOf("(")-t;return e.substr(t,i)+"()"}static GetErrorMessage(e=[]){var t="";for(const i of e)t+=i;return t}static PrintErrorMessage(e,t,i=[]){const s=_.GetErrorMessage(i);console.error("ForgeDom","Error@ "+e+":"+t+", "+s)}constructor(){throw new Error("new ErrCode() is forbidden.")}}function x(e,t,i=[]){I(e,_.GetErrorMessage(i),t)}function w(e,t,i=[]){I(e,_.GetErrorMessage(i),t)}function S(e,t=[]){I(e,_.GetErrorMessage(t))}function v(e,t=[]){C(e,_.GetErrorMessage(t),e)}function b(e,t,i=[]){C(e,_.GetErrorMessage(i),t)}function E(e,t=[]){C(e,_.GetErrorMessage(t))}function C(e,t,i=void 0){if(e<0)throw _.PrintErrorMessage("__FILE_NAME__","__LINE__",[_.ToString(e),". ",t]),new Error(i)}function I(e,t,i=void 0){if(!e)throw _.PrintErrorMessage("__FILE_NAME__","__LINE__",["ASSERT("+e+")",". ",t]),new Error(i)}_.UnknownError=-1,_.UnimplementedError=-2,_.UnsupportedError=-3,_.NotFoundError=-4,_.InvalidArgument=-5,_.BadArgumentSize=-6,_.InvalidElement=-100,_.BadElementType=-101,_.BadTaskType=-102,_.CssStyleNotExists=-120,_.CssStyleNotChanged=-121,_.CssStyleBadName=-122,_.CssStyleBadType=-123,_.CssClassNotChanged=-124,_.ForgeInsertView=-200;class A{static HasGetterMethod(e){switch(e){case A.Layout.Height:case A.Layout.Left:case A.Layout.Top:case A.Layout.Width:case A.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==A.Layout.Height?A.Layout.Height:e==A.Layout.Left?A.Layout.Left:e==A.Layout.Top?A.Layout.Top:e==A.Layout.Width?A.Layout.Width:e==A.Flex.FlexDirection?A.Flex.FlexDirection:e==A.Flex.FlexWrap?A.Flex.FlexWrap:e==A.Flex.JustifyContent?A.Flex.JustifyContent:e==A.Flex.AlignItems?A.Flex.AlignItems:e==A.Flex.AlignContent?A.Flex.AlignContent:e==A.Flex.AlignSelf?A.Flex.AlignSelf:e==A.Flex.FlexGrow?A.Flex.FlexGrow:e==A.Background.BackgroundColor?A.Background.BackgroundColor:e==A.Background.BackgroundImage?A.Background.BackgroundImage:e==A.Background.BorderRadius?A.Background.BorderRadius:e==A.Effect.BackfaceVisibility?A.Effect.BackfaceVisibility:e==A.Effect.BorderImage?A.Effect.BorderImage:e==A.Effect.BorderImageWidth?A.Effect.BorderImageWidth:e==A.Effect.BorderImageOutset?A.Effect.BorderImageOutset:e==A.Effect.Display?A.Effect.Display:e==A.Effect.ObjectFit?A.Effect.ObjectFit:e==A.Effect.Opacity?A.Effect.Opacity:e==A.Effect.Overflow?A.Effect.Overflow:e==A.Effect.Perspective?A.Effect.Perspective:e==A.Effect.PerspectiveOrigin?A.Effect.PerspectiveOrigin:e==A.Effect.Transform?A.Effect.Transform:e==A.Effect.TransformOrigin?A.Effect.TransformOrigin:e==A.Effect.TransformStyle?A.Effect.TransformStyle:e==A.Effect.Visibility?A.Effect.Visibility:e==A.Effect.ZIndex?A.Effect.ZIndex:e==A.Text.Color?A.Text.Color:e==A.Text.FontFamily?A.Text.FontFamily:e==A.Text.FontSize?A.Text.FontSize:e==A.Text.FontStyle?A.Text.FontStyle:e==A.Text.FontWeight?A.Text.FontWeight:e==A.Text.LineHeight?A.Text.LineHeight:e==A.Text.TextAlign?A.Text.TextAlign:e==A.Text.TextOverflow?A.Text.TextOverflow:e==A.Text.TextShadow?A.Text.TextShadow:e==A.Text.WebkitTextStroke?A.Text.WebkitTextStroke:e==A.Text.WhiteSpace?A.Text.WhiteSpace:e==A.Text.WordWrap?A.Text.WordWrap:e==A.Text.Direction?A.Text.Direction:e==A.Text.JsvTextEmoji?A.Text.JsvTextEmoji:e==A.Text.JsvTextLatex?A.Text.JsvTextLatex:e==A.Text.JsvTextAlignMinWidth?A.Text.JsvTextAlignMinWidth:e==A.Text.JsvTextVerticalAlign?A.Text.JsvTextVerticalAlign:e==A.Text.JsvTextLineAlign?A.Text.JsvTextLineAlign:e==A.Text.JsvTextInnerDirection?A.Text.JsvTextInnerDirection:e==A.Motion.Animation?A.Motion.Animation:e==A.Motion.Transition?A.Motion.Transition:e==A.Motion.AnimationFillMode?A.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}A.Layout=(T(i=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),i.Height="height",i.Left="left",i.Top="top",i.Width="width",i),A.Flex=(T(s=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),s.FlexDirection="flexDirection",s.FlexWrap="flexWrap",s.JustifyContent="justifyContent",s.AlignItems="alignItems",s.AlignContent="alignContent",s.AlignSelf="alignSelf",s.FlexGrow="flexGrow",s),A.Background=(T(n=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),n.BackgroundColor="backgroundColor",n.BackgroundImage="backgroundImage",n.BorderRadius="borderRadius",n),A.Effect=(T(r=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),r.BackfaceVisibility="backfaceVisibility",r.BorderImage="borderImage",r.BorderImageWidth="borderImageWidth",r.BorderImageOutset="borderImageOutset",r.Display="display",r.ObjectFit="objectFit",r.Opacity="opacity",r.Overflow="overflow",r.Perspective="perspective",r.PerspectiveOrigin="perspectiveOrigin",r.Transform="transform",r.TransformOrigin="transformOrigin",r.TransformStyle="transformStyle",r.Visibility="visibility",r.ZIndex="zIndex",r),A.Text=(T(a=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),a.Color="color",a.FontFamily="fontFamily",a.FontSize="fontSize",a.FontStyle="fontStyle",a.FontWeight="fontWeight",a.LineHeight="lineHeight",a.TextAlign="textAlign",a.TextOverflow="textOverflow",a.TextShadow="textShadow",a.WebkitTextStroke="WebkitTextStroke",a.WhiteSpace="whiteSpace",a.WordWrap="wordWrap",a.Direction="direction",a.JsvTextEmoji="JsvTextEmoji",a.JsvTextLatex="JsvTextLatex",a.JsvTextAlignMinWidth="JsvTextAlignMinWidth",a.JsvTextVerticalAlign="JsvTextVerticalAlign",a.JsvTextLineAlign="JsvTextLineAlign",a.JsvTextInnerDirection="JsvTextInnerDirection",a),A.Motion=(T(o=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),o.Animation="animation",o.Transition="transition",o.AnimationFillMode="animationFillMode",o);class P{constructor(e){let t=-1,i=null;null==e?t=P.DataType.Null:Number(e)===e&&e%1==0?t=P.DataType.Int32:Number(e)===e&&e%1!=0?t=P.DataType.Float:"string"==typeof e||e instanceof String?t=P.DataType.String:e instanceof P.AnimationImpl?t=P.DataType.Animation:e instanceof P.CornerImpl?t=P.DataType.Corner:e instanceof P.RectImpl?t=P.DataType.Rect:e instanceof P.TextShadowImpl?t=P.DataType.TextShadow:e instanceof P.WebkitTextStrokeImpl?t=P.DataType.WebkitTextStroke:e instanceof P.TransitionImpl?t=P.DataType.Transition:e instanceof P.BorderImageImpl&&(t=P.DataType.BorderImage),e!=P.InvalidInt32&&e!=P.InvalidFloat&&e!=P.InvalidPointer?i=e:(t=P.DataType.Null,i=null),this.data=new P.DataInfo,this.data.index=t,this.data.value=i}toString(){let e=null;switch(this.data.index){case P.DataType.Null:return"";case P.DataType.Int32:case P.DataType.Float:return String(this.get());case P.DataType.String:e=this.get();break;case P.DataType.Animation:case P.DataType.Corner:case P.DataType.Rect:case P.DataType.TextShadow:case P.DataType.WebkitTextStroke:case P.DataType.Transition:case P.DataType.BorderImage:case P.DataType.BackgroundImage:e=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return e??""}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}P.Base=class{constructor(e){this.rawValue=e}},P.AnimationImpl=class extends P.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},P.CornerImpl=class extends P.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},P.RectImpl=class extends P.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},P.TextShadowImpl=class extends P.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},P.WebkitTextStrokeImpl=class extends P.Base{constructor(e){super(e),this.length=0,this.color=void 0}},P.TransitionImpl=class extends P.Base{constructor(e){super(e),this.animationMap=new Map}},P.BorderImageImpl=class extends P.Base{constructor(e){super(e),this.source="",this.slice=null}},P.BackgroundImageImpl=(T(l=class extends P.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),l.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},l.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},l),P.DataType=(T(h=class{},"DataType"),h.Null=0,h.Int32=1,h.Float=2,h.String=3,h.Animation=4,h.Corner=5,h.Rect=6,h.TextShadow=7,h.WebkitTextStroke=8,h.Transition=9,h.BorderImage=10,h.BackgroundImage=11,h),P.InvalidInt32=Number.MIN_VALUE,P.InvalidFloat=Number.NaN,P.InvalidPointer=null,P.DataInfo=class{constructor(){this.value=null,this.index=-1}};class L{}L.Text=(T(c=class{},"Text"),c.Color="#000000",c.FontFamily="黑体",c.FontSize=10,c.FontStyle="normal",c.FontWeight="normal",c.LineHeight=0,c.TextAlign="start",c.TextOverflow="clip",c.TextShadow=null,c.WebkitTextStroke=null,c.WhiteSpace="normal",c.WordWrap="normal",c.Direction="ltr",c.JsvTextEmoji=0,c.JsvTextLatex=0,c.JsvTextAlignMinWidth=0,c.JsvTextVerticalAlign="top",c.JsvTextLineAlign="middle",c.JsvTextInnerDirection="unset",c);class k{static FormatVariableName(e){return e.startsWith("--")?"var("+e+")":e.startsWith("var(--")?e:(w(!1,null),null)}static IsVariable(e){let t;if(e instanceof P){if(0==e.is(P.DataType.String))return!1;t=e.get()}else{if("string"!=typeof e)return!1;t=e}return t.startsWith("--")||t.startsWith("var(--")}constructor(){throw new Error("new StyleVariable() is forbidden.")}}class R{constructor(){throw new Error("new StyleGroup() is forbidden.")}}R.Layout=(T(u=class{constructor(){this.height=P.InvalidInt32,this.left=P.InvalidInt32,this.top=P.InvalidInt32,this.width=P.InvalidInt32}},"Layout"),u.Name="layout",u),R.Flex=(T(d=class{constructor(){this.flexDirection=P.InvalidInt32,this.flexWrap=P.InvalidInt32,this.justifyContent=P.InvalidInt32,this.alignItems=P.InvalidInt32,this.alignContent=P.InvalidInt32,this.alignSelf=P.InvalidInt32,this.flexGrow=P.InvalidFloat}},"Flex"),d.Name="flex",d),R.Background=(T(g=class{constructor(){this.backgroundColor=P.InvalidPointer,this.backgroundImage=P.InvalidPointer,this.borderRadius=P.InvalidPointer}},"Background"),g.Name="background",g),R.Effect=(T(f=class{constructor(){this.backfaceVisibility=P.InvalidPointer,this.borderImage=P.InvalidPointer,this.borderImageWidth=P.InvalidPointer,this.borderImageOutset=P.InvalidPointer,this.display=P.InvalidPointer,this.objectFit=P.InvalidPointer,this.opacity=P.InvalidFloat,this.overflow=P.InvalidPointer,this.perspective=P.InvalidInt32,this.perspectiveOrigin=P.InvalidPointer,this.transform=P.InvalidPointer,this.transformOrigin=P.InvalidPointer,this.transformStyle=P.InvalidPointer,this.visibility=P.InvalidPointer,this.zIndex=P.InvalidInt32}},"Effect"),f.Name="effect",f),R.Text=(T(m=class{constructor(){this.color=P.InvalidPointer,this.fontFamily=P.InvalidPointer,this.fontSize=P.InvalidInt32,this.fontStyle=P.InvalidPointer,this.fontWeight=P.InvalidPointer,this.lineHeight=P.InvalidInt32,this.textAlign=P.InvalidPointer,this.textOverflow=P.InvalidPointer,this.textShadow=P.InvalidPointer,this.webkitTextStroke=P.InvalidPointer,this.whiteSpace=P.InvalidPointer,this.wordWrap=P.InvalidPointer,this.direction=P.InvalidPointer,this.jsvTextEmoji=P.InvalidInt32,this.jsvTextLatex=P.InvalidInt32,this.jsvTextAlignMinWidth=P.InvalidInt32,this.jsvTextVerticalAlign=P.InvalidPointer,this.jsvTextLineAlign=P.InvalidPointer,this.jsvTextInnerDirection=P.InvalidPointer}},"Text"),m.Name="text",m),R.Motion=(T(p=class{constructor(){this.animation=P.InvalidPointer,this.transition=P.InvalidPointer,this.animationFillMode="none"}},"Motion"),p.Name="motion",p),void 0===window.ForgeFront&&(window.ForgeFront={},console.log("Define global ForgeFront browser"));let F=window.ForgeFront;const D=new class{constructor(){this._count=1}get count(){return this._count}update(){this._count<Number.MAX_SAFE_INTEGER?++this._count:this._count=1}};F.sFrameCount=D;class V{static getTextPixelWith(e,t){null===V.sCanvas&&(V.sCanvas=window.originDocument.createElement("canvas"));const i=V.sCanvas.getContext("2d");i.font=t;const s=i.measureText(e);return Math.ceil(s.width)}static GetOneLineTextDrawWidth(e,t,i,s,n){const r=[];r.push(0);const a=s?"bold":"",o=n?"italic":"",l=Math.floor(2048/i);let h=0,c=0;for(;h<e.length;){const s=h+l;let n;if(h+l>=e.length)n=e.length-h;else{let t=e.lastIndexOf(" ",s);n=t>h?t-h+1:l}const u=e.slice(h,h+n),d=V.getTextPixelWith(u,`${a} ${o} ${i}px ${t}`);r.push(h),r.push(h+n),r.push(d),c+=d,h+=n}return r[0]=c,r}static GetTextWidth(e){let t="";e.bold&&(t="bold");let i="";return e.italic&&(i="italic"),this.getTextPixelWith(e.str,`${t} ${i} ${e.size}px ${e.font}`)}static GetTextRect(e,t,i,s,n){let r=Math.ceil(i.size*e.length/t.width)*n;r>t.height&&(r=t.height);return{width:t.width,height:r}}static GetCursorOffset(e,t,i,s,n,r,a){let o="";i.bold&&(o="bold");let l="";i.italic&&(l="italic");let h=0;if("right"===i.alignment){const s=this.getTextPixelWith(e,`${o} ${l} ${i.size}px ${i.font}`);(r-=t.width-s)<0&&(r=0)}let c=0;for(;r>=c&&h!==e.length;)c=this.getTextPixelWith(e.substr(0,h+1),`${o} ${l} ${i.size}px ${i.font}`),r>=c&&h++;return h}static GetCursorPosition(e,t,i,s,n,r){let a="";i.bold&&(a="bold");let o="";i.italic&&(o="italic");let l=0,h=e;if(r<e.length&&(h=h.substr(0,r)),l=this.getTextPixelWith(h,`${a} ${o} ${i.size}px ${i.font}`),"right"===i.alignment){const s=this.getTextPixelWith(e,`${a} ${o} ${i.size}px ${i.font}`);l=t.width-s+l}return{x:l,y:0}}}V.sCanvas=null,window.PlatformUtils=V;class O{constructor(e){this.state={},this.type=e,this._AutoPlay=!1}buildPlatformInstance(){this.Ele=window.originDocument.createElement(this.type),this.Ele.addEventListener("loadedmetadata",(()=>{this.hasOwnProperty("onload")&&this.onload(),this.hasOwnProperty("onloadedmetadata")&&this.onloadedmetadata()}))}set autoplay(e){void 0!==e&&(this._AutoPlay=!0,this.Ele.paused&&setTimeout((()=>{this.play()}),0))}get currentTime(){return this.Ele.currentTime}set currentTime(e){this.Ele.currentTime=e,this.setState("seek",e,"number")}get duration(){return this.Ele.duration}set loop(e){this.Ele.loop="boolean"==typeof e||void 0!==e}get muted(){return this.getState("muted")}set muted(e){this.setState("muted",e,"boolean")}get paused(){return this.Ele.paused}get playbackRate(){return this.getState("playbackRate")}set playbackRate(e){this.setState("playbackRate",e,"number")}set src(e){this.setState("src",e,"string"),e&&this._AutoPlay&&setTimeout((()=>{this.play()}),0)}get style(){const e=this;return{set bottom(t){e.setState("style",`{"bottom":"${t}"}`,"string")},set left(t){e.setState("style",`{"left":"${t}"}`,"string")},set right(t){e.setState("style",`{"right":"${t}"}`,"string")},set top(t){e.setState("style",`{"top":"${t}"}`,"string")},set height(t){e.setState("style",`{"height":"${t}"}`,"string")},set width(t){e.setState("style",`{"width":"${t}"}`,"string")}}}get volume(){return this.getState("volume")}set volume(e){this.setState("volume",e,"number")}get playableDuration(){return this.Ele.playableDuration}addEventListener(e,t){this[`on${e}`]=t,this.Ele.addEventListener(e,(t=>{this[`on${e}`](t)}))}load(){this.Ele.load()}pause(){this.Ele.pause(),this.setState("paused",!0,"boolean"),this.hasOwnProperty("onpause")&&this.onpause()}play(){this.setState("paused",!1,"boolean"),this.Ele.play(),this.hasOwnProperty("onplay")&&this.onplay()}unload(){this.setState("paused",!0,"boolean"),this.Ele.pause(),this.Ele.removeAttribute("src"),this.Ele.load()}setState(e,t,i){typeof t===i?("playbackRate"==e?this.Ele.playbackRate=t:"muted"==e?this.Ele.muted=t:this.Ele.setAttribute(e,t),this.state[e]=t,console.log(`set ${e} = ${t}`)):console.warn(`invalid paramter type to set ${e}. value is not ${i}`)}getState(e){let t=this.state[e];return console.log(`get ${e} = ${t}`),void 0===t&&(t=this.Ele.getAttribute(e),this.state[e]=t),t}onEnd(e){this.setState("paused",!0,"boolean"),this.hasOwnProperty("onended")&&this.onended()}onError(e){this.hasOwnProperty("onerror")&&this.onerror(e.currentTarget.error.code)}mediaHandler(){return this.Ele}static setDesignMapWidth(e){"number"==typeof e?O.prototype.designMapWidth=e:console.warn(`Invalid paramter type to set ${e}. It is not number.`)}}O.prototype.designMapWidth=0;class M extends O{constructor(e){super(e),super.buildPlatformInstance(e)}}class N extends M{constructor(){super("audio")}}window._ExtAudio=N;class G extends M{constructor(){super("video"),this.state.height=0,this.state.width=0,this.state.aspectRatiow="origin"}get height(){return this.getState("height")}set height(e){this.style.height=e,this.state.height=e}get poster(){return console.log("Video.poster() TODO"),null}set poster(e){console.log("Video.poster() TODO")}get videoAspectRatio(){return this.getState("aspectRatio")}set videoAspectRatio(e){this.setState("aspectRatio",e,"string")}get videoHeight(){return this.Ele.videoHeight}get videoWidth(){return this.Ele.videoWidth}get width(){return this.getState("width")}set width(e){this.style.width=e,this.state.width=e}onLoad(e){super.onLoad(e)}setRotation(e,t,i,s){let n=function(){let n=`rotate3d(0, 0, 1, ${e}deg)`;if(90==e||-90==e){let e,r;if(s?(e=i/t,r=t/i):(e=this.videoHeight/this.videoWidth,r=this.videoWidth/this.videoHeight),isNaN(e)||isNaN(r))return!1;n+=` scale3d(${e}, ${r}, 1)`}return this.Ele.style.transform=n,this.Ele.parentNode&&(this.Ele.parentNode.style.overflow="hidden"),!0};n=n.bind(this);n()||this.Ele.addEventListener("loadedmetadata",(()=>{n()}))}}window._ExtVideo=G;class B extends O{constructor(){super("video"),this._ReleaseCallbacks=[],this._ResourceTerminater=null,super.buildPlatformInstance()}setResourceTerminator(e){this._ResourceTerminater=e}hasTerminator(){return null!==this._ResourceTerminater}listenToRelease(e){this._ReleaseCallbacks.push(e)}unload(){super.unload(),null!==this._ResourceTerminater&&this._ResourceTerminater(),this._ResourceTerminater=null}releaseResource(){for(let e=0;e<this._ReleaseCallbacks.length;e++)this._ReleaseCallbacks[e]();null!==this._ResourceTerminater&&this._ResourceTerminater(),this._ResourceTerminater=null}confirmInitSetup(){}setRotation(){console.log("media.setRotation no implemented")}onPlatformDestroy(){}get videoHeight(){return this.Ele.videoHeight}get videoWidth(){return this.Ele.videoWidth}}window._ExtOVP=B,window.Audio=N,window.Video=G,window.OffscreenVideoPlayer=B;class W{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){const t=e.indexOf("(")+1,i=e.lastIndexOf(")");e=e.substring(t,i).trim()}if(!0===e.startsWith("data:"))return void(this.href=e);if(!0===e.startsWith("/")&&(e=document.location.origin+e),!0===e.startsWith("./")){const t=document.location.pathname.lastIndexOf("/");let i="";t>0&&(i=document.location.pathname.substring(0,t)),e=document.location.origin+i+e.substring(1)}if(this.href=e,!t)return;let i=this.href.indexOf("?");const s=i>0?this.href.substring(0,i):this.href;this.search=i>1?this.href.substring(i):"",i=s.indexOf("://"),this.protocol=i>0?s.substring(0,i+1):"";const n=i>1?s.substring(i+3):"";i=n.indexOf("/"),this.host=i>0?n.substring(0,i):"",this.pathname=i>1?n.substring(i):"",this.origin=i>0?`${this.protocol}//${this.host}`:"",i=this.host.indexOf(":"),this.hostname=i>0?this.host.substring(0,i):this.host,this.port=i>1?this.host.substring(i+1):"",console.log("create total parse URL, this=",this)}replace(e){this.href=e}}const H=window.AudioContext||window.webkitAudioContext;if(H){const Qi=new H;let es=0,ts=0;class is{constructor(e,t,i){this._Context=e,this._BufferSource=t,this._Gain=i,this._BufferSource.connect(this._Gain),this._Gain.connect(this._Context.destination)}start(e,t,i){this._BufferSource.start(e,t,i)}setVolume(e){this._Gain.gain.setValueAtTime(e,this._Context.currentTime)}stop(e){this._BufferSource.stop(e)}}class ss{constructor(){this._SoundBufferMap={},this._StreamMap={}}load(e,t,i,s){const n=new W(e).href,r=es++;return this._requestBuffer(n,((e,t)=>{0===e?Qi.decodeAudioData(t,(e=>{this._SoundBufferMap[r]=e,s(r,0)})):s(-1,-1)})),r}unload(e){delete this._SoundBufferMap[e]}autoPause(){}autoResume(){}play(e,t,i,s,n,r){if(this._SoundBufferMap[e]){const i=ts++,s=Qi.createBufferSource();s.buffer=this._SoundBufferMap[e],s.playbackRate.value=r,s.onended=e=>{this.stop(i)},n>0&&(s.loop=!0);const a=Qi.createGain();a.gain.setValueAtTime(t,Qi.currentTime);const o=new is(Qi,s,a);return this._StreamMap[i]=o,console.log("loop test",(n+1)*this._SoundBufferMap[e].duration),o.start(0,0,(n+1)*this._SoundBufferMap[e].duration),i}return-1}pause(e){}resume(e){}stop(e){this._StreamMap[e]&&(this._StreamMap[e].stop(),delete this._StreamMap[e])}release(){this._SoundBufferMap={},this._StreamMap={}}setVolume(e,t,i){this._StreamMap[e]&&this._StreamMap[e].setVolume(t)}setPriority(e,t){}setRate(e,t){}setLoop(e,t){}_requestBuffer(e,t){const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200===i.status?(console.log("http request succeed"),t(0,i.response)):(console.error(`download audio ${e} failed.`,i.status),t(-1,null))},i.send()}}window.SoundPool=ss}else window.SoundPool=null;F.LogF=function(e){},F.LogE=function(e){},F.LogW=function(e){},F.LogI=function(e){},F.LogD=function(e){},F.LogM=function(e){},F.ThrowError=function(e){throw new Error(e)},F.Assert=function(e){if(!e)throw new Error("ASSERT!!!!!")},F.EnableLog=function(e){F.LogM=console.log.bind(console),e>0&&(F.LogF=console.error.bind(console)),e>1&&(F.LogE=console.error.bind(console)),e>2&&(F.LogW=console.warn.bind(console)),e>3&&(F.LogI=console.log.bind(console)),e>4&&(F.LogD=console.debug.bind(console))};class Y{constructor(e,t,i,s){this.x="number"==typeof e?e:0,this.y="number"==typeof t?t:0,("number"!=typeof i||i<0)&&(i=0),this.width=i,("number"!=typeof s||s<0)&&(s=0),this.height=s}Equals(e){return null!==e&&(e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height)}}F.RectArea=Y;F.Coordinate=class{constructor(e,t){this.x=e,this.y=t}};F.Size=class{constructor(e,t){this.width=e,this.height=t}};F.RectUtils=class{FormatRectArea(e){let t=null;if(e instanceof F.RectArea)t=e;else if("object"==typeof e&&null!==e){if(isNaN(e.width)||isNaN(e.height))throw new Error("ERROR: target_size format should be {width:XXXX, height:XXXX}");t=new F.RectArea(0,0,e.width,e.height)}return t}},F.sRectUitls=new F.RectUtils,F.TextShaderType={LinearGradient:0,Image:1};F.TextShader=class{constructor(e,t){this.Type=e,this.Params=t}};class ${constructor(){const e=(new F.LayoutView).GetRenderer();this._Renderer=e,this.StringWithFont=F.sTextUtils.StringWithFont("",0,void 0,"center","middle",void 0,!1,!1,void 0,void 0,"top"),this.RectArea=new F.RectArea(0,0,0,0),this.TextAttr=F.sTextUtils.TextAttr("ellipsis","none"),this.Marquee=null,this.Shader=null,this.IsInstantLoad=!0,this.LineHeight=0,this.LatexMode=!1}SetInstantLoad(e){return this.IsInstantLoad=e,this}SetStringWithFont(e){return this.StringWithFont=e,this}SetLatexMode(e){return this.LatexMode=e,this}SetFontStyle(e,t,i,s,n,r,a,o,l,h){return this.StringWithFont="object"==typeof e?F.sTextUtils.StringWithFont("",void 0!==e.size?e.size:10,void 0!==e.font?e.font:"宋体",void 0!==e.hAlign?e.hAlign:"center",void 0!==e.vAlign?e.vAlign:"middle",void 0!==e.textColor?e.textColor:"#000000",void 0!==e.italic&&e.italic,void 0!==e.bold&&e.bold,void 0!==e.shadow?e.shadow:null,void 0!==e.strokeWidth?e.strokeWidth:null,void 0!==e.vAreaAlign?e.vAreaAlign:"top"):F.sTextUtils.StringWithFont("",e,t,i,s,n,r,a,o,l,h),this}SetRectArea(e){return e instanceof F.RectArea?this.RectArea=e:this.RectArea=new F.RectArea(e.x,e.y,e.width,e.height),this}SetViewSize(e){return e instanceof F.RectArea||(e=new F.RectArea(e.x,e.y,e.width,e.height)),this.SetRectArea(e),0===this.LineHeight&&0!==e.height&&(this.LineHeight=e.height),this}SetTextAttr(e){let t,i;return t=e.hasOwnProperty("textOverflow")?e.textOverflow:e.hasOwnProperty("text_overflow")?e.text_overflow:"clip",i=e.hasOwnProperty("wordWrap")?e.wordWrap:e.hasOwnProperty("word_wrap")?e.word_wrap:"none",this.TextAttr={word_wrap:i,text_overflow:t},this}SetMarquee(e){return e&&(this.Marquee={repetition:"infinite",direction:"left",speed:"normal"},e.repetition&&(this.Marquee.repetition=e.repetition),e.direction&&(this.Marquee.direction=e.direction),e.speed&&(this.Marquee.speed=e.speed)),this}SetShader(e){return this.Shader=e,this}SetLineHeight(e){return this.LineHeight=e,this}EnableDuplicateBuilder(){this.BuildCopyBag=!0}Clone(){const e=new $(null);return e.StringWithFont=this.StringWithFont,e.RectArea=this.RectArea,e.TextAttr=this.TextAttr,e.LineHeight=this.LineHeight,e}}F.TextViewParams=$,window.TextViewParams=F.TextViewParams;class j{constructor(e,t,i,s,n){this._layoutView=null,this._textWidth=0,this._textViewReahHeight=0,this._marqueeRunning=!0,this._marqueePause=!1,this._marqueeCurrentNum=2,this._textView=null,this._TextViewParams=t,this._NeedQuick=void 0!==s&&s,this._marquee=t.Marquee,this._rectArea=t.RectArea,this._DrawCount=0,this._ShowInterval=0,this._TextureManager=e,this._LatexMode=t.LatexMode,this._Shader=t.Shader,this._IsInstantLoad=t.IsInstantLoad?1:0,this._AutoHeight=!1,this._EnableTextureOnloadCallback=!!n,this._DuplicateBag=t.BuildCopyBag?{Set:null,Swf:null,Siz:null}:null;const r=this;let a=null;const o=t.RectArea.width,l=t.RectArea.height;let h=null,c=null;null!==this._marquee?(c=new F.ClipView,c.Init(),c.SetClipRect(0,0,o,l,!0),c.SetId("matrixClipLayoutview"),c.OnDettachFromSystem=function(){r._marqueeRunning=!1,F.ClipView.prototype.OnDettachFromSystem.call(this)}):(c=new F.LayoutView,c.OnDettachFromSystem=function(){this._TextureOnloadCallbacksTimer&&(clearTimeout(this._TextureOnloadCallbacksTimer),this._TextureOnloadCallbacksTimer=null)}),a=c.GetRenderer(),this._Renderer=a;let u=i;u||(u=t.StringWithFont.str),u=this._ConvertEscToString(u);let d=!1;t.StringWithFont.italic.length>0&&(d=!0);let g=!1;t.StringWithFont.bold.length>0&&(g=!0),h=F.sTextUtils.StringWithFont(u,t.StringWithFont.size,t.StringWithFont.font,t.StringWithFont.alignment,t.StringWithFont.vertical_align,t.StringWithFont.textColour,d,g,t.StringWithFont.shadow,t.StringWithFont.stroke_width,t.StringWithFont.vertical_area_align),void 0!==t.Marquee&&null!==t.Marquee?this._textWidth=F.sTextUtils.GetTextWidth(h):this._NeedQuick?this._textWidth=t.RectArea.width-2*t.RectArea.x:this._textWidth=F.sTextUtils.GetTextWidth(h),this.addTextView(c,h,t.TextAttr,t.RectArea,t.Marquee,t.LineHeight),this._TextureOnloadCallbacksTimer&&(clearTimeout(this._TextureOnloadCallbacksTimer),this._TextureOnloadCallbacksTimer=null),this._TextureOnloadCallbacksTimer=setTimeout((()=>{n&&n({width:this._textView.Element.clientWidth,height:this._textView.Element.clientHeight})}),0),this._layoutView=c,this._TextTexture=null,this._MarqueeTimer=null}_ConvertEscToString(e){let t=`${e}`;return-1!==t.indexOf("&quot;")&&(t=t.replace(/&quot;/gi,'"')),-1!==t.indexOf("&amp;")&&(t=t.replace(/&amp;/gi,"&")),-1!==t.indexOf("&lt;")&&(t=t.replace(/&lt;/gi,">")),-1!==t.indexOf("&gt;")&&(t=t.replace(/&gt;/gi,"<")),-1!==t.indexOf("&nbsp;")&&(t=t.replace(/&nbsp;/gi," ")),t}EnableAutoHeight(){this._AutoHeight=!0,this._textView.EnableAutoHeight()}addTextView(e,t,i,s,n,r){const a=s.height;let o;const l=F.Clone(s);let h=null;0!==t.str.length?(o=this._TextureManager.GetTextTextureByMultiRows(t,i,l,r,this._NeedQuick,this._Shader,this._IsInstantLoad,this._LatexMode,this._DuplicateBag),this._TextTexture=o.texture,this._textViewReahHeight=o.real_height,h=new F.LayoutView,h.Init(new F.TextureSetting(o.texture,null,null,!0)),h.SetId(`Text-${t.str}`),"middle"!==t.vertical_area_align&&"bottom"!==t.vertical_area_align||(h.Element.style.display="table-cell",h.Element.style.position="static",e.Element.style.display="table",e.Element.style.position="static"),e.AddView(h,0,0,l.width,a),this._textView=h):(this._textViewReahHeight=0,F.LogI("t_StringWithFont.str.length is 0"))}GetDuplicateBuilder(){return this._DuplicateBag}GetLayoutView(){return this._layoutView}GetTextWidth(){return this._textView?this._textView.Element.clientWidth:Math.floor(this._textWidth+.5)}StartAnimation(e){e&&null!==this._textView&&this._textView.StartAnimation(e)}}F.TextViewEx=j,F.TextViewControl=j;F.CopiedTextViewEx=class{constructor(e,t,i,s,n){const r={x:0,y:0,width:i.width,height:i.height};this._ContainerView=new F.LayoutView,this._TextView=this._AddTextView(e,t,r,this._ContainerView,s,n)}_AddTextView(e,t,i,s,n,r){let a=null;if(t&&0!==t.length){const o=e.GetCopiedTextTexture(t,i,n,r);a=new F.LayoutView,a.Init(new F.TextureSetting(o,null,null,!0)),t.length<15?a.SetId(`Text-${t}`):a.SetId(`Text-Long${t.length}`),s.AddView(a,0,0,i.width,i.height),r&&o.RegisterLoadImageCallback(null,r,null)}return a}EnableAutoHeight(){this._TextView&&this._TextView.EnableAutoHeight()}GetLayoutView(){return this._ContainerView}},F.Clone=function(e){return JSON.parse(JSON.stringify(e))},window.Clone=F.Clone;F.PersistTimer=new class{constructor(){this._AlreadyExited=!1,window.PersistTimer&&(this._AlreadyExited=!0)}setTimeout(e,t){return this._AlreadyExited&&window.PersistTimer.setTimeout?window.PersistTimer.setTimeout(e,t):window.setTimeout(e,t)}clearTimeout(e){this._AlreadyExited&&window.PersistTimer.clearTimeout?window.PersistTimer.clearTimeout(e):window.clearTimeout(e)}setInterval(e,t){if(!this._AlreadyExited||!window.PersistTimer.setInterval)return window.setInterval(e,t);window.PersistTimer.setInterval(e,t)}clearInterval(e){this._AlreadyExited&&window.PersistTimer.clearInterval?window.PersistTimer.clearInterval(e):window.clearInterval(e)}};F.ForegroundTimer=new class{setTimeout(e,t){return window.setTimeout(e,t)}clearTimeout(e){window.clearTimeout(e)}setInterval(e,t){return window.setInterval(e,t)}clearInterval(e){window.clearInterval(e)}},F.EasingTypeIn=0,F.EasingTypeOut=1,F.EasingTypeInOut=2,F.EasingTypeBezier=3,F.EasingTypeBlink=4,F.EasingTypeDeceleration=5,F.EasingTypeSteps=6;F.EasingBase=class{constructor(){this.Pacakge=this.Package}Package(){}_GetBasePackage(e){return{T:e,St:null}}};class U extends F.EasingBase{Package(){return this._GetBasePackage(F.EasingTypeIn)}}F.EasingIn=U;class X extends F.EasingBase{Package(){return this._GetBasePackage(F.EasingTypeOut)}}F.EasingOut=X;class z extends F.EasingBase{Package(){return this._GetBasePackage(F.EasingTypeInOut)}}F.EasingInOut=z;class K extends F.EasingBase{Package(){return this._GetBasePackage(F.EasingTypeDeceleration)}}F.EasingDeceleration=K;class J extends F.EasingBase{Package(){return this._GetBasePackage(F.EasingTypeBlink)}}F.EasingBlink=J;class q extends F.EasingBase{constructor(e,t,i,s,n){super(),this._Inited=!1,this._X1=e,this._X2=i,this._Y1=t,this._Y2=s,this._Duration=n}Package(){const e=this._GetBasePackage(F.EasingTypeBezier);return e.St={X1:this._X1,X2:this._X2,Y1:this._Y1,Y2:this._Y2,Dur:this._Duration},e}}F.BezierEasing=q;class Z extends F.EasingBase{constructor(e,t){super(),this._Steps=e,this._Type=t}Package(){const e=this._GetBasePackage(F.EasingTypeSteps);return e.St={S:this._Steps,T:this._Type},e}}F.StepsEasing=Z,F.Easing={Circular:{In:new F.EasingIn,Out:new F.EasingOut,InOut:new F.EasingInOut,Deceleration:new F.EasingDeceleration}},window.Easing=F.Easing;let Q=null,ee=null,te=null;F.sCustomCanvasResProvider=new class{GetDataUrl(e){return JSON.parse(e).forEach(((e,t)=>{switch(e.cmd){case 1:Q=window.originDocument.createElement("canvas"),ee=Q.getContext("2d"),Q.setAttribute("width",`${e.w}px`),Q.setAttribute("height",`${e.h}px`);break;case 2:"stroke"==e.type?(ee.strokeStyle=e.clr,ee.lineWidth=e.lineWidth,ee.fillStyle=null,te="stroke"):(ee.fillStyle=e.clr,ee.strokeStyle=null,te="fill");break;case 3:ee.beginPath();break;case 30:this.myMoveTo(e.x,e.y);break;case 31:this.myLineTo(e.x,e.y);break;case 32:this.myArcTo(e);break;case 33:ee.closePath();break;case 14:"stroke"===te?ee.stroke():"fill"===te&&ee.fill();break;case 13:this.myRect(e);break;case 12:this.circleDraw(e);break;case 15:this.drawLine(e);break;case 16:this.drawLinearGradientRect(e);break;case 11:this.drawColor(e.clr);break;case 10:this.clearCanvas()}})),Q.toDataURL("image/png")}myMoveTo(e,t){void 0!==e&&void 0!==t&&ee.moveTo(e,t)}myLineTo(e,t){void 0!==e&&void 0!==t&&ee.lineTo(e,t)}myArcTo(e){let t=(e.left+e.right)/2,i=(e.top+e.bottom)/2,s=(e.right-e.left)/2,n=(e.bottom-e.top)/2;const r={x:t+s*Math.cos(e.startAngle*Math.PI/180),y:i-n*Math.sin(e.startAngle*Math.PI/180)};let a=e.startAngle*Math.PI/180,o=(e.startAngle+e.sweepAngle)*Math.PI/180,l=1!=Math.sign(e.sweepAngle);ee.moveTo(r.x,r.y),ee.ellipse(t,i,s,n,0,a,o,l)}circleDraw(e){void 0!==e.x&&void 0!==e.y&&void 0!==e.radius&&(ee.arc(e.x,e.y,e.radius,0,2*Math.PI),"stroke"===te?ee.stroke():"fill"===te&&ee.fill())}myRect(e){let t=e.right-e.left,i=e.bottom-e.top,s=e.left,n=e.top;ee.rect(s,n,t,i),"stroke"===te?ee.stroke():"fill"===te&&ee.fill()}drawLine(e){ee.moveTo(e.x0,e.y0),ee.lineTo(e.x1,e.y1),ee.lineWidth=e.lineWidth,ee.strokeStyle=e.clr,ee.stroke()}drawLinearGradientRect(e){const t=e.clrs,i=e.stops;if(!t||!i||t.length!==i.length)return void console.error("drawLinearGradientRect error: stopList size is not equal to colorList size.");const s=ee.createLinearGradient(e.x0,e.y0,e.x1,e.y1);for(let e=0;e<t.length;++e)s.addColorStop(i[e],t[e]);ee.fillStyle=s,ee.fillRect(0,0,Q.width,Q.height)}drawColor(e){let t=Q.getContext("2d");t.fillStyle=e,t.fillRect(0,0,Q.width,Q.height)}clearCanvas(){Q.getContext("2d").clearRect(0,0,Q.width,Q.height)}},F.ColorSpace={RGBA_8888:"RGBA_8888",RGBA_4444:"RGBA_4444",RGBA_5551:"RGBA_5551",RGB_565:"RGB_565",RGB_ETC1:"RGB_ETC1",RGBA_ETC1:"RGBA_ETC1"},F.QRCodeLevel={L:1,M:0,Q:3,H:2},F.TextureInstantLoad={AUTO:0,SYNC:1,ASYNC:2};class ie{RenderTextureWrapper(){this.RenderTexture=null}GetTextureId(){return this.RenderTexture?.IdToken}}class se extends ie{constructor(e,t,i){if(super(),this._Manager=e,i){F.sRenderTextureDelegateManager.CreateTextureStatus().SetResourceInfo(i)}this.RenderTexture=F.sRenderTextureDelegateManager.CreateTexture(),this.RenderTexture.SetResourceInfo(t),this._CallbackIdToken=0,de.set(this.RenderTexture.IdToken,this),this._OnLoadCallback=[],F.ForgeDebug.EnableTextureTracer&&(e._ImageTextureTracer.push(this),this._TracerDescript="")}get Unloaded(){return null===this.RenderTexture||this.RenderTexture.Unloaded}set Unloaded(e){}get LoadTime(){return null!==this.RenderTexture?this.RenderTexture.LoadTime:0}set LoadTime(e){}get Width(){return null!==this.RenderTexture?this.RenderTexture.Width:0}set Width(e){}get Height(){return null!==this.RenderTexture?this.RenderTexture.Height:0}set Height(e){}UnloadTex(){this._OnLoadCallback=[],null!==this.RenderTexture&&(this._CallbackIdToken>0&&(this.RenderTexture.UnregisterOnloadCallback(this._CallbackIdToken),this._CallbackIdToken=0),de.delete(this.RenderTexture.IdToken),this.RenderTexture.UndoRef(),this.RenderTexture=null),this._TracerDescript=""}RequestToUnload(){this.UnloadTex()}RegisterLoadImageCallback(e){if(this.IsLoaded()&&null!=e)return this.RenderTexture&&e(this.RenderTexture.Width,this.RenderTexture.Height),null;let t=null;return null!=e&&(t={callback:e},this._OnLoadCallback.push(t),0===this._CallbackIdToken&&(F.Assert(null!==this.RenderTexture),this._CallbackIdToken=this.RenderTexture.RegisterOnloadCallback(se.prototype._InvokeOnLoadCallbacks.bind(this)))),t}UnregisterLoadImageCallback(e){e&&this._OnLoadCallback.some(((t,i,s)=>{if(t===e)return s.splice(i,1),!0}))}EnableBackgroundLoad(e){}DisableBackgroundLoad(e){}_InvokeOnLoadCallbacks(e,t){const i=this._OnLoadCallback;this._OnLoadCallback=[];for(let s=0;s<i.length;s++){i[s].callback(e,t)}this.RenderTexture&&this.RenderTexture.UnregisterOnloadCallback(this._CallbackIdToken)}IsLoaded(){return 0!==this.LoadTime&&!this.Unloaded}SetTextureTracerDescript(e){this._TracerDescript=e}ReallocRenderTexture(){}}F.ImageTexture=se;class ne extends F.ImageTexture{constructor(e,t,i,s,n,r){const a=F.sRenderTextureDelegateManager.CreateResourceInfo(e.GetId(),"IMG");a.Set={URL:t,Siz:s,Clr:n||"",IsF:i?1:0,NtS:r,ILd:0},super(e,a),this.Name="IMG",this.Source=t,this.IsForever=i?1:0,this.TargetSize=s,this.ColorSpace=n||"",this.NetSetting=r||null,this._InstantLoad=0,this._ImageElement=new Image,this._ImageElement.onload=function(){this._Loaded()}.bind(this),this._ImageElement.onerror=function(){this._Loaded()}.bind(this),this._ImageElement.src=t,this.RenderTexture.NeedCheckExpired=!0}_Loaded(){null!=this.RenderTexture&&(this.RenderTexture.Unloaded=!1,this.RenderTexture.LoadTime=Date.now(),this.RenderTexture.Width=this._ImageElement.width,this.RenderTexture.Height=this._ImageElement.height,this.RenderTexture.InvokeOnloadCallbacks(this._ImageElement.width,this._ImageElement.height))}UnloadTex(){super.UnloadTex(),this._ImageElement.onload=null,this._ImageElement.onerror=null}InstantLoad(e){if(this._InstantLoad=e?1:0,this.RenderTexture){const e=this.RenderTexture.GetResourceInfo();null!==e&&(e.Set.ILd=this._InstantLoad,this.RenderTexture.SetResourceInfo(e))}return this}ReallocRenderTexture(){if(this.IsForever)return void F.LogE("ReallocRenderTexture(): NOT need for forever texture");const e=this.Source,t=this.TargetSize,i=this.ColorSpace,s=this.IsForever,n=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Manager.GetId(),this.Name);n.Set={URL:e,Siz:t,Clr:i,IsF:s,ILd:this._InstantLoad},this.RenderTexture=F.sRenderTextureDelegateManager.CreateTexture(),this.RenderTexture.SetResourceInfo(n),this._Manager.CachedTextureManager.CacheTheTexture(this)}}F.UrlImageTexture=ne;class re extends F.ImageTexture{constructor(e,t,i,s,n){const r=F.sRenderTextureDelegateManager.CreateResourceInfo(e.GetId(),"GRAD");r.Set={URL:n},super(e,r),this.Gradient=n}}F.GradientTexture=re;class ae extends F.ImageTexture{constructor(e,t,i,s){const n=F.sRenderTextureDelegateManager.CreateResourceInfo(e.GetId(),"LGT");n.Set={L:t,S:i},super(e,n),this.Gradient=s}static StopPoint=class{constructor(){this.stopPosition=0,this.color=""}}}F.LinearGradientTexture=ae;class oe extends F.ImageTexture{constructor(e,t,i,s,n,r,a,o,l,h,c){const u=F.sRenderTextureDelegateManager.CreateResourceInfo(e.GetId(),"TST");let d=null;c&&(d={x:0,y:0,w:0,h:0},Object.assign(d,c)),u.Set={ST:t,IDS:i.GetIdsPack(),W:Math.floor(n.width+.5),H:Math.floor(n.height+.5),FS:r,LA:l,EM:h,LH:Math.floor(a+.5),ILD:o?1:0,TLC:s?1:0,EA:d},super(e,u),this.Name="TST",this._TextStylePack=i,i.DoRef()}UnloadTex(){this._TextStylePack.UnRef(),super.UnloadTex()}}F.TextStyleTexture=oe;F.CachedTextureManager=class{constructor(e){this._TextureManager=e,this._Renderer=e.GetRenderer(),this._CachedTextureStack=[],this._LockedTextureStack=[],this._MemoryLimited=10485760,this._VisibleMark=1}SetMemoryLimited(e){this._MemoryLimited=1024*e*1024}_FindTexture(e,t,i){for(let s=this._CachedTextureStack.length-1;s>=0;s--){const n=this._CachedTextureStack[s];if(n.Source===e&&(t===n.TargetSize||null!==t&&t.Equals(n.TargetSize))&&i===n.ColorSpace){if(null===n.RenderTexture)continue;return n}}return null}CacheTheTexture(e){for(let t=this._CachedTextureStack.length-1;t>=0;t--)if(e===this._CachedTextureStack[t])return;this._CachedTextureStack.push(e)}_MarkVisibleViewTextures(e,t){e.TextureSetting&&e.TextureSetting.Texture&&(e.TextureSetting.Texture.VisibleMark=t);const i=e.ChildViews.length;for(let s=0;s<i;s++){const i=e.ChildViews[s];i&&"VISIBLE"!==i.Visibility||this._MarkVisibleViewTextures(i,t)}}ReduceInvisibleTexture(e){this._MarkVisibleViewTextures(e,++this._VisibleMark);for(let e=0;e<this._CachedTextureStack.length;e++){const t=this._CachedTextureStack[e];t.VisibleMark!==this._VisibleMark&&(t.UnloadTex(),this._CachedTextureStack.splice(e,1),e--)}}GetCacheSize(){return this._CachedTextureStack.length}};const le=new Map;let he=0;const ce=new Map;let ue=0,de=new Map;class ge{constructor(){this.CachedTextureManager=new F.CachedTextureManager(this),this._ForeverCachedTextureManager=new F.CachedTextureManager(this),this._AtlasDataInfo={atlas_data:[],buffer_data_offset:0,textures:[]},this._ClearTimer=-1,this._ImageTextureTracer=[],this._Id=ge.sTextureManagerToken++,this._CacheMaxSize=100,this.StartScavengerCachedTimer()}StartScavengerCachedTimer(){-1===this._ClearTimer&&(this._ClearTimer=F.ForegroundTimer.setInterval(this.ScavengerCached.bind(this),3e4))}GetId(){return this._Id}GetRenderer(){return F.sDeprecatedRenderer}GetGifImage(e,t,i){return this.GetImage(e,t,i)}GetImage(e,t,i){return e?this.GetImage2(e,t,null,F.ColorSpace.RGBA_8888,i,!1,!1):(F.LogI("GetImage, url is null!"),null)}GetImage2(e,t,i,s,n,r,a){if(!e)return F.LogI("GetImage2, url is null!"),null;if(0==e.indexOf("jsvtexturestore://")){const t=e.lastIndexOf("-");if(-1!==t){const i=e.substr(t+1),s=parseInt(i,10);if(!isNaN(s))return this.GetTextureById(s)}return console.error("Error: jsvtexturestore:// parse failed url="+e),null}let o=null;i&&(o=F.sRectUitls.FormatRectArea(i)),"string"!=typeof s&&(s=e.indexOf(".pkm")>=0?e.indexOf(".pkma")>=0?F.ColorSpace.RGBA_ETC1:F.ColorSpace.RGB_ETC1:F.ColorSpace.RGB_565);return this._GetImageInternal(e,o,s,t,!1,n)}CreateMiniGradientTexture(e,t,i,s){return new F.GradientTexture(this,e,t,i,s)}_GetImageInternal(e,t,i,s,n,r){if(s){const s=this._ForeverCachedTextureManager._FindTexture(e,t,i);if(s)return s}else{const s=this.CachedTextureManager._FindTexture(e,t,i);if(s)return s}const a=new F.UrlImageTexture(this,e,s,t,i,r);return a.IsForever?this._ForeverCachedTextureManager.CacheTheTexture(a):this.CachedTextureManager.CacheTheTexture(a),a}GetRoundCornerMask(e,t){return this.GetCustomCornerMask(e,t,t,t,t)}GetCustomCornerMask(e,t,i,s,n){const r=F.sRectUitls.FormatRectArea(e),a=Math.max(t,i,s,n);if(a>r.width/2||a>r.height/2)return F.LogE(`TextureManager.GetRoundCornerMask(): radius is too large, radius=${a} w=${r.width} h=${r.height}`),null;const o=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Id,"CCM");o.Set={W:r.width,H:r.height,LT:t,RT:i,LB:s,RB:n};const l=new F.ImageTexture(this,o);return F.ForgeDebug.EnableTextureTracer&&l.SetTextureTracerDescript("CornerMask"),l}GetOneCornerMask(e){const t=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Id,"OCM");t.Set={Rad:e};const i=new F.ImageTexture(this,t);return F.ForgeDebug.EnableTextureTracer&&i.SetTextureTracerDescript("OneCornerMask"),i}GetTextTextureFromStylePack(e,t,i,s,n,r,a,o,l,h){return e&&0!==e.length?new F.TextStyleTexture(this,e,t,i,s,n,r,a,o,l,h):null}_getParamsId(e,t,i){const s=e.font,n=e.size,r=e.italic,a=e.bold,o=e.alignment,l=e.vertical_align,h=e.vertical_area_align,c=e.textColour,u=e.backgroundColour,d=e.shadow;let g="";e.stroke_width&&(g=e.stroke_width);const f=t.text_overflow,m=t.word_wrap,p=[s,r,a,d,g].join(":"),y=[n,o,l,h,f,m].join(":");let T="",_="";return le.has(p)?T=le.get(p):(T=`TS${he}`,le.set(p,T),he++),ce.has(y)?_=ce.get(y):(_=`DS${ue}`,ce.set(y,_),ue++),[T,_,c,u]}GetTextTextureByMultiRows(e,t,i,s,n,r,a,o,l){const h=e.str;if(null===h||0===h.length)return null;const c=F.sRenderBridge.GetScreenInfo().scaleRatio,u=Object.assign(i);u.x*=c,u.y*=c,u.width*=c,u.height*=c;const d=Object.assign(e);d.size=Math.ceil(d.size*c),s*=c;const g={ST:e.str,AT:JSON.stringify({TO:t.text_overflow,WW:t.word_wrap}),RA:JSON.stringify({X:parseInt(u.x+.5,10),Y:parseInt(u.y+.5,10),W:parseInt(u.width+.5,10),H:parseInt(u.height+.5,10)}),LA:o,LH:parseInt(s+.5,10),ILD:void 0!==a?a:1};if(r&&(g.SH=JSON.stringify({T:r.Type,P:r.Params})),void 0!==window.JsView&&void 0!==window.JsView.ForgeNativeRevision&&window.JsView.ForgeNativeRevision>0){const e=this._getParamsId(d,t,r);g.PI={FS:e[0],DS:e[1],TC:e[2],BC:e[3]}}const f=this._BuildTextTextureAndSerialStatus(g,d);if(null!==l){const e=Object.assign({},g);e.ST=null,e.TLC=0,l.Set=e,l.Swf=Object.assign({},d)}let m=u.height;if(void 0!==window.PlatformUtils&&!1===n){m=window.PlatformUtils.GetTextRect(h,u,d,t,s).height}if(m=Math.floor(m/c+.5),F.ForgeDebug.EnableTextureTracer){let t=e.str;t.length>8&&(t=`${e.str.substr(0,8)}...`),f.SetTextureTracerDescript(`[${t}]`)}return{texture:f,real_height:m}}GetCopiedTextTexture(e,t,i,s){const n=Object.assign({},i.Set);n.ST=e,n.TLC=void 0!==s&&s?1:0;const r=i.Swf,a=F.sRenderBridge.GetScreenInfo().scaleRatio;n.RA=JSON.stringify({X:parseInt(t.x*a+.5,10),Y:parseInt(t.y*a+.5,10),W:parseInt(t.width*a+.5,10),H:parseInt(t.height*a+.5,10)});const o=this._BuildTextTextureAndSerialStatus(n,r);if(F.ForgeDebug.EnableTextureTracer&&e){let t=e;t.length>8&&(t=`${e.substr(0,8)}...`),o.SetTextureTracerDescript(`[${t}]`)}return o}_BuildTextTextureAndSerialStatus(e,t){F.sRenderTextureDelegateManager.AppendFontStatusIfNeed(e,t);let i=null;e.FO&&(i={STA:{Nam:"T",Sta:e.FO}});const s=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Id,"T");return s.Set=e,new F.ImageTexture(this,s,i)}GetCanvasTexture(e,t){return new F.UrlImageTexture(this,F.sCustomCanvasResProvider.GetDataUrl(e),!1,null,F.ColorSpace.RGBA_8888,null)}GetColorTexture(e){const t=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Id,"CT");t.Set={Clr:e};const i=new F.ImageTexture(this,t);return F.ForgeDebug.EnableTextureTracer&&i.SetTextureTracerDescript(`Color[${e}]`),i}GetColorTextureCached(e){return this.GetColorTexture(e)}GetNamedCachedTexture(e){return null}CreateCssGradientColorTexture(e,t,i,s,n,r){let a=[];for(let e of r){let t={stop:e.stopPosition,color:e.color};a.push(t)}return new F.LinearGradientTexture(this,JSON.stringify({x0:t,y0:i,x1:s,y1:n}),JSON.stringify(a),e)}ScavengerCached(){this.CachedTextureManager.GetCacheSize()>=this._CacheMaxSize&&this.CachedTextureManager.ReduceInvisibleTexture(F.sRootView)}GetOffScreenMediaTexture(e){if(void 0===window.OffscreenVideoPlayer||!(e instanceof window.OffscreenVideoPlayer))return null;if(!e.hasTerminator()){const t=this._BuildVideoTexture(e);e.setResourceTerminator((()=>{t.UnloadTex()}))}return this._BuildVideoTexture(e)}_BuildVideoTexture(e){const t=F.sRenderTextureDelegateManager.CreateResourceInfo(this._Id,"VPLY");t.Set={Hdl:e.mediaHandler()};const i=new F.ImageTexture(this,t);return F.ForgeDebug.EnableTextureTracer&&i.SetTextureTracerDescript(`Video[${e.mediaHandler()}]`),i}GetTextureById(e){return de.has(e)?de.get(e):(console.error(`TextureManager: texture not found id=${e}`),null)}}ge.sTextureManagerToken=100,F.TextureManager=ge,window.TextureManager=F.TextureManager;F.LayoutViewDebugClass=class{SetTextureTracer(e){}GetTextureTracer(){return null}},F.ForgeDebug=new F.LayoutViewDebugClass,window.ForgeDebug=F.ForgeDebug;class fe{constructor(){this.Width=0,this.Height=0,this.MarginTop=0,this.MarginLeft=0,this.MarginRight=0,this.MarginBottom=0,this.Z=0,this.SizeAdjust=!1}SetPosition(e,t,i){this.MarginTop=t,this.MarginLeft=e,i&&(this.Z=i)}SetSize(e,t){this.Width=e,this.Height=t}Clone(){const e=new fe(null);return e.Width=this.Width,e.Height=this.Height,e.MarginTop=this.MarginTop,e.MarginLeft=this.MarginLeft,e.MarginRight=this.MarginRight,e.MarginBottom=this.MarginBottom,e.Z=this.Z,e.SizeAdjust=this.SizeAdjust,e}Equals(e){return e.Width===this.Width&&e.Height===this.Height&&e.MarginTop===this.MarginTop&&e.MarginLeft===this.MarginLeft&&e.MarginRight===this.MarginRight&&e.MarginBottom===this.MarginBottom&&e.Z===this.Z}}F.LayoutParamsBase=fe;class me extends F.LayoutParamsBase{constructor(e){super(),e instanceof F.RectArea&&(e={x:e.x,y:e.y,width:e.width,height:e.height}),e&&(e.x?this.MarginLeft=e.x:e.marginLeft&&(this.MarginLeft=e.marginLeft),e.y?this.MarginTop=e.y:e.marginTop&&(this.MarginTop=e.marginTop),e.z&&(this.Z=e.z),e.width&&(this.Width=e.width),e.height&&(this.Height=e.height),isNaN(this.MarginTop)&&(F.LogE("isNaN(this.MarginTop)!"),this.MarginTop=0),isNaN(this.MarginLeft)&&(F.LogE("isNaN(this.MarginLeft)!"),this.MarginLeft=0),"MatchParent"!==this.Width?isNaN(this.Width)&&F.LogE("isNaN(this.Width)!"):this.SizeAdjust=!0,"MatchParent"!==this.Height?isNaN(this.Height)&&F.LogE("isNaN(this.Height)!"):this.SizeAdjust=!0)}}F.LayoutParams=me,window.LayoutParams=F.LayoutParams;F.RenderTextureDelegateManager=class{constructor(){this._IdTokenGenerator=66,F.sRenderTextureDelegateManager=this,this._CheckExpiredTime=0}CreateTextureHeadStatus(){const e=new F.RenderTextureDelegate(this,0);return e.DoRef(),e}CreateTextureStatus(){const e=new F.RenderTextureDelegate(this,0);return e.DoRef(),e}CreateTexture(){const e=new F.RenderTextureDelegate(this,this._IdTokenGenerator++);return e.DoRef(),e}RecycleTexture(e){}CreateResourceInfo(e,t){return{Id:0,Nam:t,Set:null,TmId:e,NdLd:0}}AppendFontStatusIfNeed(e,t){const i={};i.Fo=t.font,i.Si=t.size,i.It=t.italic,i.Bo=t.bold,i.Al=t.alignment,i.Ve=t.vertical_align,i.Vaa=t.vertical_area_align,i.Tx=t.textColour,i.Ba=t.backgroundColour,i.En=t.enableBlend,i.Sh=t.shadow,t.stroke_width?i.Stk=t.stroke_width:i.Stk=-1,e.FO=JSON.stringify(i)}},F.sRenderTextureDelegateManager=new F.RenderTextureDelegateManager;F.RenderTextureDelegate=class{constructor(e,t){this.IdToken=t,this._Manager=e,this._Reference=0,this._SyncingResourceInfo=null,this._OnloadCallbacks={},this._OnloadCallbacksSize=0,this._OnloadCallbackIdGenerator=1,this.Unloaded=!0,this.LoadTime=0,this.RequireTime=0,this.ForceExpire=!1,this.NeedCheckExpired=!1;if(F.ForgeDebug.GetTextureTracer()){const e=new Error;this.Stack=e.stack}}DoRef(){this._Reference++}UndoRef(){this._Reference--,0===this._Reference&&(this._OnloadCallbacksSize>0&&(this._OnloadCallbacks={}),this._Manager.RecycleTexture(this))}SetResourceInfo(e){e.Id=this.IdToken,this._SyncingResourceInfo=e}GetResourceInfo(){return this._SyncingResourceInfo}ReadSyncInfo(){const e=this._SyncingResourceInfo;return this._SyncingResourceInfo=null,e}RegisterOnloadCallback(e){const t=this._OnloadCallbackIdGenerator++;return this._OnloadCallbacks[`${t}`]=e,this._OnloadCallbacksSize++,null!==this._SyncingResourceInfo&&(this._SyncingResourceInfo.NdLd=1),t}UnregisterOnloadCallback(e){delete this._OnloadCallbacks[`${e}`],this._OnloadCallbacksSize--}InvokeOnloadCallbacks(e,t){if(this._OnloadCallbacksSize>0)for(const i in this._OnloadCallbacks)this._OnloadCallbacks.hasOwnProperty(i)&&this._OnloadCallbacks[i](e,t)}IsLoaded(){return 0!==this.LoadTime&&!this.Unloaded}};F.DeprecatedRenderer=class{constructor(){F.sDeprecatedRenderer=this,this._SharedTextureManager=this.CreateTextureManager()}SetUserId(e){F.sRenderBridge.UpdateUserId(e)}GetScreenInfo(){return F.sRenderBridge.GetScreenInfo()}StringWithFont(){return F.sTextUtils.StringWithFont.apply(this,arguments)}GetTextWidth(){return F.sTextUtils.GetTextWidth.apply(this,arguments)}GetTextUtils(){return F.sTextUtils}RectArea(e,t,i,s){return new F.RectArea(e,t,i,s)}TextAttr(){return F.sTextUtils.TextAttr.apply(this,arguments)}GarbageCollect(){F.LogM("GarbageCollect called")}TriggerFrameDraw(){F.sRenderBridge.RequestSwap()}GetSharedTextureManager(){return this._SharedTextureManager}CreateTextureManager(){return new F.TextureManager}},F.sDeprecatedRenderer=null;const pe={STRING:Symbol("STRING"),FUNCTION:Symbol("FUNCTION"),LINE_FEED:Symbol("LINE_FEED"),LEFT_BRACE:Symbol("LEFT_BRACE"),RIGHT_BRACE:Symbol("RIGHT_BRACE")};const ye={},Te={BASE:Symbol("BASE"),COLOR:Symbol("COLOR"),BOLD:Symbol("BOLD"),ITALIC:Symbol("ITALIC"),DECORATION:Symbol("DECORATION"),SUPERSCRIPT:Symbol("SUPERSCRIPT"),SUBSCRIPT:Symbol("SUBSCRIPT")};class _e{constructor(){this.style,this.styleValue=""}}class xe{constructor(){this.textStyle=new _e,this.childNodes=[],this.parent}}class we extends xe{constructor(){super(),this.styleList=[],this.indexPair,this.lineFeedNode=!1,this.testValue}}function Se(e){if(null===e||0===e.length)return null;const t=function(e){const t=[];let i=0;for(;i<e.length;)if("\\"===e[i])if(i<e.length-1)if("\\"===e[i+1]||"{"===e[i+1]||"}"===e[i+1]){const e=[i+1,i+2],s={type:pe.STRING,indexPair:e};t.push(s),i+=2}else{++i;const s=i;let n=i,r=!1;for(;i<e.length&&"{"!==e[i]&&"}"!==e[i];)" "!==e[i]&&(r=!0)," "===e[i]&&r?++i:n=++i;const a=[s,n],o={type:pe.FUNCTION,indexPair:a};t.push(o)}else console.error("backslash at end.");else if("{"===e[i]){const e={type:pe.LEFT_BRACE,indexPair:null};t.push(e),++i}else if("}"===e[i]){const e={type:pe.RIGHT_BRACE,indexPair:null};t.push(e),++i}else if("\n"===e[i]){const e={type:pe.LINE_FEED,indexPair:null};t.push(e),++i}else{const s=i;let n=i;for(;i<e.length&&"\\"!==e[i]&&"{"!==e[i]&&"}"!==e[i]&&"\n"!==e[i];)++i,n=i;const r=[s,n],a={type:pe.STRING,indexPair:r};t.push(a)}for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.type===pe.STRING){let n=!0;for(let t=s.indexPair[0];t<s.indexPair[1];t++)if(" "!==e[t]){n=!1;break}!(n&&i>0&&i<t.length-1)||t[i-1].type!==pe.LEFT_BRACE&&t[i-1].type!==pe.RIGHT_BRACE||t[i+1].type!==pe.RIGHT_BRACE&&t[i+1].type!==pe.LEFT_BRACE||t.splice(i,1)}}return t}(e),i=[],s=[];let n=0;for(;n<t.length;){const r=t[n];if(r.type===pe.STRING){const e=new we;s.push(e),e.indexPair=r.indexPair,e.textStyle.style=Te.BASE,i.push(e)}else if(r.type===pe.LINE_FEED){const e=new we;s.push(e),e.lineFeedNode=!0}else if(r.type===pe.LEFT_BRACE)i.push(ye);else if(r.type===pe.RIGHT_BRACE)if(i.length>0){const e=[];let t=i.pop();for(;t!==ye&&(e.push(t),i.length>0);)t=i.pop();if(i.length>0){const t=i[i.length-1];if(t.textStyle.style===Te.BASE)console.error("lack of function");else for(;e.length>0;){const i=e.pop();t.childNodes.push(i),i.parent=t}}else console.error("lack of function")}else console.error("extra }");else if(r.type===pe.FUNCTION){const s=e.substring(r.indexPair[0],r.indexPair[1]),a=new xe;switch(s){case"textcolor":if(n<t.length-3){a.textStyle.style=Te.COLOR;const i=t[n+1],s=t[n+2],r=t[n+3];i.type===pe.LEFT_BRACE&&s.type===pe.STRING&&r.type===pe.RIGHT_BRACE?(a.textStyle.styleValue=e.substring(s.indexPair[0],s.indexPair[1]),n+=3):console.error("textcolor param format error.")}else console.error("textcolor param format error.");break;case"textb":a.textStyle.style=Te.BOLD;break;case"texti":a.textStyle.style=Te.ITALIC;break;case"textdecoration":if(n<t.length-3){a.textStyle.style=Te.DECORATION;const i=t[n+1],s=t[n+2],r=t[n+3];i.type===pe.LEFT_BRACE&&s.type===pe.STRING&&r.type===pe.RIGHT_BRACE?(a.textStyle.styleValue=e.substring(s.indexPair[0],s.indexPair[1]),n+=3):console.error("textdecoration param format error.")}else console.error("textdecoration param format error.");break;case"textsup":a.textStyle.style=Te.SUPERSCRIPT;break;case"textsub":a.textStyle.style=Te.SUBSCRIPT;break;default:console.error(`undefined style type: ${s}`)}i.push(a)}++n}return s.forEach(((e,t,i)=>{let s=e.parent;for(;s;)e.styleList.push(s.textStyle),s=s.parent})),{nodeList:s,text:e}}function ve(){this.positionQueue=[],this.timeQueue=[]}ve.prototype.reset=function(){this.positionQueue=[],this.timeQueue=[]},ve.prototype.pruneQueue=function(e){for(;this.timeQueue.length&&this.timeQueue[0]<Date.now()-e;)this.timeQueue.shift(),this.positionQueue.shift()},ve.prototype.updatePosition=function(e){this.positionQueue.push(e),this.timeQueue.push(Date.now()),this.pruneQueue(50)},ve.prototype.getVelocity=function(){this.pruneQueue(1e3);const e=this.timeQueue.length;if(e<2)return 0;const t=(this.timeQueue[e-1]-this.timeQueue[0])/1e3,i=this.positionQueue[e-1]-this.positionQueue[0];return console.log(`getVelocity distance:${i}, time:${t}, velocity:${i/t}, this.timeQueue[length-1]:${this.timeQueue[e-1]}, this.timeQueue[0]:${this.timeQueue[0]}`),i/t},window.gRootView=null,F.sRootView=null;class be{constructor(e,t,i,s){this.Texture=e,this._IsTextureExternal=!1,t instanceof F.ImageTexture?(t&&t.RenderTexture&&t.RenderTexture.NeedCheckExpired&&(t.RenderTexture.RequireTime=0),this.MaskSetting=new F.ViewTextureMask(t)):this.MaskSetting=t,e&&e.RenderTexture&&e.RenderTexture.NeedCheckExpired&&(e.RenderTexture.RequireTime=0),this._IsMaskTextureExternal=!1,this.TextureBeforeImageLoad=i,this._IsPreloadImageTextureExternal=!1,void 0===s&&(s=!0),this.HasAlpha=s}SetExternal(e,t,i){this._IsTextureExternal=e,this._IsMaskTextureExternal=t,this._IsPreloadImageTextureExternal=i}ReleaseInternalTexture(e,t){!this._IsTextureExternal&&this.Texture&&(this.Texture.UnloadTex(),this.Texture=null),!this._IsMaskTextureExternal&&this.MaskSetting&&(this.MaskSetting.UnLoad(),this.MaskSetting=null),!this._IsPreloadImageTextureExternal&&this.TextureBeforeImageLoad&&(this.TextureBeforeImageLoad.UnloadTex(),this.TextureBeforeImageLoad=null)}DebugPrint(){return` _IsTextureExternal=${this._IsTextureExternal}`}}F.TextureSetting=be,window.TextureSetting=F.TextureSetting;class Ee extends F.TextureSetting{constructor(e,t,i,s){super(e,t,i,s),this.SetExternal(!0,!0,!0)}}F.ExternalTextureSetting=Ee,window.ExternalTextureSetting=F.ExternalTextureSetting;F.PackedLayout=class{constructor(e){const t=e.RectInfo;this.RectInfo={coordX:t.coordX,coordY:t.coordY,width:t.width,height:t.height},this.LayoutParams=JSON.parse(JSON.stringify(e.LayoutParams))}ApplyToView(e){const t=this.RectInfo;e.RectInfo={coordX:t.coordX,coordY:t.coordY,width:t.width,height:t.height},e.LayoutParams=JSON.parse(JSON.stringify(this.LayoutParams))}};class Ce{constructor(){this._MaskType="COMMON"}Type(){return this._MaskType}UnLoad(){}}F.ViewMask=Ce;class Ie extends F.ViewMask{constructor(e){super(),this._MaskType="TEXTURE",this.ImageTexture=e}UnLoad(){this.ImageTexture.UnloadTex()}}F.ViewTextureMask=Ie;class Ae extends F.ViewMask{constructor(e,t,i,s){super(),this._MaskType="CORNER",this._TopLeft=e,this._TopRight=isNaN(t)?e:t,this._BottomLeft=isNaN(i)?e:i,this._BottomRight=isNaN(s)?e:s,this._CornersWidth=[0,0,0,0],this._CornersDisable=[0===this._TopLeft?1:0,0===this._TopRight?1:0,0===this._BottomLeft?1:0,0===this._BottomRight?1:0]}UnLoad(){}}F.ViewRoundCornerMask=Ae;class Pe{constructor(e,t,i,s,n,r){this.DragDirection=e||0,this.TriggerMovedDistance=t||0,this._EnableJsFling=i?1:0,this.SlidePile=s||new F.RectArea(0,0,1280,720),this.PageWidth=n>0?n:65535,this.EnableTabMode=n>0,this.PageEdge=r||1/4}}Pe.DIRECTION_DISABLE=0,Pe.DIRECTION_VERTICAL=1,Pe.DIRECTION_HORIZONTAL=2,Pe.DIRECTION_AUTO=Pe.DIRECTION_VERTICAL|Pe.DIRECTION_HORIZONTAL,F.DragSetting=Pe;class Le{constructor(){this.Settings=null,this.Listener=null,this.ListenerFlags=0,this.OverListener=null,this.OverListenerFlags=0,this.Formula=null,this.SyncString=null}SetListener(e){this.Listener=e}}Le.INFLEXION=.35,Le.DECELERATION_RATE=Math.log(.78)/Math.log(.9),Le.PHYSICAL_COEF=51890.2,F.DragInfo=Le,F.DragInfo.SCROLL_FRICTION=.06,F.DragInfo.EVENT_TYPE={OnDown:0,OnTap:1,OnLongPress:2,OnDragStart:3,OnMoved:4,OnDragEnd:5,OnRelease:6,OnFling:7};let ke=0;class Re{constructor(e,t){this.TextureSetting=e,this._dispatchLongPress=this._dispatchLongPress.bind(this),this.Visibility="VISIBLE",this.LayoutParams=null,this.ParentView=null,this.ChildViews=[],this.zIndex=0,this._Perspective=0,this._PerspectiveAnchor=[.5,.5],this._BackfaceVisibility=1,this._DebugCount=++ke,this.childZIndexCount=0,this._IsChildOfRootView=!1,this._DetachFromSystemCallback=null,this.Element=null,this.InnerChildElement=null,this.TouchFeatureBit=0,this.TapCallback=null,"root"===t?(this.Element=window.originDocument.getElementById(t),this.Element||(this.Element=window.originDocument.getElementById("app"))):"svg"===t||"path"===t?this.Element=document.createElementNS("http://www.w3.org/2000/svg",t):"jsv-element-proxy"===t?this.Element=null:t&&(this.Element=window.originDocument.createElement(t),this.Element.style.position="absolute"),this.TransitionStore={},this.TransformAnimationObj=null,this._TextureAnimationObj=null,this._DragInfo=null,this.DragControl=null,this._Velocity={x:new ve,y:new ve},this._TouchSlopSquare=64,this._InDragging=null,this._InLongPress=null,this._AlwaysInTapRegion=null,this._LastFocusX=null,this._LastFocusY=null,this._DownFocusX=null,this._DownFocusY=null,this._LastTimeStamp=null,this._ObjectFitTestCache=null,this._ProxyView=null,this.Expired=!1,this._SizeFromChild=null,this._ChildrenFromChild0=!1,this._FlexAssignedCallback=null,this._MySizeObserver=null,this.FlexInfoPack=null,this.FlexInfoPackWeak=null,this._EnableVisibleTestRect=!1}Init(e){this.ResetTexture(e)}SetElementProp(e,t,i){switch(t){case"innerview":{const e=F.sViewStore.get(i);if(e){const t=e.view;null==this.LayoutParams&&this.ResetLayoutParams({x:0,y:0,width:0,height:0});let i=this.LayoutParams;this.ResetLayoutParams({x:0,y:0,width:0,height:0}),t&&(null===this._ProxyView?this._InsertProxyLayer(t,i):t!==this._ProxyView&&console.error("Error: Can not reset proxy view"))}break}case"enable-fade":case"poster-on-top":case"text-definition":break;case"id":this.Element&&this.Element.setAttribute("id",i);break;default:F.LogE(`Error: View Unknown prop name=${t}`)}}InsertView(e,t,i){this._InsertView(e,t,i)}AddView(e,t=0,i=0,s=0,n=0){this._InsertView(e,null,{x:t,y:i,width:s,height:n})}ReOrderChildView(e,t){if(null!=this._ProxyView&&child_view_to_move!=this._ProxyView)return void this._ProxyView.ReOrderChildView(e,t);let i=!1;for(var s=0;s<this.ChildViews.length;s++)if(this.ChildViews[s]==e){this.ChildViews.splice(s,1),i=!0;break}if(i||F.LogE("ReOrderChildView(): view is not in child list stack="),t){let i=this.ChildViews.indexOf(t);i<0&&(i=this.ChildViews.length),this.ChildViews.splice(i,0,e)}else this.ChildViews.push(e);this._ChildrenListDirty=!0}MoveChildView(e,t,i){if(null!=this._ProxyView&&e!=this._ProxyView)return void this._ProxyView.MoveChildView(e,t);let s=!1;for(var n=0;n<this.ChildViews.length;n++)if(this.ChildViews[n]==e){0!=e.zIndex&&this.childZIndexCount--,this.ChildViews.splice(n,1),e.ParentView=null,s=!0;break}s||F.LogE("MoveChildView(): view is not in child list stack="),t._InsertView(e,i,e.LayoutParams);let r=null;i&&(r=t.ChildViews[t.ChildViews.indexOf(i)+1]),r&&t.Element.contains(r.Element)?t.Element.insertBefore(e.Element,r.Element):t.Element.appendChild(e.Element)}IsVisibleInTree(){if(!this._IsChildOfRootView)return!1;let e=this,t=this;for(;t;){if("hidden"==t.Element?.style?.visibility)return!1;e=t,t=t.ParentView}return e instanceof F.RootView}_InsertView(e,t,i){if(i?i instanceof F.LayoutParamsBase?e.LayoutParams=i.Clone():e.LayoutParams=new F.LayoutParams(i):e.LayoutParams||(e.LayoutParams=new F.LayoutParams({x:0,y:0})),null!==e.LayoutParams&&(e.LayoutParams.MarginLeft&&(e.Element.style.left=`${e.LayoutParams.MarginLeft}px`),e.LayoutParams.MarginTop&&(e.Element.style.top=`${e.LayoutParams.MarginTop}px`),e.LayoutParams.Width&&(e.Element.style.width=`${e.LayoutParams.Width}px`),e.LayoutParams.Height?e.Element.style.height=`${e.LayoutParams.Height}px`:e.Element.style.height=""),e.ParentView=this,t){let i=this.ChildViews.indexOf(t);i<0&&(i=this.ChildViews.length),this.ChildViews.splice(i,0,e)}else this.ChildViews.push(e);this._ChildrenListDirty=!0,this._IsChildOfRootView&&e._OnAttachToSystem(),0!=e.zIndex&&this.childZIndexCount++,this.childZIndexCount>0&&this._RequestZIndexReorder()}SetZIndex(e){if(e!=this.zIndex){var t=this.zIndex;this.zIndex=e;var i=this.ParentView;i&&(0==t&&0!=e?i.childZIndexCount++:0!=t&&0==e&&i.childZIndexCount--,i.childZIndexCount<0&&F.ThrowError("ERROR: LayoutViewBase, child z-index count ERROR"),i._RequestZIndexReorder())}}_RequestZIndexReorder(){let e=[],t=[],i=0,s=this.ChildViews.length;for(var n=0;n<s;n++){let s=this.ChildViews[n].zIndex;s<0?(s<i&&(i=s),e.push(this.ChildViews[n])):s>0&&t.push(this.ChildViews[n])}i=1e3*Math.floor(-i/1e3)+1e3;let r=e.length,a=t.length;if(r>0){e.sort(((e,t)=>e.zIndex-t.zIndex));for(n=0;n<r;n++)e[n].Element.style.zIndex=e[n].zIndex+i}if(this.ChildViews.length-e.length-t.length>0)for(n=0;n<s;n++)0==this.ChildViews[n].zIndex&&(this.ChildViews[n].Element.style.zIndex=i);if(a>0){t.sort(((e,t)=>e.zIndex-t.zIndex));for(n=0;n<a;n++)t[n].Element.style.zIndex=t[n].zIndex+i}}SetPerspective(e,t){this.Element.style.perspective=`${e}px`,this.Element.style.webkitPerspective=`${e}px`,this.Element.style.perspectiveOrigin=t,this.Element.style.webkitPerspectiveOrigin=t,this._Perspective=e,this._PerspectiveOrigin=t}SetBackfaceVisibility(e){this.Element.style.backfaceVisibility=e?"visible":"hidden",this.Element.style.webkitBackfaceVisibility=e?"visible":"hidden",console.log(`back face style ${this.Element.style.backfaceVisibility}`),this._BackfaceVisibility=e?1:0}SetTransformStyle(e){this.Element.style.transformStyle=e,this.Element.style.webkitTransformStyle=e,this._TransformStyle=e}EnableDivTouch(e,t){e.eventHandlers&&e.eventHandlers.onClick&&(this.Element.onclick=t=>{e.eventHandlers.onClick(),t.preventDefault&&t.preventDefault()},this.Element.style.pointerEvents="auto")}_DoDragPause(e){this._DragInfo.Settings.EnableTabMode||this.DragControl&&this.DragControl.pause(((t,i)=>{if(null!==this.Element.style.transform){let s=this.GetLayoutParams();s=this._GetMovedLayoutParams(t-s.MarginLeft,i-s.MarginTop),this.ResetLayoutParams(s),this._DragImactSensorRecycle(),console.log(`_DoDragPause lp.MarginLeft:${s.MarginLeft}, lp.MarginTop:${s.MarginTop}`),this.DragControl=null,this.Element.style.transform=null,e.viewX=t,e.viewY=i,this._DragInfo.Listener.OnFling(e)}}))}TouchEventProcess(e){let t=!1;switch(e.type){case F.DragInfo.EVENT_TYPE.OnDown:console.log("TouchEventProcess OnDown in"),this._DoDragPause(e),this._DragInfo.Listener&&this._DragInfo.Listener.OnDown&&(t=this._DragInfo.Listener.OnDown(e));break;case F.DragInfo.EVENT_TYPE.OnTap:this._DragInfo.Listener&&this._DragInfo.Listener.OnTap&&(t=this._DragInfo.Listener.OnTap(e));break;case F.DragInfo.EVENT_TYPE.OnLongPress:this._DragInfo.Listener&&this._DragInfo.Listener.OnLongPress&&(t=this._DragInfo.Listener.OnLongPress(e));break;case F.DragInfo.EVENT_TYPE.OnDragStart:this._DragMovedDistanceX=0,this._DragMovedDistanceY=0,this._DragInfo.Listener&&this._DragInfo.Listener.OnDragStart&&(t=this._DragInfo.Listener.OnDragStart(e));break;case F.DragInfo.EVENT_TYPE.OnMoved:this._DragInfo.Listener&&this._DragInfo.Listener.OnMoved&&(t=this._DoDragMove(e,!0));break;case F.DragInfo.EVENT_TYPE.OnDragEnd:if(this._DragInfo.Listener&&this._DragInfo.Listener.OnDragEnd){t=!!this._SlideIfEnableTabMod(e,-1)||this._DoDragEnd(e)}break;case F.DragInfo.EVENT_TYPE.OnRelease:this._DragInfo.Listener&&this._DragInfo.Listener.OnRelease&&(t=this._DragInfo.Listener.OnRelease(e));break;case F.DragInfo.EVENT_TYPE.OnFling:if(this._DragInfo.Listener&&this._DragInfo.Listener.OnFling){t=!!this._SlideIfEnableTabMod(e,-1)||this._DoFling(e)}break;default:console.log(`TouchEventProcess:${e}`)}return t}RemoveView(e){for(let t=0;t<this.ChildViews.length;t++)if(this.ChildViews[t]===e){e.IsChildOfRootView()&&e._OnDetachFromSystem(),this.ChildViews.splice(t,1),e.ParentView=null;break}}_OnDetachFromSystem(){this._IsChildOfRootView=!1,this._DetachFromSystemCallback?(this._DetachFromSystemCallback.some(((e,t,i)=>{e()})),this._DetachFromSystemCallback=null):this.OnDettachFromSystem();for(let e=0;e<this.ChildViews.length;e++){this.ChildViews[e]._OnDetachFromSystem()}this.ParentView.Element.removeChild(this.Element),this._releaseViewResources()}RegisterDetachCallback(e){e&&(null==this._DetachFromSystemCallback&&(this._DetachFromSystemCallback=[]),this._DetachFromSystemCallback.push(e))}UnregisterDetachCallback(e){if(e&&this._DetachFromSystemCallback){let t=!1,i=this._DetachFromSystemCallback;for(let s=0;s<i.length;s++)if(i[s]===e){i.splice(s,1),t=!0;break}t?0==i.length&&(this._DetachFromSystemCallback=null):console.error("no found")}else console.error("Unregister nothing...")}OnDettachFromSystem(){}_releaseViewResources(){this.Expired||(this.StopAnimation(),this.StopTextureAnimation(),this.Expired=!0)}ClearViews(){const e=this.ChildViews.length;if(0!==e){for(let t=0;t<e;t++){const e=this.ChildViews[t];e&&e.IsChildOfRootView()&&e._OnDetachFromSystem()}this.ChildViews=[]}}_ResetTextStyle(e){this.Element.style.overflow="hidden";let t=F.sTextStyleCache.GetDsFromId(e.Set.IDS.DS).Describe,i=F.sTextStyleCache.GetFsFromId(e.Set.IDS.FS).Describe,s=F.sTextStyleCache.GetCsFromId(e.Set.IDS.CS).Describe,n=null;"DISABLE"!==e.Set.IDS.SS&&(n=F.sTextStyleCache.GetSsFromId(e.Set.IDS.SS).Describe),this.Element.style.fontFamily=i.font,this.Element.style.fontSize=`${e.Set.FS}px`,i.italic&&(this.Element.style.fontStyle="italic"),i.bold?this.Element.style.fontWeight="bold":this.Element.style.fontWeight="normal",this.Element.style.textAlign=t.alignment,this.Element.style.verticalAlign=t.vertical_area_align,this.Element.style.direction=t.direction;let r=s.text_color;this.Element.style.color=r;let a=s.bg_color;this.Element.style.backgroundColor=a,n&&(n.shadow_blur>0&&(this.Element.style.textShadow=`${n.shadow_offset_x}px ${n.shadow_offset_y}px ${n.shadow_blur}px ${n.shadow_color}`),n.stroke_width>0&&(this.Element.style.WebkitTextStroke=`${n.stroke_width}px ${n.stroke_color}`)),this.Element.style.width=`${e.Set.W}px`,this.Element.style.height=`${e.Set.H}px`;let o=parseInt(this.Element.style.fontSize);if(e.Set.LH&&(this.Element.style.lineHeight=`${e.Set.LH}px`,o=parseInt(this.Element.style.lineHeight)),e.Set.EA){let t=e.Set.EA,i=window.originDocument.createElement("div");i.style.float=t.x>0?"right":"left",i.style.width=t.w+"px",i.style.height=t.h-1+"px",i.style.backgroundColor="rgba(0,0,0,0)",i.style.position="relative",this.Element.appendChild(i)}this.Element.style.textOverflow=t.text_overflow,this.Element.style.wordBreak="normal";let l=!1,h=t.word_wrap;if("none"===h?this.Element.style.whiteSpace="nowrap":h&&(this.Element.style.wordWrap=h.replace("_","-"),l=!0),l&&"ellipsis"==this.Element.style.textOverflow&&(this.Element.style.display="-webkit-box",this.Element.style.webkitLineClamp=""+Math.floor(parseInt(this.Element.style.height)/o),this.Element.style.webkitBoxOrient="vertical"),e.Set.LA){const t=Se(e.Set.ST);!function(e,t){const i=t.text;for(const s of t.nodeList){if(s.lineFeedNode){e.appendChild(window.originDocument.createElement("br"));continue}const t=i.substring(s.indexPair[0],s.indexPair[1]),n=window.originDocument.createElement("span");let r,a=n;for(const e of s.styleList)switch(e.style){case Te.BASE:break;case Te.BOLD:r=window.originDocument.createElement("b"),a.appendChild(r),a=r;break;case Te.ITALIC:r=window.originDocument.createElement("i"),a.appendChild(r),a=r;break;case Te.COLOR:n.style.color=e.styleValue;break;case Te.DECORATION:n.style.textDecoration=e.styleValue;break;case Te.SUPERSCRIPT:r=window.originDocument.createElement("sup"),a.appendChild(r),a=r;break;case Te.SUBSCRIPT:r=window.originDocument.createElement("sub"),a.appendChild(r),a=r}a.textContent=t,e.appendChild(n)}}(this.Element,t)}else{let t=window.originDocument.createElement("span");t.textContent=e.Set.ST,this.Element.appendChild(t)}}_SetBorderRadius(e){(this.InnerChildElement?this.InnerChildElement:this.Element).style.borderRadius=`${e._TopLeft}px ${e._TopRight}px ${e._BottomRight}px ${e._BottomLeft}px`}_InsertProxyLayer(e,t){if(e.ParentView=this,this._IsChildOfRootView){for(let e of this.ChildViews)e._AdvanceDepthForProxyLayer();e._OnAttachToSystem()}e.ChildViews=e.ChildViews.concat(this.ChildViews),e._ChildrenListDirty=!0;for(let t=0;t<e.ChildViews.length;t++)e.ChildViews[t].ParentView=e,e._RequestLayoutForAddingView(e.ChildViews[t]);null!==t?t instanceof F.LayoutParamsBase?e.LayoutParams=t.Clone():e.LayoutParams=new F.LayoutParams(t):null===e.LayoutParams&&(e.LayoutParams=new F.LayoutParams({x:0,y:0})),e.ResetLayoutParams(e.LayoutParams),this.ChildViews=[e],this._ChildrenListDirty=!0,this._RequestLayoutForAddingView(e),this._ProxyView=e,this._IsChildOfRootView&&e._OnAttachToSystem()}_RequestLayoutForAddingView(e){this._RequestLayout()}ResetTexture(e,t){let i=null;if(e&&(i=new F.ExternalTextureSetting(e,t)),this.TextureSetting=i,i){if(i.Texture.Source)"IMG"===this.Element.tagName?this.Element.src=i.Texture.Source:(this.Element.style.backgroundImage=`url(${i.Texture.Source})`,this.Element.style.backgroundSize="100% 100%",this.Element.style.backgroundColor=null);else if(i.Texture.Gradient)this.Element.style.backgroundImage=i.Texture.Gradient,this.Element.style.backgroundColor=null;else if(i.Texture.RenderTexture&&i.Texture.RenderTexture._SyncingResourceInfo){const e=i.Texture.RenderTexture._SyncingResourceInfo;if("TST"===e.Nam)this._ResetTextStyle(e);else if("CT"===e.Nam)this.Element.style.backgroundColor=e.Set.Clr,this.Element.style.backgroundImage=null;else if("VPLY"===e.Nam){const t=e.Set.Hdl;t.style.width="100%",t.style.height="100%",t.style.objectFit="fill",this.Element.appendChild(t),this.InnerChildElement=t}}i.MaskSetting&&"CORNER"===i.MaskSetting._MaskType&&this._SetBorderRadius(i.MaskSetting)}else this.Element.style.backgroundColor="",this.Element.style.backgroundImage="",this.Element.style.borderRadius=""}SetVisibility(e){if("string"==typeof e){let t=e.toLocaleLowerCase();this.Element.style.visibility="visible"==t?"inherit":t}else this.Element.style.visibility="inherit"}SetViewOpacity(e){this.Element.style.opacity=e}_OnAttachToSystem(){"svg"!==this.Element.id&&"path"!==this.Element.id||console.log("_OnAttachToSystem appendChild");let e=this.ParentView.ChildViews[this.ParentView.ChildViews.indexOf(this)+1];e&&this.ParentView.Element.contains(e.Element)?this.ParentView.Element.insertBefore(this.Element,e.Element):this.ParentView.Element.appendChild(this.Element),this._IsChildOfRootView=!0;const t=this.ChildViews;let i;for(let e=0;e<t.length;e++)i=t[e],i._OnAttachToSystem();this._FlushFlexDiv()}IsChildOfRootView(){return this._IsChildOfRootView}StartAnimation(e,t,i){void 0!==this.TransformAnimationObj&&this.TransformAnimationObj&&(this.TransformAnimationObj.Cancel(e),this.TransformAnimationObj=null,window.jsvInAndroidWebView?this.Element.style.webkitAnimation=null:this.Element.style.animation=null),null==this._ProxyView?(this.TransformAnimationObj=e,!isNaN(i)&&i>0&&e.EnableDelay(i),e.Start(this)):this._ProxyView.StartAnimation(e,t,i)}ApplyStyleTransition(e){this.TransitionStore={...this.TransitionStore,...e};let t="";Object.values(this.TransitionStore).forEach((e=>{t&&(t+=","),t+=e})),window.jsvInAndroidWebView?this.Element.style.webkitTransition=t:this.Element.style.transition=t}StopAnimation(){void 0!==this.TransformAnimationObj&&this.TransformAnimationObj&&(this.TransformAnimationObj.Cancel(),this.TransformAnimationObj=null),null==this._ProxyView||this._ProxyView.StopAnimation()}StartTextureAnimation(e){void 0!==this._TextureAnimationObj&&this._TextureAnimationObj&&(this._TextureAnimationObj.Cancel(e),this._TextureAnimationObj=null),this._TextureAnimationObj=e,e.AsTextureAnimation(),e.Start(this),this._RequestLayout()}_RequestLayout(){}StopTextureAnimation(){void 0!==this._TextureAnimationObj&&this._TextureAnimationObj&&(this._TextureAnimationObj.Cancel(),this._TextureAnimationObj=null)}StopAllAnimations(){this.StopAnimation(),this.StopTextureAnimation();for(let e=0;e<this.ChildViews.length;e++)this.ChildViews[e].StopAllAnimations()}GetAnimation(){return this.TransformAnimationObj}DetachAnimation(e){this.TransformAnimationObj===e&&(this.TransformAnimationObj=null,window.jsvInAndroidWebView?(this.Element.style.webkitAnimation=null,this.Element.style.webkitTransition=null):(this.Element.style.animation=null,this.Element.style.transition=null))}ResetCssTransform(e,t){if(e){const t=e.split("translate3d");for(let e=1;e<t.length;e++){let i=!1,s=t[e].replace(/\).*/,"");s=s.replace(/.*\(/,"");const n=s.split(",");for(let e=0;e<n.length;e++){const t=n[e].trim();t.match(/[0-9]$/)&&(n[e]=t+"px",i=!0)}i&&(s=n.join(","),t[e]=t[e].replace(/\(.*?\)/,"("+s+")"))}e=t.join("translate3d")}e===this._CssTransform&&t===this._CssTransformOrigin||(window.jsvInAndroidWebView?(this.Element.style.webkitTransform=e,this.Element.style.webkitTransformOrigin=t):(this.Element.style.transform=e,this.Element.style.transformOrigin=t),this._CssTransform=e,this._CssTransformOrigin=t)}ResetTextureCssTransform(e,t){this.ResetCssTransform(e,t)}SetId(e){this.Id=e}ResetLayoutParams(e){if(null==this._ProxyView)if(null!==e)if(e instanceof F.LayoutParamsBase?this.LayoutParams=e.Clone():this.LayoutParams=new F.LayoutParams(e),null==this.FlexInfoPackWeak)this.ParentView?.FlexInfoPackWeak?.container||(this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`),isNaN(this.LayoutParams.Width)||this._SizeFromChild&&0==this.LayoutParams.Width||(this.Element.style.width=`${this.LayoutParams.Width}px`),isNaN(this.LayoutParams.Height)||this._SizeFromChild&&0==this.LayoutParams.Height||(this.Element.style.height=`${this.LayoutParams.Height}px`);else{this.ParentView.FlexInfoPackWeak||(this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`);let e=this;for(;e._ChildrenFromChild0;)e=e.ChildViews[0];e._SizeFromChild||(e.Element.width=0==this.LayoutParams.Width?void 0:this.LayoutParams.Width+"px",e.Element.height=0==this.LayoutParams.Height?void 0:this.LayoutParams.Height+"px")}else F.ThrowError("ResetLayoutParams(): new params is null");else this._ProxyView.ResetLayoutParams(e)}GetRenderer(){return F.LayoutViewBase.sRenderer}GetLayoutParams(){return this.LayoutParams?this.LayoutParams.Clone():new F.LayoutParams}EnableAutoHeight(){this._AutoHeight=!0}WaitTextureToResize(e){}ApplyObjectFit(e,t,i,s,n){if(this._ProxyView)return console.warn("ProxiedView not support ApplyObjectFit"),null;null===this._ObjectFitTestCache&&(this._ObjectFitTestCache={frameWidth:NaN,frameHeight:NaN,textureWidth:NaN,textureHeight:NaN,objectFit:"fill",clipLayout:null});let r=this._ObjectFitTestCache;if(r.frameWidth===e&&r.objectFit===n&&r.frameHeight===t&&r.textureWidth===i&&r.textureHeight===s)return r.clipLayout;r.frameWidth=e,r.frameHeight=t,r.textureWidth=i,r.textureHeight=s,r.objectFit=n;let a={width:0,height:0},o=e/t;const l=i/s;if(!l)return console.warn("Warning:Texture size is 0!"),clip_layout;if(0===e||0===t){if(0===e&&0===t)return clip_layout;0===e?e=t*l:t=e/l,o=e/t}let h="";switch(n){case"fill":a.width=e,a.height=t,h="fill";break;case"none":a.width=i,a.height=s,h="none";break;case"cover":a=this._StretchSize(e,t,l,l<o),h="cover";break;case"scale-down":a=this._StretchSize(e,t,l,l>o),a.width>i&&(a.width=i,a.height=s),h="scale-down";break;case"contain":a=this._StretchSize(e,t,l,l>o),h="contain"}if(a.width=Math.floor(a.width),a.height=Math.floor(a.height),a.width!=e||a.height!=t){let i={};i.width=Math.min(a.width,e),i.height=Math.min(a.height,t),i.x=Math.floor((e-i.width)/2),i.y=Math.floor((t-i.height)/2),r.clipLayout=i;return(this.InnerChildElement?this.InnerChildElement:this.Element).style.objectFit=h,i}return null}_StretchSize(e,t,i,s){const n={width:0,height:0};return s?(n.width=e,n.height=e/i):(n.height=t,n.width=t*i),n}GetPositionOffset(e){let t=this,i=0,s=0;for(;e!==t;)i+=t.LayoutParams?t.LayoutParams.MarginLeft:0,s+=t.LayoutParams?t.LayoutParams.MarginTop:0,t=t.ParentView,t||F.ThrowError("ERROR: Target parent layoutview is not found in LayoutView tree");return new F.Coordinate(i,s)}_dispatchLongPress(){this._LongPressDelayRequestTaskId=0,this._InLongPress=!0;const e={type:F.DragInfo.EVENT_TYPE.OnLongPress,x:this._CurrentDownEvent.designX,y:this._CurrentDownEvent.designY};this.TouchEventProcess(e)}_onMouseDown(e,t,i){this._Velocity.x.reset(),this._Velocity.y.reset(),this._Velocity.x.updatePosition(e),this._Velocity.y.updatePosition(t),this._LastFocusX=e,this._DownFocusX=this._LastFocusX,this._LastFocusY=t,this._DownFocusY=this._LastFocusY,this._CurrentDownEvent={designX:e,designY:t,timeStamp:i},this._AlwaysInTapRegion=!0,this._InLongPress=!1,0!==this._LongPressDelayRequestTaskId&&(clearTimeout(this._LongPressDelayRequestTaskId),this._LongPressDelayRequestTaskId=0),this._LongPressDelayRequestTaskId=setTimeout(this._dispatchLongPress,600);return{type:F.DragInfo.EVENT_TYPE.OnDown,x:e,y:t,deltaX:0,deltaY:0}}_onMouseMove(e,t,i){if(!this._CurrentDownEvent)return null;this._Velocity.x.updatePosition(e),this._Velocity.y.updatePosition(t);const s=parseInt(e-this._LastFocusX,10),n=parseInt(t-this._LastFocusY,10),r=parseInt(e-this._DownFocusX,10),a=parseInt(t-this._DownFocusY,10);let o=null;if(this._AlwaysInTapRegion){r*r+a*a>this._TouchSlopSquare&&(o={type:F.DragInfo.EVENT_TYPE.OnDragStart,x:e,y:t},this._LastFocusX=e,this._LastFocusY=t,this._LastTimeStamp=i,this._AlwaysInTapRegion=!1,this._InLongPress=!1,this._InDragging=!0,0!==this._LongPressDelayRequestTaskId&&(clearTimeout(this._LongPressDelayRequestTaskId),this._LongPressDelayRequestTaskId=0))}else this._InDragging&&(Math.abs(s)>=1||Math.abs(n)>=1)&&(o={type:F.DragInfo.EVENT_TYPE.OnMoved,x:e,y:t,deltaX:r,deltaY:a,_deltaX:s,_deltaY:n,timeStamp:parseInt((this._LastTimeStamp-i)/1e3,10)},this._LastFocusX=e,this._LastFocusY=t,this._LastTimeStamp=i);return o}_onMouseUp(e,t,i){let s=null;if(this._CurrentDownEvent){const i=window.Forge.DesignMap(),n=Math.floor(i.displayScale*i.width),r=window.innerWidth/n,a=this._Velocity.x.getVelocity()/r,o=this._Velocity.y.getVelocity()/r;let l=e-this._CurrentDownEvent.designX,h=t-this._CurrentDownEvent.designY;const c=e-this._LastFocusX,u=t-this._LastFocusY;this._InLongPress||(this._AlwaysInTapRegion?s={type:F.DragInfo.EVENT_TYPE.OnTap,x:e,y:t,velocityX:0,velocityY:0,deltaX:l,deltaY:h,_deltaX:c,_deltaY:u}:(Math.abs(o)>70||Math.abs(a)>70?(l=this._GetSplineFlingDistance(a),h=this._GetSplineFlingDistance(o),s={type:F.DragInfo.EVENT_TYPE.OnFling,x:e,y:t,velocityX:a,velocityY:o,deltaX:a<0?-l:l,deltaY:o<0?-h:h,_deltaX:c,_deltaY:u}):s={type:F.DragInfo.EVENT_TYPE.OnDragEnd,x:e,y:t,deltaX:l,deltaY:h,_deltaX:c,_deltaY:u},this.TouchEventProcess(s),s={type:F.DragInfo.EVENT_TYPE.OnRelease,x:e,y:t,deltaX:l,deltaY:h,_deltaX:c,_deltaY:u},this._CurrentDownEvent=null)),this._InLongPress=!1,0!==this._LongPressDelayRequestTaskId&&(clearTimeout(this._LongPressDelayRequestTaskId),this._LongPressDelayRequestTaskId=0)}return s}_onTouchEvent(e){const t=window.Forge.DesignMap(),i=Math.floor(t.displayScale*t.width),s=window.innerWidth/i,n=e.clientX/s,r=e.clientY/s;let a=null;switch(e.type){case"touchstart":case"mousedown":a=this._onMouseDown(n,r,e.timeStamp);break;case"touchmove":case"mousemove":a=this._onMouseMove(n,r,e.timeStamp);break;case"touchend":case"touchcancel":case"mouseup":a=this._onMouseUp(n,r,e.timeStamp)}return!!a&&this.TouchEventProcess(a)}_AddEventListener(){this.Element.style.pointerEvents="auto",this._ValidTouch=!1;"ontouchstart"in window?(this.Element.addEventListener("touchstart",(e=>{if(console.log("touchstart",e),this._ValidTouch=!0,e.touches&&e.touches.length>0){console.log(`touchstart event.touches[0].clientX:${e.touches[0].clientX}, event.touches[0].clientY:${e.touches[0].clientY}`);this._onTouchEvent({type:e.type,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY,timeStamp:e.timeStamp})&&e.stopPropagation()}}),!0),this.Element.addEventListener("touchmove",(e=>{if(this._ValidTouch&&(console.log("touchmove",e),e.touches&&e.touches.length>0)){console.log(`touchmove event.touches[0].clientX:${e.touches[0].clientX}, event.touches[0].clientY:${e.touches[0].clientY}`);this._onTouchEvent({type:e.type,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY,timeStamp:e.timeStamp})&&e.stopPropagation()}}),!0),this.Element.addEventListener("touchend",(e=>{if(console.log(`touchend event.touches.length:${e.touches.length}, event.clientX:${e.clientX}, event.pageX:${e.pageX}`),this._ValidTouch=!1,e.changedTouches&&e.changedTouches.length>0){console.log(`touchend event.changedTouches[0].clientX:${e.changedTouches[0].clientX}, event.changedTouches[0].pageX:${e.changedTouches[0].pageX}`);this._onTouchEvent({type:e.type,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,timeStamp:e.timeStamp})&&e.stopPropagation()}}),!0),this.Element.addEventListener("touchcancel",(e=>{if(this._ValidTouch=!1,console.log("touchcancel",e),e.changedTouches&&e.changedTouches.length>0){console.log(`touchcancel event.clientX:${e.clientX}, event.clientY:${e.clientY}`);this._onTouchEvent({type:e.type,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY,timeStamp:e.timeStamp})&&e.stopPropagation()}}),!0)):(this.Element.addEventListener("mousedown",(e=>{console.log("mousedown",e),this._ValidTouch=!0;this._onTouchEvent(e)&&e.stopPropagation()}),!0),this.Element.addEventListener("mousemove",(e=>{if(this._ValidTouch){this._onTouchEvent(e)&&e.stopPropagation()}}),!0),this.Element.addEventListener("mouseup",(e=>{console.log("mouseup",e),this._ValidTouch=!1;this._onTouchEvent(e)&&e.stopPropagation()}),!0))}_GetSplineDeceleration(e){return Math.log(F.DragInfo.INFLEXION*Math.abs(e)/(F.DragInfo.SCROLL_FRICTION*F.DragInfo.PHYSICAL_COEF))}_GetSplineFlingDistance(e){const t=this._GetSplineDeceleration(e),i=F.DragInfo.DECELERATION_RATE-1;return F.DragInfo.SCROLL_FRICTION*F.DragInfo.PHYSICAL_COEF*Math.exp(F.DragInfo.DECELERATION_RATE/i*t)}_DoDragMove(e,t){let i=e._deltaX,s=e._deltaY;this._DragMovedDistanceX+=i,this._DragMovedDistanceY+=s,t||(i=e.deltaX,s=e.deltaY);const n=e.timeStamp/1e3;let r=`left ${n}s, top ${n}s`;this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_VERTICAL?(i=0,r=`top ${n}s`):this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_HORIZONTAL?(s=0,r=`left ${n}s`):this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_DISABLE&&(i=0,s=0);let a=this.GetLayoutParams();return a=this._GetMovedLayoutParams(i,s),t&&(this.Element.style.transition=r,this.ResetLayoutParams(a)),!!((Math.abs(this._DragMovedDistanceX)>=this._DragInfo.Settings.TriggerMovedDistance||Math.abs(this._DragMovedDistanceY)>=this._DragInfo.Settings.TriggerMovedDistance)&&this._DragInfo.Listener&&this._DragInfo.Listener.OnMoved)&&(e.viewX=a.MarginLeft,e.viewY=a.MarginTop,this._DragInfo.Listener.OnMoved(e))}_GetMovedLayoutParams(e,t){const i=this.GetLayoutParams();let s=i.MarginLeft+e,n=i.MarginTop+t;return s>this._DragInfo.Settings.SlidePile.x?s=this._DragInfo.Settings.SlidePile.x:s+i.Width<this._DragInfo.Settings.SlidePile.x+this._DragInfo.Settings.SlidePile.width&&(s=this._DragInfo.Settings.SlidePile.x+this._DragInfo.Settings.SlidePile.width-i.Width),n>this._DragInfo.Settings.SlidePile.y?n=this._DragInfo.Settings.SlidePile.y:n+i.Height<this._DragInfo.Settings.SlidePile.y+this._DragInfo.Settings.SlidePile.height&&(n=this._DragInfo.Settings.SlidePile.y+this._DragInfo.Settings.SlidePile.height-i.Height),i.SetPosition(s,n),i}_SlideIfEnableTabMod(e,t){if(!this._DragInfo.Settings.EnableTabMode)return!1;const i=e._deltaX,s=e._deltaY;let n=e.deltaX,r=e.deltaY,a=this._DragInfo.Settings.PageWidth*this._DragInfo.Settings.PageEdge;const o=this.GetLayoutParams(),l=o.MarginLeft+i,h=o.MarginTop+s;switch(e.type===F.DragInfo.EVENT_TYPE.OnFling&&(a=0),this._DragInfo.Settings.DragDirection){case F.DragSetting.DIRECTION_VERTICAL:if(n=0,r>=0){const e=this._DragInfo.Settings.PageWidth-Math.abs(h)%this._DragInfo.Settings.PageWidth;r=e>=a?this._DragInfo.Settings.PageWidth-e:-e}else{const e=Math.abs(h)%this._DragInfo.Settings.PageWidth;r=e>=a?-(this._DragInfo.Settings.PageWidth-e):e}break;case F.DragSetting.DIRECTION_HORIZONTAL:if(r=0,n>=0){const e=this._DragInfo.Settings.PageWidth-Math.abs(l)%this._DragInfo.Settings.PageWidth;n=e>=a?this._DragInfo.Settings.PageWidth-e:-e,console.log(`right, left_width:${e}, distance_x:${n}`)}else{const e=Math.abs(l)%this._DragInfo.Settings.PageWidth;n=e>=a?-(this._DragInfo.Settings.PageWidth-e):e,console.log(`left, left_width:${e}, distance_x:${n}`)}break;case F.DragSetting.DIRECTION_AUTO:console.log("slideIfEnableTabMode DragDirection error DRAG_DIRECTION_AUTO")}if(0===n&&0===r)return console.log("slideIfEnableTabMode distance_x === 0 && distance_y === 0"),!1;const c=Math.sqrt(n*n+r*r)/.3;return e.deltaX=n,e.deltaY=r,this._DonFlingAnim(e,c),!0}_DoDragEnd(e){let t=e._deltaX,i=e._deltaY;this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_VERTICAL?t=0:this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_HORIZONTAL?i=0:this._DragInfo.Settings.DragDirection===F.DragSetting.DIRECTION_DISABLE&&(t=0,i=0),console.log("_DoDragEnd event:",e,this.Element.style);let s=this.GetLayoutParams();return s=this._GetMovedLayoutParams(t,i),this.ResetLayoutParams(s),e.viewX=s.MarginLeft,e.viewY=s.MarginTop,this._DragInfo.Listener.OnDragEnd(e)}_DragImactSensorRecycle(){console.log("_DragImactSensorRecycle this._DragImactSensor:",this._DragImactSensor),this._DragImactSensor&&this._DragImactSensor.Recycle()}_DonFlingAnim(e,t){const i=e.deltaX,s=e.deltaY,n=this.GetLayoutParams(),r=n.MarginLeft,a=n.MarginTop,o=n.MarginLeft+i,l=n.MarginTop+s,h=this._GetMovedLayoutParams(i,s);if(h.MarginLeft===n.MarginLeft&&h.MarginTop===n.MarginTop)return void console.log("_DonFlingAnim adjust_lp.MarginLeft === lp.MarginLeft && adjust_lp.MarginTop === lp.MarginTop");this.DragControl=new F.DragTranslateControl,this.DragControl._SetView(this),this.DragControl.speed(t),console.log(`OnFling speed:${t}`);const c=this._DragInfo.Settings;this._DragImactSensorRecycle(),this.Element.style.transform=null,this.DragControl.target(n.MarginLeft,n.MarginTop).jumpSilent(),n.SetPosition(0,0),this.ResetLayoutParams(n);let u=0;this.DragControl.target(o,l).start(((t,r)=>{this.DragControl=null,n.SetPosition(t,r),this.ResetLayoutParams(n),this.Element.style.transform=null,this._DragImactSensorRecycle(),e.viewX=t,e.viewY=r,this._DragInfo.Listener.OnFling(e),console.log(`_DonFlingAnim end view_x:${t}, view_y:${r}, distance_x:${i}, distance_y:${s}`)}),(e=>{const t=i*e,n=s*e;if(console.log(`_DonFlingAnim progress:${e}, deltaX:${t}, deltaY:${n}`),Math.abs(t)>this._DragInfo.Settings.TriggerMovedDistance||Math.abs(n)>this._DragInfo.Settings.TriggerMovedDistance){const e={deltaX:r+t,deltaY:a+n,_deltaX:t,_deltaY:n,timeStamp:parseInt((Date.now()-u)/1e3,10)};this._DoDragMove(e,!1),u=Date.now()}}));const d=this.GetPositionOffset(this.ParentView);this._DragImactSensor=new F.DragImpactSensor([{x:c.SlidePile.x+d.x,y:c.SlidePile.y+d.y},{x:c.SlidePile.x+d.x+c.SlidePile.width,y:c.SlidePile.y+d.y},{x:c.SlidePile.x+d.x,y:c.SlidePile.y+d.y+c.SlidePile.height},{x:c.SlidePile.x+d.x+c.SlidePile.width,y:c.SlidePile.y+d.y+c.SlidePile.height}],this.Element,new F.sImpactSensorManager.Callback((t=>{this._DoDragPause(e),this._DragImactSensorRecycle()}),null))}_DoFling(e){let t=e.deltaX,i=e.deltaY,s=!0,n=0;switch(this._DragInfo.Settings.DragDirection){case F.DragSetting.DIRECTION_VERTICAL:t=0,0===i&&(s=!1),n=Math.abs(e.velocityY);break;case F.DragSetting.DIRECTION_HORIZONTAL:i=0,0===t&&(s=!1),n=Math.abs(e.velocityX);break;case F.DragSetting.DIRECTION_DISABLE:s=!1;break;default:n=Math.sqrt(e.velocityX**2,e.velocityY**2)}return s&&(e.deltaX=t,e.deltaY=i,this._DonFlingAnim(e,n)),!0}_FindFirstRectChild(){if(0!=this.Element.clientWidth&&0!=this.Element.clientHeight)return this;let e,t;if(this.ChildViews.length>0)for(let i=0;i<this.ChildViews.length;i++)if(t=this.ChildViews[i],t&&(e=t._FindFirstRectChild(),null!=e))return e;return null}GetBoundingClientRect(e){this.Element?setTimeout((()=>{let t=this,i=0;for(;t;)t.TransformAnimationObj&&t.TransformAnimationObj.repeatTimes>0&&(i++,t.TransformAnimationObj.AddAnimationListener(new F.AnimationListener(null,(t=>{if(i--,i<=0){let t=this._FindFirstRectChild();t||(t=this);const{left:i,top:s,width:n,height:r}=t.Element.getBoundingClientRect();e?.(JSON.stringify({status:0,data:{left:i,top:s,width:n,height:r}}))}})))),t=t.ParentView;if(0==i){let t=this._FindFirstRectChild();t||(t=this);const{left:i,top:s,width:n,height:r}=t.Element.getBoundingClientRect();e?.(JSON.stringify({status:0,data:{left:i,top:s,width:n,height:r}}))}}),1):e?.(JSON.stringify({status:-1,error:"BrowserError: dom element is null."}))}ChildViewsCount(){return this.ChildViews.length}MarkFlexSizeFromChild(e){this._ChildrenFromChild0&&console.error("Error: from child0 冲突 size"),this._SizeFromChild=e,this.Element.style.display="flex","0px"==this.Element.style.width&&(this.Element.style.width=""),"0px"==this.Element.style.height&&(this.Element.style.height=""),this._SizeFromChild?this._SizeFromChild.Element.style.position="relative":console.error("Error: Need insert child0 before mark")}MarkFlexChildrenFromChild0(){this._SizeFromChild&&console.error("Error: from child0 冲突 child"),this._ChildrenFromChild0=!0}TransChildFlexInfoPack(e){e.FlexInfoPack?(this.FlexInfoPack=e.FlexInfoPack,e.FlexInfoPack=null):this.FlexInfoPack!=e.FlexInfoPackWeak&&console.error("Error: TransChildFlexInfoPack dismatch")}RegisterFlexAssigned(e){this._FlexAssignedCallback=e,null==this._MySizeObserver&&(this._MySizeObserver=new ResizeObserver((t=>{for(let i of t)i.target==this.Element&&e?.(0,0,i.contentRect.width,i.contentRect.height)}))),e?(this._MySizeObserver.disconnect(),this._MySizeObserver.observe(this.Element)):this._MySizeObserver.disconnect()}ResetFlexContainerCell(e){e?(this._EnsureFlexInfoPack(),this.FlexInfoPackWeak.container=e,this._FlushFlexDiv()):console.error("Error: Can NOT cancel flex container")}ResetFlexItemCell(e){this._EnsureFlexInfoPack(),this.FlexInfoPackWeak.item=e,this._FlushFlexDiv()}_EnsureFlexInfoPack(){null==this.FlexInfoPackWeak&&(this.FlexInfoPack={container:null,item:null},this.FlexInfoPackWeak=this.FlexInfoPack)}_FlushFlexDiv(){if(this._IsChildOfRootView){if(null!=this.FlexInfoPackWeak){if(null!=this.FlexInfoPackWeak.container)if(this._ChildrenFromChild0)this.Element.style.width="",this.Element.style.height="",this.Element.style.display="flex";else{this.Element.style.display="flex";let e=this.FlexInfoPackWeak.container;this.Element.style.flexDirection=this._ConvertFlexSetToString(e.flexDirection),this.Element.style.flexWrap=this._ConvertFlexSetToString(e.flexWrap),this.Element.style.justifyContent=this._ConvertFlexSetToString(e.justifyContent),this.Element.style.alignItems=this._ConvertFlexSetToString(e.alignItems),this.Element.style.alignContent=this._ConvertFlexSetToString(e.alignContent);let t=this;for(;t.ParentView._ChildrenFromChild0;)t=t.ParentView;this.Element.style.width=t.LayoutParams.Width>0?t.LayoutParams.Width+"px":"",this.Element.style.height=t.LayoutParams.Height>0?t.LayoutParams.Height+"px":"";for(let e=0;e<this.ChildViews.length;e++){let t=this.ChildViews[e].Element;t.style.position="relative",t.style.left="",t.style.top=""}}else this.Element.style.flexDirection="",this.Element.style.flexWrap="",this.Element.style.justifyContent="",this.Element.style.alignItems="",this.Element.style.alignContent="";if(this.FlexInfoPack&&this.FlexInfoPack.item){let e=this.FlexInfoPack.item;this.Element.style.alignSelf=this._ConvertFlexSetToString(e.alignSelf),this.Element.style.flexGrow=e.flexGrow}}this.ParentView.FlexInfoPackWeak?.container?this.Element.style.position="relative":this.ParentView._SizeFromChild||(this.Element.style.position="absolute")}}_ConvertFlexSetToString(e){switch(e){case F.FlexSetNames.NoSet:return"";case F.FlexSetNames.Auto:return"auto";case F.FlexSetNames.Row:return"row";case F.FlexSetNames.RowReverse:return"row-reverse";case F.FlexSetNames.Column:return"column";case F.FlexSetNames.ColumnReverse:return"column-reverse";case F.FlexSetNames.NoWrap:return"nowrap";case F.FlexSetNames.Wrap:return"wrap";case F.FlexSetNames.FlexStart:return"flex-start";case F.FlexSetNames.FlexEnd:return"flex-end";case F.FlexSetNames.Center:return"center";case F.FlexSetNames.Stretch:return"stretch";default:return console.error("No support flex set, value="+e),""}}EnableVisibleTestRect(){this._EnableVisibleTestRect=!0}DragEnables(e){this.TouchRecvEnableAdd(e)}TouchRecvEnableAdd(e){0==(1&this.TouchFeatureBit)&&(1&e)>0&&(this.TouchFeatureBit=e)}HasTapCallback(){return null!=this.TapCallback}RegisterTapCallback(e){this.TapCallback=e}}Re.DivId=0,F.LayoutViewBase=Re;class Fe extends Re{constructor(e,t){!e||e instanceof F.TextureSetting||F.ThrowError("ERROR:LayoutView need TextureSetting as parameter"),super(e,t=t||"div")}HtmlCanAccessElement(){return!0}HtmlGetElement(){return this.Element}}F.LayoutView=Fe,window.LayoutView=F.LayoutView;class De extends F.LayoutView{constructor(){super(void 0,"root"),this._ViewType=1,this._IsChildOfRootView=!0,window.gRootView=this,F.sRootView=this,this.ResetLayoutParams({x:0,y:0,width:4096,height:2500})}HtmlGetTouchRoot(){return this.HtmlGetElement()}}F.RootView=De,window.RootView=F.RootView;class Ve{constructor(e,t,i,s,n){this.coordX=e,this.coordY=t,this.width=i,this.height=s,this.useScissors=n,this.maskStencil=null}updateInfo(e,t,i,s,n){this.coordX=e,this.coordY=t,this.width=i,this.height=s,this.useScissors=n}setMaskStencil(e){this.maskStencil=e}}class Oe extends F.LayoutView{constructor(e){super(e,"div"),this._ClipRectInfo=null,this.Id="ClipView",this.TextureSetting=null}SetId(e){this.Id=`${e}_ClipView`}SetClipRect(e,t,i,s,n){null===this._ClipRectInfo?this._ClipRectInfo=new Ve(e,t,i,s,n):this._ClipRectInfo.updateInfo(e,t,i,s,n);const r=e,a=t,o=this.LayoutParams.Width-r-i,l=this.LayoutParams.Height-a-s;n?(this.Element.style.overflow="hidden",this.Element.style.clipPath=`inset(${a}px ${o}px ${l}px ${r}px)`):(this.Element.style.overflow="visible",this.Element.style.clipPath="unset")}SetWholeSizeScissor(e,t){this.Element.style.overflow=e&&t?"hidden":"visible"}}F.ClipView=Oe,window.ClipView=F.ClipView;class Me extends F.LayoutView{constructor(e){super(e,"div"),this._HorizontalRepeats=[0,0,0,0],this._VerticalRepeats=[0,0,0,0],this._HorizontalPadding=[0,0],this._VerticalPadding=[0,0],this._ImageDspWidth=0,this._ImageDspHeight=0}ResetTexture(e,t){let i=null;e&&(i=new F.ExternalTextureSetting(e,t)),this.TextureSetting=i,this._ApplyChanges()}SetRepeat(e,t){F.Assert(e.length<=2),F.Assert(t.length<=2);for(let i=0;i<2;i++)i<e.length?(this._HorizontalRepeats[2*i]=e[i].start,this._HorizontalRepeats[2*i+1]=e[i].width):(this._HorizontalRepeats[2*i]=0,this._HorizontalRepeats[2*i+1]=0),i<t.length?(this._VerticalRepeats[2*i]=t[i].start,this._VerticalRepeats[2*i+1]=t[i].width):(this._VerticalRepeats[2*i]=0,this._VerticalRepeats[2*i+1]=0);return this._ApplyChanges(),this}SetPadding(e,t){return F.Assert(null!==e),F.Assert(null!==t),this._VerticalPadding[0]=t.start,this._VerticalPadding[1]=t.width,this._HorizontalPadding[0]=e.start,this._HorizontalPadding[1]=e.width,this._ApplyChanges(),this}SetImageDspSize(e,t){this._ImageDspWidth=e,this._ImageDspHeight=t}_ApplyChanges(){let e=this.TextureSetting;if(e){if(e.MaskSetting&&"CORNER"===e.MaskSetting._MaskType&&this._SetBorderRadius(e.MaskSetting),e.Texture.Source){const t=e.Texture.RenderTexture.Width,i=e.Texture.RenderTexture.Height,s=t/this._ImageDspWidth,n=i/this._ImageDspHeight,r=this._HorizontalRepeats[0],a=this._ImageDspWidth-this._HorizontalRepeats[1]-r,o=this._VerticalRepeats[0],l=this._ImageDspHeight-this._VerticalRepeats[1]-o;let h=Math.floor(this._HorizontalRepeats[0]*s),c=t-Math.floor(this._HorizontalRepeats[1]*s)-h,u=Math.floor(this._VerticalRepeats[0]*n),d=i-Math.floor(this._VerticalRepeats[1]*n)-u;h+c>=t&&(h-=1,c-=1),u+d>=i&&(u-=1,d-=1);const g=`${u} ${c} ${d} ${h}`;this.Element.style.borderImage=`url(${e.Texture.Source}) ${g} fill`;const f=this._HorizontalPadding[0],m=this._ImageDspWidth-this._HorizontalPadding[1]-f,p=this._VerticalPadding[0],y=this._ImageDspHeight-this._VerticalPadding[1]-p;this.Element.style.borderImageWidth=`${o}px ${a}px ${l}px ${r}px`,this.Element.style.borderImageOutset=`${p}px ${m}px ${y}px ${f}px`}}else this.Element.style.borderRadius="",this.Element.style.borderImage=""}}F.NinePatchView=Me;class Ne extends F.LayoutView{constructor(e){let t;t=e.startsWith("jsve-")?e.substr(5):e.substr(3),super(void 0,t)}setAttribute(e,t){this.Element.setAttribute(e,t)}removeAttribute(e){this.Element.removeAttribute(e)}getAttribute(e){return this.Element.getAttribute(e)}hasAttribute(e){return this.Element.hasAttribute(e)}get textContent(){return this.Element.textContent}set textContent(e){this.Element.textContent=e}}F.JsvElementView=Ne;F.VideoView=class extends Fe{constructor(e,t){super(t),this._ViewType=8,this.Element=e,this.Id="VideoView"}SetId(e){this.Id=`${e}_VideoView`}ResetLayoutParams(e){null!==e?(e instanceof F.LayoutParamsBase?this.LayoutParams=e.Clone():this.LayoutParams=new F.LayoutParams(e),this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`,this.LayoutParams.Width&&(this.Element.style.width=`${this.LayoutParams.Width}px`),this.LayoutParams.Height&&(this.Element.style.height=`${this.LayoutParams.Height}px`)):F.ThrowError("ResetLayoutParams(): new params is null")}_OnAttachToSystem(){console.log("Video attach"),super._OnAttachToSystem()}_OnDetachFromSystem(){super._OnDetachFromSystem()}};class Ge extends F.LayoutView{constructor(){super(null,"input"),this._ViewType=5,this._InputType=F.TextInputType.TEXT,this.Id="EditControlView"}_OnAttachToSystem(){super._OnAttachToSystem(),this.Element.style.left="-1920px",this.Element.style.top="-1080px",this.Element.style.width="1px",this.Element.style.height="1px",this.Element.style.pointerEvents="auto",this.Element.addEventListener("keydown",(e=>{e=e||window.event;let t=this.Element.selectionStart;console.log(`keydown cur_offset:${t}`),37===e.keyCode?(--t,t<0&&(t=0),t!==this.Element.selectionStart?(this.OnTextChanged(this.Element.value,t,!0),e.stopPropagation&&e.stopPropagation()):this.Element.blur()):39===e.keyCode?(++t,t>this.Element.value.length&&(t=this.Element.value.length),t!==this.Element.selectionStart?(this.OnTextChanged(this.Element.value,t,!0),e.stopPropagation&&e.stopPropagation()):this.Element.blur()):38===e.keyCode||40===e.keyCode?this.Element.blur():27!==e.keyCode&&1e4!==e.keyCode||this.Element.blur()})),this.Element.onfocus=e=>{console.log("onfocus in"),this.OnStatusChanged(1)},this.Element.onblur=e=>{console.log("onblur in"),this.OnStatusChanged(0)};this.Element.oninput=e=>{if(console.log("oninput:",e),e.target.value.length>0&&e.target.selectionStart>0){const i=e.target.selectionStart-1,s=e.target.selectionStart,n=e.target.value.slice(i,s);t=n,"0".charCodeAt()<=t.charCodeAt()&&t.charCodeAt()<="9".charCodeAt()||this._InputType!==F.TextInputType.NUMBER||(e.target.value=e.target.value.substr(0,i)+e.target.value.substr(s),e.target.selectionStart=i)}var t;const i=e.target.value,s=e.target.selectionStart;this.OnTextChanged(decodeURIComponent(i),s)}}SetId(e){this.Id=`${e}_EditControlView`}showIme(e,t,i){this.Element?e!==F.TextInputType.NONE?(null==i&&(i=t.length>0?t.length:0),i<0?i=0:i>t.length&&(i=t.length>0?t.length:0),this._InputType=e,this.Element.type="text",this.Element.value=t,this.Element.focus(),this.Element.selectionStart=i,this.Element.selectionEnd=i):console.log("showIme input_type error"):console.log("showIme but ele is null!")}hideIme(){this.Element?this.Element.blur():console.log("hideIme, but ele is null!")}updateCursorOffset(e,t){this.Element?(this.Element.selectionStart=t,this.Element.selectionEnd=t,this.Element.value=e):console.log("updateCursorOffset, but ele is null!")}OnTextChanged(e,t,i){console.log(`OnTextChanged value:${e}`)}OnStatusChanged(e){}OnEditAction(e){}}class Be extends F.LayoutView{constructor(e,t=1){super(e),this._ViewType=10,this._FilterType=t,this.Id="FilterView",this._Type=t,t==Be.Type.GRAY_DOWN?this.Element.style.filter="grayscale(100%)":t==Be.Type.WAVE&&console.warn("FilterView: ripple effect has not been implemented on the browser side.")}FilterSwitch(e){this.Element&&this._Type==Be.Type.GRAY_DOWN&&(this.Element.style.filter=e?"grayscale(100%)":"")}SetId(e){this.Id=e+"_FilterView"}AddWaveSourceList(){}AddWaveSourceSingle(){}RemoveSource(){}DispatchCommand(){}}Be.Type={GRAY_DOWN:1,WAVE:2},Be.WAVE={CIRCLE_WAVE:1,RECTANGLE_WAVE:2},F.FilterView=Be;class We extends F.LayoutView{constructor(){super(null,"div"),this._Iframe=window.originDocument.createElement("iframe"),this._Iframe.style.border="none",this._Iframe.style.margin="0px",this._Iframe.style.padding="0px",this._Iframe.scrolling="no",this._IframeWidth=0,this._IframeHeight=0,this.Element.appendChild(this._Iframe)}SetIframeSize(e,t){isNaN(e)||(this._IframeWidth=e,this._Iframe.width=e),isNaN(t)||(this._IframeHeight=t,this._Iframe.height=t)}SetInnerHtml(e){this._Iframe.srcdoc=e,this._Iframe.onload=()=>{0==this._IframeHeight&&(this._Iframe.height=this._Iframe.contentDocument.body.clientHeight)}}}F.IFrameView=We;let He={NONE:0,TEXT:1,PASSWORD:2,TEXT_AREA:3,CONTENT_EDITABLE:4,SEARCH:5,URL:6,EMAIL:7,TELEPHONE:8,NUMBER:9};F.TextInputType=He,F.EditControlView=Ge;class Ye{constructor(e){this._Current=new Array(e).fill(0),this._Target=new Array(e).fill(0),this._RepeatStart=new Array(e).fill(0),this._JumpTarget=null,this._Jumping=!1,this._ParameterCount=e,this._StateIndex=0,this._StateLocked=!1,this._StartSwitcher=!1,this._PausedCallback=null,this._EndCallback=null,this._NextEndCallback=null,this._Token=0,this._Repeat=!1,this._OnRepeatCallback=null,this._SpriteView=null,this._AdvanceCallback=null}setRepeat(e,t){return this._Repeat=e,this._OnRepeatCallback=e?t:null,this}start(e,t){this._NextEndCallback=e,this._EndCallback=null,this._AdvanceCallback=t,this._StartSwitcher=!0,this._Jumping=!1,this._StateMachineNext()}pause(e){this._AdvanceCallback=null,null===this._EndCallback&&null===this._NextEndCallback||(this._EndCallback=null,this._NextEndCallback=null),0===this._StateIndex?e&&this._CallbackWithCatch(this._Current,e):(e&&(this._PausedCallback=e),this._StateMachineNext())}jump(){this._JumpTarget=[...this._Target],this._Jumping=!0,this._StartSwitcher=!0,this._StateMachineNext()}jumpSilent(){this._JumpTarget=[...this._Target]}startFpsTesting(){F.sRenderBridge.SetStepFpsSwitch(!0)}stopFpsTesting(){F.sRenderBridge.SetStepFpsSwitch(!1)}_WrapBuildAnimation(e,t,i,s){console.warn("Should Override")}_WrapCallback(e,t){console.warn("Should Override")}_CallbackWithCatch(e,t){try{this._WrapCallback(e,t)}catch(e){console.error("Error:in callback"),console.error(e)}}_StateMachineNext(){this._StateLocked||(0===this._StateIndex?this._StartSwitcher&&(this._StartSwitcher=!1,this._StartAnimation()&&(this._StateIndex=1)):1===this._StateIndex&&this._StopAnimation())}_StartAnimation(){this._EndCallback=this._NextEndCallback,this._NextEndCallback=null;const e=this._JumpTarget?[...this._JumpTarget]:[...this._Current],t=this._Target,i=this._Repeat?[...this._RepeatStart]:null,s=this._WrapBuildAnimation(i,e,t,this._Jumping);if(this._JumpTarget=null,this._Jumping=!1,null===s)return;const n=[...t],r=this,a=(new F.AnimationListener).OnFinalProgress((t=>{r._OnPaused(null!==i?i:e,n,t)})).OnAdvance((e=>{this._AdvanceCallback&&this._AdvanceCallback(e)}));return this._OnRepeatCallback&&a.OnRepeat((e=>{r._OnRepeatCallback&&r._OnRepeatCallback(e)})),s.AddAnimationListener(a),s.Enable(F.AnimationEnable.KeepTransform),this._Repeat&&s.EnableInfinite(),this._SpriteView.StartAnimation(s),!0}_StopAnimation(){this._SpriteView.StopAnimation()}_OnPaused(e,t,i){for(let s=0;s<this._ParameterCount;s++)this._Current[s]=Math.floor((t[s]-e[s])*i+e[s]);this._StateLocked=!0;const s=this._PausedCallback,n=this._EndCallback;this._PausedCallback=null,s&&this._CallbackWithCatch(this._Current,s),n&&1===i&&(this._EndCallback=null,this._CallbackWithCatch(this._Current,n)),this._StateLocked=!1,this._StateIndex=0;this._StateMachineNext()}_SetView(e){this._SpriteView=e}}F.DragTranslateControl=class extends Ye{constructor(){super(2),this._Mode=0,this._Speed=0,this._VerlocityAcc=0,this._VerlocityInit=0,this._AccAlongX=!0,this._AnimationRef=null,this._AllowFrameStep=!1}allowFrameStepMode(e){return this._AllowFrameStep=e,this}selectMode(e){switch(e){case"UniformMotion":this._Mode=0;break;case"AcceleratedMotion":this._Mode=1,this.setRepeat(!1);break;default:console.error(`Unsupported input=${e}`)}return this}targetX(e){return this._Target[0]=e,this}targetY(e){return this._Target[1]=e,this}target(e,t){return this._Target[0]=e,this._Target[1]=t,this}enableRepeatFrom(e,t,i){if(this._ComfirmMode(0))return this.setRepeat(!0,i),this._RepeatStart[0]=e,this._RepeatStart[1]=t,this}speed(e){if(console.log(`speed, pixel_per_second:${e}`),this._ComfirmMode(0))return this._Speed=e,this}accelerateX(e,t){if(this._ComfirmMode(1))return this._Target[0]=t,this._VerlocityAcc=e,this._VerlocityInit=0,this._AccAlongX=!0,this}accelerateY(e,t){if(this._ComfirmMode(1))return this._Target[1]=t,this._VerlocityAcc=e,this._VerlocityInit=0,this._AccAlongX=!1,this}decelerateX(e,t){if(this._ComfirmMode(1))return this._VerlocityAcc=e,this._VerlocityInit=t,this._AccAlongX=!0,this}decelerateY(e,t){if(this._ComfirmMode(1))return this._VerlocityAcc=e,this._VerlocityInit=t,this._AccAlongX=!1,this}decelerate(e,t,i,s){if(1===this._Mode)return this._VerlocityAcc[0]=e,this._VerlocityAcc[1]=t,this._VerlocityInit[0]=i,this._VerlocityInit[1]=s,this;console.error("Error: mode error")}_ComfirmMode(e){return this._Mode===e||(console.error("Error: mode error"),!1)}_WrapBuildAnimation(e,t,i,s){return s?this._AnimationRef=this._UniformMove(null,t,i,s):0===this._Mode?this._AnimationRef=this._UniformMove(e,t,i,!1):1===this._Mode&&(this._AnimationRef=this._AccelerMove(t,i)),this._AnimationRef}_UniformMove(e,t,i,s){let n=0,r=0,a=0,o=1;const l=t[0],h=t[1],c=i[0],u=i[1];if(null!==e){n=e[0],r=e[1];const t=this._Distance(l,h,c,u),i=this._Distance(n,r,c,u);a=(i-t)/i,s||(o=1e3*i/this._Speed)}else n=l,r=h,a=0,s||(o=1e3*this._Distance(l,h,c,u)/this._Speed);s||0!==o||console.warn("Discard starting request for no distance");let d=null;if(n!==c&&r!==u||s||!this._AllowFrameStep||!window.JsView)d=new F.TranslateAnimation(n,c,r,u,o,null);else{console.log("Using frame translate animation");let e=0,t=0,i=!0;n!==c?(e=n,t=c,i=!0):(e=r,t=u,i=!1),d=new F.TranslateFrameAnimation(e,t,this._Speed,i)}return 0!==a&&(a<0?console.warn("Warning: start position out of repeating range"):d.SetStartPos(a)),d}_AccelerMove(e,t){const i=this._AccAlongX?e[0]:e[1],s=this._VerlocityInit,n=this._VerlocityAcc;let r,a,o,l,h=!0;if(0!==n)return 0===s?(r=this._AccAlongX?t[0]:t[1],a=Math.floor(1e3*Math.sqrt(2*Math.abs(r-i)/n)),h=!0):(a=Math.floor(1e3*Math.abs(s)/n),r=i+Math.floor(5e-4*s*a),h=!1),0===a&&console.warn("no moved..."),this._AccAlongX?(o=r,this._Target[0]=o,l=this._Target[1]):(o=this._Target[0],l=r,this._Target[1]=l),new F.TranslateAnimation(e[0],o,e[1],l,a,h?F.Easing.Circular.In:F.Easing.Circular.Out);console.error("Error: no found acceleration")}_Distance(e,t,i,s){const n=i-e,r=s-t;return Math.sqrt(n*n+r*r)}_WrapCallback(e,t){this._AnimationRef=null,t&&t(e[0],e[1])}};F.LayoutView;class $e{StringWithFont(e,t,i,s,n,r,a,o,l,h,c){t||(t=$e._sDefaultFontSize),i||(i=$e._sDefaultFont);let u="";!0===a&&(u="italic");let d="";return!0===o&&(d="bold"),s||(s="left"),n||(n="middle"),r||(r=$e._sDefaultFontColor),l||(l=null),c||(c="top"),h||(h=-1),{str:`${e}`,font:i,size:t,italic:u,bold:d,stroke_width:h,alignment:s,vertical_align:n,textColour:r,backgroundColour:$e._sDefaultBackgroundColor,enableBlend:!0,shadow:l,vertical_area_align:c}}TextAttr(e,t){return e||(e="none"),t||(t="none"),{text_overflow:e,word_wrap:t}}GetTextWidth(...e){if(e.length<=1){let t=e[0];return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextWidth(t):t.str.length*t.size+1}{let t=e[0];if(void 0!==window.PlatformUtils){let i={str:t,font:e[1]?e[1]:"黑体",size:e[2],bold:e[3],italic:e[4]};return window.PlatformUtils.GetTextWidth(i)}return t.length*t.size+1}}GetOneLineTextDrawWidth(e,t,i,s,n,r){if(void 0!==window.PlatformUtils){let a=window.PlatformUtils.GetOneLineTextDrawWidth(e,t??"黑体",i,s,n);r.push(...a)}else console.error("GetOneLineTextDrawWidth: window.PlatformUtils undefined.")}GetTextRect(e,t,i,s,n){return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextRect(e,t,i,s,n):{width:t.width,height:t.height}}GetTextInfo(e,t,i,s,n){return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextInfo(e,t,i,s,n):{start:0,end:e.length,width:t.width,height:t.height}}GetCursorOffset(e,t,i,s,n,r,a){return void 0!==window.PlatformUtils?window.PlatformUtils.GetCursorOffset(e,t,i,s,n,r,a):0}GetCursorPosition(e,t,i,s,n,r){return void 0!==window.PlatformUtils?window.PlatformUtils.GetCursorPosition(e,t,i,s,n,r):{x:0,y:0}}BuildTextView(e,t,i,s,n,r,a,o,l,h,c){n.width=isNaN(n.width)?0:n.width,n.height=isNaN(n.height)?0:n.height,r=isNaN(r)?10:r,a=isNaN(a)?0:a;let u=new F.LayoutView;const d=e.GetTextTextureFromStylePack(t,i,!!s,n,r,a,2!=o,l,h,c);return s&&setTimeout((()=>{s(u.Element.clientWidth,u.Element.clientHeight)})),null===d?(console.error("Error: Build text texture failed!"),null):(u.ResetTexture(d),t.length<10?u.SetId("Text-"+t):u.SetId("Text-Long-"+t.length),u.ResetLayoutParams({x:0,y:0,width:n.width,height:n.height}),u)}}$e._sDefaultFont="黑体",$e._sDefaultFontSize=30,$e._sDefaultFontColor="#FFFFFF",$e._sDefaultBackgroundColor="rgba(0, 0, 0, 0)",F.TextUtils=$e,F.sTextUtils=new F.TextUtils;class je{constructor(){this._InnerViews={},this._ViewToken=1}add(e){const t=++this._ViewToken;return this._InnerViews[`${t}`]=e,t}remove(e){this._InnerViews[e]&&delete this._InnerViews[e]}get(e){return this._InnerViews[e]}clear(){this._InnerViews={},this._ViewToken=1}}F.ViewStore=je;let Ue=new je;F.sViewStore=Ue;class Xe{constructor(e,t){this.view=e,this.layout_params=t}}F.ViewInfo=Xe;let ze=0;F.AnimationBase=class{constructor(){this.IdToken=ze++,this._AttachedGroup=null,this.AnimationListenerObj=null,this._AnimationClose=!1,this._LayoutViewRef=null,this._IsTextureAnim=!1}SetAnimationListener(e){this.AnimationListenerObj=e,this.OnNewListener(e)}AddAnimationListener(e){this.AnimationListenerObj&&e.AddInherit(this.AnimationListenerObj),this.AnimationListenerObj=e,this.OnNewListener(e)}RemoveAnimationListener(){this.AnimationListenerObj=null}OnNewListener(e){}GetAnimationListener(){return this.AnimationListenerObj}Cancel(e){this._LayoutViewRef&&this._LayoutViewRef.DetachAnimation(this);const t=this.AnimationListenerObj;if(t&&t.OnAnimationEnd&&!this._AnimationClose&&(this._AnimationClose=!0,t.OnAnimationEnd(!1)),this._AttachedGroup){let t=!0;e&&(t=e._AttachedGroup!==this._AttachedGroup),t&&(this._AttachedGroup.CancelFromInternalAnimation(this),this._AttachedGroup=null)}}AttachToGroup(e){null!==this._AttachedGroup&&F.ThrowError("ERROR: In TransformAnimation.AttachToGroup(), animation already attached to other group"),this._AttachedGroup=e}RemoveFromGroup(){this._AttachedGroup=null}AsTextureAnimation(){this._IsTextureAnim=!0}Start(e){this._LayoutViewRef=e}SetCannotDisable(e){}OnStart(){const e=this.AnimationListenerObj;e&&e.OnAnimationStart&&e.OnAnimationStart()}OnEnd(e){this._LayoutViewRef&&!e&&(this._LayoutViewRef.DetachAnimation(this),this._LayoutViewRef=null);const t=this.AnimationListenerObj;t&&t.OnAnimationEnd&&!this._AnimationClose&&(this._AnimationClose=!0,t.OnAnimationEnd(!0))}OnRepeatEvent(){const e=this.AnimationListenerObj;e&&e.OnAnimRepeat&&e.OnAnimRepeat()}OnViewHide(){const e=this.AnimationListenerObj;e&&e.OnViewNoVisible&&e.OnViewNoVisible()}OnFinalProgress(e){const t=this.AnimationListenerObj;t&&t.OnAnimFinal&&t.OnAnimFinal(e)}OnAnimAdvance(e){const t=this.AnimationListenerObj;t&&t.OnAnimAdvance&&t.OnAnimAdvance(e)}};class Ke{constructor(e,t,i){this.OnAnimationStart=e,this._OnAnimationStart=e,this.OnAnimationEnd=t,this._OnAnimationEnd=t,this.OnViewNoVisible=i,this._OnViewNoVisible=i,this.OnAnimFinal=null,this._OnAnimFinal=null,this.OnAnimRepeat=null,this._OnAnimRepeat=null,this._AttachedGroup=null,this._InheritListener=[],this._OnAnimAdvance=null,this.OnAnimAdvance=null}OnStart(e){return this._OnAnimationStart=e,this.OnAnimationStart=e,this}OnEnd(e){return this._OnAnimationEnd=e,this.OnAnimationEnd=e,this}OnAdvance(e){return this._OnAnimAdvance=e,this.OnAnimAdvance=e,this}OnFinalProgress(e){return this._OnAnimFinal=e,this.OnAnimFinal=e,this}OnRepeat(e){return this._OnAnimRepeat=e,this.OnAnimRepeat=e,this}AddInherit(e){if(e){if(0===this._InheritListener.length){const e=this;this.OnAnimationStart=function(){e._OnAnimationStart&&e._OnAnimationStart();for(let t=0;t<e._InheritListener.length;t++)e._InheritListener[t].OnAnimationStart&&e._InheritListener[t].OnAnimationStart()},this.OnAnimationEnd=function(t){e._OnAnimationEnd&&e._OnAnimationEnd(t);for(let i=0;i<e._InheritListener.length;i++)e._InheritListener[i].OnAnimationEnd&&e._InheritListener[i].OnAnimationEnd(t)},this.OnViewNoVisible=function(){e._OnViewNoVisible&&e._OnViewNoVisible();for(let t=0;t<e._InheritListener.length;t++)e._InheritListener[t].OnViewNoVisible&&e._InheritListener[t].OnViewNoVisible()},this.OnAnimFinal=function(t){e._OnAnimFinal&&e._OnAnimFinal(t);for(let i=0;i<e._InheritListener.length;i++)e._InheritListener[i].OnAnimFinal&&e._InheritListener[i].OnAnimFinal(t)},this.OnAnimRepeat=function(){e._OnAnimRepeat&&e._OnAnimRepeat();for(let t=0;t<e._InheritListener.length;t++)e._InheritListener[t].OnAnimRepeat&&e._InheritListener[t].OnAnimRepeat()},this.OnAnimAdvance=function(){e._OnAnimAdvance&&e._OnAnimAdvance();for(let t=0;t<e._InheritListener.length;t++)e._InheritListener[t].OnAnimAdvance&&e._InheritListener[t].OnAnimAdvance()}}this._InheritListener.push(e)}}}F.AnimationListener=Ke;class Je{constructor(e){this._SS=e}insertRule(e){window.jsvInAndroidWebView&&(e=(e=e.replace(/@keyframes/,"@-webkit-keyframes")).replace(/transform/g,"-webkit-transform"));const t=this._SS.cssRules.length;this._SS.insertRule(e,t)}removeRule(e){this.removeMultiRules([e])}hasRule(e){const t=this._SS.cssRules;for(let i=t.length-1;i>=0;i--)if(t[i].name===e)return!0;return!1}removeMultiRules(e){const t=this._SS,i=this._SS.cssRules;for(let s=i.length-1;s>=0;s--)for(const n in e)if(i[s].name===e[n]){e.splice(n,1),t.deleteRule(s);break}}}let qe=null;function Ze(){return null===qe&&(qe=function(e){let t=null;const i=document.styleSheets;if(!i||0===i.length)return console.error("Error: styleSheet empty"),null;if(e){for(let s=0;s<i.length;++s){const n=i[s];if(n.cssRules[0]&&n.cssRules[0].name&&n.cssRules[0].name===e){t=n;break}}if(null===t)return console.error(`Error: no found tag=${e}`),null}else t=i[i.length-1];return new Je(t)}()),qe}function Qe(e){let t="linear";if(e&&void 0!==e.T)switch(e.T){case F.EasingTypeIn:t="ease-in";break;case F.EasingTypeOut:t="ease-out";break;case F.EasingTypeInOut:t="ease-in-out";break;case F.EasingTypeBezier:t=`cubic-bezier(${e.St.X1},${e.St.Y1},${e.St.X2},${e.St.Y2})`;break;case F.EasingTypeSteps:t=`steps(${e.St.S},${0===e.St.T?"start":"end"})`;case F.EasingTypeBlink:case F.EasingTypeDeceleration:}return t}function et(e,t){const i=-1===e.repeatTimes?"infinite":e.repeatTimes;let s="linear";e.easing&&(s=Qe(e.easing));return`${t} ${e.duration/1e3}s ${s} ${e.delayedTime/1e3}s ${i}`}const tt=(e,t,i)=>{e.hasOwnProperty("__jsvHookListeners")||(e.__jsvHookListeners=new Map);const s=e.__jsvHookListeners;s.has(t)&&s.forEach((i=>{e.removeEventListener(t,i),e.__jsvHookListeners.delete(t)})),e.addEventListener(t,i),e.__jsvHookListeners.set(t,i)},it=e=>e>=65&&e<=90||e>=97&&e<=122,st=e=>e>=48&&e<=57,nt=e=>{if(!e)return null;let t="",i="",s=[],n=0;for(let r=0;r<e.length;r++){const a=e.charCodeAt(r);if(0===n?(it(a)||st(a))&&(t+=e[r]):(st(a)||46===a||45===a||101===a)&&(i+=e[r]),40===a)n=1,i="",s=[];else{if(41===a)return s.push(parseFloat(i)),{name:t,params:s};44===a&&(s.push(parseFloat(i)),i="")}}return console.error("transform error",e),null};function rt(e){const t=e.Element.children;let i=null;for(let e=0;e<t.length;e++)if("_AnimateProgressTracer"===t[e].id){i=t[e];break}return null===i&&(i=window.originDocument.createElement("div"),i.id="_AnimateProgressTracer",e.Element.appendChild(i)),i}let at=0;class ot{constructor(e){this._TracerDiv=rt(e),this._IdToken=at++,this._KeyFrameName=null,this._AdvanceTimer=null,this._AdvanceListener=null,this._TracerDiv.hasOwnProperty("_ForgeProgressToken")||(this._TracerDiv._ForgeProgressToken=0),this._OnEndListener=e=>{e.stopPropagation()},tt(this._TracerDiv,"animationend",this._OnEndListener)}_ClearAdvanceTimer(){null!==this._AdvanceTimer&&(clearInterval(this._AdvanceTimer),this._AdvanceTimer=null)}_NotifyAdvance(){this._ClearAdvanceTimer(),null!==this._AdvanceListener&&(this._AdvanceTimer=setInterval((()=>{const e=this.GetProgress();this._AdvanceListener(e),1===e&&this._ClearAdvanceTimer()}),100))}Start(e,t,i){this._AdvanceListener=i,this._KeyFrameName&&console.error("Error: Asset!! should Stop before start"),this._TracerDiv._ForgeProgressToken=(this._TracerDiv._ForgeProgressToken+1)%2,this._KeyFrameName=this._BuildTraceKeyFrame(t,this._IdToken,this._TracerDiv._ForgeProgressToken),this._TracerDiv.style.animation=et(e,this._KeyFrameName),tt(this._TracerDiv,"animationend",this._OnEndListener),this._NotifyAdvance()}Stop(){const e=this.GetProgress();return this._TracerDiv.style.animation=null,this._KeyFrameName&&(this._RemoveTraceKeyFrame(this._KeyFrameName),this._KeyFrameName=null),this._AdvanceListener&&(this._ClearAdvanceTimer(),this._AdvanceListener(e),this._AdvanceListener=null),e}GetProgress(){const e=window.getComputedStyle(this._TracerDiv);if(0===e.transform.length);else if(e.transform.length>0&&"none"!==e.transform){const t=nt(e.transform);return null!==t?t.params[4]/1e3:(console.error("Error:internal error"),0)}return 1}_BuildTraceKeyFrame(e,t,i){const s=`_AnimateProgress_${t}_${i}`,n=Ze(),r=`@keyframes ${s}\n {0%{transform:translate3d(${Math.floor(1e3*e)}px,0,0)}\n 100%{transform:translate3d(1000px,0,0)}}`;return n.insertRule(r),s}_RemoveTraceKeyFrame(e){Ze().removeRule(e)}}class lt{constructor(e,t){this._TracerDiv=rt(e),this._IdToken=at++,this._KeyFrameNameArray=null,this._StepsTotal=t,this._RunAnimList=null,this._TracerDiv.hasOwnProperty("_ForgeProgressToken")||(this._TracerDiv._ForgeProgressToken=0),this._OnEndListener=e=>{e.stopPropagation()},this._TracerDiv.addEventListener("animationend",this._OnEndListener)}Start(e){this._KeyFrameName&&console.error("Error: Asset!! should Stop before start"),this._TracerDiv._ForgeProgressToken=(this._TracerDiv._ForgeProgressToken+1)%2,this._BuildTraceKeyFrameGroup(this._IdToken,this._TracerDiv._ForgeProgressToken),this._RunAnimList=this._ConvertToAnimationStyle(e),this._TracerDiv.style.animation=this._RunAnimList[0]}TriggerNextStep(e){this._TracerDiv.style.animation=this._RunAnimList[e]}Stop(){const e=this.GetProgress();return this._TracerDiv.style.animation=null,null!==this._KeyFrameNameArray&&(this._RemoveTraceKeyFrameGroup(),this._KeyFrameNameArray=null),e}GetProgress(){const e=window.getComputedStyle(this._TracerDiv);if(0===e.transform.length);else if("none"!==e.transform){const t=nt(e.transform);if(null!==t){return t.params[4]/(100*this._StepsTotal)}return console.error("Error:internal error"),0}return 1}_BuildTraceKeyFrameGroup(e,t){this._KeyFrameNameArray=new Array(this._StepsTotal);const i=Ze();for(let s=0;s<this._KeyFrameNameArray.length;s++){const n=`_AnimateGroupProgress_${e}_${t}_Cnt_${s===this._KeyFrameNameArray.length-1?"finalStep":`${s}`}`,r=`@keyframes ${n}\n {0%{transform:translate3d(${100*s}px,0,0)}\n 100%{transform:translate3d(${100+100*s}px,0,0)}}`;i.insertRule(r),this._KeyFrameNameArray[s]=n}}_RemoveTraceKeyFrameGroup(){const e=Ze();this._KeyFrameNameArray.forEach((t=>{e.removeRule(t)}))}_ConvertToAnimationStyle(e){const t=[];for(let i=0;i<e.length;i++){let s="linear";const n=e[i];n.easing&&(s=Qe(n.easing)),t.push(`${this._KeyFrameNameArray[i]} ${n.duration/1e3}s ${s}`)}return t}}let ht=0;F.AnimationDelegate=class extends F.AnimationBase{constructor(e,t,i){super();let s=null;i&&(s=i.Package()),this.typeName=e,this.duration=t,this.easing=s,this.repeatTimes=1,this.delayedTime=0,this.enableFlags=0,this.enableStartPos=0,this._Progress=null}EnableDelay(e){return this.delayedTime=e,this}SetStartPos(e){this.enableStartPos=e}EnableInfinite(){return this.repeatTimes=-1,this}SetRepeat(e){return this.repeatTimes=e,this}Enable(e){return this._EnableFlagsInner(e),this}OnNewListener(e){let t=0;e.OnAnimFinal&&(t|=F.AnimationEnable.AckFinalProgress),e.OnAnimRepeat&&(t|=F.AnimationEnable.AckRepeat),0!==t&&this._EnableFlagsInner(t)}_EnableFlagsInner(e){-1!==this.enableFlags?this.enableFlags|=e:this.enableFlags=e}_GetCSSKeyframesRule(e){let t=null;const i=document.styleSheets;for(let s=0;s<i.length;++s)if(i[s]&&i[s].cssRules){for(const n in i[s].cssRules)if(i[s].cssRules[n].name===e){t=i[s].cssRules[n];break}if(t)break}return t}CheckCssAnimationFormat(e){const t=this._GetCSSKeyframesRule(e);if(t&&t.cssRules)for(const i in t.cssRules){if(!t.cssRules[i]||!t.cssRules[i].style)continue;if(!t.cssRules[i].style.opacity&&!t.cssRules[i].style.transform)continue;const s=t.cssRules[i].style.transform;s&&(-1!==s.indexOf("rotate(")?console.error(`@keyframe ${e}, only support rotate3d, current transform:${s}`):-1!==s.indexOf("translate(")?console.error(`@keyframe ${e}, only support translate3d, current transform:${s}`):-1!==s.indexOf("scale(")&&console.error(`@keyframe ${e}, only support scale3d, current transform:${s}`))}}},F.KeyFrameAnimation=class extends F.AnimationDelegate{constructor(e,t,i){super(e,t,i),this._KeyFrameNameToRecycle=null,this._TestRepeat=this._TestRepeat.bind(this),this._LatestProgressValue=0;const s=this;this._OnEndEvent=e=>{e.stopPropagation(),s._PerformAnimationEnd(!0)},this._CurrentEndEventFunc=null}Start(e){super.Start(e),e.ResetCssTransform(null,null),e.Element&&(e.Element.style.pointerEvents="auto"),this.enableStartPos>0?this._EnableStarterAnimation():this._EnableCssAnimation(this._BuildKeyFrame(),this._OnEndEvent,0)}Cancel(){super.Cancel(),this._PerformAnimationEnd(!1)}_EnableStarterAnimation(){let e=this._OnEndEvent;if(1!==this.repeatTimes){const t=this;e=e=>{e.stopPropagation(),null!==t._Progress&&t._Progress.Stop(),t.delayedTime=0,t.repeatTimes>0&&(t.repeatTimes-=1),this.OnRepeatEvent(),t._EnableCssAnimation(t._BuildKeyFrame(),t._OnEndEvent,0)}}const t=this.repeatTimes,i=this.duration;this.repeatTimes=1,this.duration*=1-this.enableStartPos,this._EnableCssAnimation(this._BuildStarterKeyFrame(),e,this.enableStartPos),this.repeatTimes=t,this.duration=i}_CreateAnimation(e){const t=Ze();t.removeRule(e.name),t.insertRule(e.keyFrameString)}_EnableCssAnimation(e,t,i){if(null===e)return;e.tmp?null!==e.keyFrameString&&(Ze().insertRule(e.keyFrameString),this._KeyFrameNameToRecycle=e.name):this._CreateAnimation(e);const s=e.name;this.CheckCssAnimationFormat(s);const n=this._LayoutViewRef.Element;0==(this.enableFlags&F.AnimationEnable.AckFinalProgress)&&0==(this.enableFlags&F.AnimationEnable.KeepTransform)&&0==(this.enableFlags&F.AnimationEnable.AckRepeat)||(this._Progress=new ot(this._LayoutViewRef),this._Progress.Start(this,i,(e=>{this.OnAnimAdvance(e)})),0!=(this.enableFlags&F.AnimationEnable.AckRepeat)&&(this._LatestProgressValue=0,F.sRenderBridge.RegisterPerFrameCallback(this._TestRepeat)));const r=et(this,s);window.jsvInAndroidWebView?(n.style.webkitAnimation=r,n.addEventListener("webkitAnimationEnd",t)):(n.style.animation=r,n.addEventListener("animationend",t)),this._CurrentEndEventFunc=t}_PerformAnimationEnd(e){if(null!==this._CurrentEndEventFunc){const e=this._LayoutViewRef.Element,t=this._CurrentEndEventFunc;setTimeout((()=>{window.jsvInAndroidWebView?e.removeEventListener("webkitAnimationEnd",t):e.removeEventListener("animationend",t)}),0),this._CurrentEndEventFunc=null}if(null===this._Progress)return void(e&&this.OnEnd());0!=(this.enableFlags&F.AnimationEnable.AckRepeat)&&F.sRenderBridge.UnregisterPerFrameCallback(this._TestRepeat);let t=this._Progress.Stop();if(e&&(t=1),0!=(this.enableFlags&F.AnimationEnable.KeepTransform)){const e=this._GetFrozenTransform(t);this._LayoutViewRef?.ResetCssTransform(e.transform,e.transformOrigin)}e&&this.OnEnd(),0!=(this.enableFlags&F.AnimationEnable.AckFinalProgress)&&window.setTimeout((()=>{this.OnFinalProgress(t)}),0),null!==this._KeyFrameNameToRecycle&&(Ze().removeRule(this._KeyFrameNameToRecycle),this._KeyFrameNameToRecycle=null)}_TestRepeat(){const e=this._Progress.GetProgress();this._LatestProgressValue>e&&this.OnRepeatEvent(),this._LatestProgressValue=e}_BuildStarterKeyFrame(){console.warn("Warning:Should override and return keyframe name")}_BuildKeyFrame(){console.warn("Warning:Should override and return keyframe name")}_GetFrozenTransform(e){console.warn("Warning:Should override and keep view transform by ResetCssTransform()")}};let ct=class extends F.KeyFrameAnimation{constructor(e,t,i,s,n,r){super("TL",n,r),this.startX=e,this.startY=i,this.endX=t,this.endY=s}_BuildStarterKeyFrame(){if(this.enableStartPos>0){const e=(this.endX-this.startX)*this.enableStartPos+this.startX,t=(this.endY-this.startY)*this.enableStartPos+this.startY,i="_ForgeAnim_TL_"+ht++;return{name:i,keyFrameString:`@keyframes ${i} {0%{transform:translate3d(${e}px,${t}px,0);}100%{transform:translate3d(${this.endX}px,${this.endY}px,0);}}`}}console.error("Error: no enabled starter position")}_BuildKeyFrame(){const e="_ForgeAnim_TL_"+ht++;return{name:e,keyFrameString:`@keyframes ${e} {0%{transform:translate3d(${this.startX}px,${this.startY}px,0);}100%{transform:translate3d(${this.endX}px,${this.endY}px,0);}}`,tmp:!0}}_GetFrozenTransform(e){return{transform:`translate3d(${Math.floor((this.endX-this.startX)*e+this.startX)}px,${Math.floor((this.endY-this.startY)*e+this.startY)}px,0)`,transformOrigin:null}}};F.FuncAnimation=class extends F.AnimationDelegate{constructor(e,t,i){super("FC2",t,i),this.formula=e,console.warn("NO implemented")}},F.TranslateAnimation=ct;let ut=class extends F.AnimationDelegate{constructor(e,t,i,s,n,r){super("RO",n,r),i instanceof F.Vec3||(i=new F.Vec3(i)),s instanceof F.Vec3||(s=new F.Vec3(s)),this.startAngle=e,this.offsetAngle=t,this.anchorVec3=i,this.axisVec3=s,console.warn("NO implemented")}};F.RotateAnimation=ut,F.BasicScaleAnimation=class extends F.AnimationDelegate{constructor(e,t,i,s,n,r,a,o,l,h){super("SC",a,o),console.warn("NO implemented")}};let dt=class extends F.BasicScaleAnimation{constructor(e,t,i,s,n,r){const a=200;super(e*a,e*a,t*a,t*a,i,s,n,r,200,200)}};F.ScaleAnimation=dt,F.OpacityAnimation=class extends F.AnimationDelegate{constructor(e,t,i,s){super("OP",i,s),console.warn("NO implemented")}},F.CssKeyframeAnimation=class extends F.KeyFrameAnimation{constructor(e,t,i,s,n){super("CK",t,i),this._keyFramesSet=e}_BuildKeyFrame(){let e=this._keyFramesSet.replaceAll("\n","");if(e.indexOf("@keyframes")<0&&e.indexOf("@-webkit-keyframes")<0)return console.warn("Warning:keyframes array empty"),null;let t=e.split(" ")[1];t.indexOf("{")>=0&&(t=t.substr(0,t.indexOf("{"))),e=e.replaceAll(/([left|top|width|height]:\s+\d+)/g,"$1px");const i=e.split("translate3d");for(let e=1;e<i.length;e++){let t=!1,s=i[e].replace(/\).*/,"");s=s.replace(/.*\(/,"");const n=s.split(",");for(let e=0;e<n.length;e++){const i=n[e].trim();i.match(/[0-9]$/)&&(n[e]=i+"px",t=!0)}t&&(s=n.join(","),i[e]=i[e].replace(/\(.*?\)/,"("+s+")"))}return{name:t,keyFrameString:i.join("translate3d"),tmp:!1}}_GetLastKeyframeTransform(e){let t=e.indexOf("to");if(t<0&&(t=e.indexOf("100%")),t<0)return"";{let i=e.indexOf("transform:",t);return i<0?"":e.substring(i+10,e.indexOf(";",i))}}_GetFrozenTransform(e){let t={transform:"",transformOrigin:null};return 1===e?t={transform:this._GetLastKeyframeTransform(this._keyFramesSet),transformOrigin:null}:console.warn("CssKeyframeAnimation can not get transform whill progress is not 1"),t}},F.CssTransitionAnimation=class extends F.AnimationDelegate{constructor(e){super("CT",null,null),this._transArray=e}Start(e){super.Start(e);const t=this,i=this._transArray,s={};if(0===i.length)return void console.warn("Warning:transition empty");let n="";for(let e=0;e<i.length;e++){let t="linear";const r=i[e];r.tf&&(t=Qe(r.tf)),n=`${r.name} ${r.dur/1e3}s ${t} ${r.dly/1e3}s`,s[r.name]=n}e.ApplyStyleTransition(s),n&&(e.Element.addEventListener("transitionend",(e=>{e.stopPropagation(),t.OnEnd(!0)})),e.Element.addEventListener("webkitTransitionEnd",(e=>{e.stopPropagation(),t.OnEnd(!0)})))}},F.KeyFrameGroupAnimation=class extends F.AnimationDelegate{constructor(e){super(e,0,null),this._KeyFrameArray=null,this._LatestProgressValue=0,this._CurrentEndEventFunc=null,this._Progress=null,this._AnimRunList=null,this._AnimationRunIndex=0;const t=this;this._OnEndEvent=e=>{e.stopPropagation(),this._TestFinalKeyFrame(e)?t._PerformAnimationEnd(!0):(this._AnimationRunIndex++,this._LayoutViewRef.Element.style.animation=this._AnimRunList[this._AnimationRunIndex],this._Progress.TriggerNextStep(this._AnimationRunIndex),t._OnSubKeyFrameDone(e))}}Start(e){super.Start(e),e.ResetCssTransform(null,null),e.Element&&(e.Element.style.pointerEvents="auto"),this._EnableCssAnimation(this._BuildKeyFrameGroup(),this._OnEndEvent)}Cancel(){super.Cancel(),this._PerformAnimationEnd(!1)}_EnableCssAnimation(e,t){if(null===e)return;this._KeyFrameArray=new Array(e.length);const i=Ze();for(let t=0;t<e.length;t++){const s=e[t];this.CheckCssAnimationFormat(s.name),this._KeyFrameArray[t]={name:s.name,easing:s.ease.Package(),duration:s.duration,needRecycle:!1},null!==s.keyFrameString&&(i.insertRule(s.keyFrameString),this._KeyFrameArray.needRecycle=!0)}const s=this._LayoutViewRef.Element;0==(this.enableFlags&F.AnimationEnable.AckFinalProgress)&&0==(this.enableFlags&F.AnimationEnable.KeepTransform)||(this._Progress=new lt(this._LayoutViewRef,this._KeyFrameArray.length),this._Progress.Start(this._KeyFrameArray)),this._AnimRunList=this._ConvertToAnimationStyle(this._KeyFrameArray),this._AnimationRunIndex=0,window.jsvInAndroidWebView?(s.style.webkitAnimation=this._AnimRunList[0],s.addEventListener("webkitAnimationEnd",t)):(s.style.animation=this._AnimRunList[0],s.addEventListener("animationend",t)),this._CurrentEndEventFunc=t}_PerformAnimationEnd(e){if(null!==this._CurrentEndEventFunc){const e=this._LayoutViewRef.Element,t=this._CurrentEndEventFunc;setTimeout((()=>{window.jsvInAndroidWebView?e.removeEventListener("webkitAnimationEnd",t):e.removeEventListener("animationend",t)}),0),this._CurrentEndEventFunc=null}if(null===this._Progress)return void(e&&this.OnEnd());let t=this._Progress.Stop();if(e&&(t=1),0!=(this.enableFlags&F.AnimationEnable.KeepTransform)){const e=this._GetFrozenTransform(t);this._LayoutViewRef.ResetCssTransform(e.transform,e.transformOrigin)}e&&this.OnEnd(),0!=(this.enableFlags&F.AnimationEnable.AckFinalProgress)&&window.setTimeout((()=>{this.OnFinalProgress(t)}),0);const i=Ze();for(const e of this._KeyFrameArray)e.needRecycle&&i.removeRule(e.name);this._KeyFrameArray=null}_ConvertToAnimationStyle(e){const t=[];for(let i=0;i<e.length;i++){let s="linear";const n=e[i];n.easing&&(s=Qe(n.easing)),t.push(`${n.name} ${n.duration/1e3}s ${s}`)}return t}_BuildKeyFrameGroup(){console.warn("Warning:Should override and return keyframe name")}_GetFrozenTransform(e){console.warn("Warning:Should override and keep view transform by ResetCssTransform()")}_TestFinalKeyFrame(e){console.warn("Warning:Should override")}_OnSubKeyFrameDone(e){console.warn("Warning:Should override")}};let gt=class extends F.TranslateAnimation{constructor(e,t,i,s,n,r){let a=n,o=r,l=n,h=r;s?(a=e,l=t):(o=e,h=t);super(a,l,o,h,Math.abs(Math.floor((t-e)/i*1e3)),null)}};F.TranslateFrameAnimation=gt;let ft=class extends F.KeyFrameGroupAnimation{constructor(e,t,i,s,n,r,a,o){super("Thr"),this._FromX=e,this._FromY=t,this._XorY=i,this._InitV=s,this._Acc=n,this._To=r,this._HasPole=a,this._PoleCallback=null,this._PolePosition=o,this._IsPositiveMove=this._InitV>0||0===this._InitV&&this._Acc>0}SetPoleCallback(e){this._PoleCallback=e}_MakeTranslateString(e,t,i){return`@keyframes ${e} {0%{transform:translate3d(${t.x.value}px,${t.y.value}px,0);}100%{transform:translate3d(${i.x.value}px,${i.y.value}px,0);}}`}_BuildKeyFrameGroup(){const e=""+ht++,t=[],i={x:{value:this._FromX},y:{value:this._FromY}},s={x:{value:this._FromX},y:{value:this._FromY}},n=0===this._XorY?i.x:i.y,r=0===this._XorY?s.x:s.y;if(this._HasPole){let a=`_ForgeAnim_Thr_Forw_${e}`;r.value=this._PolePosition;let o=this._MakeTranslateString(a,i,s);t.push({name:a,keyFrameString:o,ease:F.Easing.Circular.Out,duration:Math.floor(-this._InitV/this._Acc*1e3)}),a=`_ForgeAnim_Thr_Backw_${e}`,n.value=this._PolePosition,r.value=this._To,o=this._MakeTranslateString(a,i,s),t.push({name:a,keyFrameString:o,ease:F.Easing.Circular.In,duration:Math.floor(1e3*Math.sqrt(2*(this._To-this._PolePosition)/this._Acc))})}else{const a=`_ForgeAnim_Thr_Forw_${e}`;r.value=this._To;const o=this._MakeTranslateString(a,i,s),l=this._IsPositiveMove?this._InitV:-this._InitV,h=this._IsPositiveMove?this._Acc:-this._Acc,c=this._IsPositiveMove?r.value-n.value:n.value-r.value;t.push({name:a,keyFrameString:o,ease:h>0?F.Easing.Circular.In:F.Easing.Circular.Out,duration:Math.floor((Math.sqrt(l*l+2*h*c)-l)/h*1e3)})}return t}_GetFrozenTransform(e){const t={x:{value:this._FromX},y:{value:this._FromY}};let i=0===this._XorY?t.x.value:t.y.value;const s=0===this._XorY?t.x:t.y;let n=0;i=this._IsPositiveMove?i:-i;const r=this._IsPositiveMove?this._To:-this._To,a=this._IsPositiveMove?this._PolePosition:-this._PolePosition;if(this._HasPole){const t=(2*a-i-r)*e;n=t>a-i?a-(t-(a-i)):i+t}else n=i+(r-i)*e;s.value=Math.floor(this._IsPositiveMove?n:-n);return{transform:`translate3d(${t.x.value}px,${t.y.value}px,0)`,transformOrigin:null}}_TestFinalKeyFrame(e){return this._HasPole?e.animationName.indexOf("_ForgeAnim_Thr_Backw_")>=0:e.animationName.indexOf("_ForgeAnim_Thr_Forw_")>=0}_OnSubKeyFrameDone(e){this._HasPole&&this._PoleCallback&&this._PoleCallback()}};F.ThrowAnimation=ft;let mt={ReleaseAfterEndCallback:1,KeepTransform:2,AckFinalProgress:4,AckRepeat:8};F.AnimationEnable=mt,F.AnimFireCommand={AltSpeed:(e,t,i)=>{},RunFreeMoveCmdPacks:(e,t)=>{e.TransformAnimationObj.doCommand(t)}},F.FreeMoveActEvtType={ActEvent_ActFinish:1,ActEvent_Speed_X_Revert:2,ActEvent_Speed_Y_Revert:3,ActEvent_ActReject:4};let pt=0;class yt extends F.AnimationDelegate{constructor(e,t){super(e,t,null),this._StepsCount=1,this._Running=!1,this._NextStepIndex=0;const i=this;this._OnStepEnd=()=>{i._NextStep()}}SetStepsCount(e){this._StepsCount=e,this._SplitSteps()}Start(e){super.Start(e),window.jsvInAndroidWebView?this._LayoutViewRef.Element.addEventListener("webkitAnimationEnd",this._OnStepEnd):this._LayoutViewRef.Element.addEventListener("animationend",this._OnStepEnd),this._Running=!0,this._NextStep()}Cancel(){this._Running=!1}_NextStep(){null!==this._KeyFrameName&&(Ze().removeRule(this._KeyFrameName),this._KeyFrameName=null);const e=this._NextStepIndex===this._StepsCount;if(!this._Running||e)return void this._PerformAnimationEnd(e);const t=this._CreateOneStepKeyFrame(this._NextStepIndex);this._KeyFrameName=t.name,Ze().insertRule(t.keyFrameString);const i=et({repeatTimes:this.repeatTimes,easing:this.easing,delayedTime:0,duration:this.duration/this._StepsCount},this._KeyFrameName),s=this._LayoutViewRef.Element;window.jsvInAndroidWebView?s.style.webkitAnimation=i:s.style.animation=i,this._NextStepIndex++}_PerformAnimationEnd(e){window.jsvInAndroidWebView?this._LayoutViewRef.Element.removeEventListener("webkitAnimationEnd",this._OnStepEnd):this._LayoutViewRef.Element.removeEventListener("animationend",this._OnStepEnd);const t=this._NextStepIndex/this._StepsCount;if(0!=(this.enableFlags&F.AnimationEnable.KeepTransform)){const e=this._GetFrozenTransform(this._NextStepIndex-1);this._LayoutViewRef.ResetCssTransform(e.transform,e.transformOrigin)}e&&this.OnEnd(),window.setTimeout((()=>{this.OnFinalProgress(t)}),0)}_GetFrozenTransform(e){console.warn("Warning:Should override and keep view transform by ResetCssTransform()")}_SplitSteps(){console.warn("Warning: should be override by child class")}_CreateOneStepKeyFrame(e){console.warn("Warning: should be override by child class")}}F.TranslateStepAnimation=class extends yt{constructor(e,t,i,s,n){super("TL-S",n),this.startX=e,this.startY=i,this.endX=t,this.endY=s,this._StepsArray=null}_SplitSteps(){const e=this._StepsCount,t=(this.endX-this.startX)/e,i=(this.endY-this.startY)/e;this._StepsArray=new Array(e);let s=this.startX,n=this.startY;for(let r=0;r<e-1;r++)s+=t,n+=i,this._StepsArray[r]={targetX:Math.floor(s),targetY:Math.floor(n)};this._StepsArray[e-1]={targetX:this.endX,targetY:this.endY}}_CreateOneStepKeyFrame(e){let t=0,i=0;0===e?(t=this.startX,i=this.startY):(t=this._StepsArray[e-1].targetX,i=this._StepsArray[e-1].targetY);const s=this._StepsArray[e].targetX,n=this._StepsArray[e].targetY,r="_ForgeStepAnim_TL_"+pt++;return{name:r,keyFrameString:`@keyframes ${r} {\n 0%{transform:translate3d(${t}px,${i}px,0);}\n 100%{transform:translate3d(${s}px,${n}px,0);}}`}}_GetFrozenTransform(e){return{transform:`translate3d(${this._StepsArray[e].targetX}px,${this._StepsArray[e].targetY}px,0)`,transformOrigin:null}}};F.RenderBridge=class{constructor(){this._ScreenInfo={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this._FrameLoopFunc=null,this._CallbacksPerFrame=new Set,this._WillSwapCallbacks=new Map,this._DoWillSwapCallback=this._OnWillSwap.bind(this),this._AfterSwapCallbacks=new Map,this._DoAfterSwapCallback=this._OnAfterSwap.bind(this)}BeginHtmlFrameLoop(){null===this._FrameLoopFunc&&window.requestAnimationFrame&&(this._FrameLoopFunc=this._OnAnimation.bind(this),window.requestAnimationFrame(this._FrameLoopFunc))}_OnAnimation(){let e=!1;if(F.sViewSensorManager.HtmlHasActiveSensor()&&(F.sViewSensorManager.HtmlDoWorkOnFrame(),F.sViewSensorManager.HtmlHasActiveSensor()&&(e=!0)),this._CallbacksPerFrame.size>0){for(const e of this._CallbacksPerFrame)e();this._CallbacksPerFrame.size>0&&(e=!0)}e?window.requestAnimationFrame(this._FrameLoopFunc):this._FrameLoopFunc=null}GetScreenInfo(){return this._ScreenInfo}InitScreenBuffer(e,t){isNaN(e)&&(e=1),isNaN(t)&&(t=1280);const i=t*e,s=i/16*9;this._ScreenInfo.width=Math.floor(i),this._ScreenInfo.height=Math.floor(s),this._ScreenInfo.x=2/this._ScreenInfo.width,this._ScreenInfo.y=2/this._ScreenInfo.height,this._ScreenInfo.perspective=this._ScreenInfo.x,this._ScreenInfo.scaleRatio=e,this._ScreenInfo.designedWidth=t}RequestSwap(){this._OnRequesting||(this._OnRequesting=!0,Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then(this._DoRequestSwap.bind(this))}))}))}))})))}SetGlobalConfig(e){}AddWillSwapListener(e,t){this._WillSwapCallbacks.set(e,t)}AddAfterSwapListener(e,t){this._AfterSwapCallbacks.set(e,t)}_DoRequestSwap(){this._WillSwapCallbacks.size>0&&this._WillSwapCallbacks.forEach(this._DoWillSwapCallback),this._AfterSwapCallbacks.size>0&&this._AfterSwapCallbacks.forEach(this._DoAfterSwapCallback),this._OnRequesting=!1,F.sFrameCount.update()}GetSwapCount(){return F.sFrameCount.count}InstantPerformSwap(){this._OnRequesting&&(this._OnRequesting=!1,this._DoRequestSwap(!1))}_OnWillSwap(e){e()}_OnAfterSwap(e){e()}RegisterPerFrameCallback(e){this._CallbacksPerFrame.add(e),this.BeginHtmlFrameLoop()}UnregisterPerFrameCallback(e){this._CallbacksPerFrame.delete(e)}HasPendingRenderBreak(){return!1}FinishRenderBreak(){}};let Tt=new F.RenderBridge;F.sRenderBridge=Tt;class _t{constructor(e,t,i){this._TextureManager=e,this._GL=t,this._Loaded=!1,this._OnLoad=i,this.TextureId=null,this._TextureSource=null}_setGLTexture(){this.TextureId=this._GL.createTexture(),this._GL.activeTexture(this._GL.TEXTURE0),this._GL.bindTexture(this._GL.TEXTURE_2D,this.TextureId),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_WRAP_S,this._GL.CLAMP_TO_EDGE),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_WRAP_T,this._GL.CLAMP_TO_EDGE),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_MIN_FILTER,this._GL.NEAREST),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_MAG_FILTER,this._GL.LINEAR),this._GL.texImage2D(this._GL.TEXTURE_2D,0,this._GL.RGBA,this._GL.RGBA,this._GL.UNSIGNED_BYTE,this._TextureSource)}loaded(){return this._Loaded}recycle(){this._TextureManager.recycle(this._TextureSource)}}_t.IMAGE=Symbol("Texture.IMAGE"),_t.COLOR=Symbol("Texture.COLOR");class xt extends _t{constructor(e,t,i,s){if(super(e,t,i),s){const e=s.trim();if(0===e.indexOf("http"))this.Url=e;else if(0===e.indexOf("url")){const t=e.indexOf("("),i=e.indexOf(")");this.Url=e.substring(t+1,i)}else this.Url=s;this._TextureSource=new Image,this._TextureSource.onload=()=>{this._setGLTexture(),this._Loaded=!0,this._OnLoad&&this._OnLoad()},this._TextureSource.src=this.Url,this._TextureSource.crossOrigin="*",this._TextureSource.crossOrigin="Anonymous"}}}class wt{constructor(){this._Canvas=window.originDocument.createElement("canvas"),this._Canvas.setAttribute("width","1px"),this._Canvas.setAttribute("height","1px"),this._Canvas.setAttribute("style","position: absolute; pointer-events: none;"),document.body.appendChild(this._Canvas),this._GL=this._Canvas.getContext("2d")}getColorImageData(e,t,i,s){const n=this._GL.createImageData(1,1);return n.data[0]=e,n.data[1]=t,n.data[2]=i,n.data[3]=s,n}}let St=null;class vt extends _t{constructor(e,t,i,s){super(e,t,i),null===St&&(St=new wt),this.Color=s;const n=(e=>{if(!e)return null;if(0===(e=e.trim()).indexOf("rgba")){const t=e.indexOf("("),i=e.indexOf(")");return e.substr(t+1,i-t-1).split(",").map(((e,t)=>3===t?Math.ceil(255*parseFloat(e)):parseInt(e,10)))}if(0===e.indexOf("#")){let t=e.substr(1);const i=t.length;if(6===i||8===i){6===i&&(t+="FF");const e=parseInt(`0x${t}`,10);return[e>>24&255,e>>16&255,e>>8&255,255&e]}return null}return null})(this.Color);this._TextureSource=St.getColorImageData(...n),this._setGLTexture(),this._Loaded=!0,this._OnLoad&&this._OnLoad()}}const bt=new class{constructor(){this._TextureMap={}}getTexture(e,t,i,s){let n;if(this._TextureMap[s])n=this._TextureMap[s].texture,this._TextureMap[s].useCount++;else{switch(e){case _t.IMAGE:n=new xt(this,t,i,s);break;case _t.COLOR:n=new vt(this,t,i,s);break;default:console.log(`getTexture type is error:${e}`)}this._TextureMap[s]={texture:n,useCount:1}}return n}recycle(e){this._TextureMap[e]&&(this._TextureMap[e].useCount--,this._TextureMap[e].useCount<0&&delete this._TextureMap[e])}},Et=(e,t)=>Math.random()*(t-e)+e;class Ct{constructor(e,t,i,s,n){this._ViewId=e,this._Type=t.type,this._ParticleNum=t.particleNum,this._DeltaAngle=t.deltaAngle/180*Math.PI,this._DeltaWidthFact=t.deltaWidth/s.width,this._DeltaHeightFact=t.deltaHeight/s.height,this._PointSizeMin=t.pointSizeMin,this._PointSizeMax=t.pointSizeMax,this._SpeedMin=t.speedMin,this._SpeedMax=t.speedMax,this._LifeMin=t.lifeMin/1e3,this._LifeMax=t.lifeMax/1e3,this._AddNumSpeed=t.addNumSpeed,this._AcceletateX=t.accelerateX,this._AcceletateY=t.accelerateY,this._EnableFade=t.enableFade,this._EnableShrink=t.enableShrink,this._AngularVelocityMin=0,this._AngularVelocityMax=0,"number"==typeof t.angularVelocityMin&&"number"==typeof t.angularVelocityMax&&(this._AngularVelocityMin=t.angularVelocityMin,this._AngularVelocityMax=t.angularVelocityMax),this._AlphaMin=1,this._AlphaMax=1,"number"==typeof t.alphaMin&&"number"==typeof t.alphaMax&&(this._AlphaMin=t.alphaMin,this._AlphaMax=t.alphaMax),this._Texture=i,this._Buffer=new Float32Array(9*this._ParticleNum),this._AddedParticleNum=0,this._DomProxyView=n,this._StartTime=-1,this._LastFrameTime=-1,this._Stopped=!1,this._getTransform=this._getTransform.bind(this)}_getTransform(){let e=this._DomProxyView.HtmlGetElement();const t=Pt(e.style.width),i=Pt(e.style.height);let s=new window.WebKitCSSMatrix;for(;e.parentNode;){const t=getComputedStyle(e);if(t.transform){const i=t.transformOrigin?t.transformOrigin:t.webkitTransformOrigin;if(i){const n=Pt(i),r=new window.WebKitCSSMatrix(`translate(-${n[0]}px,-${n[1]}px)`),a=new window.WebKitCSSMatrix(`translate(${n[0]}px,${n[1]}px)`),o=new window.WebKitCSSMatrix(`translate(${e.offsetLeft}px,${e.offsetTop}px)`),l=new window.WebKitCSSMatrix(t.transform);s=o.multiply(a.multiply(l.multiply(r.multiply(s))))}else s=new window.WebKitCSSMatrix(t.transform).multiply(s)}e=e.parentNode}const n=new window.WebKitCSSMatrix;n.m11=0,n.m12=0,n.m14=1,n.m21=t,n.m22=0,n.m24=1,n.m31=0,n.m32=i,n.m34=1,n.m41=t,n.m42=i,n.m44=1,s=s.multiply(n);return[s.m11,s.m12,s.m21,s.m22,s.m31,s.m32,s.m41,s.m42]}_updateParticleInfo(e,t,i,s,n,r){const a=Et(0,2*this._DeltaWidthFact),o=Et(0,2*this._DeltaHeightFact);this._Buffer[9*e]=a*i[0]+o*s[0]+t[0],this._Buffer[9*e+1]=a*i[1]+o*s[1]+t[1],this._Buffer[9*e+2]=n+Et(-this._DeltaAngle,this._DeltaAngle),this._Buffer[9*e+3]=Et(this._SpeedMin,this._SpeedMax),this._Buffer[9*e+4]=r,this._Buffer[9*e+5]=Et(this._LifeMin,this._LifeMax),this._Buffer[9*e+6]=Et(this._PointSizeMin,this._PointSizeMax),this._Buffer[9*e+7]=Et(this._AngularVelocityMin,this._AngularVelocityMax),this._Buffer[9*e+8]=Et(this._AlphaMin,this._AlphaMax)}onDrawFrame(e,t,i){if(!this._DomProxyView||!this._DomProxyView.HtmlCanAccessElement())return;if(!this._Texture.loaded()||this._Stopped)return;this._StartTime<0&&(this._StartTime=Date.now()),this._LastFrameTime<0&&(this._LastFrameTime=this._StartTime);const s=this._getTransform();for(let e=0;e<s.length;e++)s[e]=e%2==0?2*s[e]/window.innerWidth-1:1-2*s[e]/window.innerHeight;const n=(Date.now()-this._StartTime)/1e3,r=[s[0],s[1]],a=[s[2]-s[0],s[3]-s[1]],o=[s[4]-s[0],s[5]-s[1]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=-a[1]/l,c=a[0]/l>0?Math.acos(h):2*Math.PI-Math.acos(h);if(0===this._Type)if(this._AddedParticleNum<this._ParticleNum){for(let e=0;e<this._ParticleNum;e++)this._updateParticleInfo(e,r,a,o,c,n);this._AddedParticleNum=this._ParticleNum}else{let e=!0;for(let t=0;t<this._ParticleNum;t++)if(this._Buffer[9*t+4]+this._Buffer[9*t+5]>n){e=!1;break}e&&(this._Stopped=!0)}else if(this._AddedParticleNum<this._ParticleNum){let e=Math.round((Date.now()-this._LastFrameTime)*this._AddNumSpeed);this._AddedParticleNum+e>this._ParticleNum&&(e=this._ParticleNum-this._AddedParticleNum);for(let t=0;t<e;t++)this._updateParticleInfo(this._AddedParticleNum+t,r,a,o,c,n);this._AddedParticleNum+=e}else for(let e=0;e<this._ParticleNum;e++)this._Buffer[9*e+4]+this._Buffer[9*e+5]<n&&this._updateParticleInfo(e,r,a,o,c,n);const u=e.getUniformLocation(t,"uTime");e.uniform1f(u,n);const d=e.getUniformLocation(t,"uAccelerate");e.uniform2f(d,this._AcceletateX,this._AcceletateY);const g=e.getUniformLocation(t,"uEnableFade");e.uniform1i(g,this._EnableFade?1:0);const f=e.getUniformLocation(t,"uEnableShrink");e.uniform1i(f,this._EnableShrink?1:0),e.bindBuffer(e.ARRAY_BUFFER,i),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._Texture.TextureId),e.bufferSubData(e.ARRAY_BUFFER,0,this._Buffer);const m=this._Buffer.BYTES_PER_ELEMENT,p=e.getAttribLocation(t,"aPosition");e.vertexAttribPointer(p,2,e.FLOAT,!1,9*m,0),e.enableVertexAttribArray(p);const y=e.getAttribLocation(t,"aSpeed");e.vertexAttribPointer(y,2,e.FLOAT,!1,9*m,2*m),e.enableVertexAttribArray(y);const T=e.getAttribLocation(t,"aLife");e.vertexAttribPointer(T,2,e.FLOAT,!1,9*m,4*m),e.enableVertexAttribArray(T);const _=e.getAttribLocation(t,"aPointSize");e.vertexAttribPointer(_,1,e.FLOAT,!1,9*m,6*m),e.enableVertexAttribArray(_);const x=e.getAttribLocation(t,"aAngularVelocity");e.vertexAttribPointer(x,1,e.FLOAT,!1,9*m,7*m),e.enableVertexAttribArray(x);const w=e.getAttribLocation(t,"aAlpha");e.vertexAttribPointer(w,1,e.FLOAT,!1,9*m,8*m),e.enableVertexAttribArray(w),e.drawArrays(e.POINTS,0,this._AddedParticleNum)}recycle(){this._Buffer=null,this._Texture.recycle(),this._Stopped=!0}}let It=0;let At=new class{constructor(){this._Inited=!1,this._Canvas=null,this._GL=null,this._GLProgram=null,this._VBO=null,this._ParticleViewMap={},this._LoopStarted=!1,this._onDrawFrame=this._onDrawFrame.bind(this)}_initCanvas(){if(this._Canvas=window.originDocument.createElement("canvas"),this._Canvas.setAttribute("width",`${window.innerWidth}px`),this._Canvas.setAttribute("height",`${window.innerHeight}px`),this._Canvas.setAttribute("style","position: absolute; pointer-events: none;"),document.body.appendChild(this._Canvas),this._GL=this._Canvas.getContext("webgl"),!this._GL)return void console.error("init webgl failed");console.log("webgl info: ",this._GL.getParameter(this._GL.VERSION),this._GL.getParameter(this._GL.SHADING_LANGUAGE_VERSION),this._GL.getParameter(this._GL.VENDOR));const e=this._GL.createShader(this._GL.VERTEX_SHADER);this._GL.shaderSource(e,"attribute vec2 aPosition;attribute vec2 aSpeed;attribute vec2 aLife;attribute float aPointSize;attribute float aAngularVelocity;attribute float aAlpha;uniform float uTime;uniform vec2 uAccelerate;uniform bool uEnableFade;uniform bool uEnableShrink;varying float vAlpha;varying mat2 vTextureRotate;void main() { float use_time = (uTime - aLife.x) / 10.0; float x = aSpeed.y * cos(aSpeed.x) * use_time + 0.5 * uAccelerate.x * use_time * use_time; float y = aSpeed.y * sin(aSpeed.x) * use_time + 0.5 * uAccelerate.y * use_time * use_time; float percent = (uTime - aLife.x) / aLife.y; percent = percent > 1.0 ? 0.0 : cos(1.57 * percent); vAlpha = aAlpha * (uEnableFade ? percent : 1.0); float angular = aAngularVelocity * use_time; vTextureRotate = mat2(cos(angular), sin(angular), -sin(angular), cos(angular)); gl_PointSize = uEnableShrink ? aPointSize * percent : aPointSize; gl_Position = vec4(x + aPosition.x, y + aPosition.y, 0.0, 1.0);}"),this._GL.compileShader(e);const t=this._GL.createShader(this._GL.FRAGMENT_SHADER);this._GL.shaderSource(t,"precision mediump float;uniform sampler2D uTexture;varying float vAlpha;varying mat2 vTextureRotate;void main(void) { vec2 center = vec2(0.5, 0.5); vec2 rotateCoord = vTextureRotate * (gl_PointCoord - center) + center; vec4 texture = texture2D(uTexture, rotateCoord) * vAlpha; gl_FragColor = texture;}"),this._GL.compileShader(t),this._GLProgram=this._GL.createProgram(),this._GL.attachShader(this._GLProgram,e),this._GL.attachShader(this._GLProgram,t),this._GL.linkProgram(this._GLProgram);const i=new Float32Array(4500),s=i.BYTES_PER_ELEMENT;this._VBO=this._GL.createBuffer(),this._GL.bindBuffer(this._GL.ARRAY_BUFFER,this._VBO),this._GL.bufferData(this._GL.ARRAY_BUFFER,i,this._GL.DYNAMIC_DRAW);const n=this._GL.getAttribLocation(this._GLProgram,"aPosition");this._GL.vertexAttribPointer(n,2,this._GL.FLOAT,!1,9*s,0),this._GL.enableVertexAttribArray(n);const r=this._GL.getAttribLocation(this._GLProgram,"aSpeed");this._GL.vertexAttribPointer(r,2,this._GL.FLOAT,!1,9*s,2*s),this._GL.enableVertexAttribArray(r);const a=this._GL.getAttribLocation(this._GLProgram,"aLife");this._GL.vertexAttribPointer(a,2,this._GL.FLOAT,!1,9*s,4*s),this._GL.enableVertexAttribArray(a);const o=this._GL.getAttribLocation(this._GLProgram,"aPointSize");this._GL.vertexAttribPointer(o,1,this._GL.FLOAT,!1,9*s,6*s),this._GL.enableVertexAttribArray(o);const l=this._GL.getAttribLocation(this._GLProgram,"aAngularVelocity");this._GL.vertexAttribPointer(l,1,this._GL.FLOAT,!1,9*s,7*s),this._GL.enableVertexAttribArray(l);const h=this._GL.getAttribLocation(this._GLProgram,"aAlpha");this._GL.vertexAttribPointer(h,1,this._GL.FLOAT,!1,9*s,8*s),this._GL.enableVertexAttribArray(h),this._GL.useProgram(this._GLProgram);const c=this._GL.getUniformLocation(this._GLProgram,"uTexture");this._GL.uniform1i(c,0),this._GL.enable(this._GL.BLEND),this._GL.enable(this._GL.SAMPLE_ALPHA_TO_COVERAGE),this._GL.blendFunc(this._GL.ONE,this._GL.ONE_MINUS_SRC_ALPHA),this._Inited=!0}_onDrawFrame(){this._GL.clear(this._GL.COLOR_BUFFER_BIT),this._GL.useProgram(this._GLProgram);for(const e in this._ParticleViewMap)this._ParticleViewMap.hasOwnProperty(e)&&this._ParticleViewMap[e].onDrawFrame(this._GL,this._GLProgram,this._VBO);window.requestAnimationFrame(this._onDrawFrame)}addParticle(e,t,i,s){this._Inited||this._initCanvas();const n=It++;let r;return r=0===t.indexOf("rgba")||0===t.indexOf("#")?bt.getTexture(_t.COLOR,this._GL,null,t):bt.getTexture(_t.IMAGE,this._GL,null,t),this._ParticleViewMap[n]=new Ct(n,e,r,i,s),this._LoopStarted||(this._LoopStarted=!0,window.requestAnimationFrame(this._onDrawFrame)),n}recycleView(e){this._ParticleViewMap[e]&&(this._ParticleViewMap[e].recycle(),delete this._ParticleViewMap[e])}};F.sParticleManager=At;let Pt=e=>{if(e.indexOf(" ")>=0){return e.split(" ").map((e=>parseInt(e.substr(0,e.length-2),10)))}return parseInt(e.substr(0,e.length-2),10)};F.ReactUtils={StyleClassMap:{}};{let ns=0;class rs{constructor(e,t){this._ID=t||e+ns++,this.Describe={},this._RefCount=0,this._Recycled=!1}ManualSetId(e){this._ID=e}GetId(){return this._ID}DoRef(){this._RefCount++}UnRef(){this._RefCount>0?this._RefCount--:console.warn("Already 0...")}}class as extends rs{constructor(e){super(null,e)}}const os=new as("DISABLE"),ls={alignment:"left",vertical_align:"top",vertical_area_align:"top",text_overflow:"clip",word_wrap:"normal",direction:"ltr"},hs=["alignment","vertical_align","vertical_area_align","text_overflow","word_wrap","direction"];class cs extends rs{constructor(e,t,i,s,n,r){super("DS",null),this.Describe.alignment=e,this.Describe.vertical_align=t,this.Describe.vertical_area_align=i,this.Describe.text_overflow=s,this.Describe.word_wrap=n,this.Describe.direction=r}GetSyncData(){return{T:0,ID:this._ID,A:this.Describe.alignment,VA:this.Describe.vertical_align,VAA:this.Describe.vertical_area_align,TO:this.Describe.text_overflow,WW:this.Describe.word_wrap,DIR:this.Describe.direction}}}const us={font:"黑体",italic:!1,bold:!1},ds=["font","italic","bold"];class gs extends rs{constructor(e,t,i){super("FS",null),this.Describe.font=e,this.Describe.italic=t,this.Describe.bold=i}GetSyncData(){return{T:1,ID:this._ID,F:this.Describe.font,I:this.Describe.italic,B:this.Describe.bold}}}const fs={text_color:"#000000",bg_color:"#FFFFFF00"},ms=["text_color","bg_color"];class ps extends rs{constructor(e,t){super("CS",null),this.Describe.text_color=e,this.Describe.bg_color=t}GetSyncData(){return{T:2,ID:this._ID,TC:this.Describe.text_color,BC:this.Describe.bg_color}}}const ys=["shadow_offset_x","shadow_offset_y","shadow_blur","shadow_color","stroke_width","stroke_color"];class Ts extends rs{constructor(e,t,i,s,n,r){super("SS",null),this.Describe.shadow_offset_x=e,this.Describe.shadow_offset_y=t,this.Describe.shadow_blur=i,this.Describe.shadow_color=s,this.Describe.stroke_width=n,this.Describe.stroke_color=r}GetSyncData(){return{T:3,ID:this._ID,OX:this.Describe.shadow_offset_x,OY:this.Describe.shadow_offset_y,B:this.Describe.shadow_blur,C:this.Describe.shadow_color,SW:this.Describe.stroke_width,SC:this.Describe.stroke_color}}}class _s{constructor(e){this.DS=F.sTextStyleCache.GetDisplayStyle(e),this.FS=F.sTextStyleCache.GetFontStyle(e),this.CS=F.sTextStyleCache.GetColorStyle(e),this.SS=F.sTextStyleCache.GetSpecialStyle(e),this._IdsCache=null}DoRef(){this.DS.DoRef(),this.FS.DoRef(),this.CS.DoRef(),this.SS.DoRef()}UnRef(){this.DS.UnRef(),this.FS.UnRef(),this.CS.UnRef(),this.SS.UnRef()}GetIdsPack(){return this._IdsCache||(this._IdsCache={DS:this.DS.GetId(),FS:this.FS.GetId(),CS:this.CS.GetId(),SS:this.SS.GetId()}),this._IdsCache}}class xs{constructor(){this._DisplayStyleMap=new Map,this._DisplayStyleIds=new Map,this._FontStyleMap=new Map,this._FontStyleIds=new Map,this._ColorStyleMap=new Map,this._ColorStyleIds=new Map,this._SpecialStyleMap=new Map,this._SpecialStyleIds=new Map,this._NewStyleList=[]}StyleToPack(e){let t={alignment:void 0!==e.hAlign?e.hAlign:ls.alignment,vertical_align:void 0!==e.vAlign?e.vAlign:ls.vertical_align,vertical_area_align:void 0!==e.vAreaAlign?e.vAreaAlign:ls.vertical_area_align,text_overflow:void 0!==e.textOverflow?e.textOverflow:ls.text_overflow,word_wrap:void 0!==e.wordWrap?e.wordWrap:ls.word_wrap,font:void 0!==e.font?e.font:us.font,italic:void 0!==e.italic?e.italic:us.italic,bold:void 0!==e.bold?e.bold:us.bold,text_color:void 0!==e.textColor?e.textColor:fs.text_color,bg_color:void 0!==e.backgroundColor?e.backgroundColor:fs.bg_color,direction:void 0!==e.direction?e.direction:"ltr",shadow_offset_x:0,shadow_offset_y:0,shadow_blur:0,shadow_color:null,stroke_width:0,stroke_color:null};if(e.shadow){const i=e.shadow;t.shadow_offset_x=i.shadowOffsetX,t.shadow_offset_y=i.shadowOffsetY,t.shadow_blur=i.shadowBlur,t.shadow_color=i.shadowColor}if(e.stroke){const i=e.stroke;t.stroke_width=i.strokeWidth,t.stroke_color=i.strokeColor}return new _s(t)}PrepareSyncNewStyles(){if(this._NewStyleList.length>0){let e=[];for(let t of this._NewStyleList)e.push(t.GetSyncData());F.sRenderTextureDelegateManager.CreateTextureHeadStatus().SetResourceInfo({STA:{Nam:"TST",Sta:e}}),this._NewStyleList=[]}}GetDisplayStyle(e){return this._GetStyle(e,hs,cs,this._DisplayStyleMap,this._DisplayStyleIds)}GetFontStyle(e){return this._GetStyle(e,ds,gs,this._FontStyleMap,this._FontStyleIds)}GetColorStyle(e){return this._GetStyle(e,ms,ps,this._ColorStyleMap,this._ColorStyleIds)}GetSpecialStyle(e){return 0===e.shadow_blur&&0===e.stroke_width?os:this._GetStyle(e,ys,Ts,this._SpecialStyleMap,this._SpecialStyleIds)}GetDsFromId(e){return this._DisplayStyleIds.get(e)}GetFsFromId(e){return this._FontStyleIds.get(e)}GetCsFromId(e){return this._ColorStyleIds.get(e)}GetSsFromId(e){return this._SpecialStyleIds.get(e)}_GetStyle(e,t,i,s,n){let r=[];for(let i of t)r.push(e[i]);let a=r.join(":"),o=null;return s.has(a)?o=s.get(a):(o=new i(...r),s.set(a,o),n.set(o.GetId(),o),window.JsView&&this._NewStyleList.push(o)),o}}F.TextStyleObjectBase=rs,F.TextStylePack=_s,F.sTextStyleCache=new xs}{let ws=1,Ss=2,vs=3;class bs{constructor(e,t){this.IdToken=F.sViewSensorManager.IdTokenGenerator++,this.Type=e,this.Manager=null,this._OnAnyViewLostList=null,this._AnyViewLostMark=null,this._OnWholeViewLostList=null,this._WholeViewLostMark=null,this._HtmlStatusInfo={target:null==t?ws:Ss}}OnManaged(e){return this._HtmlStatusInfo.target!=vs&&(this.Manager?(console.error("manage duplicated"),!1):(this._RegisterViewLostCallbacks(),this.Manager=e,!0))}ResetAutoRecycleViewsRef(e,t){e instanceof Array&&t instanceof Array?this._HtmlStatusInfo.target!=vs&&(this._UnregisterViewCallbacks(),this._OnAnyViewLostList=e,this._OnWholdViewLostList=t,this.Manager&&this._RegisterViewLostCallbacks()):console.error("need array ",e,t)}Expired(){return this._HtmlStatusInfo.target==vs}Recycle(){this._HtmlStatusInfo.target!=vs&&this.Manager&&(this._HtmlStatusInfo.target=vs,this.OnSelfRecycle(),this.Manager.RecycleSensor(this),this.Manager=null,this._UnregisterViewCallbacks()),this._OnAnyViewLostList=null,this._OnWholdViewLostList=null}HtmlDoWorkOnFrame(){console.log("Need be override")}HtmlNeedWorkOnFrame(){return!0}OnCallback(e){console.log("Need be override")}OnSelfRecycle(){}_RegisterViewLostCallbacks(){let e=this;if(this._OnAnyViewLostList?.length>0){let t=this._OnAnyViewLostList.length;this._AnyViewLostMark={callbacks:new Array(t).fill(null)};for(let i=0;i<t;i++){let t=this._OnAnyViewLostList[i];if(t.HtmlCanAccessElement()&&t.Expired)this._OnAnyViewLostList[i]=null;else{let s=()=>{e.Recycle()};this._AnyViewLostMark.callbacks[i]=s,t.RegisterDetachCallback(s)}}}else this._AnyViewLostMark=null;if(this._OnWholeViewLostList?.length>0){let t=this._OnWholeViewLostList.length;this._WholeViewLostMark={list:new Array(t).fill({callback:null,lost:!1}),lostCount:0};for(let i=0;i<t;i++){let t=this._OnWholeViewLostList[i];if(t.HtmlCanAccessElement()&&t.Expired)this._OnWholeViewLostList[i]=null,this._WholeViewLostMark.list[i].lost=!0,this._WholeViewLostMark.lostCount++;else{let s=()=>{e._OnViewOfWholeListLost(i)};this._WholeViewLostMark.list[i].callback=s,t.RegisterDetachCallback(s)}}}else this._WholeViewLostMark=null}_UnregisterViewCallbacks(){if(this._AnyViewLostMark){let e=this._OnAnyViewLostList.length;for(let t=0;t<e;t++){this._OnAnyViewLostList[t]&&this._OnAnyViewLostList[t].UnregisterDetachCallback(this._AnyViewLostMark.callbacks[t])}this._AnyViewLostMark=null}if(this._WholeViewLostMark){let e=this._OnWholdViewLostList.length;for(let t=0;t<e;t++){this._OnWholdViewLostList[t]&&this._OnWholdViewLostList[t].UnregisterDetachCallback(this._WholeViewLostMark.list[t].callback)}this._WholeViewLostMark=null}}_OnViewOfWholeListLost(e){this._WholeViewLostMark.list[e].lost||(this._WholeViewLostMark.lostCount++,this._WholeViewLostMark.list[e].lost=!0,this._WholeViewLostMark.list[view_idx].callback=null,this._OnWholdViewLostList[e]=null),this._WholeViewLostMark.lostCount==this._OnWholeViewLostList.length&&this.Recycle()}}bs.TypeDefines={TYPE_IMPACT:1,TYPE_FROZE_SET:2,TYPE_ON_SCREEN:3,TYPE_ENV_BLOCK:3,TYPE_DRAG_IMPACT:101},F.ViewSensor=bs}{class Es{constructor(){this._SensorMaps={},this.IdTokenGenerator=77}HtmlDoWorkOnFrame(){for(let e in this._SensorMaps){let t=this._SensorMaps[e];t.Expired()?delete this._SensorMaps[e]:t.HtmlDoWorkOnFrame()}}HtmlHasActiveSensor(){for(let e in this._SensorMaps)if(this._SensorMaps[e].HtmlNeedWorkOnFrame())return!0;return!1}AddSensor(e){if(e){e.OnManaged(this)&&(this._SensorMaps[e.IdToken]=e),this.RequestSwap()}}AddToSyncList(e){this._SensorMaps.hasOwnProperty(e.IdToken)||console.error("Error: (Add)No in map",this._SensorMaps,e)}RecycleSensor(e){this._SensorMaps.hasOwnProperty(e.IdToken)?(delete this._SensorMaps[e.IdToken],this.RequestSwap()):console.error("Error: (del)No in map",this._SensorMaps,e)}RequestSwap(){F.sRenderBridge.BeginHtmlFrameLoop()}}F.sViewSensorManager=new Es}class Lt{constructor(e,t,i){this.element=i,this.row=e,this.column=t}toString(){return`[${this.element[0]},${this.element[1]},${this.element[2]},${this.element[3]},${this.element[4]},${this.element[5]},${this.element[6]},${this.element[7]},${this.element[8]},${this.element[9]},${this.element[10]},${this.element[11]},${this.element[12]},${this.element[13]},${this.element[14]},${this.element[15]}]`}multiply(e){if(this.column!==e.row)throw new Error("matrix multiply error");const t=[];for(let i=0;i<this.row;i++)for(let s=0;s<e.column;s++){t[i+s*e.column]=0;for(let n=0;n<this.column;n++)t[i+s*e.column]+=this.element[i+n*this.column]*e.element[n+s*e.column]}return new Lt(this.row,e.column,t)}static identity(){return new Lt(4,4,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}static translate(e,t,i){return new Lt(4,4,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1])}static scale(e,t,i){return new Lt(4,4,[e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1])}static rotate(e,t,i,s){const n=Math.cos(s/180*Math.PI),r=Math.sin(s/180*Math.PI),a=Math.sqrt(e*e+t*t+i*i);if(1!==a){const s=1/a;e*=s,t*=s,i*=s}const o=1-n,l=e*t,h=t*i,c=i*e,u=e*r,d=t*r,g=i*r,f=[];return f[0]=e*e*o+n,f[1]=l*o+g,f[2]=c*o-d,f[3]=0,f[4]=l*o-g,f[5]=t*t*o+n,f[6]=h*o+u,f[7]=0,f[8]=c*o+d,f[9]=h*o-u,f[10]=i*i*o+n,f[11]=0,f[12]=0,f[13]=0,f[14]=0,f[15]=1,new Lt(4,4,f)}static skew(e,t){const i=new Array(16).fill(0),s=2*Math.PI*(t/360),n=-2*Math.PI*(e/360);return i[0]=1-n*s,i[1]=-Math.tan(s),i[4]=Math.tan(n),i[5]=1,i[10]=1,i[15]=1,new Lt(4,4,i)}static transform2d(e,t,i,s,n,r){return new Lt(4,4,[e,t,0,0,i,s,0,0,0,0,1,0,n,r,0,1])}}const kt=e=>e>=65&&e<=90||e>=97&&e<=122,Rt=e=>e>=48&&e<=57,Ft=(e,t)=>{switch(e){case"translate3d":return Lt.translate(t[0],t[1],t[2]);case"scale3d":return Lt.scale(t[0],t[1],t[2]);case"rotate3d":return Lt.rotate(t[0],t[1],t[2],t[3]);case"skew":return Lt.skew(t[0],t[1]);case"matrix":return Lt.transform2d(t[0],t[1],t[2],t[3],t[4],t[5]);case"matrix3d":return new Lt(4,4,t);default:throw new Error(`no support type ${e}`)}},Dt=e=>{let t=Lt.identity();if(!e)return t;let i="",s="",n=[],r=0;for(let a=0;a<e.length;a++){const o=e.charCodeAt(a);0===r?(kt(o)||Rt(o))&&(i+=e[a]):(Rt(o)||46===o||45===o||101===o)&&(s+=e[a]),40===o?(r=1,s="",n=[]):41===o?(n.push(parseFloat(s)),t=t.multiply(Ft(i,n)),i="",r=0):44===o&&(n.push(parseFloat(s)),s="")}return t},Vt=e=>{if(e.indexOf(" ")>=0){return e.split(" ").map((e=>parseInt(e.substr(0,e.length-2),10)))}return parseInt(e.substr(0,e.length-2),10)},Ot=e=>{let t=e;const i=Vt(t.style.width),s=Vt(t.style.height);let n=Lt.identity();for(;t.parentNode;){const e=getComputedStyle(t),i=e.transform?e.transform:e.webkitTransform;if(i){const s=e.transformOrigin?e.transformOrigin:e.webkitTransformOrigin,r=Dt(i);if(s){const e=Vt(s),i=Lt.translate(-e[0],-e[1],0),a=Lt.translate(e[0],e[1],0);n=Lt.translate(t.offsetLeft,t.offsetTop,0).multiply(a.multiply(r.multiply(i.multiply(n))))}else n=r.multiply(n)}t=t.parentNode}const r=new Lt(4,4,[0,0,0,1,i,0,0,1,0,s,0,1,i,s,0,1]);n=n.multiply(r);const a=n.element;return[a[0],a[1],a[4],a[5],a[8],a[9],a[12],a[13]]};function Mt(e){let t=Ot(e),i=Math.min(t[0],t[2],t[4],t[6]),s=Math.max(t[0],t[2],t[4],t[6]);return[Math.min(t[1],t[3],t[5],t[7]),Math.max(t[1],t[3],t[5],t[7]),i,s]}class Nt{constructor(e,t){this.set(e,t)}add(e,t){return e instanceof Nt?(this.x+=e.x,this.y+=e.y):(this.x+=e||0,this.y+=t||0),this}angle(e){if(void 0!==e)return this.set(this.length(),0).rotate(e);let t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t}angleDeg(e){return void 0!==e?this.angle(e/180*Math.PI):180*this.angle()/Math.PI}clone(){return new Nt(this.x,this.y)}cross(e,t){return e instanceof Nt?this.x*e.y-this.y*e.x:this.x*t-this.y*e}distance(e,t){const i=this.distanceSq(e,t);if(void 0!==i)return Math.sqrt(i)}distanceSq(e,t){let i,s;if(e instanceof Nt)i=e.x-this.x,s=e.y-this.y;else{if(void 0===t)return;i=e-this.x,s=t-this.y}return i*i+s*s}dot(e,t){return e instanceof Nt?this.x*e.x+this.y*e.y:this.x*e+this.y*t}equals(e,t,i){return e instanceof Nt?(t=t||0,Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=t):void 0!==t&&(i=i||0,Math.abs(this.x-e)<=i&&Math.abs(this.y-t)<=i)}length(){return Math.sqrt(this.lengthSq())}lengthSq(){return this.x*this.x+this.y*this.y}negate(){return this.scale(-1)}normalize(){return this.scale(1/this.length())}rotate(e){const t=Math.cos(e),i=Math.sin(e);return this.set(this.x*t-this.y*i,this.x*i+this.y*t)}rotateDeg(e){return this.rotate(e/180*Math.PI)}scale(e,t){return this.x*=e,this.y*=t||e,this}set(e,t){return e instanceof Nt?(this.x=e.x,this.y=e.y):(this.x=e||0,this.y=t||0),this}setPolar(e,t){return this.set(t,0).rotate(e)}setPolarDeg(e,t){return this.setPolar(e/180*Math.PI,t)}sub(e,t){return void 0!==t?(this.x-=e,this.y-=t):(this.x-=e.x,this.y-=e.y),this}toString(){return`(${this.x}, ${this.y})`}}function Gt(e,t,i){return i=i||0,Math.abs(e-t)<Math.abs(i)}const Bt={isEqual:Gt,isZero:(e,t)=>Gt(e,0,t),clamp:(e,t,i)=>e>t?e<i?e:i:t},Wt=Bt.isZero,Ht=Bt.clamp,Yt=1/3,$t=new Nt(0,0),jt=1e-4;function Ut(e){return"[object Array]"===Object.prototype.toString.call(e)}function Xt(e){if(!Ut(e))throw new Error("Polygon must be an array of points");switch(typeof e[0]){case"number":{if(e.length%2!=0)throw new Error("Polygon that contains array of numbers must has even length ([x0, y0, x1, y1, ...., xn, yn])");const t=[];for(let i=0;i<e.length;i+=2)t.push(new Nt(e[i],e[i+1]));return t}case"object":return e.map(Ut(e[0])?e=>new Nt(e[0],e[1]):e=>new Nt(e.x,e.y));default:throw new Error("Passed polygon is not an array of 2D coordinates")}}function zt(e){if(1===e.length)return new Nt(e[0]);const t=new Nt(0,0);e.forEach((e=>t.add(e))),t.scale(1/e.length);const i=new Nt;let s=0;return e.forEach(((n,r)=>{const a=new Nt(n),o=new Nt(r+1===e.length?e[0]:e[r+1]);a.add(-t.x,-t.y),o.add(-t.x,-t.y);const l=.5*a.cross(o);s+=l,i.add(a.add(o).scale(Yt).scale(l))})),Wt(s,jt)?i.set(e[0]):i.scale(1/s).add(t)}function Kt(e,t){let i=e[0],s=t.dot(e[0]),n=0;for(let r=1;r<e.length;r++)n=t.dot(e[r]),n>s&&(s=n,i=e[r]);return new Nt(i)}function Jt(e,t,i){const s=Kt(e,i),n=Kt(t,i.negate());return new Nt(s.sub(n))}function qt(e,t){const i=new Nt(0,0),s=new Nt(e).negate(),n=new Nt(t).sub(e),r=n.dot(n);if(Wt(r,jt))return i.set(e);let a=s.dot(n)/r;return a=Ht(a,0,1),i.set(n.scale(a).add(e))}function Zt(e,t){e=Xt(e),t=Xt(t);const i=zt(e),s=zt(t).add(i.negate());let n,r,a;n=Jt(e,t,s),r=Jt(e,t,s.negate());for(let i=0;i<30;i++){const i=qt(n,r);if(Wt(i.length(),jt))return 0;s.set(i.negate().normalize()),a=Jt(e,t,s);const o=a.dot(s),l=n.dot(s);if(Wt(o-l,jt))return o;n.distanceSq($t)<r.distanceSq($t)?r=a:n=a}return 0}const Qt={intersect:(e,t)=>Wt(Zt(e,t),jt),distance:Zt};class ei extends F.ViewSensor{constructor(e,t,i,s){super(F.ViewSensor.TypeDefines.TYPE_IMPACT),this._HtmlConfig={view1:e,view2:t,frozeSetId:s?s.IdToken:0,status:{contacted:!1}},this._Callback=i,this._FrozeViewsSet=s,s&&s.DoRef(),this.ResetAutoRecycleViewsRef([e,t],[]),F.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){if(!this.Expired()&&this._HtmlConfig.view1&&this._HtmlConfig.view2&&this._HtmlConfig.view1.HtmlCanAccessElement()&&this._HtmlConfig.view1.HtmlCanAccessElement()){(e=this._HtmlConfig.view1.HtmlGetElement(),t=this._HtmlConfig.view2.HtmlGetElement(),Qt.intersect(Ot(e),Ot(t)))?this._HtmlConfig.status.contacted||(this._HtmlConfig.status.contacted=!0,this.OnCallback(1)):this._HtmlConfig.status.contacted&&(this.OnCallback(2),this._HtmlConfig.status.contacted=!1)}var e,t}OnCallback(e){this._Callback&&(1==e&&this._Callback.OnBeginContact?this._Callback.OnBeginContact():2==e&&this._Callback.OnEndContact&&this._Callback.OnEndContact())}OnSelfRecycle(){this._FrozeViewsSet&&(this._FrozeViewsSet.UnRef(),this._FrozeViewsSet=null),this._HtmlConfig=null}}F.ImpactSensor=ei;class ti extends F.ViewSensor{constructor(e,t){super(F.ViewSensor.TypeDefines.TYPE_FROZE_SET),this._PreImpactViewList=null,this._OnImpactViewList=null,this._UpdateAutoRecycleRef(e,!0,t,!0),F.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){}HtmlNeedWorkOnFrame(){return!1}UpdatePreImpactList(e){this._UpdateAutoRecycleRef(e,!0,null,!1)}UpdateOnImpactList(e){this._UpdateAutoRecycleRef(null,!1,e,!0)}DoRef(){this.Expired()?console.error("Error: froze set is expired for all bind views lost"):this._RefCount++}UnRef(){this._RefCount>0&&this._RefCount--,0==this._RefCount&&this.Recycle()}OnSelfRecycle(){this._PreImpactViewList=null,this._OnImpactViewList=null}_UpdateAutoRecycleRef(e,t,i,s){t&&(this._PreImpactViewList=e instanceof Array?e:[]),s&&(this._OnImpactViewList=i instanceof Array?i:[]),this.ResetAutoRecycleViewsRef([],[...this._PreImpactViewList,...this._OnImpactViewList])}}class ii{constructor(e,t){this.Start=e,this.End=t}Merge(e){return this.IsInterAct(e)?(this.Start>e.Start&&(this.Start=e.Start),this.End<e.End&&(this.End=e.End),!0):this.End+1==e.Start?(this.End=e.End,!0):this.Start==e.End+1&&(this.Start=e.Start,!0)}IsInterAct(e){return e.Start<this.Start?!(e.End<this.Start):e.Start<=this.End}IsInclude(e){return this.Start<=e.Start&&this.End>=e.End}Exclude(e){var t={success:!1,newSplitedRange:null};return this.IsInterAct(e)?(e.Start<=this.Start?e.End<this.End?this.Start=e.End+1:this.Clear():(e.End<this.End&&(t.newSplitedRange=new ii(e.End+1,this.End),t.newSplitedRange=t.newSplitedRange),this.End=e.Start-1),t.success=!0,t.success=t.success,t):t}IsEmpty(){return this.Start>this.End}Clear(){this.End=this.Start-1}Clone(){return new ii(this.Start,this.End)}}const si="OV",ni="NV",ri="OH",ai="NH";class oi extends F.ViewSensor{constructor(e,t){super(F.ViewSensor.TypeDefines.TYPE_ON_SCREEN),this._HtmlConfig={view:e,container:null,enable:!1,testRange:null,status:{horizonVisible:!1,verticalVisible:!1}},this._Callback=t,this.ResetAutoRecycleViewsRef([e],[]),F.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){if(!this.Expired()&&this._HtmlConfig.enable&&this._HtmlConfig.testRange&&this._HtmlConfig.view&&this._HtmlConfig.view.HtmlCanAccessElement()){let e=F.sRenderBridge.GetScreenInfo().designedWidth,t=Math.floor(9*e/16);if(!this._HtmlConfig.view.IsVisibleInTree()){if(this._HtmlConfig.status.horizonVisible||this._HtmlConfig.status.verticalVisible){let e={};e[ri]=this._HtmlConfig.status.horizonVisible,e[ai]=!1,e[si]=this._HtmlConfig.status.verticalVisible,e[ni]=!1,this._HtmlConfig.status.horizonVisible=!1,this._HtmlConfig.status.verticalVisible=!1,this.OnCallback(e)}return}let i={top:0,bottom:0,left:0,right:0},s=Mt(this._HtmlConfig.view.HtmlGetElement());[i.top,i.bottom,i.left,i.right]=s;let n,r,a={top:0,bottom:t,left:0,right:e},o=!0;if(this._HtmlConfig.container&&this._HtmlConfig.container.HtmlCanAccessElement()){let i=Mt(this._HtmlConfig.container.HtmlGetElement());[a.top,a.bottom,a.left,a.right]=i,n=new ii(a.left,a.right),r=new ii(a.top,a.bottom);let s=new ii(0,e),l=new ii(0,t);o=s.IsInterAct(n)&&l.IsInterAct(r)}else n=new ii(a.left,a.right),r=new ii(a.top,a.bottom);let l,h,c,u,d=new ii(i.left,i.right),g=new ii(i.top,i.bottom),f=this._HtmlConfig.testRange;{let e=Math.floor((i.right-i.left)*f.horizon);l=new ii(i.left,i.left+e),h=new ii(i.right-e,i.right)}{let e=Math.floor((i.bottom-i.top)*f.vertical);c=new ii(i.top,i.top+e),u=new ii(i.bottom-e,i.bottom)}let m=(n.IsInclude(l)||n.IsInclude(h))&&r.IsInterAct(g)&&o,p=(r.IsInclude(c)||r.IsInclude(u))&&n.IsInterAct(d)&&o;if(m!=this._HtmlConfig.status.horizonVisible||p!=this._HtmlConfig.status.verticalVisible){let e={};e[ri]=this._HtmlConfig.status.horizonVisible,e[ai]=m,e[si]=this._HtmlConfig.status.verticalVisible,e[ni]=p,this._HtmlConfig.status.horizonVisible=m,this._HtmlConfig.status.verticalVisible=p,this.OnCallback(e)}}}HtmlNeedWorkOnFrame(){return this._HtmlConfig.enable}HtmlRequestSync(){F.sRenderBridge.BeginHtmlFrameLoop()}ResetArea(e){"number"!=typeof e.horizon&&(e.horizon=1),"number"!=typeof e.vertical&&(e.vertical=1),this._HtmlConfig.testRange=e,this.HtmlRequestSync()}Enable(e){this._HtmlConfig.enable=e,this._HtmlConfig.status.horizonVisible=!1,this._HtmlConfig.status.verticalVisible=!1,this.HtmlRequestSync()}ResetContainer(e){this._HtmlConfig.container=e,this.HtmlRequestSync()}OnCallback(e){this._Callback&&this._Callback(e[ri],e[ai],e[si],e[ni])}OnSelfRecycle(){this._HtmlConfig=null}}F.VisibleSensor=oi;const li=new class{constructor(){this.allEnvBlockList=[]}getSensor(e){const t=[];for(let i=0;i<this.allEnvBlockList.length;i++)this.allEnvBlockList[i].topGID==e&&t.push({direction:"top",start:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)}}),this.allEnvBlockList[i].bottomGID==e&&t.push({direction:"bottom",start:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)},end:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}}),this.allEnvBlockList[i].leftGID==e&&t.push({direction:"left",start:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}}),this.allEnvBlockList[i].rightGID===e&&t.push({direction:"right",start:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[i]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}});return t}addSensor(e){this.allEnvBlockList.push(e)}deleteSensor(e){for(let t=0;t<this.allEnvBlockList.length;t++)this.allEnvBlockList[t]===e&&this.allEnvBlockList.splice(t,1)}};class hi extends F.ViewSensor{constructor(e){super(F.ViewSensor.TypeDefines.TYPE_ENV_BLOCK),this._HtmlConfig={view:e,enable:!0},this.topGID=0,this.bottomGID=0,this.leftGID=0,this.rightGID=0}HtmlNeedWorkOnFrame(){return this._HtmlConfig.enable}ResetTopGID(e){if(null==e||0==e)return!1;this.topGID=e}ResetBottomGID(e){if(null==e||0==e)return!1;this.bottomGID=e}ResetLeftGID(e){if(null==e||0==e)return!1;this.leftGID=e}ResetRightGID(e){if(null==e||0==e)return!1;this.rightGID=e}Enable(e){this._HtmlConfig.enable=e,e?li.addSensor(this):li.deleteSensor(this)}OnSelfRecycle(){this._HtmlConfig=null}}function ci(e){if(!e)throw Error("assert :P")}function ui(e,t,i){for(var s=0;4>s;s++)if(e[t+s]!=i.charCodeAt(s))return!0;return!1}function di(e,t,i,s,n){for(var r=0;r<n;r++)e[t+r]=i[s+r]}function gi(e,t,i,s){for(var n=0;n<s;n++)e[t+n]=i}function fi(e){return new Int32Array(e)}function mi(e,t){for(var i=[],s=0;s<e;s++)i.push(new t);return i}function pi(e,t){var i=[];return function e(i,s,n){for(var r=n[s],a=0;a<r&&(i.push(n.length>s+1?[]:new t),!(n.length<s+1));a++)e(i[a],s+1,n)}(i,0,e),i}function yi(e,t){for(var i="",s=0;s<4;s++)i+=String.fromCharCode(e[t++]);return i}function Ti(e,t){return(e[t+0]<<0|e[t+1]<<8|e[t+2]<<16)>>>0}function _i(e,t){return(e[t+0]<<0|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}F.EnvBlockerSensor=hi,window.WebPDecoder=function(){function e(e,t){for(var i=1<<t-1>>>0;e&i;)i>>>=1;return i?(e&i-1)+i:e}function t(e,t,i,s,n){ci(!(s%i));do{e[t+(s-=i)]=n}while(0<s)}function i(i,n,r,a,o){if(ci(2328>=o),512>=o)var l=fi(512);else if(null==(l=fi(o)))return 0;return function(i,n,r,a,o,l){var h,c,u=n,d=1<<r,g=fi(16),f=fi(16);for(ci(0!=o),ci(null!=a),ci(null!=i),ci(0<r),c=0;c<o;++c){if(15<a[c])return 0;++g[a[c]]}if(g[0]==o)return 0;for(f[1]=0,h=1;15>h;++h){if(g[h]>1<<h)return 0;f[h+1]=f[h]+g[h]}for(c=0;c<o;++c)h=a[c],0<a[c]&&(l[f[h]++]=c);if(1==f[15])return(a=new s).g=0,a.value=l[0],t(i,u,1,d,a),d;var m,p=-1,y=d-1,T=0,_=1,x=1,w=1<<r;for(c=0,h=1,o=2;h<=r;++h,o<<=1){if(_+=x<<=1,0>(x-=g[h]))return 0;for(;0<g[h];--g[h])(a=new s).g=h,a.value=l[c++],t(i,u+T,o,w,a),T=e(T,h)}for(h=r+1,o=2;15>=h;++h,o<<=1){if(_+=x<<=1,0>(x-=g[h]))return 0;for(;0<g[h];--g[h]){if(a=new s,(T&y)!=p){for(u+=w,m=1<<(p=h)-r;15>p&&!(0>=(m-=g[p]));)++p,m<<=1;d+=w=1<<(m=p-r),i[n+(p=T&y)].g=m+r,i[n+p].value=u-n-p}a.g=h-r,a.value=l[c++],t(i,u+(T>>r),o,w,a),T=e(T,h)}}return _!=2*f[15]-1?0:d}(i,n,r,a,o,l)}function s(){this.value=this.g=0}function n(){this.value=this.g=0}function r(){this.G=mi(5,s),this.H=fi(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=mi(Mi,n)}function a(e,t,i,s){ci(null!=e),ci(null!=t),ci(2147483648>s),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=t,e.pa=i,e.Jd=t,e.Yc=i+s,e.Zc=4<=s?i+s-4+1:i,T(e)}function o(e,t){for(var i=0;0<t--;)i|=x(e,128)<<t;return i}function l(e,t){var i=o(e,t);return _(e)?-i:i}function h(e,t,i,s){var n,r=0;for(ci(null!=e),ci(null!=t),ci(4294967288>s),e.Sb=s,e.Ra=0,e.u=0,e.h=0,4<s&&(s=4),n=0;n<s;++n)r+=t[i+n]<<8*n;e.Ra=r,e.bb=s,e.oa=t,e.pa=i}function c(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<Bi-8>>>0,++e.bb,e.u-=8;m(e)&&(e.h=1,e.u=0)}function u(e,t){if(ci(0<=t),!e.h&&t<=Gi){var i=f(e)&Ni[t];return e.u+=t,c(e),i}return e.h=1,e.u=0}function d(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function g(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function f(e){return e.Ra>>>(e.u&Bi-1)>>>0}function m(e){return ci(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>Bi}function p(e,t){e.u=t,e.h=m(e)}function y(e){e.u>=Wi&&(ci(e.u>=Wi),c(e))}function T(e){ci(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(ci(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function _(e){return o(e,1)}function x(e,t){var i=e.Ca;0>e.b&&T(e);var s=e.b,n=i*t>>>8,r=(e.I>>>s>n)+0;for(r?(i-=n,e.I-=n+1<<s>>>0):i=n+1,s=i,n=0;256<=s;)n+=8,s>>=8;return s=7^n+Hi[s],e.b-=s,e.Ca=(i<<s)-1,r}function w(e,t,i){e[t+0]=i>>24&255,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=i>>0&255}function S(e,t){return e[t+0]<<0|e[t+1]<<8}function v(e,t){return S(e,t)|e[t+2]<<16}function b(e,t){return S(e,t)|S(e,t+2)<<16}function E(e,t){var i=1<<t;return ci(null!=e),ci(0<t),e.X=fi(i),null==e.X?0:(e.Mb=32-t,e.Xa=t,1)}function C(e,t){ci(null!=e),ci(null!=t),ci(e.Xa==t.Xa),di(t.X,0,e.X,0,1<<t.Xa)}function I(){this.X=[],this.Xa=this.Mb=0}function A(e,t,i,s){ci(null!=i),ci(null!=s);var n=i[0],r=s[0];return 0==n&&(n=(e*r+t/2)/t),0==r&&(r=(t*n+e/2)/e),0>=n||0>=r?0:(i[0]=n,s[0]=r,1)}function P(e,t){return e+(1<<t)-1>>>t}function L(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function k(e,t){self[t]=function(t,i,s,n,r,a,o){var l;for(l=0;l<r;++l){var h=self[e](a[o+l-1],s,n+l);a[o+l]=L(t[i+l],h)}}}function R(){this.ud=this.hd=this.jd=0}function F(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function D(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function V(e,t){return D(e+(e-t+.5>>1))}function O(e,t,i){return Math.abs(t-i)-Math.abs(e-i)}function M(e,t,i,s,n,r,a){for(s=r[a-1],i=0;i<n;++i)r[a+i]=s=L(e[t+i],s)}function N(e,t,i,s,n){var r;for(r=0;r<i;++r){var a=e[t+r],o=a>>8&255,l=16711935&(l=(l=16711935&a)+((o<<16)+o));s[n+r]=(4278255360&a)+l>>>0}}function G(e,t){t.jd=e>>0&255,t.hd=e>>8&255,t.ud=e>>16&255}function B(e,t,i,s,n,r){var a;for(a=0;a<s;++a){var o=t[i+a],l=o>>>8,h=o,c=255&(c=(c=o>>>16)+((e.jd<<24>>24)*(l<<24>>24)>>>5));h=255&(h=(h=h+((e.hd<<24>>24)*(l<<24>>24)>>>5))+((e.ud<<24>>24)*(c<<24>>24)>>>5));n[r+a]=(4278255360&o)+(c<<16)+h}}function W(e,t,i,s,n){self[t]=function(e,t,i,r,a,o,l,h,c){for(r=l;r<h;++r)for(l=0;l<c;++l)a[o++]=n(i[s(e[t++])])},self[e]=function(e,t,r,a,o,l,h){var c=8>>e.b,u=e.Ea,d=e.K[0],g=e.w;if(8>c)for(e=(1<<e.b)-1,g=(1<<c)-1;t<r;++t){var f,m=0;for(f=0;f<u;++f)f&e||(m=s(a[o++])),l[h++]=n(d[m&g]),m>>=c}else self["VP8LMapColor"+i](a,o,d,g,l,h,t,r,u)}}function H(e,t,i,s,n){for(i=t+i;t<i;){var r=e[t++];s[n++]=r>>16&255,s[n++]=r>>8&255,s[n++]=r>>0&255}}function Y(e,t,i,s,n){for(i=t+i;t<i;){var r=e[t++];s[n++]=r>>16&255,s[n++]=r>>8&255,s[n++]=r>>0&255,s[n++]=r>>24&255}}function $(e,t,i,s,n){for(i=t+i;t<i;){var r=(a=e[t++])>>16&240|a>>12&15,a=a>>0&240|a>>28&15;s[n++]=r,s[n++]=a}}function j(e,t,i,s,n){for(i=t+i;t<i;){var r=(a=e[t++])>>16&248|a>>13&7,a=a>>5&224|a>>3&31;s[n++]=r,s[n++]=a}}function U(e,t,i,s,n){for(i=t+i;t<i;){var r=e[t++];s[n++]=r>>0&255,s[n++]=r>>8&255,s[n++]=r>>16&255}}function X(e,t,i,s,n,r){if(0==r)for(i=t+i;t<i;)w(s,((r=e[t++])[0]>>24|r[1]>>8&65280|r[2]<<8&16711680|r[3]<<24)>>>0),n+=32;else di(s,n,e,t,i)}function z(e,t){self[t][0]=self[e+"0"],self[t][1]=self[e+"1"],self[t][2]=self[e+"2"],self[t][3]=self[e+"3"],self[t][4]=self[e+"4"],self[t][5]=self[e+"5"],self[t][6]=self[e+"6"],self[t][7]=self[e+"7"],self[t][8]=self[e+"8"],self[t][9]=self[e+"9"],self[t][10]=self[e+"10"],self[t][11]=self[e+"11"],self[t][12]=self[e+"12"],self[t][13]=self[e+"13"],self[t][14]=self[e+"0"],self[t][15]=self[e+"0"]}function K(e){return e==Ws||e==Hs||e==Ys||e==$s}function J(){this.eb=[],this.size=this.A=this.fb=0}function q(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Z(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new J,this.f.kb=new q,this.sd=null}function Q(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ee(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function te(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function ie(e,t){var i=e.T,s=t.ba.f.RGBA,n=s.eb,r=s.fb+e.ka*s.A,a=pn[t.ba.S],o=e.y,l=e.O,h=e.f,c=e.N,u=e.ea,d=e.W,g=t.cc,f=t.dc,m=t.Mc,p=t.Nc,y=e.ka,T=e.ka+e.T,_=e.U,x=_+1>>1;for(0==y?a(o,l,null,null,h,c,u,d,h,c,u,d,n,r,null,null,_):(a(t.ec,t.fc,o,l,g,f,m,p,h,c,u,d,n,r-s.A,n,r,_),++i);y+2<T;y+=2)g=h,f=c,m=u,p=d,c+=e.Rc,d+=e.Rc,r+=2*s.A,a(o,(l+=2*e.fa)-e.fa,o,l,g,f,m,p,h,c,u,d,n,r-s.A,n,r,_);return l+=e.fa,e.j+T<e.o?(di(t.ec,t.fc,o,l,_),di(t.cc,t.dc,h,c,x),di(t.Mc,t.Nc,u,d,x),i--):1&T||a(o,l,null,null,h,c,u,d,h,c,u,d,n,r+s.A,null,null,_),i}function se(e,t,i){var s=e.F,n=[e.J];if(null!=s){var r=e.U,a=t.ba.S,o=a==Ns||a==Ys;t=t.ba.f.RGBA;var l=[0],h=e.ka;l[0]=e.T,e.Kb&&(0==h?--l[0]:(--h,n[0]-=e.width),e.j+e.ka+e.T==e.o&&(l[0]=e.o-e.j-h));var c=t.eb;h=t.fb+h*t.A;e=vs(s,n[0],e.width,r,l,c,h+(o?0:3),t.A),ci(i==l),e&&K(a)&&ws(c,h,o,r,l,t.A)}return 0}function ne(e){var t=e.ma,i=t.ba.S,s=11>i,n=i==Vs||i==Ms||i==Ns||i==Gs||12==i||K(i);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!Di(t.Oa,e,n?11:12))return 0;if(n&&K(i)&&yi(),e.da)alert("todo:use_scaling");else{if(s){if(t.Ib=te,e.Kb){if(i=e.U+1>>1,t.memory=fi(e.U+2*i),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+i,t.Ib=ie,yi()}}else alert("todo:EmitYUV");n&&(t.Jb=se,s&&li())}if(s&&!Ln){for(e=0;256>e;++e)kn[e]=89858*(e-128)+En>>bn,Dn[e]=-22014*(e-128)+En,Fn[e]=-45773*(e-128),Rn[e]=113618*(e-128)+En>>bn;for(e=Cn;e<In;++e)t=76283*(e-16)+En>>bn,Vn[e-Cn]=Me(t,255),On[e-Cn]=Me(t+8>>4,15);Ln=1}return 1}function re(e){var t=e.ma,i=e.U,s=e.T;return ci(!(1&e.ka)),0>=i||0>=s?0:(i=t.Ib(e,t),null!=t.Jb&&t.Jb(e,t,i),t.Dc+=i,1)}function ae(e){e.ma.memory=null}function oe(e,t,i,s){return 47!=u(e,8)?0:(t[0]=u(e,14)+1,i[0]=u(e,14)+1,s[0]=u(e,1),0!=u(e,3)?0:!e.h)}function le(e,t){if(4>e)return e+1;var i=e-2>>1;return(2+(1&e)<<i)+u(t,i)+1}function he(e,t){return 120<t?t-120:1<=(i=((i=Js[t-1])>>4)*e+(8-(15&i)))?i:1;var i}function ce(e,t,i){var s=f(i),n=e[t+=255&s].g-8;return 0<n&&(p(i,i.u+8),s=f(i),t+=e[t].value,t+=s&(1<<n)-1),p(i,i.u+e[t].g),e[t].value}function ue(e,t,i){return i.g+=e.g,i.value+=e.value<<t>>>0,ci(8>=i.g),e.g}function de(e,t,i){var s=e.xc;return ci((t=0==s?0:e.vc[e.md*(i>>s)+(t>>s)])<e.Wb),e.Ya[t]}function ge(e,t,i,s){var n=e.ab,r=e.c*t,a=e.C;t=a+t;var o=i,l=s;for(s=e.Ta,i=e.Ua;0<n--;){var h=e.gc[n],c=a,u=t,d=o,g=l,f=(l=s,o=i,h.Ea);switch(ci(c<u),ci(u<=h.nc),h.hc){case 2:ji(d,g,(u-c)*f,l,o);break;case 0:var m=c,p=u,y=l,T=o,_=(b=h).Ea;0==m&&(Yi(d,g,null,null,1,y,T),M(d,g+1,0,0,_-1,y,T+1),g+=_,T+=_,++m);for(var x=1<<b.b,w=x-1,S=P(_,b.b),v=b.K,b=b.w+(m>>b.b)*S;m<p;){var E=v,C=b,I=1;for($i(d,g,y,T-_,1,y,T);I<_;){var A=(I&~w)+x;A>_&&(A=_),(0,Ji[E[C++]>>8&15])(d,g+ +I,y,T+I-_,A-I,y,T+I),I=A}g+=_,T+=_,++m&w||(b+=S)}u!=h.nc&&di(l,o-f,l,o+(u-c-1)*f,f);break;case 1:for(f=d,p=g,_=(d=h.Ea)-(T=d&~(y=(g=1<<h.b)-1)),m=P(d,h.b),x=h.K,h=h.w+(c>>h.b)*m;c<u;){for(w=x,S=h,v=new R,b=p+T,E=p+d;p<b;)G(w[S++],v),qi(v,f,p,g,l,o),p+=g,o+=g;p<E&&(G(w[S++],v),qi(v,f,p,_,l,o),p+=_,o+=_),++c&y||(h+=m)}break;case 3:if(d==l&&g==o&&0<h.b){for(p=l,d=f=o+(u-c)*f-(T=(u-c)*P(h.Ea,h.b)),g=l,y=o,m=[],T=(_=T)-1;0<=T;--T)m[T]=g[y+T];for(T=_-1;0<=T;--T)p[d+T]=m[T];Ui(h,c,u,l,f,l,o)}else Ui(h,c,u,d,g,l,o)}o=s,l=i}l!=i&&di(s,i,o,l,r)}function fe(e,t){var i=e.V,s=e.Ba+e.c*e.C,n=t-e.C;if(ci(t<=e.l.o),ci(16>=n),0<n){var r=e.l,a=e.Ta,o=e.Ua,l=r.width;if(ge(e,n,i,s),n=o=[o],ci((i=e.C)<(s=t)),ci(r.v<r.va),s>r.o&&(s=r.o),i<r.j){var h=r.j-i;i=r.j;n[0]+=h*l}if(i>=s?i=0:(n[0]+=4*r.v,r.ka=i-r.j,r.U=r.va-r.v,r.T=s-i,i=1),i){if(o=o[0],11>(i=e.ca).S){var c=i.f.RGBA,u=(s=i.S,n=r.U,r=r.T,h=c.eb,c.A),d=r;for(c=c.fb+e.Ma*c.A;0<d--;){var g=a,f=o,m=n,p=h,y=c;switch(s){case Ds:Zi(g,f,m,p,y);break;case Vs:Qi(g,f,m,p,y);break;case Ws:Qi(g,f,m,p,y),ws(p,y,0,m,1,0);break;case Os:is(g,f,m,p,y);break;case Ms:X(g,f,m,p,y,1);break;case Hs:X(g,f,m,p,y,1),ws(p,y,0,m,1,0);break;case Ns:X(g,f,m,p,y,0);break;case Ys:X(g,f,m,p,y,0),ws(p,y,1,m,1,0);break;case Gs:es(g,f,m,p,y);break;case $s:es(g,f,m,p,y),Ss(p,y,m,1,0);break;case Bs:ts(g,f,m,p,y);break;default:ci(0)}o+=l,c+=u}e.Ma+=r}else alert("todo:EmitRescaledRowsYUVA");ci(e.Ma<=i.height)}}e.C=t,ci(e.C<=e.i)}function me(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var i=e.Ya[t].G,s=e.Ya[t].H;if(0<i[1][s[1]+0].g||0<i[2][s[2]+0].g||0<i[3][s[3]+0].g)return 0}return 1}function pe(e,t,i,s,n,r){if(0!=e.Z){var a=e.qd,o=e.rd;for(ci(null!=mn[e.Z]);t<i;++t)mn[e.Z](a,o,s,n,s,n,r),a=s,o=n,n+=r;e.qd=a,e.rd=o}}function ye(e,t){var i=e.l.ma,s=0==i.Z||1==i.Z?e.l.j:e.C;s=e.C<s?s:e.C;if(ci(t<=e.l.o),t>s){var n=e.l.width,r=i.ca,a=i.tb+n*s,o=e.V,l=e.Ba+e.c*s,h=e.gc;ci(1==e.ab),ci(3==h[0].hc),zi(h[0],s,t,o,l,r,a),pe(i,s,t,r,a,n)}e.C=e.Ma=t}function Te(e,t,i,s,n,r,a){var o=e.$/s,l=e.$%s,h=e.m,c=e.s,u=i+e.$,d=u;n=i+s*n;var g=i+s*r,T=280+c.ua,_=e.Pb?o:16777216,x=0<c.ua?c.Wa:null,w=c.wc,S=u<g?de(c,l,o):null;ci(e.C<r),ci(g<=n);var v=!1;e:for(;;){for(;v||u<g;){var b=0;if(o>=_){var E=u-i;ci((_=e).Pb),_.wd=_.m,_.xd=E,0<_.s.ua&&C(_.s.Wa,_.s.vb),_=o+Zs}if(l&w||(S=de(c,l,o)),ci(null!=S),S.Qb&&(t[u]=S.qb,v=!0),!v)if(y(h),S.jc){b=h,E=t;var I=u,A=S.pd[f(b)&Mi-1];ci(S.jc),256>A.g?(p(b,b.u+A.g),E[I]=A.value,b=0):(p(b,b.u+A.g-256),ci(256<=A.value),b=A.value),0==b&&(v=!0)}else b=ce(S.G[0],S.H[0],h);if(h.h)break;if(v||256>b){if(!v)if(S.nd)t[u]=(S.qb|b<<8)>>>0;else{if(y(h),v=ce(S.G[1],S.H[1],h),y(h),E=ce(S.G[2],S.H[2],h),I=ce(S.G[3],S.H[3],h),h.h)break;t[u]=(I<<24|v<<16|b<<8|E)>>>0}if(v=!1,++u,++l>=s&&(l=0,++o,null!=a&&o<=r&&!(o%16)&&a(e,o),null!=x))for(;d<u;)b=t[d++],x.X[(506832829*b&4294967295)>>>x.Mb]=b}else if(280>b){if(b=le(b-256,h),E=ce(S.G[4],S.H[4],h),y(h),E=he(s,E=le(E,h)),h.h)break;if(u-i<E||n-u<b)break e;for(I=0;I<b;++I)t[u+I]=t[u+I-E];for(u+=b,l+=b;l>=s;)l-=s,++o,null!=a&&o<=r&&!(o%16)&&a(e,o);if(ci(u<=n),l&w&&(S=de(c,l,o)),null!=x)for(;d<u;)b=t[d++],x.X[(506832829*b&4294967295)>>>x.Mb]=b}else{if(!(b<T))break e;for(v=b-280,ci(null!=x);d<u;)b=t[d++],x.X[(506832829*b&4294967295)>>>x.Mb]=b;b=u,ci(!(v>>>(E=x).Xa)),t[b]=E.X[v],v=!0}v||ci(h.h==m(h))}if(e.Pb&&h.h&&u<n)ci(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&C(e.s.vb,e.s.Wa);else{if(h.h)break e;null!=a&&a(e,o>r?r:o),e.a=0,e.$=u-i}return 1}return e.a=3,0}function _e(e){ci(null!=e),e.vc=null,e.yc=null,e.Ya=null;var t=e.Wa;null!=t&&(t.X=null),e.vb=null,ci(null!=e)}function xe(){var e=new Zt;return null==e?null:(e.a=0,e.xb=fn,z("Predictor","VP8LPredictors"),z("Predictor","VP8LPredictors_C"),z("PredictorAdd","VP8LPredictorsAdd"),z("PredictorAdd","VP8LPredictorsAdd_C"),ji=N,qi=B,Zi=H,Qi=Y,es=$,ts=j,is=U,self.VP8LMapColor32b=Xi,self.VP8LMapColor8b=Ki,e)}function we(e,t,n,a,o){var l=1,h=[e],c=[t],d=a.m,g=a.s,m=null,T=0;e:for(;;){if(n)for(;l&&u(d,1);){var _=h,x=c,w=a,S=1,v=w.m,b=w.gc[w.ab],C=u(v,2);if(w.Oc&1<<C)l=0;else{switch(w.Oc|=1<<C,b.hc=C,b.Ea=_[0],b.nc=x[0],b.K=[null],++w.ab,ci(4>=w.ab),C){case 0:case 1:b.b=u(v,3)+2,S=we(P(b.Ea,b.b),P(b.nc,b.b),0,w,b.K),b.K=b.K[0];break;case 3:var I,A=u(v,8)+1,k=16<A?0:4<A?1:2<A?2:3;if(_[0]=P(b.Ea,k),b.b=k,I=S=we(A,1,0,w,b.K)){var R,F=A,D=b,V=1<<(8>>D.b),O=fi(V);if(null==O)I=0;else{var M=D.K[0],N=D.w;for(O[0]=D.K[0][0],R=1;R<1*F;++R)O[R]=L(M[N+R],O[R-1]);for(;R<4*V;++R)O[R]=0;D.K[0]=null,D.K[0]=O,I=1}}S=I;break;case 2:break;default:ci(0)}l=S}}if(h=h[0],c=c[0],l&&u(d,1)&&!(l=1<=(T=u(d,4))&&11>=T)){a.a=3;break e}var G;if(G=l)t:{var B,W,H,Y=a,$=h,j=c,U=T,X=n,z=Y.m,K=Y.s,J=[null],q=1,Z=0,Q=qs[U];i:for(;;){if(X&&u(z,1)){var ee=u(z,3)+2,te=P($,ee),ie=P(j,ee),se=te*ie;if(!we(te,ie,0,Y,J))break i;for(J=J[0],K.xc=ee,B=0;B<se;++B){var ne=J[B]>>8&65535;J[B]=ne,ne>=q&&(q=ne+1)}}if(z.h)break i;for(W=0;5>W;++W){var re=Xs[W];!W&&0<U&&(re+=1<<U),Z<re&&(Z=re)}var ae=mi(q*Q,s),oe=q,le=mi(oe,r);if(null==le)var he=null;else ci(65536>=oe),he=le;var ce=fi(Z);if(null==he||null==ce||null==ae){Y.a=1;break i}var de=ae;for(B=H=0;B<q;++B){var ge=he[B],fe=ge.G,me=ge.H,pe=0,ye=1,xe=0;for(W=0;5>W;++W){re=Xs[W],fe[W]=de,me[W]=H,!W&&0<U&&(re+=1<<U);s:{var Se,ve=re,be=Y,Ee=ce,Ce=de,Ie=H,Ae=0,Pe=be.m,Le=u(Pe,1);if(gi(Ee,0,0,ve),Le){var ke=u(Pe,1)+1,Re=u(Pe,1),Fe=u(Pe,0==Re?1:8);Ee[Fe]=1,2==ke&&(Ee[Fe=u(Pe,8)]=1);var De=1}else{var Ve=fi(19),Oe=u(Pe,4)+4;if(19<Oe){be.a=3;var Me=0;break s}for(Se=0;Se<Oe;++Se)Ve[Ks[Se]]=u(Pe,3);var Ne=void 0,Ge=void 0,Be=be,We=Ve,He=ve,Ye=Ee,$e=0,je=Be.m,Ue=8,Xe=mi(128,s);n:for(;i(Xe,0,7,We,19);){if(u(je,1)){var ze=2+2*u(je,3);if((Ne=2+u(je,ze))>He)break n}else Ne=He;for(Ge=0;Ge<He&&Ne--;){y(je);var Ke=Xe[0+(127&f(je))];p(je,je.u+Ke.g);var Je=Ke.value;if(16>Je)Ye[Ge++]=Je,0!=Je&&(Ue=Je);else{var qe=16==Je,Ze=Je-16,Qe=Us[Ze],et=u(je,js[Ze])+Qe;if(Ge+et>He)break n;for(var tt=qe?Ue:0;0<et--;)Ye[Ge++]=tt}}$e=1;break n}$e||(Be.a=3),De=$e}(De=De&&!Pe.h)&&(Ae=i(Ce,Ie,8,Ee,ve)),De&&0!=Ae?Me=Ae:(be.a=3,Me=0)}if(0==Me)break i;if(ye&&1==zs[W]&&(ye=0==de[H].g),pe+=de[H].g,H+=Me,3>=W){var it,st=ce[0];for(it=1;it<re;++it)ce[it]>st&&(st=ce[it]);xe+=st}}if(ge.nd=ye,ge.Qb=0,ye&&(ge.qb=(fe[3][me[3]+0].value<<24|fe[1][me[1]+0].value<<16|fe[2][me[2]+0].value)>>>0,0==pe&&256>fe[0][me[0]+0].value&&(ge.Qb=1,ge.qb+=fe[0][me[0]+0].value<<8)),ge.jc=!ge.Qb&&6>xe,ge.jc){var nt,rt=ge;for(nt=0;nt<Mi;++nt){var at=nt,ot=rt.pd[at],lt=rt.G[0][rt.H[0]+at];256<=lt.value?(ot.g=lt.g+256,ot.value=lt.value):(ot.g=0,ot.value=0,at>>=ue(lt,8,ot),at>>=ue(rt.G[1][rt.H[1]+at],16,ot),at>>=ue(rt.G[2][rt.H[2]+at],0,ot),ue(rt.G[3][rt.H[3]+at],24,ot))}}}K.vc=J,K.Wb=q,K.Ya=he,K.yc=ae,G=1;break t}G=0}if(!(l=G)){a.a=3;break e}if(0<T){if(g.ua=1<<T,!E(g.Wa,T)){a.a=1,l=0;break e}}else g.ua=0;var ht=a,ct=h,ut=c,dt=ht.s,gt=dt.xc;if(ht.c=ct,ht.i=ut,dt.md=P(ct,gt),dt.wc=0==gt?-1:(1<<gt)-1,n){a.xb=gn;break e}if(null==(m=fi(h*c))){a.a=1,l=0;break e}l=(l=Te(a,m,0,h,c,c,null))&&!d.h;break e}return l?(null!=o?o[0]=m:(ci(null==m),ci(n)),a.$=0,n||_e(g)):_e(g),l}function Se(e,t){var i=e.c*e.i,s=i+t+16*t;return ci(e.c<=t),e.V=fi(s),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+i+t,1)}function ve(e,t){var i=e.C,s=t-i,n=e.V,r=e.Ba+e.c*i;for(ci(t<=e.l.o);0<s;){var a=16<s?16:s,o=e.l.ma,l=e.l.width,h=l*a,c=o.ca,u=o.tb+l*i,d=e.Ta,g=e.Ua;ge(e,a,n,r),bs(d,g,c,u,h),pe(o,i,i+a,c,u,l),s-=a,n+=a*e.c,i+=a}ci(i==t),e.C=e.Ma=t}function be(){this.ub=this.yd=this.td=this.Rb=0}function Ee(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ce(){this.Fb=this.Bb=this.Cb=0,this.Zb=fi(4),this.Lb=fi(4)}function Ie(){this.Yb=function(){var e=[];return function e(t,i,s){for(var n=s[i],r=0;r<n&&(t.push(s.length>i+1?[]:0),!(s.length<i+1));r++)e(t[r],i+1,s)}(e,0,[3,11]),e}()}function Ae(){this.jb=fi(3),this.Wc=pi([4,8],Ie),this.Xc=pi([4,17],Ie)}function Pe(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new fi(4),this.od=new fi(4)}function Le(){this.ld=this.La=this.dd=this.tc=0}function ke(){this.Na=this.la=0}function Re(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Fe(){this.ad=fi(384),this.Za=0,this.Ob=fi(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function De(){this.uc=this.M=this.Nb=0,this.wa=Array(new Le),this.Y=0,this.ya=Array(new Fe),this.aa=0,this.l=new Ne}function Ve(){this.y=fi(16),this.f=fi(8),this.ea=fi(8)}function Oe(){this.cb=this.a=0,this.sc="",this.m=new d,this.Od=new be,this.Kc=new Ee,this.ed=new Pe,this.Qa=new Ce,this.Ic=this.$c=this.Aa=0,this.D=new De,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=mi(8,d),this.ia=0,this.pb=mi(4,Re),this.Pa=new Ae,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Ve),this.Hd=0,this.rb=Array(new ke),this.sb=0,this.wa=Array(new Le),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Fe),this.L=this.aa=0,this.gd=pi([4,2],Le),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Me(e,t){return 0>e?0:e>t?t:e}function Ne(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Ge(){var e=new Oe;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,tn||(tn=Ye)),e}function Be(e,t,i){return 0==e.a&&(e.a=t,e.sc=i,e.cb=0),0}function We(e,t,i){return 3<=i&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function He(e,t){if(null==e)return 0;if(e.a=0,e.sc="OK",null==t)return Be(e,2,"null VP8Io passed to VP8GetHeaders()");var i=t.data,s=t.w,n=t.ha;if(4>n)return Be(e,7,"Truncated header.");var r=i[s+0]|i[s+1]<<8|i[s+2]<<16,h=e.Od;if(h.Rb=!(1&r),h.td=r>>1&7,h.yd=r>>4&1,h.ub=r>>5,3<h.td)return Be(e,3,"Incorrect keyframe parameters.");if(!h.yd)return Be(e,4,"Frame not displayable.");s+=3,n-=3;var c=e.Kc;if(h.Rb){if(7>n)return Be(e,7,"cannot parse picture header");if(!We(i,s,n))return Be(e,3,"Bad code word");c.c=16383&(i[s+4]<<8|i[s+3]),c.Td=i[s+4]>>6,c.i=16383&(i[s+6]<<8|i[s+5]),c.Ud=i[s+6]>>6,s+=7,n-=7,e.za=c.c+15>>4,e.Ub=c.i+15>>4,t.width=c.c,t.height=c.i,t.Da=0,t.j=0,t.v=0,t.va=t.width,t.o=t.height,t.da=0,t.ib=t.width,t.hb=t.height,t.U=t.width,t.T=t.height,gi((r=e.Pa).jb,0,255,r.jb.length),ci(null!=(r=e.Qa)),r.Cb=0,r.Bb=0,r.Fb=1,gi(r.Zb,0,0,r.Zb.length),gi(r.Lb,0,0,r.Lb)}if(h.ub>n)return Be(e,7,"bad partition length");a(r=e.m,i,s,h.ub),s+=h.ub,n-=h.ub,h.Rb&&(c.Ld=_(r),c.Kd=_(r)),c=e.Qa;var u,d=e.Pa;if(ci(null!=r),ci(null!=c),c.Cb=_(r),c.Cb){if(c.Bb=_(r),_(r)){for(c.Fb=_(r),u=0;4>u;++u)c.Zb[u]=_(r)?l(r,7):0;for(u=0;4>u;++u)c.Lb[u]=_(r)?l(r,6):0}if(c.Bb)for(u=0;3>u;++u)d.jb[u]=_(r)?o(r,8):255}else c.Bb=0;if(r.Ka)return Be(e,3,"cannot parse segment header");if((c=e.ed).zd=_(r),c.Tb=o(r,6),c.wb=o(r,3),c.Pc=_(r),c.Pc&&_(r)){for(d=0;4>d;++d)_(r)&&(c.vd[d]=l(r,6));for(d=0;4>d;++d)_(r)&&(c.od[d]=l(r,6))}if(e.L=0==c.Tb?0:c.zd?1:2,r.Ka)return Be(e,3,"cannot parse filter header");var g=n;if(n=u=s,s=u+g,c=g,e.Xb=(1<<o(e.m,2))-1,g<3*(d=e.Xb))i=7;else{for(u+=3*d,c-=3*d,g=0;g<d;++g){var f=i[n+0]|i[n+1]<<8|i[n+2]<<16;f>c&&(f=c),a(e.Jc[+g],i,u,f),u+=f,c-=f,n+=3}a(e.Jc[+d],i,u,c),i=u<s?0:5}if(0!=i)return Be(e,i,"cannot parse partitions");for(i=o(u=e.m,7),n=_(u)?l(u,4):0,s=_(u)?l(u,4):0,c=_(u)?l(u,4):0,d=_(u)?l(u,4):0,u=_(u)?l(u,4):0,g=e.Qa,f=0;4>f;++f){if(g.Cb){var m=g.Zb[f];g.Fb||(m+=i)}else{if(0<f){e.pb[f]=e.pb[0];continue}m=i}var p=e.pb[f];p.Sc[0]=Qs[Me(m+n,127)],p.Sc[1]=en[Me(m+0,127)],p.Eb[0]=2*Qs[Me(m+s,127)],p.Eb[1]=101581*en[Me(m+c,127)]>>16,8>p.Eb[1]&&(p.Eb[1]=8),p.Qc[0]=Qs[Me(m+d,117)],p.Qc[1]=en[Me(m+u,127)],p.lc=m+u}if(!h.Rb)return Be(e,4,"Not a key frame.");for(_(r),h=e.Pa,i=0;4>i;++i){for(n=0;8>n;++n)for(s=0;3>s;++s)for(c=0;11>c;++c)d=x(r,ln[i][n][s][c])?o(r,8):an[i][n][s][c],h.Wc[i][n].Yb[s][c]=d;for(n=0;17>n;++n)h.Xc[i][n]=h.Wc[i][hn[n]]}return e.kc=_(r),e.kc&&(e.Bd=o(r,8)),e.cb=1}function Ye(e,t,i,s,n,r,a){var o=t[n].Yb[i];for(i=0;16>n;++n){if(!x(e,o[i+0]))return n;for(;!x(e,o[i+1]);)if(o=t[++n].Yb[0],i=0,16==n)return 16;var l=t[n+1].Yb;if(x(e,o[i+2])){var h=e,c=0;if(x(h,(d=o)[(u=i)+3]))if(x(h,d[u+6])){for(o=0,u=2*(c=x(h,d[u+8]))+(d=x(h,d[u+9+c])),c=0,d=sn[u];d[o];++o)c+=c+x(h,d[o]);c+=3+(8<<u)}else x(h,d[u+7])?(c=7+2*x(h,165),c+=x(h,145)):c=5+x(h,159);else c=x(h,d[u+4])?3+x(h,d[u+5]):2;o=l[2]}else c=1,o=l[1];l=a+nn[n],0>(h=e).b&&T(h);var u,d=h.b,g=(u=h.Ca>>1)-(h.I>>d)>>31;--h.b,h.Ca+=g,h.Ca|=1,h.I-=(u+1&g)<<d,r[l]=((c^g)-g)*s[(0<n)+0]}return 16}function $e(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,gi(e.zc,0,0,e.zc.length),e.ja=0}function je(e,t){if(null==e)return 0;if(null==t)return Be(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!He(e,t))return 0;if(ci(e.cb),null==t.ac||t.ac(t)){t.ob&&(e.L=0);var i=Nn[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=t.v-i>>4,e.zb=t.j-i>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=t.o+15+i>>4,e.Hb=t.va+15+i>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var s=e.ed;for(i=0;4>i;++i){var n;if(e.Qa.Cb){var r=e.Qa.Lb[i];e.Qa.Fb||(r+=s.Tb)}else r=s.Tb;for(n=0;1>=n;++n){var a=e.gd[i][n],o=r;if(s.Pc&&(o+=s.vd[0],n&&(o+=s.od[0])),0<(o=0>o?0:63<o?63:o)){var l=o;0<s.wb&&((l=4<s.wb?l>>2:l>>1)>9-s.wb&&(l=9-s.wb)),1>l&&(l=1),a.dd=l,a.tc=2*o+l,a.ld=40<=o?2:15<=o?1:0}else a.tc=0;a.La=n}}}i=0}else Be(e,6,"Frame setup failed"),i=e.a;if(i=0==i){if(i){e.$c=0,0<e.Aa||(e.Ic=Bn);e:{i=e.Ic;s=4*(l=e.za);var h=32*l,c=l+1,u=0<e.L?l*(0<e.Aa?2:1):0,d=(2==e.Aa?2:1)*l;if((a=s+832+(n=3*(16*i+Nn[e.L])/2*h)+(r=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=a)i=0;else{if(a>e.Vb){if(e.Vb=0,e.Ec=fi(a),e.Fc=0,null==e.Ec){i=Be(e,1,"no memory during frame initialization.");break e}e.Vb=a}a=e.Ec,o=e.Fc,e.Ac=a,e.Bc=o,o+=s,e.Gd=mi(h,Ve),e.Hd=0,e.rb=mi(c+1,ke),e.sb=1,e.wa=u?mi(u,Le):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=l),ci(!0),e.oc=a,e.pc=o,o+=832,e.ya=mi(d,Fe),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=l),e.R=16*l,e.B=8*l,l=(h=Nn[e.L])*e.R,h=h/2*e.B,e.sa=a,e.ta=o+l,e.qa=e.sa,e.ra=e.ta+16*i*e.R+h,e.Ha=e.qa,e.Ia=e.ra+8*i*e.B+h,e.$c=0,o+=n,e.mb=r?a:null,e.nb=r?o:null,ci(o+r<=e.Fc+e.Vb),$e(e),gi(e.Ac,e.Bc,0,s),i=1}}if(i){if(t.ka=0,t.y=e.sa,t.O=e.ta,t.f=e.qa,t.N=e.ra,t.ea=e.Ha,t.Vd=e.Ia,t.fa=e.R,t.Rc=e.B,t.F=null,t.J=0,!Ps){for(i=-255;255>=i;++i)Es[255+i]=0>i?-i:i;for(i=-1020;1020>=i;++i)Cs[1020+i]=-128>i?-128:127<i?127:i;for(i=-112;112>=i;++i)Is[112+i]=-16>i?-16:15<i?15:i;for(i=-255;510>=i;++i)As[255+i]=0>i?0:255<i?255:i;Ps=1}ss=tt,ns=qe,as=Ze,os=Qe,ls=et,rs=Je,hs=Bt,cs=Wt,us=$t,ds=jt,gs=Ht,fs=Yt,ms=Ut,ps=Xt,ys=Dt,Ts=Vt,_s=Ot,xs=Mt,un[0]=pt,un[1]=st,un[2]=ft,un[3]=mt,un[4]=yt,un[5]=_t,un[6]=Tt,un[7]=xt,un[8]=St,un[9]=wt,cn[0]=ht,cn[1]=rt,cn[2]=at,cn[3]=ot,cn[4]=ct,cn[5]=ut,cn[6]=dt,dn[0]=Ct,dn[1]=nt,dn[2]=vt,dn[3]=bt,dn[4]=At,dn[5]=It,dn[6]=Pt,i=1}else i=0}i&&(i=function(e,t){for(e.M=0;e.M<e.Va;++e.M){var i,s=e.Jc[e.M&e.Xb],n=e.m,r=e;for(i=0;i<r.za;++i){var a=n,o=r,l=o.Ac,h=o.Bc+4*i,c=o.zc,u=o.ya[o.aa+i];if(o.Qa.Bb?u.$b=x(a,o.Pa.jb[0])?2+x(a,o.Pa.jb[2]):x(a,o.Pa.jb[1]):u.$b=0,o.kc&&(u.Ad=x(a,o.Bd)),u.Za=!x(a,145)+0,u.Za){var d=u.Ob,g=0;for(o=0;4>o;++o){var f,m=c[0+o];for(f=0;4>f;++f){m=on[l[h+f]][m];for(var p=rn[x(a,m[0])];0<p;)p=rn[2*p+x(a,m[p])];m=-p,l[h+f]=m}di(d,g,l,h,4),g+=4,c[0+o]=m}}else m=x(a,156)?x(a,128)?1:3:x(a,163)?2:0,u.Ob[0]=m,gi(l,h,m,4),gi(c,0,m,4);u.Dd=x(a,142)?x(a,114)?x(a,183)?1:3:2:0}if(r.m.Ka)return Be(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(r=s,a=(n=e).rb[n.sb-1],l=n.rb[n.sb+n.ja],i=n.ya[n.aa+n.ja],h=n.kc?i.Ad:0)a.la=l.la=0,i.Za||(a.Na=l.Na=0),i.Hc=0,i.Gc=0,i.ia=0;else{var y,T;if(a=l,l=r,h=n.Pa.Xc,c=n.ya[n.aa+n.ja],u=n.pb[c.$b],o=c.ad,d=0,g=n.rb[n.sb-1],m=f=0,gi(o,d,0,384),c.Za)var _=0,w=h[3];else{p=fi(16);var S=a.Na+g.Na;if(S=tn(l,h[1],S,u.Eb,0,p,0),a.Na=g.Na=(0<S)+0,1<S)ss(p,0,o,d);else{var v=p[0]+3>>3;for(p=0;256>p;p+=16)o[d+p]=v}_=1,w=h[0]}var b=15&a.la,E=15&g.la;for(p=0;4>p;++p){var C=1&E;for(v=T=0;4>v;++v)b=b>>1|(C=(S=tn(l,w,S=C+(1&b),u.Sc,_,o,d))>_)<<7,T=T<<2|(3<S?3:1<S?2:0!=o[d+0]),d+=16;b>>=4,E=E>>1|C<<7,f=(f<<8|T)>>>0}for(w=b,_=E>>4,y=0;4>y;y+=2){for(T=0,b=a.la>>4+y,E=g.la>>4+y,p=0;2>p;++p){for(C=1&E,v=0;2>v;++v)S=C+(1&b),b=b>>1|(C=0<(S=tn(l,h[2],S,u.Qc,0,o,d)))<<3,T=T<<2|(3<S?3:1<S?2:0!=o[d+0]),d+=16;b>>=2,E=E>>1|C<<5}m|=T<<4*y,w|=b<<4<<y,_|=(240&E)<<y}a.la=w,g.la=_,c.Hc=f,c.Gc=m,c.ia=43690&m?0:u.ia,h=!(f|m)}if(0<n.L&&(n.wa[n.Y+n.ja]=n.gd[i.$b][i.Za],n.wa[n.Y+n.ja].La|=!h),r.Ka)return Be(e,7,"Premature end-of-file encountered.")}if($e(e),n=t,r=1,i=(s=e).D,a=0<s.L&&s.M>=s.zb&&s.M<=s.Va,0==s.Aa)e:{if(i.M=s.M,i.uc=a,Ri(s,i),r=1,i=(T=s.D).Nb,a=(m=Nn[s.L])*s.R,l=m/2*s.B,p=16*i*s.R,v=8*i*s.B,h=s.sa,c=s.ta-a+p,u=s.qa,o=s.ra-l+v,d=s.Ha,g=s.Ia-l+v,E=0==(b=T.M),f=b>=s.Va-1,2==s.Aa&&Ri(s,T),T.uc)for(C=(S=s).D.M,ci(S.D.uc),T=S.yb;T<S.Hb;++T){_=T,w=C;var I=(A=(M=S).D).Nb;y=M.R;var A=A.wa[A.Y+_],P=M.sa,L=M.ta+16*I*y+16*_,k=A.dd,R=A.tc;if(0!=R)if(ci(3<=R),1==M.L)0<_&&Ts(P,L,y,R+4),A.La&&xs(P,L,y,R),0<w&&ys(P,L,y,R+4),A.La&&_s(P,L,y,R);else{var F=M.B,D=M.qa,V=M.ra+8*I*F+8*_,O=M.Ha,M=M.Ia+8*I*F+8*_;I=A.ld,0<_&&(cs(P,L,y,R+4,k,I),ds(D,V,O,M,F,R+4,k,I)),A.La&&(fs(P,L,y,R,k,I),ps(D,V,O,M,F,R,k,I)),0<w&&(hs(P,L,y,R+4,k,I),us(D,V,O,M,F,R+4,k,I)),A.La&&(gs(P,L,y,R,k,I),ms(D,V,O,M,F,R,k,I))}}if(s.ia&&alert("todo:DitherRow"),null!=n.put){if(T=16*b,b=16*(b+1),E?(n.y=s.sa,n.O=s.ta+p,n.f=s.qa,n.N=s.ra+v,n.ea=s.Ha,n.W=s.Ia+v):(T-=m,n.y=h,n.O=c,n.f=u,n.N=o,n.ea=d,n.W=g),f||(b-=m),b>n.o&&(b=n.o),n.F=null,n.J=null,null!=s.Fa&&0<s.Fa.length&&T<b&&(n.J=si(s,n,T,b-T),n.F=s.mb,null==n.F&&0==n.F.length)){r=Be(s,3,"Could not decode alpha data.");break e}T<n.j&&(m=n.j-T,T=n.j,ci(!(1&m)),n.O+=s.R*m,n.N+=s.B*(m>>1),n.W+=s.B*(m>>1),null!=n.F&&(n.J+=n.width*m)),T<b&&(n.O+=n.v,n.N+=n.v>>1,n.W+=n.v>>1,null!=n.F&&(n.J+=n.v),n.ka=T-n.j,n.U=n.va-n.v,n.T=b-T,r=n.put(n))}i+1!=s.Ic||f||(di(s.sa,s.ta-a,h,c+16*s.R,a),di(s.qa,s.ra-l,u,o+8*s.B,l),di(s.Ha,s.Ia-l,d,g+8*s.B,l))}if(!r)return Be(e,6,"Output aborted.")}return 1}(e,t)),null!=t.bc&&t.bc(t),i&=1}return i?(e.cb=0,i):0}function Ue(e,t,i,s,n){n=e[t+i+32*s]+(n>>3),e[t+i+32*s]=-256&n?0>n?0:255:n}function Xe(e,t,i,s,n,r){Ue(e,t,0,i,s+n),Ue(e,t,1,i,s+r),Ue(e,t,2,i,s-r),Ue(e,t,3,i,s-n)}function ze(e){return(20091*e>>16)+e}function Ke(e,t,i,s){var n,r=0,a=fi(16);for(n=0;4>n;++n){var o=e[t+0]+e[t+8],l=e[t+0]-e[t+8],h=(35468*e[t+4]>>16)-ze(e[t+12]),c=ze(e[t+4])+(35468*e[t+12]>>16);a[r+0]=o+c,a[r+1]=l+h,a[r+2]=l-h,a[r+3]=o-c,r+=4,t++}for(n=r=0;4>n;++n)o=(e=a[r+0]+4)+a[r+8],l=e-a[r+8],h=(35468*a[r+4]>>16)-ze(a[r+12]),Ue(i,s,0,0,o+(c=ze(a[r+4])+(35468*a[r+12]>>16))),Ue(i,s,1,0,l+h),Ue(i,s,2,0,l-h),Ue(i,s,3,0,o-c),r++,s+=32}function Je(e,t,i,s){var n=e[t+0]+4,r=35468*e[t+4]>>16,a=ze(e[t+4]),o=35468*e[t+1]>>16;Xe(i,s,0,n+a,e=ze(e[t+1]),o),Xe(i,s,1,n+r,e,o),Xe(i,s,2,n-r,e,o),Xe(i,s,3,n-a,e,o)}function qe(e,t,i,s,n){Ke(e,t,i,s),n&&Ke(e,t+16,i,s+4)}function Ze(e,t,i,s){ns(e,t+0,i,s,1),ns(e,t+32,i,s+128,1)}function Qe(e,t,i,s){var n;for(e=e[t+0]+4,n=0;4>n;++n)for(t=0;4>t;++t)Ue(i,s,t,n,e)}function et(e,t,i,s){e[t+0]&&os(e,t+0,i,s),e[t+16]&&os(e,t+16,i,s+4),e[t+32]&&os(e,t+32,i,s+128),e[t+48]&&os(e,t+48,i,s+128+4)}function tt(e,t,i,s){var n,r=fi(16);for(n=0;4>n;++n){var a=e[t+0+n]+e[t+12+n],o=e[t+4+n]+e[t+8+n],l=e[t+4+n]-e[t+8+n],h=e[t+0+n]-e[t+12+n];r[0+n]=a+o,r[8+n]=a-o,r[4+n]=h+l,r[12+n]=h-l}for(n=0;4>n;++n)a=(e=r[0+4*n]+3)+r[3+4*n],o=r[1+4*n]+r[2+4*n],l=r[1+4*n]-r[2+4*n],h=e-r[3+4*n],i[s+0]=a+o>>3,i[s+16]=h+l>>3,i[s+32]=a-o>>3,i[s+48]=h-l>>3,s+=64}function it(e,t,i){var s,n=t-32,r=Rs,a=255-e[n-1];for(s=0;s<i;++s){var o,l=r,h=a+e[t-1];for(o=0;o<i;++o)e[t+o]=l[h+e[n+o]];t+=32}}function st(e,t){it(e,t,4)}function nt(e,t){it(e,t,8)}function rt(e,t){it(e,t,16)}function at(e,t){var i;for(i=0;16>i;++i)di(e,t+32*i,e,t-32,16)}function ot(e,t){var i;for(i=16;0<i;--i)gi(e,t,e[t-1],16),t+=32}function lt(e,t,i){var s;for(s=0;16>s;++s)gi(t,i+32*s,e,16)}function ht(e,t){var i,s=16;for(i=0;16>i;++i)s+=e[t-1+32*i]+e[t+i-32];lt(s>>5,e,t)}function ct(e,t){var i,s=8;for(i=0;16>i;++i)s+=e[t-1+32*i];lt(s>>4,e,t)}function ut(e,t){var i,s=8;for(i=0;16>i;++i)s+=e[t+i-32];lt(s>>4,e,t)}function dt(e,t){lt(128,e,t)}function gt(e,t,i){return e+2*t+i+2>>2}function ft(e,t){var i,s=t-32;s=new Uint8Array([gt(e[s-1],e[s+0],e[s+1]),gt(e[s+0],e[s+1],e[s+2]),gt(e[s+1],e[s+2],e[s+3]),gt(e[s+2],e[s+3],e[s+4])]);for(i=0;4>i;++i)di(e,t+32*i,s,0,s.length)}function mt(e,t){var i=e[t-1],s=e[t-1+32],n=e[t-1+64],r=e[t-1+96];w(e,t+0,16843009*gt(e[t-1-32],i,s)),w(e,t+32,16843009*gt(i,s,n)),w(e,t+64,16843009*gt(s,n,r)),w(e,t+96,16843009*gt(n,r,r))}function pt(e,t){var i,s=4;for(i=0;4>i;++i)s+=e[t+i-32]+e[t-1+32*i];for(s>>=3,i=0;4>i;++i)gi(e,t+32*i,s,4)}function yt(e,t){var i=e[t-1+0],s=e[t-1+32],n=e[t-1+64],r=e[t-1-32],a=e[t+0-32],o=e[t+1-32],l=e[t+2-32],h=e[t+3-32];e[t+0+96]=gt(s,n,e[t-1+96]),e[t+1+96]=e[t+0+64]=gt(i,s,n),e[t+2+96]=e[t+1+64]=e[t+0+32]=gt(r,i,s),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=gt(a,r,i),e[t+3+64]=e[t+2+32]=e[t+1+0]=gt(o,a,r),e[t+3+32]=e[t+2+0]=gt(l,o,a),e[t+3+0]=gt(h,l,o)}function Tt(e,t){var i=e[t+1-32],s=e[t+2-32],n=e[t+3-32],r=e[t+4-32],a=e[t+5-32],o=e[t+6-32],l=e[t+7-32];e[t+0+0]=gt(e[t+0-32],i,s),e[t+1+0]=e[t+0+32]=gt(i,s,n),e[t+2+0]=e[t+1+32]=e[t+0+64]=gt(s,n,r),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=gt(n,r,a),e[t+3+32]=e[t+2+64]=e[t+1+96]=gt(r,a,o),e[t+3+64]=e[t+2+96]=gt(a,o,l),e[t+3+96]=gt(o,l,l)}function _t(e,t){var i=e[t-1+0],s=e[t-1+32],n=e[t-1+64],r=e[t-1-32],a=e[t+0-32],o=e[t+1-32],l=e[t+2-32],h=e[t+3-32];e[t+0+0]=e[t+1+64]=r+a+1>>1,e[t+1+0]=e[t+2+64]=a+o+1>>1,e[t+2+0]=e[t+3+64]=o+l+1>>1,e[t+3+0]=l+h+1>>1,e[t+0+96]=gt(n,s,i),e[t+0+64]=gt(s,i,r),e[t+0+32]=e[t+1+96]=gt(i,r,a),e[t+1+32]=e[t+2+96]=gt(r,a,o),e[t+2+32]=e[t+3+96]=gt(a,o,l),e[t+3+32]=gt(o,l,h)}function xt(e,t){var i=e[t+0-32],s=e[t+1-32],n=e[t+2-32],r=e[t+3-32],a=e[t+4-32],o=e[t+5-32],l=e[t+6-32],h=e[t+7-32];e[t+0+0]=i+s+1>>1,e[t+1+0]=e[t+0+64]=s+n+1>>1,e[t+2+0]=e[t+1+64]=n+r+1>>1,e[t+3+0]=e[t+2+64]=r+a+1>>1,e[t+0+32]=gt(i,s,n),e[t+1+32]=e[t+0+96]=gt(s,n,r),e[t+2+32]=e[t+1+96]=gt(n,r,a),e[t+3+32]=e[t+2+96]=gt(r,a,o),e[t+3+64]=gt(a,o,l),e[t+3+96]=gt(o,l,h)}function wt(e,t){var i=e[t-1+0],s=e[t-1+32],n=e[t-1+64],r=e[t-1+96];e[t+0+0]=i+s+1>>1,e[t+2+0]=e[t+0+32]=s+n+1>>1,e[t+2+32]=e[t+0+64]=n+r+1>>1,e[t+1+0]=gt(i,s,n),e[t+3+0]=e[t+1+32]=gt(s,n,r),e[t+3+32]=e[t+1+64]=gt(n,r,r),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=r}function St(e,t){var i=e[t-1+0],s=e[t-1+32],n=e[t-1+64],r=e[t-1+96],a=e[t-1-32],o=e[t+0-32],l=e[t+1-32],h=e[t+2-32];e[t+0+0]=e[t+2+32]=i+a+1>>1,e[t+0+32]=e[t+2+64]=s+i+1>>1,e[t+0+64]=e[t+2+96]=n+s+1>>1,e[t+0+96]=r+n+1>>1,e[t+3+0]=gt(o,l,h),e[t+2+0]=gt(a,o,l),e[t+1+0]=e[t+3+32]=gt(i,a,o),e[t+1+32]=e[t+3+64]=gt(s,i,a),e[t+1+64]=e[t+3+96]=gt(n,s,i),e[t+1+96]=gt(r,n,s)}function vt(e,t){var i;for(i=0;8>i;++i)di(e,t+32*i,e,t-32,8)}function bt(e,t){var i;for(i=0;8>i;++i)gi(e,t,e[t-1],8),t+=32}function Et(e,t,i){var s;for(s=0;8>s;++s)gi(t,i+32*s,e,8)}function Ct(e,t){var i,s=8;for(i=0;8>i;++i)s+=e[t+i-32]+e[t-1+32*i];Et(s>>4,e,t)}function It(e,t){var i,s=4;for(i=0;8>i;++i)s+=e[t+i-32];Et(s>>3,e,t)}function At(e,t){var i,s=4;for(i=0;8>i;++i)s+=e[t-1+32*i];Et(s>>3,e,t)}function Pt(e,t){Et(128,e,t)}function Lt(e,t,i){var s=e[t-i],n=e[t+0],r=3*(n-s)+Ls[1020+e[t-2*i]-e[t+i]],a=ks[112+(r+4>>3)];e[t-i]=Rs[255+s+ks[112+(r+3>>3)]],e[t+0]=Rs[255+n-a]}function kt(e,t,i,s){var n=e[t+0],r=e[t+i];return Fs[255+e[t-2*i]-e[t-i]]>s||Fs[255+r-n]>s}function Rt(e,t,i,s){return 4*Fs[255+e[t-i]-e[t+0]]+Fs[255+e[t-2*i]-e[t+i]]<=s}function Ft(e,t,i,s,n){var r=e[t-3*i],a=e[t-2*i],o=e[t-i],l=e[t+0],h=e[t+i],c=e[t+2*i],u=e[t+3*i];return 4*Fs[255+o-l]+Fs[255+a-h]>s?0:Fs[255+e[t-4*i]-r]<=n&&Fs[255+r-a]<=n&&Fs[255+a-o]<=n&&Fs[255+u-c]<=n&&Fs[255+c-h]<=n&&Fs[255+h-l]<=n}function Dt(e,t,i,s){var n=2*s+1;for(s=0;16>s;++s)Rt(e,t+s,i,n)&&Lt(e,t+s,i)}function Vt(e,t,i,s){var n=2*s+1;for(s=0;16>s;++s)Rt(e,t+s*i,1,n)&&Lt(e,t+s*i,1)}function Ot(e,t,i,s){var n;for(n=3;0<n;--n)Dt(e,t+=4*i,i,s)}function Mt(e,t,i,s){var n;for(n=3;0<n;--n)Vt(e,t+=4,i,s)}function Nt(e,t,i,s,n,r,a,o){for(r=2*r+1;0<n--;){if(Ft(e,t,i,r,a))if(kt(e,t,i,o))Lt(e,t,i);else{var l=e,h=t,c=i,u=l[h-2*c],d=l[h-c],g=l[h+0],f=l[h+c],m=l[h+2*c],p=27*(T=Ls[1020+3*(g-d)+Ls[1020+u-f]])+63>>7,y=18*T+63>>7,T=9*T+63>>7;l[h-3*c]=Rs[255+l[h-3*c]+T],l[h-2*c]=Rs[255+u+y],l[h-c]=Rs[255+d+p],l[h+0]=Rs[255+g-p],l[h+c]=Rs[255+f-y],l[h+2*c]=Rs[255+m-T]}t+=s}}function Gt(e,t,i,s,n,r,a,o){for(r=2*r+1;0<n--;){if(Ft(e,t,i,r,a))if(kt(e,t,i,o))Lt(e,t,i);else{var l=e,h=t,c=i,u=l[h-c],d=l[h+0],g=l[h+c],f=ks[112+((m=3*(d-u))+4>>3)],m=ks[112+(m+3>>3)],p=f+1>>1;l[h-2*c]=Rs[255+l[h-2*c]+p],l[h-c]=Rs[255+u+m],l[h+0]=Rs[255+d-f],l[h+c]=Rs[255+g-p]}t+=s}}function Bt(e,t,i,s,n,r){Nt(e,t,i,1,16,s,n,r)}function Wt(e,t,i,s,n,r){Nt(e,t,1,i,16,s,n,r)}function Ht(e,t,i,s,n,r){var a;for(a=3;0<a;--a)Gt(e,t+=4*i,i,1,16,s,n,r)}function Yt(e,t,i,s,n,r){var a;for(a=3;0<a;--a)Gt(e,t+=4,1,i,16,s,n,r)}function $t(e,t,i,s,n,r,a,o){Nt(e,t,n,1,8,r,a,o),Nt(i,s,n,1,8,r,a,o)}function jt(e,t,i,s,n,r,a,o){Nt(e,t,1,n,8,r,a,o),Nt(i,s,1,n,8,r,a,o)}function Ut(e,t,i,s,n,r,a,o){Gt(e,t+4*n,n,1,8,r,a,o),Gt(i,s+4*n,n,1,8,r,a,o)}function Xt(e,t,i,s,n,r,a,o){Gt(e,t+4,1,n,8,r,a,o),Gt(i,s+4,1,n,8,r,a,o)}function zt(){this.ba=new Z,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ee,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Kt(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Jt(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function qt(){this.ua=0,this.Wa=new I,this.vb=new I,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new r,this.yc=new s}function Zt(){this.xb=this.a=0,this.l=new Ne,this.ca=new Z,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new g,this.Pb=0,this.wd=new g,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new qt,this.ab=0,this.gc=mi(4,Jt),this.Oc=0}function Qt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ne,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function ei(e,t,i,s,n,r,a){for(e=null==e?0:e[t+0],t=0;t<a;++t)n[r+t]=e+i[s+t]&255,e=n[r+t]}function ti(e,t,i,s,n,r,a){var o;if(null==e)ei(null,null,i,s,n,r,a);else for(o=0;o<a;++o)n[r+o]=e[t+o]+i[s+o]&255}function ii(e,t,i,s,n,r,a){if(null==e)ei(null,null,i,s,n,r,a);else{var o,l=e[t+0],h=l,c=l;for(o=0;o<a;++o)h=c+(l=e[t+o])-h,c=i[s+o]+(-256&h?0>h?0:255:h)&255,h=l,n[r+o]=c}}function si(e,t,i,s){var n=t.width,r=t.o;if(ci(null!=e&&null!=t),0>i||0>=s||i+s>r)return null;if(!e.Cc){if(null==e.ga){var a;if(e.ga=new Qt,(a=null==e.ga)||(a=t.width*t.o,ci(0==e.Gb.length),e.Gb=fi(a),e.Uc=0,null==e.Gb?a=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,a=1),a=!a),!a){a=e.ga;var o=e.Fa,l=e.P,c=e.qc,u=e.mb,d=e.nb,g=l+1,f=c-1,p=a.l;if(ci(null!=o&&null!=u&&null!=t),mn[0]=null,mn[1]=ei,mn[2]=ti,mn[3]=ii,a.ca=u,a.tb=d,a.c=t.width,a.i=t.height,ci(0<a.c&&0<a.i),1>=c)t=0;else if(a.$a=o[l+0]>>0&3,a.Z=o[l+0]>>2&3,a.Lc=o[l+0]>>4&3,l=o[l+0]>>6&3,0>a.$a||1<a.$a||4<=a.Z||1<a.Lc||l)t=0;else if(p.put=re,p.ac=ne,p.bc=ae,p.ma=a,p.width=t.width,p.height=t.height,p.Da=t.Da,p.v=t.v,p.va=t.va,p.j=t.j,p.o=t.o,a.$a)e:{ci(1==a.$a),t=xe();t:for(;;){if(null==t){t=0;break e}if(ci(null!=a),a.mc=t,t.c=a.c,t.i=a.i,t.l=a.l,t.l.ma=a,t.l.width=a.c,t.l.height=a.i,t.a=0,h(t.m,o,g,f),!we(a.c,a.i,1,t,null))break t;if(1==t.ab&&3==t.gc[0].hc&&me(t.s)?(a.ic=1,o=t.c*t.i,t.Ta=null,t.Ua=0,t.V=fi(o),t.Ba=0,null==t.V?(t.a=1,t=0):t=1):(a.ic=0,t=Se(t,a.c)),!t)break t;t=1;break e}a.mc=null,t=0}else t=f>=a.c*a.i;a=!t}if(a)return null;1!=e.ga.Lc?e.Ga=0:s=r-i}ci(null!=e.ga),ci(i+s<=r);e:{if(t=(o=e.ga).c,r=o.l.o,0==o.$a){if(g=e.rc,f=e.Vc,p=e.Fa,l=e.P+1+i*t,c=e.mb,u=e.nb+i*t,ci(l<=e.P+e.qc),0!=o.Z)for(ci(null!=mn[o.Z]),a=0;a<s;++a)mn[o.Z](g,f,p,l,c,u,t),g=c,f=u,u+=t,l+=t;else for(a=0;a<s;++a)di(c,u,p,l,t),g=c,f=u,u+=t,l+=t;e.rc=g,e.Vc=f}else{if(ci(null!=o.mc),t=i+s,ci(null!=(a=o.mc)),ci(t<=a.i),a.C>=t)t=1;else if(o.ic||li(),o.ic){o=a.V,g=a.Ba,f=a.c;var T=a.i,_=(p=1,l=a.$/f,c=a.$%f,u=a.m,d=a.s,a.$),x=f*T,w=f*t,S=d.wc,v=_<w?de(d,c,l):null;ci(_<=x),ci(t<=T),ci(me(d));t:for(;;){for(;!u.h&&_<w;){if(c&S||(v=de(d,c,l)),ci(null!=v),y(u),256>(T=ce(v.G[0],v.H[0],u)))o[g+_]=T,++_,++c>=f&&(c=0,++l<=t&&!(l%16)&&ye(a,l));else{if(!(280>T)){p=0;break t}T=le(T-256,u);var b,E=ce(v.G[4],v.H[4],u);if(y(u),!(_>=(E=he(f,E=le(E,u)))&&x-_>=T)){p=0;break t}for(b=0;b<T;++b)o[g+_+b]=o[g+_+b-E];for(_+=T,c+=T;c>=f;)c-=f,++l<=t&&!(l%16)&&ye(a,l);_<w&&c&S&&(v=de(d,c,l))}ci(u.h==m(u))}ye(a,l>t?t:l);break t}!p||u.h&&_<x?(p=0,a.a=u.h?5:3):a.$=_,t=p}else t=Te(a,a.V,a.Ba,a.c,a.i,t,ve);if(!t){s=0;break e}}i+s>=r&&(e.Cc=1),s=1}if(!s)return null;if(e.Cc&&(null!=(s=e.ga)&&(s.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+i*n}function ni(e,t,i,s,n,r){for(;0<n--;){var a,o=e,l=t+(i?1:0),h=e,c=t+(i?0:3);for(a=0;a<s;++a){var u=h[c+4*a];255!=u&&(u*=32897,o[l+4*a+0]=o[l+4*a+0]*u>>23,o[l+4*a+1]=o[l+4*a+1]*u>>23,o[l+4*a+2]=o[l+4*a+2]*u>>23)}t+=r}}function ri(e,t,i,s,n){for(;0<s--;){var r;for(r=0;r<i;++r){var a=e[t+2*r+0],o=15&(h=e[t+2*r+1]),l=4369*o,h=(240&h|h>>4)*l>>16;e[t+2*r+0]=(240&a|a>>4)*l>>16&240|(15&a|a<<4)*l>>16>>4&15,e[t+2*r+1]=240&h|o}t+=n}}function ai(e,t,i,s,n,r,a,o){var l,h,c=255;for(h=0;h<n;++h){for(l=0;l<s;++l){var u=e[t+l];r[a+4*l]=u,c&=u}t+=i,a+=o}return 255!=c}function oi(e,t,i,s,n){var r;for(r=0;r<n;++r)i[s+r]=e[t+r]>>8}function li(){ws=ni,Ss=ri,vs=ai,bs=oi}function hi(e,t,i){self[e]=function(e,s,n,r,a,o,l,h,c,u,d,g,f,m,p,y,T){var _,x=T-1>>1,w=a[o+0]|l[h+0]<<16,S=c[u+0]|d[g+0]<<16;ci(null!=e);var v=3*w+S+131074>>2;for(t(e[s+0],255&v,v>>16,f,m),null!=n&&(v=3*S+w+131074>>2,t(n[r+0],255&v,v>>16,p,y)),_=1;_<=x;++_){var b=a[o+_]|l[h+_]<<16,E=c[u+_]|d[g+_]<<16,C=w+b+S+E+524296,I=C+2*(b+S)>>3;v=I+w>>1,w=(C=C+2*(w+E)>>3)+b>>1,t(e[s+2*_-1],255&v,v>>16,f,m+(2*_-1)*i),t(e[s+2*_-0],255&w,w>>16,f,m+(2*_-0)*i),null!=n&&(v=C+S>>1,w=I+E>>1,t(n[r+2*_-1],255&v,v>>16,p,y+(2*_-1)*i),t(n[r+2*_+0],255&w,w>>16,p,y+(2*_+0)*i)),w=b,S=E}1&T||(v=3*w+S+131074>>2,t(e[s+T-1],255&v,v>>16,f,m+(T-1)*i),null!=n&&(v=3*S+w+131074>>2,t(n[r+T-1],255&v,v>>16,p,y+(T-1)*i)))}}function yi(){pn[Ds]=yn,pn[Vs]=_n,pn[Os]=Tn,pn[Ms]=xn,pn[Ns]=wn,pn[Gs]=Sn,pn[Bs]=vn,pn[Ws]=_n,pn[Hs]=xn,pn[Ys]=wn,pn[$s]=Sn}function Ti(e){return e&~Pn?0>e?0:255:e>>An}function _i(e,t){return Ti((19077*e>>8)+(26149*t>>8)-14234)}function xi(e,t,i){return Ti((19077*e>>8)-(6419*t>>8)-(13320*i>>8)+8708)}function wi(e,t){return Ti((19077*e>>8)+(33050*t>>8)-17685)}function Si(e,t,i,s,n){s[n+0]=_i(e,i),s[n+1]=xi(e,t,i),s[n+2]=wi(e,t)}function vi(e,t,i,s,n){s[n+0]=wi(e,t),s[n+1]=xi(e,t,i),s[n+2]=_i(e,i)}function bi(e,t,i,s,n){var r=xi(e,t,i);t=r<<3&224|wi(e,t)>>3,s[n+0]=248&_i(e,i)|r>>5,s[n+1]=t}function Ei(e,t,i,s,n){var r=240&wi(e,t)|15;s[n+0]=240&_i(e,i)|xi(e,t,i)>>4,s[n+1]=r}function Ci(e,t,i,s,n){s[n+0]=255,Si(e,t,i,s,n+1)}function Ii(e,t,i,s,n){vi(e,t,i,s,n),s[n+3]=255}function Ai(e,t,i,s,n){Si(e,t,i,s,n),s[n+3]=255}function Me(e,t){return 0>e?0:e>t?t:e}function Pi(e,t,i){self[e]=function(e,s,n,r,a,o,l,h,c){for(var u=h+(-2&c)*i;h!=u;)t(e[s+0],n[r+0],a[o+0],l,h),t(e[s+1],n[r+0],a[o+0],l,h+i),s+=2,++r,++o,h+=2*i;1&c&&t(e[s+0],n[r+0],a[o+0],l,h)}}function Li(e,t,i){return 0==i?0==e?0==t?6:5:0==t?4:0:i}function ki(e,t,i,s,n){switch(e>>>30){case 3:ns(t,i,s,n,0);break;case 2:rs(t,i,s,n);break;case 1:os(t,i,s,n)}}function Ri(e,t){var i,s,n=t.M,r=t.Nb,a=e.oc,o=e.pc+40,l=e.oc,h=e.pc+584,c=e.oc,u=e.pc+600;for(i=0;16>i;++i)a[o+32*i-1]=129;for(i=0;8>i;++i)l[h+32*i-1]=129,c[u+32*i-1]=129;for(0<n?a[o-1-32]=l[h-1-32]=c[u-1-32]=129:(gi(a,o-32-1,127,21),gi(l,h-32-1,127,9),gi(c,u-32-1,127,9)),s=0;s<e.za;++s){var d=t.ya[t.aa+s];if(0<s){for(i=-1;16>i;++i)di(a,o+32*i-4,a,o+32*i+12,4);for(i=-1;8>i;++i)di(l,h+32*i-4,l,h+32*i+4,4),di(c,u+32*i-4,c,u+32*i+4,4)}var g=e.Gd,f=e.Hd+s,m=d.ad,p=d.Hc;if(0<n&&(di(a,o-32,g[f].y,0,16),di(l,h-32,g[f].f,0,8),di(c,u-32,g[f].ea,0,8)),d.Za){var y=a,T=o-32+16;for(0<n&&(s>=e.za-1?gi(y,T,g[f].y[15],4):di(y,T,g[f+1].y,0,4)),i=0;4>i;i++)y[T+128+i]=y[T+256+i]=y[T+384+i]=y[T+0+i];for(i=0;16>i;++i,p<<=2)y=a,T=o+Mn[i],un[d.Ob[i]](y,T),ki(p,m,16*+i,y,T)}else if(y=Li(s,n,d.Ob[0]),cn[y](a,o),0!=p)for(i=0;16>i;++i,p<<=2)ki(p,m,16*+i,a,o+Mn[i]);for(i=d.Gc,y=Li(s,n,d.Dd),dn[y](l,h),dn[y](c,u),p=m,y=l,T=h,255&(d=i>>0)&&(170&d?as(p,256,y,T):ls(p,256,y,T)),d=c,p=u,255&(i>>=8)&&(170&i?as(m,320,d,p):ls(m,320,d,p)),n<e.Ub-1&&(di(g[f].y,0,a,o+480,16),di(g[f].f,0,l,h+224,8),di(g[f].ea,0,c,u+224,8)),i=8*r*e.B,g=e.sa,f=e.ta+16*s+16*r*e.R,m=e.qa,d=e.ra+8*s+i,p=e.Ha,y=e.Ia+8*s+i,i=0;16>i;++i)di(g,f+i*e.R,a,o+32*i,16);for(i=0;8>i;++i)di(m,d+i*e.B,l,h+32*i,8),di(p,y+i*e.B,c,u+32*i,8)}}function Fi(e,t,i,s,n,r,a,o,l){var c=[0],u=[0],d=0,f=null!=l?l.kd:0,m=null!=l?l:new Kt;if(null==e||12>i)return 7;m.data=e,m.w=t,m.ha=i,t=[t],i=[i],m.gb=[m.gb];e:{var p=t,y=i,T=m.gb;if(ci(null!=e),ci(null!=y),ci(null!=T),T[0]=0,12<=y[0]&&!ui(e,p[0],"RIFF")){if(ui(e,p[0]+8,"WEBP")){T=3;break e}var _=b(e,p[0]+4);if(12>_||4294967286<_){T=3;break e}if(f&&_>y[0]-8){T=7;break e}T[0]=_,p[0]+=12,y[0]-=12}T=0}if(0!=T)return T;for(_=0<m.gb[0],i=i[0];;){e:{var x=e;y=t,T=i;var w=c,S=u,E=p=[0];if((A=d=[d])[0]=0,8>T[0])T=7;else{if(!ui(x,y[0],"VP8X")){if(10!=b(x,y[0]+4)){T=3;break e}if(18>T[0]){T=7;break e}var C=b(x,y[0]+8),I=1+v(x,y[0]+12);if(2147483648<=I*(x=1+v(x,y[0]+15))){T=3;break e}null!=E&&(E[0]=C),null!=w&&(w[0]=I),null!=S&&(S[0]=x),y[0]+=18,T[0]-=18,A[0]=1}T=0}}if(d=d[0],p=p[0],0!=T)return T;if(y=!!(2&p),!_&&d)return 3;if(null!=r&&(r[0]=!!(16&p)),null!=a&&(a[0]=y),null!=o&&(o[0]=0),a=c[0],p=u[0],d&&y&&null==l){T=0;break}if(4>i){T=7;break}if(_&&d||!_&&!d&&!ui(e,t[0],"ALPH")){i=[i],m.na=[m.na],m.P=[m.P],m.Sa=[m.Sa];e:{C=e,T=t,_=i;var A=m.gb;w=m.na,S=m.P,E=m.Sa;I=22,ci(null!=C),ci(null!=_),x=T[0];var P=_[0];for(ci(null!=w),ci(null!=E),w[0]=null,S[0]=null,E[0]=0;;){if(T[0]=x,_[0]=P,8>P){T=7;break e}var L=b(C,x+4);if(4294967286<L){T=3;break e}var k=8+L+1&-2;if(I+=k,0<A&&I>A){T=3;break e}if(!ui(C,x,"VP8 ")||!ui(C,x,"VP8L")){T=0;break e}if(P[0]<k){T=7;break e}ui(C,x,"ALPH")||(w[0]=C,S[0]=x+8,E[0]=L),x+=k,P-=k}}if(i=i[0],m.na=m.na[0],m.P=m.P[0],m.Sa=m.Sa[0],0!=T)break}i=[i],m.Ja=[m.Ja],m.xa=[m.xa];e:if(A=e,T=t,_=i,w=m.gb[0],S=m.Ja,E=m.xa,C=T[0],x=!ui(A,C,"VP8 "),I=!ui(A,C,"VP8L"),ci(null!=A),ci(null!=_),ci(null!=S),ci(null!=E),8>_[0])T=7;else{if(x||I){if(A=b(A,C+4),12<=w&&A>w-12){T=3;break e}if(f&&A>_[0]-8){T=7;break e}S[0]=A,T[0]+=8,_[0]-=8,E[0]=I}else E[0]=5<=_[0]&&47==A[C+0]&&!(A[C+4]>>5),S[0]=_[0];T=0}if(i=i[0],m.Ja=m.Ja[0],m.xa=m.xa[0],t=t[0],0!=T)break;if(4294967286<m.Ja)return 3;if(null==o||y||(o[0]=m.xa?2:1),a=[a],p=[p],m.xa){if(5>i){T=7;break}o=a,f=p,y=r,null==e||5>i?e=0:5<=i&&47==e[t+0]&&!(e[t+4]>>5)?(_=[0],A=[0],w=[0],h(S=new g,e,t,i),oe(S,_,A,w)?(null!=o&&(o[0]=_[0]),null!=f&&(f[0]=A[0]),null!=y&&(y[0]=w[0]),e=1):e=0):e=0}else{if(10>i){T=7;break}o=p,null==e||10>i||!We(e,t+3,i-3)?e=0:(f=e[t+0]|e[t+1]<<8|e[t+2]<<16,y=16383&(e[t+7]<<8|e[t+6]),e=16383&(e[t+9]<<8|e[t+8]),1&f||3<(f>>1&7)||!(f>>4&1)||f>>5>=m.Ja||!y||!e?e=0:(a&&(a[0]=y),o&&(o[0]=e),e=1))}if(!e)return 3;if(a=a[0],p=p[0],d&&(c[0]!=a||u[0]!=p))return 3;null!=l&&(l[0]=m,l.offset=t-l.w,ci(4294967286>t-l.w),ci(l.offset==l.ha-i));break}return 0==T||7==T&&d&&null==l?(null!=r&&(r[0]|=null!=m.na&&0<m.na.length),null!=s&&(s[0]=a),null!=n&&(n[0]=p),0):T}function Di(e,t,i){var s=t.width,n=t.height,r=0,a=0,o=s,l=n;if(t.Da=null!=e&&0<e.Da,t.Da&&(o=e.cd,l=e.bd,r=e.v,a=e.j,11>i||(r&=-2,a&=-2),0>r||0>a||0>=o||0>=l||r+o>s||a+l>n))return 0;if(t.v=r,t.j=a,t.va=r+o,t.o=a+l,t.U=o,t.T=l,t.da=null!=e&&0<e.da,t.da){if(!A(o,l,i=[e.ib],r=[e.hb]))return 0;t.ib=i[0],t.hb=r[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*s/4&&t.hb<3*n/4,t.Kb=0),1}function Vi(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function Oi(e,t,i,s){if(null==s||0>=e||0>=t)return 2;if(null!=i){if(i.Da){var n=i.cd,r=i.bd,a=-2&i.v,o=-2&i.j;if(0>a||0>o||0>=n||0>=r||a+n>e||o+r>t)return 2;e=n,t=r}if(i.da){if(!A(e,t,n=[i.ib],r=[i.hb]))return 2;e=n[0],t=r[0]}}s.width=e,s.height=t;e:{var l=s.width,h=s.height;if(e=s.S,0>=l||0>=h||!(e>=Ds&&13>e))e=2;else{if(0>=s.Rd&&null==s.sd){a=r=n=t=0;var c=(o=l*Wn[e])*h;if(11>e||(r=(h+1)/2*(t=(l+1)/2),12==e&&(a=(n=l)*h)),null==(h=fi(c+2*r+a))){e=1;break e}s.sd=h,11>e?((l=s.f.RGBA).eb=h,l.fb=0,l.A=o,l.size=c):((l=s.f.kb).y=h,l.O=0,l.fa=o,l.Fd=c,l.f=h,l.N=0+c,l.Ab=t,l.Cd=r,l.ea=h,l.W=0+c+r,l.Db=t,l.Ed=r,12==e&&(l.F=h,l.J=0+c+2*r),l.Tc=a,l.lb=n)}if(t=1,n=s.S,r=s.width,a=s.height,n>=Ds&&13>n)if(11>n)e=s.f.RGBA,t&=(o=Math.abs(e.A))*(a-1)+r<=e.size,t&=o>=r*Wn[n],t&=null!=e.eb;else{e=s.f.kb,o=(r+1)/2,c=(a+1)/2,l=Math.abs(e.fa);h=Math.abs(e.Ab);var u=Math.abs(e.Db),d=Math.abs(e.lb),g=d*(a-1)+r;t&=l*(a-1)+r<=e.Fd,t&=h*(c-1)+o<=e.Cd,t=(t&=u*(c-1)+o<=e.Ed)&l>=r&h>=o&u>=o,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==n&&(t&=d>=r,t&=g<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=i&&i.fd&&(e=Vi(s)),e}var Mi=64,Ni=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Gi=24,Bi=32,Wi=8,Hi=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];k("Predictor0","PredictorAdd0"),self.Predictor0=function(){return 4278190080},self.Predictor1=function(e){return e},self.Predictor2=function(e,t,i){return t[i+0]},self.Predictor3=function(e,t,i){return t[i+1]},self.Predictor4=function(e,t,i){return t[i-1]},self.Predictor5=function(e,t,i){return F(F(e,t[i+1]),t[i+0])},self.Predictor6=function(e,t,i){return F(e,t[i-1])},self.Predictor7=function(e,t,i){return F(e,t[i+0])},self.Predictor8=function(e,t,i){return F(t[i-1],t[i+0])},self.Predictor9=function(e,t,i){return F(t[i+0],t[i+1])},self.Predictor10=function(e,t,i){return F(F(e,t[i-1]),F(t[i+0],t[i+1]))},self.Predictor11=function(e,t,i){var s=t[i+0];return 0>=O(s>>24&255,e>>24&255,(t=t[i-1])>>24&255)+O(s>>16&255,e>>16&255,t>>16&255)+O(s>>8&255,e>>8&255,t>>8&255)+O(255&s,255&e,255&t)?s:e},self.Predictor12=function(e,t,i){var s=t[i+0];return(D((e>>24&255)+(s>>24&255)-((t=t[i-1])>>24&255))<<24|D((e>>16&255)+(s>>16&255)-(t>>16&255))<<16|D((e>>8&255)+(s>>8&255)-(t>>8&255))<<8|D((255&e)+(255&s)-(255&t)))>>>0},self.Predictor13=function(e,t,i){var s=t[i-1];return(V((e=F(e,t[i+0]))>>24&255,s>>24&255)<<24|V(e>>16&255,s>>16&255)<<16|V(e>>8&255,s>>8&255)<<8|V(e>>0&255,s>>0&255))>>>0};var Yi=self.PredictorAdd0;self.PredictorAdd1=M,k("Predictor2","PredictorAdd2"),k("Predictor3","PredictorAdd3"),k("Predictor4","PredictorAdd4"),k("Predictor5","PredictorAdd5"),k("Predictor6","PredictorAdd6"),k("Predictor7","PredictorAdd7"),k("Predictor8","PredictorAdd8"),k("Predictor9","PredictorAdd9"),k("Predictor10","PredictorAdd10"),k("Predictor11","PredictorAdd11"),k("Predictor12","PredictorAdd12"),k("Predictor13","PredictorAdd13");var $i=self.PredictorAdd2;W("ColorIndexInverseTransform","MapARGB","32b",(function(e){return e>>8&255}),(function(e){return e})),W("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(e){return e}),(function(e){return e>>8&255}));var ji,Ui=self.ColorIndexInverseTransform,Xi=self.MapARGB,zi=self.VP8LColorIndexInverseTransformAlpha,Ki=self.MapAlpha,Ji=self.VP8LPredictorsAdd=[];Ji.length=16,(self.VP8LPredictors=[]).length=16,(self.VP8LPredictorsAdd_C=[]).length=16,(self.VP8LPredictors_C=[]).length=16;var qi,Zi,Qi,es,ts,is,ss,ns,rs,as,os,ls,hs,cs,us,ds,gs,fs,ms,ps,ys,Ts,_s,xs,ws,Ss,vs,bs,Es=fi(511),Cs=fi(2041),Is=fi(225),As=fi(767),Ps=0,Ls=Cs,ks=Is,Rs=As,Fs=Es,Ds=0,Vs=1,Os=2,Ms=3,Ns=4,Gs=5,Bs=6,Ws=7,Hs=8,Ys=9,$s=10,js=[2,3,7],Us=[3,3,11],Xs=[280,256,256,256,40],zs=[0,1,1,1,0],Ks=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Js=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],qs=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Zs=8,Qs=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],en=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],tn=null,sn=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],nn=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],rn=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],an=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],on=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ln=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],hn=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],cn=[],un=[],dn=[],gn=1,fn=2,mn=[],pn=[];hi("UpsampleRgbLinePair",Si,3),hi("UpsampleBgrLinePair",vi,3),hi("UpsampleRgbaLinePair",Ai,4),hi("UpsampleBgraLinePair",Ii,4),hi("UpsampleArgbLinePair",Ci,4),hi("UpsampleRgba4444LinePair",Ei,2),hi("UpsampleRgb565LinePair",bi,2);var yn=window.UpsampleRgbLinePair,Tn=window.UpsampleBgrLinePair,_n=window.UpsampleRgbaLinePair,xn=window.UpsampleBgraLinePair,wn=window.UpsampleArgbLinePair,Sn=window.UpsampleRgba4444LinePair,vn=window.UpsampleRgb565LinePair,bn=16,En=1<<bn-1,Cn=-227,In=482,An=6,Pn=(256<<An)-1,Ln=0,kn=fi(256),Rn=fi(256),Fn=fi(256),Dn=fi(256),Vn=fi(In-Cn),On=fi(In-Cn);Pi("YuvToRgbRow",Si,3),Pi("YuvToBgrRow",vi,3),Pi("YuvToRgbaRow",Ai,4),Pi("YuvToBgraRow",Ii,4),Pi("YuvToArgbRow",Ci,4),Pi("YuvToRgba4444Row",Ei,2),Pi("YuvToRgb565Row",bi,2);var Mn=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Nn=[0,2,8],Gn=[8,7,6,4,4,2,2,2,1,1,1,1],Bn=1;this.WebPDecodeRGBA=function(e,t,i,s,n){var r=Vs,a=new zt,o=new Z;a.ba=o,o.S=r,o.width=[o.width],o.height=[o.height];var l=o.width,c=o.height,u=new Q;if(null==u||null==e)var d=2;else ci(null!=u),d=Fi(e,t,i,u.width,u.height,u.Pd,u.Qd,u.format,null);if(0!=d?l=0:(null!=l&&(l[0]=u.width[0]),null!=c&&(c[0]=u.height[0]),l=1),l){o.width=o.width[0],o.height=o.height[0],null!=s&&(s[0]=o.width),null!=n&&(n[0]=o.height);e:{if(s=new Ne,(n=new Kt).data=e,n.w=t,n.ha=i,n.kd=1,t=[0],ci(null!=n),(0==(e=Fi(n.data,n.w,n.ha,null,null,null,t,null,n))||7==e)&&t[0]&&(e=4),0==(t=e)){if(ci(null!=a),s.data=n.data,s.w=n.w+n.offset,s.ha=n.ha-n.offset,s.put=re,s.ac=ne,s.bc=ae,s.ma=a,n.xa){if(null==(e=xe())){a=1;break e}if(function(e,t){var i=[0],s=[0],n=[0];t:for(;;){if(null==e)return 0;if(null==t)return e.a=2,0;if(e.l=t,e.a=0,h(e.m,t.data,t.w,t.ha),!oe(e.m,i,s,n)){e.a=3;break t}if(e.xb=fn,t.width=i[0],t.height=s[0],!we(i[0],s[0],1,e,null))break t;return 1}return ci(0!=e.a),0}(e,s)){if(s=0==(t=Oi(s.width,s.height,a.Oa,a.ba))){t:{s=e;i:for(;;){if(null==s){s=0;break t}if(ci(null!=s.s.yc),ci(null!=s.s.Ya),ci(0<s.s.Wb),ci(null!=(i=s.l)),ci(null!=(n=i.ma)),0!=s.xb){if(s.ca=n.ba,s.tb=n.tb,ci(null!=s.ca),!Di(n.Oa,i,Ms)){s.a=2;break i}if(!Se(s,i.width))break i;if(i.da)break i;if((i.da||K(s.ca.S))&&li(),11>s.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=s.ca.f.kb.F&&li()),s.Pb&&0<s.s.ua&&null==s.s.vb.X&&!E(s.s.vb,s.s.Wa.Xa)){s.a=1;break i}s.xb=0}if(!Te(s,s.V,s.Ba,s.c,s.i,i.o,fe))break i;n.Dc=s.Ma,s=1;break t}ci(0!=s.a),s=0}s=!s}s&&(t=e.a)}else t=e.a}else{if(null==(e=new Ge)){a=1;break e}if(e.Fa=n.na,e.P=n.P,e.qc=n.Sa,He(e,s)){if(0==(t=Oi(s.width,s.height,a.Oa,a.ba))){if(e.Aa=0,i=a.Oa,ci(null!=(n=e)),null!=i){if(0<(l=0>(l=i.Md)?0:100<l?255:255*l/100)){for(c=u=0;4>c;++c)12>(d=n.pb[c]).lc&&(d.ia=l*Gn[0>d.lc?0:d.lc]>>3),u|=d.ia;u&&(alert("todo:VP8InitRandom"),n.ia=1)}n.Ga=i.Id,100<n.Ga?n.Ga=100:0>n.Ga&&(n.Ga=0)}je(e,s)||(t=e.a)}}else t=e.a}0==t&&null!=a.Oa&&a.Oa.fd&&(t=Vi(a.ba))}a=t}r=0!=a?null:11>r?o.f.RGBA.eb:o.f.kb.y}else r=null;return r};var Wn=[3,4,3,4,4,2,2,4,4,4,2,1,1]},new window.WebPDecoder,window.WebPRiffParser=function(e,t){var i={},s=0,n=!1,r=0,a=0;if(i.frames=[],!function(e,t,i,s){for(var n=0;n<s;n++)if(e[t+n]!=i.charCodeAt(n))return!0;return!1}(e,t,"RIFF",4)){for(_i(e,t+=4),t+=8;t<e.length;){var o=yi(e,t),l=_i(e,t+=4);t+=4;var h=l+(1&l);switch(o){case"VP8 ":case"VP8L":void 0===i.frames[s]&&(i.frames[s]={}),(d=i.frames[s]).src_off=n?a:t-8,d.src_size=r+l+8,s++,n&&(n=!1,r=0,a=0);break;case"VP8X":(d=i.header={}).feature_flags=e[t];var c=t+4;d.canvas_width=1+Ti(e,c),c+=3,d.canvas_height=1+Ti(e,c),c+=3;break;case"ALPH":n=!0,r=h+8,a=t-8;break;case"ANIM":(d=i.header).bgcolor=_i(e,t),c=t+4,d.loop_count=(g=e)[(f=c)+0]<<0|g[f+1]<<8,c+=2;break;case"ANMF":var u,d;(d=i.frames[s]={}).offset_x=2*Ti(e,t),t+=3,d.offset_y=2*Ti(e,t),t+=3,d.width=1+Ti(e,t),t+=3,d.height=1+Ti(e,t),t+=3,d.duration=Ti(e,t),t+=3,u=e[t++],d.dispose=1&u,d.blend=u>>1&1}"ANMF"!=o&&(t+=h)}var g,f;return i}},window.ApicTools={parseGIF:e,decompressFrames:t},F.FlexSetNames={NoSet:1,Auto:2,Row:3,RowReverse:4,Column:5,ColumnReverse:6,NoWrap:7,Wrap:8,WrapReverse:9,FlexStart:10,FlexEnd:11,Center:12,SpaceBetween:13,SpaceAround:14,SpaceEvenly:15,Stretch:16,Baseline:17},F.FlexContainerProps=class{constructor(){this.flexDirection=F.FlexSetNames.Row,this.flexWrap=F.FlexSetNames.NoWrap,this.justifyContent=F.FlexSetNames.FlexStart,this.alignItems=F.FlexSetNames.Center,this.alignContent=F.FlexSetNames.FlexStart}},F.FlexItemProps=class{constructor(){this.alignSelf=F.FlexSetNames.NoSet,this.flexGrow=0}},console.log("Using JsView HTML Forge");let xi=F;class wi{static StringToInt32(e){let t=P.InvalidInt32,i=parseInt(e);return 0==isNaN(i)&&(t=i),t}static StringTrim(e){return e.trim()}static StringStartsWith(e,t){return e.startsWith(t)}static StringEndsWith(e,t){return e.endsWith(t)}static StringSplit(e,t=" ",i=0,s=0,n=!1){e||(e=""),0==s&&(s=e.length-1);let r=(e=e.substring(i,s+1)).trim().split(t),a=[];for(let e of r)e&&(n&&(e=e.trim(),0==e.length)||a.push(e));return a}static MergeBrackets(e,t=null){let i=[],s="",n=null,r=null,a=0,o=!1;for(let l of e){let e=0;for(;e<l.length;)if(a>0){let t=l.indexOf(")",e),i=l.indexOf("(",e);if(-1!=i&&(-1==t||i<t))a++,e=i+1;else{if(!(t>=0))break;a--,e=t+1}}else{let t=l.indexOf("(",e);if(-1==t)break;a++,e=t+1}o?(t&&(s+=t),s+=l):null!=n?(s+=n,t&&(s+=t),s+=l,n=null,o=!0):n=l,0==a&&(o?(r=s,s=""):r=l,i.push(r),n=null,o=!1)}return i}static ConvertToInt32(e,t){if(t.is(P.DataType.Null))return 0;if(t.is(P.DataType.String)){const e=t.get();if(""===e)return 0;if(wi.StringTrim(e),wi.StringEndsWith(e,"px")){const t='JsView Warning: Using px will make style performance lower, you can directly use numbers instead of "'+e+'".';console.warn(t)}return wi.StringToInt32(e)}return t.is(P.DataType.Int32)||t.is(P.DataType.Float)?t.get():(b(_.InvalidArgument,P.InvalidInt32,["Failed to convert style ",e,"=",t.toString(),", value type is supported."]),P.InvalidInt32)}static ConvertToFloat(e,t){return t.is(P.DataType.Null)?P.InvalidFloat:t.is(P.DataType.String)&&""===t.get()?0:t.is(P.DataType.Int32)||t.is(P.DataType.Float)?t.get():(b(_.InvalidArgument,P.InvalidFloat,["Failed to convert style ",e,"=",t.toString(),", value type is supported."]),P.InvalidFloat)}static ConvertToString(e,t,i=!1){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);let s=t.get();return null==s||s.length<=0?P.InvalidPointer:(i&&(s=s.toUpperCase()),s)}static ConvertToCorner(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;let i=null;if(t.is(P.DataType.Int32)){const e=t.get();i=new P.CornerImpl(String(e)),i.topLeft=e,i.topRight=e,i.bottomRight=e,i.bottomLeft=e}else if(t.is(P.DataType.String)){const e=t.get();if(null==e||e.length<=0)return P.InvalidPointer;const s=wi.StringSplit(e),n=s.length;i=new P.CornerImpl(e),i.topLeft=n>0?parseInt(s[0]):0,i.topRight=n>1?parseInt(s[1]):i.topLeft,i.bottomRight=n>2?parseInt(s[2]):i.topLeft,i.bottomLeft=n>3?parseInt(s[3]):i.bottomRight}else b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not number or string."]);return i}static ConvertToRect(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style "+e+"="+t+", value type is not string."]);const i=t.get();if(null==i||i.length<=0)return P.InvalidPointer;const s=new P.RectImpl(i),n=wi.StringSplit(i),r=n.length;return s.top=r>0?parseInt(n[0]):0,s.right=r>1?parseInt(n[1]):s.top,s.bottom=r>2?parseInt(n[2]):s.top,s.left=r>3?parseInt(n[3]):s.right,s}static ConvertToAnimation(e,t,i=null){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);const s=t.get();if(null==s||s.length<=0)return P.InvalidPointer;if(null!=i&&null!=i.rawValue&&i.rawValue==s)return i;return wi.ParseToAnimation(s)}static ConvertToTransition(e,t,i=null){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);const s=t.get();if(null==s||s.length<=0)return P.InvalidPointer;if(null!=i&&null!=i.rawValue&&i.rawValue==s)return i;let n=[];const r=wi.StringSplit(s,",");for(let e=0;e<r.length;e++)if(r[e].indexOf("(")>=0){let t=e;for(;t<r.length&&r[t].indexOf(")")<0;)t++;let i="";for(let s=e;s<=t;s++)s!=e&&(i+=","),i+=r[s];e=t,n.push(i)}else n.push(r[e]);const a=new P.TransitionImpl(s);for(const t of n){const i=wi.ConvertToAnimation(e,new P(t));if(null!=i&&(a.animationMap.set(i.name,i),"all"==i?.name)){const e=["opacity","left","top","width","height","transform"];for(const t of e)a.animationMap.set(t,i)}}return a}static ConvertToTextShadow(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);const i=t.get();if(null==i||i.length<=0)return P.InvalidPointer;const s=new P.TextShadowImpl(i),n=wi.StringSplit(i);n.length>0&&(s.hShadow=parseInt(n[0])),n.length>1&&(s.vShadow=parseInt(n[1])),n.length>2&&(s.blur=parseInt(n[2]));let r=-1;return 3==n.length?r=2:n.length>3&&(r=3),r>0&&(s.color=n[r]),s}static ConvertToWebkitTextStroke(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);const i=t.get();if(null==i||i.length<=0)return P.InvalidPointer;const s=new P.WebkitTextStrokeImpl(i),n=wi.StringSplit(i);return n.length>0&&(s.length=parseInt(n[0])),n.length>1&&(s.color=n[1]),s}static ConvertToBorderImage(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);const i=t.get();if(null==i||i.length<=0)return P.InvalidPointer;const s=new P.BorderImageImpl(i),n=wi.StringSplit(i),r=n.length;return r>0&&(s.source=n[0]),r>1&&(s.slice=wi.ConvertToRect(e,new P(n[1]))),s}static ConvertToBackgroundImage(e,t){if(t.is(P.DataType.Null))return P.InvalidPointer;0==t.is(P.DataType.String)&&b(_.InvalidArgument,P.InvalidPointer,["Failed to convert style ",e,"=",t.toString(),", type is not string."]);let i=t.get();if(null==i||i.length<=0)return P.InvalidPointer;const s=new P.BackgroundImageImpl(i),n="linear-gradient(";if(0==i.indexOf(n)){i=wi.StringTrim(i),s.type=P.BackgroundImageImpl.eType.LINEAR_GRADIENT,s.linearGradient=new P.BackgroundImageImpl.LinearGradient,s.urlPath=i;let e=wi.StringSplit(i,",",16,i.length-2);e=wi.MergeBrackets(e,",");let n=e.length;if(n>0){let t=e[0];if(-1!=t.indexOf("to ")){e.splice(0,1);let i=e.length;-1!=t.indexOf("left")?(s.linearGradient.fromX=i+1,s.linearGradient.toX=0):-1!=t.indexOf("right")?(s.linearGradient.fromX=0,s.linearGradient.toX=i+1):(s.linearGradient.fromX=0,s.linearGradient.toX=0),-1!=t.indexOf("top")?(s.linearGradient.fromY=i+1,s.linearGradient.toY=0):-1!=t.indexOf("bottom")?(s.linearGradient.fromY=0,s.linearGradient.toY=i+1):(s.linearGradient.fromY=0,s.linearGradient.toY=0)}else s.linearGradient.fromX=0,s.linearGradient.toX=0,s.linearGradient.fromY=0,s.linearGradient.toY=2}if(n<2)return console.error(`linear gradient format error: str=${t}`),null;let r=1/e.length,a=e.length;for(let t=0;t<a;t++){let i=e[t];i=wi.StringTrim(i);let n=new xi.LinearGradientTexture.StopPoint;n.color=i,n.stopPosition=t!=a-1?t*r:1,s.linearGradient.stops.push(n)}}else s.type=P.BackgroundImageImpl.eType.URL_PATH,s.urlPath=i;return s}static ConvertToFlexEnum(e,t){let i=t.toString();return"flexDirection"==e?"row"==i?xi.FlexSetNames.Row:"row-reverse"==i?xi.FlexSetNames.RowReverse:"column"==i?xi.FlexSetNames.Column:"column-reverse"==i?xi.FlexSetNames.ColumnReverse:(console.warn("Unknown flexDirection value="+i),P.InvalidInt32):"flexWrap"==e?"nowrap"==i?xi.FlexSetNames.NoWrap:"wrap"==i?xi.FlexSetNames.Wrap:"wrap-reverse"==i?xi.FlexSetNames.WrapReverse:(console.warn("Unknown flexWrap value="+i),P.InvalidInt32):"justifyContent"==e?"flex-start"==i?xi.FlexSetNames.FlexStart:"flex-end"==i?xi.FlexSetNames.FlexEnd:"center"==i?xi.FlexSetNames.Center:(console.warn("Unknown justifyContent value="+i),P.InvalidInt32):"alignItems"==e?"stretch"==i?xi.FlexSetNames.Stretch:"flex-start"==i?xi.FlexSetNames.FlexStart:"flex-end"==i?xi.FlexSetNames.FlexEnd:"center"==i?xi.FlexSetNames.Center:(console.warn("Unknown alignItems value="+i),P.InvalidInt32):"alignContent"==e?"flex-start"==i?xi.FlexSetNames.FlexStart:"flex-end"==i?xi.FlexSetNames.FlexEnd:"center"==i?xi.FlexSetNames.Center:(console.warn("Unknown alignContent value="+i),P.InvalidInt32):"alignSelf"==e?"stretch"==i?xi.FlexSetNames.Stretch:"flex-start"==i?xi.FlexSetNames.FlexStart:"flex-end"==i?xi.FlexSetNames.FlexEnd:"center"==i?xi.FlexSetNames.Center:(console.warn("Unknown alignSelf value="+i),P.InvalidInt32):P.InvalidInt32}static ParseToAnimation(e){const t=wi.StringTrim(e);let i=[];const s=t.indexOf("cubic-bezier");if(s>=0){const e=t.indexOf(")"),n=t.substring(s,e-1),r=wi.StringSplit(t,n);for(const e of r){const t=wi.StringSplit(e);i=[...i,...t]}i.push(n)}else i=wi.StringSplit(t);let n="",r=0,a=1,o=t.indexOf("alternate")>=0;for(var l=2;l<i.length;l++){if("infinite"==i[l]){a=-1;continue}let e=wi.ParseToTimeMs(i[l]);0==isNaN(e)?r=e:(e=wi.ParseToFloat(i[l]),0==isNaN(e)?a=e:n=i[l])}const h=i.length>1?wi.ParseToTimeMs(i[1]):0,c=new P.AnimationImpl(t);return c.name=i.length>0?i[0]:"",c.duration=h,c.timingFunction=wi.ParseToEasing(n,h),c.delay=r,c.iterationCount=a,c.direction=o,c}static ParseToTimeMs(e){if(0==wi.StringEndsWith(e,"s"))return NaN;let t=wi.ParseToFloat(e);return wi.StringEndsWith(e,"ms")?t*=1:wi.StringEndsWith(e,"s")&&(t*=1e3),t}static ParseToFloat(e){const t=wi.StringTrim(e);return parseFloat(t)}static ParseToEasing(e,t){let i=null;return e.indexOf("ease")>=0?i=e.indexOf("-in-out")>=0?F.Easing.Circular.InOut:e.indexOf("-out")>=0?F.Easing.Circular.Out:e.indexOf("-in")>=0?F.Easing.Circular.In:F.Easing.Circular.InOut:e.indexOf("linear")>=0?i=null:e.indexOf("cubic-bezier")>=0?i=wi.ParseToEasingBezier(e,t):e.indexOf("steps")>=0&&(i=wi.ParseToEasingSteps(e)),i}static ParseToEasingBezier(e,t){let i=e.indexOf("(");i>=0&&(e=e.substring(i+1));let s=wi.StringSplit(e,","),n={x1:s.length>0?parseFloat(s[0]):0,y1:s.length>1?parseFloat(s[1]):0,x2:s.length>2?parseFloat(s[2]):0,y2:s.length>3?parseFloat(s[3]):0};return new F.BezierEasing(n.x1,n.y1,n.x2,n.y2,t)}static ParseToEasingSteps(e){let t=e.indexOf("(");t>=0&&(e=e.substring(t+1));let i=wi.StringSplit(e,","),s={steps:i.length>0?parseInt(i[0]):1,type:i.length>1?i[1].includes("start")?0:1:0};return new F.StepsEasing(s.steps,s.type)}constructor(){throw new Error("new StyleGroup() is forbidden.")}}class Si{static IsInheritedProp(e){return e==A.Text.Color||e==A.Text.FontFamily||e==A.Text.FontSize||e==A.Text.FontStyle||e==A.Text.FontWeight||e==A.Text.LineHeight||e==A.Text.TextAlign||e==A.Text.TextOverflow||e==A.Text.TextShadow||e==A.Text.WebkitTextStroke||e==A.Text.WhiteSpace||e==A.Text.WordWrap||e==A.Text.Direction||e==A.Text.JsvTextEmoji||e==A.Text.JsvTextLatex||e==A.Text.JsvTextAlignMinWidth||e==A.Text.JsvTextVerticalAlign||e==A.Text.JsvTextLineAlign||e==A.Text.JsvTextInnerDirection}constructor(){this.changedStyleGroups=new Set,this.lockedPropNames=new Set,this.layout=void 0,this.background=void 0,this.flex=void 0,this.effect=void 0,this.text=void 0,this.motion=void 0}setPropValue(e,t,i){if(0==i&&1==this.isPropNameLocked(e))return _.CssStyleNotChanged;const s=this.setValue(e,t);return null==s?_.CssStyleNotChanged:(this.changedStyleGroups.add(s),this.needUpdateTransition(e)&&this.changedStyleGroups.add(R.Motion.Name),i&&this.lockedPropNames.add(e),0)}getPropValue(e){return this.getValue(e)}hasPropValue(e){return this.hasValue(e)}hasPropGroup(e){return e==R.Layout.Name?null!=this.layout:e==R.Background.Name?null!=this.background:e==R.Effect.Name?null!=this.effect:e==R.Text.Name?null!=this.text:e==R.Motion.Name&&null!=this.motion}isPropNameLocked(e){return 1==this.lockedPropNames.has(e)}addChangedStyleGroup(e){return e!=R.Layout.Name&&e!=R.Background.Name&&e!=R.Effect.Name&&e!=R.Text.Name&&e!=R.Motion.Name&&v(_.InvalidArgument),this.changedStyleGroups.add(e),0}getChangedStyleGroups(){return this.changedStyleGroups}clearChangedStyleGroups(){this.changedStyleGroups.clear()}setValue(e,t){let i=null;return e==A.Layout.Left||e==A.Layout.Top||e==A.Layout.Width||e==A.Layout.Height?i=this.setLayoutValue(e,t):e==A.Flex.FlexDirection||e==A.Flex.FlexWrap||e==A.Flex.JustifyContent||e==A.Flex.AlignItems||e==A.Flex.AlignContent||e==A.Flex.AlignSelf||e==A.Flex.FlexGrow?i=this.setFlexValue(e,t):e==A.Background.BackgroundColor||e==A.Background.BackgroundImage||e==A.Background.BorderRadius?i=this.setBackgroundValue(e,t):e==A.Effect.BackfaceVisibility||e==A.Effect.BorderImage||e==A.Effect.BorderImageWidth||e==A.Effect.BorderImageOutset||e==A.Effect.Display||e==A.Effect.ObjectFit||e==A.Effect.Opacity||e==A.Effect.Overflow||e==A.Effect.Perspective||e==A.Effect.PerspectiveOrigin||e==A.Effect.Transform||e==A.Effect.TransformOrigin||e==A.Effect.TransformStyle||e==A.Effect.Visibility||e==A.Effect.ZIndex?i=this.setEffectValue(e,t):e==A.Text.Color||e==A.Text.FontFamily||e==A.Text.FontSize||e==A.Text.FontStyle||e==A.Text.FontWeight||e==A.Text.TextAlign||e==A.Text.TextOverflow||e==A.Text.TextShadow||e==A.Text.LineHeight||e==A.Text.WebkitTextStroke||e==A.Text.WhiteSpace||e==A.Text.WordWrap||e==A.Text.Direction||e==A.Text.JsvTextEmoji||e==A.Text.JsvTextLatex||e==A.Text.JsvTextAlignMinWidth||e==A.Text.JsvTextVerticalAlign||e==A.Text.JsvTextLineAlign||e==A.Text.JsvTextInnerDirection?i=this.setTextValue(e,t):e==A.Motion.Animation||e==A.Motion.Transition||e==A.Motion.AnimationFillMode?i=this.setMotionValue(e,t):b(_.UnimplementedError,null),null!=i&&this.changedStyleGroups.add(i),i}getValue(e){let t;return e==A.Layout.Left||e==A.Layout.Top||e==A.Layout.Width||e==A.Layout.Height?t=this.getLayoutValue(e):e==A.Flex.FlexDirection||e==A.Flex.FlexWrap||e==A.Flex.JustifyContent||e==A.Flex.AlignItems||e==A.Flex.AlignContent||e==A.Flex.AlignSelf||e==A.Flex.FlexGrow?t=this.getFlexValue(e):e==A.Background.BackgroundColor||e==A.Background.BackgroundImage||e==A.Background.BorderRadius?t=this.getBackgroundValue(e):e==A.Effect.BackfaceVisibility||e==A.Effect.BorderImage||e==A.Effect.BorderImageWidth||e==A.Effect.BorderImageOutset||e==A.Effect.Display||e==A.Effect.ObjectFit||e==A.Effect.Opacity||e==A.Effect.Overflow||e==A.Effect.Perspective||e==A.Effect.PerspectiveOrigin||e==A.Effect.Transform||e==A.Effect.TransformOrigin||e==A.Effect.TransformStyle||e==A.Effect.Visibility||e==A.Effect.ZIndex?t=this.getEffectValue(e):e==A.Text.Color||e==A.Text.FontFamily||e==A.Text.FontSize||e==A.Text.FontStyle||e==A.Text.FontWeight||e==A.Text.TextAlign||e==A.Text.TextOverflow||e==A.Text.TextShadow||e==A.Text.LineHeight||e==A.Text.WebkitTextStroke||e==A.Text.WhiteSpace||e==A.Text.WordWrap||e==A.Text.Direction||e==A.Text.JsvTextEmoji||e==A.Text.JsvTextLatex||e==A.Text.JsvTextAlignMinWidth||e==A.Text.JsvTextVerticalAlign||e==A.Text.JsvTextLineAlign||e==A.Text.JsvTextInnerDirection?t=this.getTextValue(e):e==A.Motion.Animation||e==A.Motion.Transition||e==A.Motion.AnimationFillMode?t=this.getMotionValue(e):(b(_.UnimplementedError,null),t=new P),t}hasValue(e){let t=!1;return e==A.Layout.Left||e==A.Layout.Top||e==A.Layout.Width||e==A.Layout.Height?t=this.hasLayoutValue(e):e==A.Flex.FlexDirection||e==A.Flex.FlexWrap||e==A.Flex.JustifyContent||e==A.Flex.AlignItems||e==A.Flex.AlignContent||e==A.Flex.AlignSelf||e==A.Flex.FlexGrow?t=this.hasFlexValue(e):e==A.Background.BackgroundColor||e==A.Background.BackgroundImage||e==A.Background.BorderRadius?t=this.hasBackgroundValue(e):e==A.Effect.BackfaceVisibility||e==A.Effect.BorderImage||e==A.Effect.BorderImageWidth||e==A.Effect.BorderImageOutset||e==A.Effect.Display||e==A.Effect.ObjectFit||e==A.Effect.Overflow||e==A.Effect.Perspective||e==A.Effect.PerspectiveOrigin||e==A.Effect.Transform||e==A.Effect.TransformOrigin||e==A.Effect.TransformStyle||e==A.Effect.Visibility||e==A.Effect.ZIndex?t=this.hasEffectValue(e):e==A.Text.Color||e==A.Text.FontFamily||e==A.Text.FontSize||e==A.Text.FontStyle||e==A.Text.FontWeight||e==A.Text.TextAlign||e==A.Text.TextOverflow||e==A.Text.TextShadow||e==A.Text.LineHeight||e==A.Text.WebkitTextStroke||e==A.Text.WhiteSpace||e==A.Text.WordWrap||e==A.Text.Direction||e==A.Text.JsvTextEmoji||e==A.Text.JsvTextLatex||e==A.Text.JsvTextAlignMinWidth||e==A.Text.JsvTextVerticalAlign||e==A.Text.JsvTextLineAlign||e==A.Text.JsvTextInnerDirection?t=this.hasTextValue(e):e!=A.Motion.Animation&&e!=A.Motion.Transition&&e!=A.Motion.AnimationFillMode||(t=this.hasMotionValue(e)),t}setLayoutValue(e,t){const i=(e,t)=>{const i=t;return this.layout[e]==i==0&&(this.layout[e]=i,!0)};this.ensureGroupExist(R.Layout.Name);let s=!1;if(e==A.Layout.Height)s=i("height",wi.ConvertToInt32(e,t));else if(e==A.Layout.Left)s=i("left",wi.ConvertToInt32(e,t));else if(e==A.Layout.Top)s=i("top",wi.ConvertToInt32(e,t));else{if(e!=A.Layout.Width)throw new Error;s=i("width",wi.ConvertToInt32(e,t))}return s?R.Layout.Name:null}getLayoutValue(e){const t=e=>this.layout?new P(this.layout[e]):new P;if(e==A.Layout.Height)return t("height");if(e==A.Layout.Left)return t("left");if(e==A.Layout.Top)return t("top");if(e==A.Layout.Width)return t("width");throw new Error}hasLayoutValue(e){const t=e=>!(!this.layout||this.layout[e]==P.InvalidInt32);if(e==A.Layout.Height)return t("height");if(e==A.Layout.Left)return t("left");if(e==A.Layout.Top)return t("top");if(e==A.Layout.Width)return t("width");throw new Error}setFlexValue(e,t){const i=(e,t)=>{const i=t;return this.flex[e]==i==0&&(this.flex[e]=i,!0)};this.ensureGroupExist(R.Flex.Name);let s=!1;if(e==A.Flex.FlexDirection)s=i("flexDirection",wi.ConvertToFlexEnum(e,t));else if(e==A.Flex.FlexWrap)s=i("flexWrap",wi.ConvertToFlexEnum(e,t));else if(e==A.Flex.JustifyContent)s=i("justifyContent",wi.ConvertToFlexEnum(e,t));else if(e==A.Flex.AlignItems)s=i("alignItems",wi.ConvertToFlexEnum(e,t));else if(e==A.Flex.AlignContent)s=i("alignContent",wi.ConvertToFlexEnum(e,t));else if(e==A.Flex.AlignSelf)s=i("alignSelf",wi.ConvertToFlexEnum(e,t));else{if(e!=A.Flex.FlexGrow)throw new Error;s=i("flexGrow",wi.ConvertToFloat(e,t))}return s?R.Flex.Name:null}getFlexValue(e){const t=e=>this.flex?new P(this.flex[e]):new P;if(e==A.Flex.FlexDirection)return t("flexDirection");if(e==A.Flex.FlexWrap)return t("flexWrap");if(e==A.Flex.JustifyContent)return t("justifyContent");if(e==A.Flex.AlignItems)return t("alignItems");if(e==A.Flex.AlignContent)return t("alignContent");if(e==A.Flex.AlignSelf)return t("alignSelf");if(e==A.Flex.FlexGrow)return t("flexGrow");throw new Error}hasFlexValue(e){const t=e=>!(!this.flex||this.flex[e]==P.InvalidInt32);if(e==A.Flex.FlexDirection)return t("flexDirection");if(e==A.Flex.FlexWrap)return t("flexWrap");if(e==A.Flex.JustifyContent)return t("justifyContent");if(e==A.Flex.AlignItems)return t("alignItems");if(e==A.Flex.AlignContent)return t("alignContent");if(e==A.Flex.AlignSelf)return t("alignSelf");if(e==A.Flex.FlexGrow)return!(!this.flex||this.flex[e]==P.InvalidFloat);throw new Error}setBackgroundValue(e,t){const i=(e,t)=>{const i=t;return this.background[e]==i==0&&(this.background[e]=i,!0)};this.ensureGroupExist(R.Background.Name);let s=!1;if(e==A.Background.BackgroundColor)s=i("backgroundColor",wi.ConvertToString(e,t));else if(e==A.Background.BackgroundImage)s=i("backgroundImage",wi.ConvertToBackgroundImage(e,t));else{if(e!=A.Background.BorderRadius)throw new Error;s=i("borderRadius",wi.ConvertToCorner(e,t))}return s?R.Background.Name:null}getBackgroundValue(e){const t=e=>this.background?new P(this.background[e]):new P;if(e==A.Background.BackgroundColor)return t("backgroundColor");if(e==A.Background.BackgroundImage)return t("backgroundImage");if(e==A.Background.BorderRadius)return t("borderRadius");throw new Error}hasBackgroundValue(e){const t=e=>!(!this.background||this.background[e]==P.InvalidPointer);if(e==A.Background.BackgroundColor)return t("backgroundColor");if(e==A.Background.BackgroundImage)return t("backgroundImage");if(e==A.Background.BorderRadius)return t("borderRadius");throw new Error}setEffectValue(e,t){const i=(e,t)=>{const i=t;return this.effect[e]==i==0&&(this.effect[e]=i,!0)};this.ensureGroupExist(R.Effect.Name);let s=!1;if(e==A.Effect.BackfaceVisibility)s=i("backfaceVisibility",wi.ConvertToString(e,t));else if(e==A.Effect.BorderImage)s=i("borderImage",wi.ConvertToBorderImage(e,t));else if(e==A.Effect.BorderImageWidth)s=i("borderImageWidth",wi.ConvertToRect(e,t));else if(e==A.Effect.BorderImageOutset)s=i("borderImageOutset",wi.ConvertToRect(e,t));else if(e==A.Effect.Display)s=i("display",wi.ConvertToString(e,t));else if(e==A.Effect.ObjectFit)s=i("objectFit",wi.ConvertToString(e,t));else if(e==A.Effect.Opacity)s=i("opacity",wi.ConvertToFloat(e,t));else if(e==A.Effect.Overflow)s=i("overflow",wi.ConvertToString(e,t));else if(e==A.Effect.Perspective)s=i("perspective",wi.ConvertToInt32(e,t));else if(e==A.Effect.PerspectiveOrigin)s=i("perspectiveOrigin",wi.ConvertToInt32(e,t));else if(e==A.Effect.Transform)s=i("transform",wi.ConvertToString(e,t));else if(e==A.Effect.TransformOrigin)s=i("transformOrigin",wi.ConvertToString(e,t));else if(e==A.Effect.TransformStyle)s=i("transformStyle",wi.ConvertToString(e,t));else if(e==A.Effect.Visibility)s=i("visibility",wi.ConvertToString(e,t));else{if(e!=A.Effect.ZIndex)throw new Error;s=i("zIndex",wi.ConvertToInt32(e,t))}return s?R.Effect.Name:null}getEffectValue(e){const t=e=>this.effect?new P(this.effect[e]):new P;if(e==A.Effect.BackfaceVisibility)return t("backfaceVisibility");if(e==A.Effect.BorderImage)return t("borderImage");if(e==A.Effect.BorderImageWidth)return t("borderImageWidth");if(e==A.Effect.BorderImageOutset)return t("borderImageOutset");if(e==A.Effect.Display)return t("display");if(e==A.Effect.ObjectFit)return t("objectFit");if(e==A.Effect.Opacity)return t("opacity");if(e==A.Effect.Overflow)return t("overflow");if(e==A.Effect.Perspective)return t("perspective");if(e==A.Effect.PerspectiveOrigin)return t("perspectiveOrigin");if(e==A.Effect.Transform)return t("transform");if(e==A.Effect.TransformOrigin)return t("transformOrigin");if(e==A.Effect.TransformStyle)return t("transformStyle");if(e==A.Effect.Visibility)return t("visibility");if(e==A.Effect.ZIndex)return t("zIndex");throw new Error}hasEffectValue(e){const t=(e,t)=>!(!this.effect||this.effect[e]==t);if(e==A.Effect.BackfaceVisibility)return t("backfaceVisibility",P.InvalidInt32);if(e==A.Effect.BorderImage)return t("borderImage",P.InvalidPointer);if(e==A.Effect.BorderImageWidth)return t("borderImageWidth",P.InvalidPointer);if(e==A.Effect.BorderImageOutset)return t("borderImageOutset",P.InvalidPointer);if(e==A.Effect.Display)return t("display",P.InvalidPointer);if(e==A.Effect.ObjectFit)return t("objectFit",P.InvalidPointer);if(e==A.Effect.Overflow)return t("overflow",P.InvalidPointer);if(e==A.Effect.Perspective)return t("perspective",P.InvalidInt32);if(e==A.Effect.PerspectiveOrigin)return t("perspectiveOrigin",P.InvalidInt32);if(e==A.Effect.Transform)return t("transform",P.InvalidPointer);if(e==A.Effect.TransformOrigin)return t("transformOrigin",P.InvalidPointer);if(e==A.Effect.TransformStyle)return t("transformStyle",P.InvalidPointer);if(e==A.Effect.Visibility)return t("visibility",P.InvalidPointer);if(e==A.Effect.ZIndex)return t("zIndex",P.InvalidInt32);throw new Error}setTextValue(e,t){const i=(e,t)=>{const i=t;return this.text[e]==i==0&&(this.text[e]=i,!0)};this.ensureGroupExist(R.Text.Name);let s=!1;if(e==A.Text.Color)s=i("color",wi.ConvertToString(e,t));else if(e==A.Text.FontFamily)s=i("fontFamily",wi.ConvertToString(e,t));else if(e==A.Text.FontSize)s=i("fontSize",wi.ConvertToInt32(e,t));else if(e==A.Text.FontStyle)s=i("fontStyle",wi.ConvertToString(e,t));else if(e==A.Text.FontWeight)s=i("fontWeight",wi.ConvertToString(e,t));else if(e==A.Text.LineHeight)s=i("lineHeight",wi.ConvertToInt32(e,t));else if(e==A.Text.TextAlign)s=i("textAlign",wi.ConvertToString(e,t));else if(e==A.Text.TextOverflow)s=i("textOverflow",wi.ConvertToString(e,t));else if(e==A.Text.TextShadow)s=i("textShadow",wi.ConvertToTextShadow(e,t));else if(e==A.Text.WebkitTextStroke)s=i("webkitTextStroke",wi.ConvertToWebkitTextStroke(e,t));else if(e==A.Text.WhiteSpace)s=i("whiteSpace",wi.ConvertToString(e,t));else if(e==A.Text.WordWrap)s=i("wordWrap",wi.ConvertToString(e,t));else if(e==A.Text.Direction)s=i("direction",wi.ConvertToString(e,t));else if(e==A.Text.JsvTextEmoji)s=i("jsvTextEmoji",wi.ConvertToInt32(e,t));else if(e==A.Text.JsvTextLatex)s=i("jsvTextLatex",wi.ConvertToInt32(e,t));else if(e==A.Text.JsvTextAlignMinWidth)s=i("jsvTextAlignMinWidth",wi.ConvertToInt32(e,t));else if(e==A.Text.JsvTextVerticalAlign)s=i("jsvTextVerticalAlign",wi.ConvertToString(e,t));else if(e==A.Text.JsvTextLineAlign)s=i("jsvTextLineAlign",wi.ConvertToString(e,t));else{if(e!=A.Text.JsvTextInnerDirection)throw new Error;s=i("jsvTextInnerDirection",wi.ConvertToString(e,t))}return s?R.Text.Name:null}getTextValue(e){const t=e=>this.text?new P(this.text[e]):new P;if(e==A.Text.Color)return t("color");if(e==A.Text.FontFamily)return t("fontFamily");if(e==A.Text.FontSize)return t("fontSize");if(e==A.Text.FontStyle)return t("fontStyle");if(e==A.Text.FontWeight)return t("fontWeight");if(e==A.Text.LineHeight)return t("lineHeight");if(e==A.Text.TextAlign)return t("textAlign");if(e==A.Text.TextOverflow)return t("textOverflow");if(e==A.Text.TextShadow)return t("textShadow");if(e==A.Text.WebkitTextStroke)return t("webkitTextStroke");if(e==A.Text.WhiteSpace)return t("whiteSpace");if(e==A.Text.WordWrap)return t("wordWrap");if(e==A.Text.Direction)return t("direction");if(e==A.Text.JsvTextEmoji)return t("jsvTextEmoji");if(e==A.Text.JsvTextLatex)return t("jsvTextLatex");if(e==A.Text.JsvTextAlignMinWidth)return t("jsvTextAlignMinWidth");if(e==A.Text.JsvTextVerticalAlign)return t("jsvTextVerticalAlign");if(e==A.Text.JsvTextLineAlign)return t("jsvTextLineAlign");if(e==A.Text.JsvTextInnerDirection)return t("jsvTextInnerDirection");throw new Error}hasTextValue(e){const t=(e,t)=>!(!this.text||this.text[e]==t);if(e==A.Text.Color)return t("color",P.InvalidPointer);if(e==A.Text.FontFamily)return t("fontFamily",P.InvalidPointer);if(e==A.Text.FontSize)return t("fontSize",P.InvalidInt32);if(e==A.Text.FontStyle)return t("fontStyle",P.InvalidPointer);if(e==A.Text.FontWeight)return t("fontWeight",P.InvalidPointer);if(e==A.Text.LineHeight)return t("lineHeight",P.InvalidInt32);if(e==A.Text.TextAlign)return t("textAlign",P.InvalidPointer);if(e==A.Text.TextOverflow)return t("textOverflow",P.InvalidPointer);if(e==A.Text.TextShadow)return t("textShadow",P.InvalidPointer);if(e==A.Text.WebkitTextStroke)return t("webkitTextStroke",P.InvalidPointer);if(e==A.Text.WhiteSpace)return t("whiteSpace",P.InvalidPointer);if(e==A.Text.WordWrap)return t("wordWrap",P.InvalidPointer);if(e==A.Text.Direction)return t("direction",P.InvalidPointer);if(e==A.Text.JsvTextEmoji)return t("jsvTextEmoji",P.InvalidInt32);if(e==A.Text.JsvTextLatex)return t("jsvTextLatex",P.InvalidInt32);if(e==A.Text.JsvTextAlignMinWidth)return t("jsvTextAlignMinWidth",P.InvalidInt32);if(e==A.Text.JsvTextVerticalAlign)return t("jsvTextVerticalAlign",P.InvalidPointer);if(e==A.Text.JsvTextLineAlign)return t("jsvTextLineAlign",P.InvalidPointer);if(e==A.Text.JsvTextInnerDirection)return t("jsvTextInnerDirection",P.InvalidPointer);throw new Error}setMotionValue(e,t){const i=(e,t)=>{const i=t;return this.motion[e]==i==0&&(this.motion[e]=i,!0)};this.ensureGroupExist(R.Motion.Name);let s=!1;if(e==A.Motion.Animation)s=i("animation",wi.ConvertToAnimation(e,t,this.motion.animation));else if(e==A.Motion.Transition)s=i("transition",wi.ConvertToTransition(e,t,this.motion.transition));else{if(e!=A.Motion.AnimationFillMode)throw new Error;s=i("animationFillMode",wi.ConvertToString(e,t))}return s?R.Motion.Name:null}getMotionValue(e){const t=e=>this.motion?new P(this.motion[e]):new P;if(e==A.Motion.Animation)return t("animation");if(e==A.Motion.Transition)return t("transition");if(e==A.Motion.AnimationFillMode)return t("animationFillMode");throw new Error}hasMotionValue(e){const t=e=>!(!this.motion||this.motion[e]==P.InvalidPointer);if(e==A.Motion.Animation)return t("animation");if(e==A.Motion.Transition)return t("transition");if(e==A.Motion.AnimationFillMode)return t("animationFillMode");throw new Error}needUpdateTransition(e){return null!=this.motion&&null==this.motion.animation&&null!=this.motion.transition&&(e==A.Layout.Height||e==A.Layout.Left||e==A.Layout.Top||e==A.Layout.Width||e==A.Effect.Transform)}ensureGroupExist(e){e==R.Layout.Name&&null==this.layout?this.layout=new R.Layout:e==R.Flex.Name&&null==this.flex?this.flex=new R.Flex:e==R.Background.Name&&null==this.background?this.background=new R.Background:e==R.Effect.Name&&null==this.effect?this.effect=new R.Effect:e==R.Text.Name&&null==this.text?this.text=new R.Text:e==R.Motion.Name&&null==this.motion&&(this.motion=new R.Motion)}}var vi,bi,Ei;class Ci{constructor(e){this.classNames="",this.classAttributes=new Set,this.classStyleManager=e}getManager(){return this.classStyleManager}setClassNames(e){return null==e&&(e=""),this.classNames==e?_.CssClassNotChanged:(this.classNames=e,0)}getClassNames(){return this.classNames}appendClassAttribute(e){return this.classAttributes.has(e)?_.CssClassNotChanged:(this.classAttributes.add(e),0)}mergeClassAttributes(e){for(let t of e.classAttributes)this.classAttributes.add(t);return 0}hasClassAttribute(e){return this.classAttributes.has(e)}getClassAttributes(){return this.classAttributes}getClassDeclarations(e){if(0==this.classNames.length)return null;let t="";t+=this.classNames,t+=" @ ";for(const e of this.classAttributes)t+=e+" ";const i=t;let s=this.classStyleManager.findStyleClassCache(i);return null==s&&(s=this.makeClassDeclarations(e),this.classStyleManager.appendStyleClassCache(i,s)),s}getKeyframes(e){if(0==e.length)return"";const t=this.classStyleManager.getKeyframes(this.classAttributes,e);return 0==t.length?"":t}static CastToStyleValue(e){let t;return null==e||Number(e)===e||"string"==typeof e?t=new P(e):"boolean"==typeof e?t=new P(Number(e)):(b(_.UnimplementedError,null),t=new P),t}static ParseDeclarations(e,t,i){let s=new Map;for(let n of t){if(0==e.has(i))continue;const t=e.get(i);if(0==t.has(n))continue;const r=t.get(n);let a;a=r instanceof String==0?r:Ci.ParseDeclarationsFromString(r),s=new Map([...s,...a])}return s}static ParseDeclarationsFromString(e){let t=new Map;const i=JSON.parse(e);for(const[e,s]of Object.entries(i)){const i=A.ToConst(e);if(null==i){console.error("Unsupported style name: "+e);continue}if(i==A.Effect.ObjectFit||i==A.Effect.Overflow){console.warn("Unimplemented style name: "+i+", please set the "+i+" attribute directly in the element's style.");continue}const n=Ci.CastToStyleValue(s);t.set(i,n)}return t}makeClassDeclarations(e){let t=new Map;const i=this.classStyleManager.getStyleSheets(),s=this.getNestedClassCombine(e),n=Ci.ParseDeclarations(i,s,Ci.Manager.StyleSheetKeyGlobal);for(const[e,i]of n)t.set(e,i);for(const e of this.classAttributes){const n=Ci.ParseDeclarations(i,s,e);for(const[e,i]of n)t.set(e,i)}return t}getNestedClassCombine(e){const t=wi.StringSplit(this.classNames),i=[];for(const e of t)i.push("."+e);for(let t=e.length-1;t>=0;t--){const s=e[t],n=i.length,r=wi.StringSplit(s);for(const e of r)for(let t=0;t<n;t++){const s=i[t];i.push("."+e+" "+s)}}return i}}Ci.Manager=(T(vi=class{constructor(){this.styleSheetMap=new Map,this.parsedStyleClassCache=new Map,this.propVariableMap=new Map}declareStyleSheets(e){for(const[t,i]of Object.entries(e)){let e=0;e=parseInt(t,16),0==this.styleSheetMap.has(e)&&this.styleSheetMap.set(e,new Map);const s=this.styleSheetMap.get(e);for(const[e,t]of Object.entries(i))if(s.has(e)&&console.warn('StyleSheets class "'+e+'" already exists, overwrite it with the new value.'),t.includes("@keyframes"))s.set(e,t);else{const i=Ci.ParseDeclarationsFromString(t);s.set(e,i)}}return 0}undeclareStyleSheets(e){for(const[t,i]of Object.entries(e)){let e=0;if(e=parseInt(t,16),0==this.styleSheetMap.has(e))continue;const s=this.styleSheetMap.get(e);for(const[e,t]of Object.entries(i))s.delete(e)}return 0}getStyleSheets(){return this.styleSheetMap}appendStyleClassCache(e,t){this.parsedStyleClassCache.set(e,t)}findStyleClassCache(e){const t=this.parsedStyleClassCache.get(e);return null==t?null:t}clearStyleClassCache(){this.parsedStyleClassCache.clear()}watchVariable(e,t,i,s,n){let r=A.ToConst(t);x(null!=r,_.InvalidArgument);let a=this.getVariableInfo(s);if(x(null!=a,_.InvalidArgument),0==a.watchListenerMap.has(e)){const t=new Set;a.watchListenerMap.set(e,t)}const o=a.watchListenerMap.get(e),l=new Ci.Manager.VariableInfo.WatchListener;if(l.propName=r,l.listener=i,o.add(l),0==a.value.is(P.DataType.Null)){const e=i(r,a.value,n);if(e==_.CssStyleNotChanged)return e;v(e)}return 0}watchKeyframeVariables(e,t,i,s,n){const r=this.getRawKeyframes(e.classAttributes,s);if(0==r.length)return 0;const a=new Set;let o=this.getKeyframesVarNames(r,a);v(o);for(const s of a)o=this.watchVariable(e,t,i,s,n),v(o);return 0}unwatchVariable(e,t){for(const[i,s]of this.propVariableMap){if(0==s.watchListenerMap.has(e))continue;let i=s.watchListenerMap.get(e);for(const e of i)if(e.propName!=t){i.delete(e);break}}return 0}unwatchAllVariables(e){for(const[t,i]of this.propVariableMap)i.watchListenerMap.delete(e)}setVariable(e,t,i){let s=this.getVariableInfo(e);x(null!=s,_.InvalidArgument),s.value=t;for(const[e,n]of s.watchListenerMap)for(const e of n){let s=new Set;const n=e.listener(e.propName,t,s);if(n==_.CssStyleNotChanged)return n;v(n);for(const e of s)i.add(e)}return 0}insertKeyFrame(e,t){const i=this.styleSheetMap.get(Ci.Manager.StyleSheetKeyGlobal);w(i,null),i?.set(e,t)}removeKeyFrame(e){const t=this.styleSheetMap.get(Ci.Manager.StyleSheetKeyGlobal);if(w(t,null),t?.has(e)){t.delete(e);const i=document.styleSheets[0],s=i.cssRules;for(let t=s.length-1;t>=0;t--)if(s[t].name===e){i.deleteRule(t);break}}}getKeyframes(e,t){if(0==t.length)return"";const i=this.getRawKeyframes(e,t);if(0==i.length)return"";const s=new Set;if(b(this.getKeyframesVarNames(i,s),""),0==s.size)return i;let n=i;for(const e of s){const t=this.getVariableInfo(e);w(null!=t,""),r=e,a=t.value.toString(),n=n.replaceAll(r,a)}var r,a;return n}getRawKeyframes(e,t){if(0==t.length)return Ci.Manager.ConstEmptyString;if(0==this.styleSheetMap.has(Ci.Manager.StyleSheetKeyGlobal))return Ci.Manager.ConstEmptyString;const i=this.styleSheetMap.get(Ci.Manager.StyleSheetKeyGlobal);for(const s of e){const e=t+"-"+s.toString(16).padStart(8,"0");if(0==i.has(e))continue;return i.get(e)}if(i.has(t)){return i.get(t)}return Ci.Manager.ConstEmptyString}getKeyframesVarNames(e,t){t.clear();let i=e;const s=/var\([\s\S]+?\)/;let n;for(;null!==(n=s.exec(i));)t.add(n[0]),i=i.substring(n.index+n[0].length);return 0}getVariableInfo(e){let t=k.FormatVariableName(e);if(x(null!=t,null),0==this.propVariableMap.has(t)){const e=new Ci.Manager.VariableInfo;this.propVariableMap.set(t,e)}let i=this.propVariableMap.get(t);return i}},"Manager"),vi.StyleSheetKeyGlobal=0,vi.VariableInfo=(T(bi=class{constructor(){this.value=new P,this.watchListenerMap=new Map}},"VariableInfo"),bi.WatchListener=class{},bi),vi.ConstEmptyString="",vi);class Ii{static STYLE_PROPERTY_GETTER(e,t,i){let s=new P;return e.getProperty(t,s)>=0?s.get():i}constructor(e,t){this.lastCssClassKeySet=new Set,this.elementDelegate=e,this.style=new Si,this.styleClass=new Ci(t)}finalize(){this.styleClass.getManager().unwatchAllVariables(this.styleClass)}hasPropGroup(e){return this.style.hasPropGroup(e)}setProperty(e,t,i){let s=e;0==k.IsVariable(e)&&(s=A.ToConst(e)),x(s,_.UnsupportedError),i.clear();return this.setStyleInheritedProperty(s,t,!0,i)}getProperty(e,t){const i=A.ToConst(e);x(i,_.UnsupportedError);return this.getStyleInheritedProperty(i,t)}setClassNames(e){const t=this.styleClass.setClassNames(e);return x(t>=0||t==_.CssClassNotChanged,t),0}getClassNames(){return this.styleClass.getClassNames()}appendClassAttribute(e){const t=this.styleClass.appendClassAttribute(e);return t==_.CssClassNotChanged||v(t),0}mergeClassAttributes(e){return v(this.styleClass.mergeClassAttributes(e.styleClass)),0}getKeyframes(e){const t=this.styleClass.getKeyframes(e);return w(null!=t,null,["Failed to get keyframes:"+e]),t}getNestedClassNames(e){const t=this.elementDelegate;x(null!=t,_.InvalidElement);const i=t.parentNode;x(null!=i,_.InvalidElement);const s=i.styleDelegate,n=this.styleClass.getClassAttributes();let r=[];for(const e of n){const t=[];v(s.getNestedClassNamesRecursive(e,t)),(r.length<=0||r.length>t.length)&&(r=t)}for(const t of r)e.push(t);if(e.length>5){let e="JsView: Low performance warning: ";e+="It is recommended that the nesting of style classes in a single vue file should less than 6.",e+="You can avoid this risk by splitting the vue file.",console.warn(e)}return 0}updateClassDeclarations(e,t){t.clear();const i=this.lastCssClassKeySet,s=new Set,n=this.styleClass.getClassDeclarations(e);if(null!=n)for(const[e,r]of n){let n=this.setStyleInheritedProperty(e,r,!1,t);n==_.CssStyleNotChanged&&(n=0),E(n),s.add(e),i.delete(e)}let r=new P;for(const e of i){let i=this.setStyleInheritedProperty(e,r,!1,t);i==_.CssStyleNotChanged&&(i=0),E(i)}this.lastCssClassKeySet=s}addChangedStyleGroup(e){return this.style.addChangedStyleGroup(e)}getChangedStyleGroups(){return this.style.getChangedStyleGroups()}clearChangedStyleGroups(){this.style.clearChangedStyleGroups()}jsvValidHeight(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Height,0)}height(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Height,P.InvalidInt32)}left(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Left,0)}top(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Top,0)}jsvValidWidth(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Width,0)}width(){return Ii.STYLE_PROPERTY_GETTER(this,A.Layout.Width,P.InvalidInt32)}flexDirection(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.FlexDirection,P.InvalidInt32)}flexWrap(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.FlexWrap,P.InvalidInt32)}justifyContent(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.JustifyContent,P.InvalidInt32)}alignItems(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.AlignItems,P.InvalidInt32)}alignContent(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.AlignContent,P.InvalidInt32)}alignSelf(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.AlignSelf,P.InvalidInt32)}flexGrow(){return Ii.STYLE_PROPERTY_GETTER(this,A.Flex.FlexGrow,P.InvalidFloat)}backgroundColor(){return Ii.STYLE_PROPERTY_GETTER(this,A.Background.BackgroundColor,null)}backgroundImage(){return Ii.STYLE_PROPERTY_GETTER(this,A.Background.BackgroundImage,null)}borderRadius(){return Ii.STYLE_PROPERTY_GETTER(this,A.Background.BorderRadius,null)}backfaceVisibility(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.BackfaceVisibility,null)}borderImage(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.BorderImage,null)}borderImageWidth(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.BorderImageWidth,null)}borderImageOutset(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.BorderImageOutset,null)}display(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Display,null)}objectFit(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.ObjectFit,null)}opacity(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Opacity,1)}overflow(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Overflow,null)}perspective(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Perspective,0)}perspectiveOrigin(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.PerspectiveOrigin,null)}transform(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Transform,null)}transformOrigin(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.TransformOrigin,null)}transformStyle(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.TransformStyle,null)}visibility(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.Visibility,null)}zIndex(){return Ii.STYLE_PROPERTY_GETTER(this,A.Effect.ZIndex,0)}color(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.Color,L.Text.Color)}fontFamily(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.FontFamily,L.Text.FontFamily)}fontSize(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.FontSize,L.Text.FontSize)}fontStyle(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.FontStyle,L.Text.FontStyle)}fontWeight(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.FontWeight,L.Text.FontWeight)}lineHeight(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.LineHeight,L.Text.LineHeight)}textAlign(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.TextAlign,L.Text.TextAlign)}textOverflow(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.TextOverflow,L.Text.TextOverflow)}textShadow(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.TextShadow,L.Text.TextShadow)}webkitTextStroke(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.WebkitTextStroke,L.Text.WebkitTextStroke)}whiteSpace(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.WhiteSpace,L.Text.WhiteSpace)}wordWrap(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.WordWrap,L.Text.WordWrap)}direction(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.Direction,L.Text.Direction)}jsvTextEmoji(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextEmoji,L.Text.JsvTextEmoji)}jsvTextLatex(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextLatex,L.Text.JsvTextLatex)}jsvTextAlignMinWidth(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextAlignMinWidth,L.Text.JsvTextAlignMinWidth)}jsvTextVerticalAlign(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextVerticalAlign,L.Text.JsvTextVerticalAlign)}jsvTextLineAlign(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextLineAlign,L.Text.JsvTextLineAlign)}jsvTextInnerDirection(){return Ii.STYLE_PROPERTY_GETTER(this,A.Text.JsvTextInnerDirection,L.Text.JsvTextInnerDirection)}animation(){return Ii.STYLE_PROPERTY_GETTER(this,A.Motion.Animation,null)}transition(){return Ii.STYLE_PROPERTY_GETTER(this,A.Motion.Transition,null)}animationFillMode(){return Ii.STYLE_PROPERTY_GETTER(this,A.Motion.AnimationFillMode,null)}static OnVariableChanged(e,t,i,s){const n=e;if(t==A.Motion.Animation){const e=n.elementDelegate;x(null!=e,_.InvalidElement),n.addChangedStyleGroup(R.Motion.Name),s.add(e.nativeId)}else{const e=n.setStyleInheritedProperty(t,i,!1,s);if(e==_.CssStyleNotChanged)return e;v(e)}return 0}setStyleInheritedProperty(e,t,i,s){const n=this.styleClass.getManager();let r=_.UnknownError;if(k.IsVariable(e))r=n.setVariable(e,t,s);else if(k.IsVariable(t))r=n.watchVariable(this.styleClass,e,Ii.OnVariableChanged.bind(null,this),t.get(),s);else{if(r=this.style.setPropValue(e,t,i),r==_.CssStyleNotChanged)return r;if(v(r),e==A.Motion.Animation){i&&(r=n.unwatchVariable(this.styleClass,e),v(r));const t=this.style.getPropValue(e);t.is(P.DataType.Animation)&&(r=n.watchKeyframeVariables(this.styleClass,e,Ii.OnVariableChanged.bind(null,this),t.get().name,s),v(r))}}if(r==_.CssStyleNotChanged)return r;v(r);const a=this.elementDelegate;x(null!=a,_.InvalidElement),s.add(a.nativeId);const o=(e,t,i)=>{for(const s of t.childNodes)s.styleDelegate.style.hasPropValue(e)||o(e,s,i);const s=t instanceof Mi?t:null;null!=s&&0!=s.getTextContent().length&&(t.styleDelegate.addChangedStyleGroup(R.Text.Name),i.add(t.nativeId))};return Si.IsInheritedProp(e)&&o(e,a,s),0}getStyleInheritedProperty(e,t){if(t.reset(this.style.getPropValue(e)),0==t.is(P.DataType.Null))return 0;if(0==Si.IsInheritedProp(e))return _.CssStyleNotExists;const i=this.elementDelegate;x(null!=i,_.InvalidElement);const s=i.parentNode;if(null==s)return _.CssStyleNotExists;const n=s.styleDelegate.getStyleInheritedProperty(e,t);return n<0?n:0}getNestedClassNamesRecursive(e,t){const i=this.elementDelegate;if(x(null!=i,_.InvalidElement),0==this.styleClass.hasClassAttribute(e))return 0;const s=i.parentNode;x(null!=s,_.InvalidElement);v(s.styleDelegate.getNestedClassNamesRecursive(e,t));const n=this.styleClass.getClassNames();return n.length<=0||t.push(n),0}}class Ai{constructor(e){let t=-1;null==e?t=Ai.DataType.Null:Number(e)===e&&e%1==0?t=Ai.DataType.Int32:Number(e)===e&&e%1!=0?t=Ai.DataType.Float:"string"==typeof e&&(t=Ai.DataType.String),this.data=new Ai.DataInfo,e!=Ai.InvalidInt32&&e!=Ai.InvalidFloat&&e!=Ai.InvalidPointer?this.data.value=e:this.data.value=null,this.data.index=t}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}Ai.DataType=(T(Ei=class{},"DataType"),Ei.Null=0,Ei.Int32=1,Ei.Float=2,Ei.String=3,Ei),Ai.InvalidInt32=Number.MIN_VALUE,Ai.InvalidFloat=Number.NaN,Ai.InvalidPointer=null,Ai.DataInfo=class{constructor(){this.value=null,this.index=-1}};class Pi{constructor(){this._PersistMap=new Map,this._PersistMax=300,this._PersistIdx=0,this._PersistTrackList=new Array(this._PersistMax),this._TempMap=new Map,this._TempMax=50,this._TempIdx=0,this._TempTrackList=new Array(this._TempMax)}getPersistPack(e){return this._PersistMap.get(e)}putPersistPack(e,t){Pi._putPack(this._PersistMap,this._PersistTrackList,this._PersistIdx,e,t),this._PersistIdx=(this._PersistIdx+1)%this._PersistMax}getTempPack(e){return this._TempMap.get(e)}putTempPack(e,t){Pi._putPack(this._TempMap,this._TempTrackList,this._TempIdx,e,t),this._TempIdx=(this._TempIdx+1)%this._TempMax}static _putPack(e,t,i,s,n){let r=t[i];r&&(e.delete(r),t[i]=s),e.set(s,n)}}let Li=new Pi;var ki,Ri;class Fi{GetAnimationManager(){}GetRootView(){return new F.RootView}GetTextureManager(){return window.JsvCode.ForgeHandles.TextureManager}GetTextureSetting(e,t){return new F.ExternalTextureSetting(e,t)}GetRenderBridge(){return Fi.sRenderBridge}}Fi.ClipView=F.ClipView,Fi.LayoutView=F.LayoutView,Fi.NinePatchView=F.NinePatchView,Fi.ViewRoundCornerMask=F.ViewRoundCornerMask,Fi.AnimationListener=F.AnimationListener,Fi.sRenderBridge=F.sRenderBridge,Fi.TextureInstantLoad={AUTO:F.TextureInstantLoad.AUTO,SYNC:F.TextureInstantLoad.SYNC,ASYNC:F.TextureInstantLoad.ASYNC},Fi.FlexContainerProps=F.FlexContainerProps,Fi.FlexSetNames=F.FlexSetNames,Fi.FlexItemProps=F.FlexItemProps,Fi.Animation=class{constructor(){}Cancel(){this.animation.Cancel()}Enable(e){this.animation.Enable(e)}EnableDelay(e){this.animation.EnableDelay(e)}SetAnimationListener(e){this.animation.SetAnimationListener(e)}SetRepeat(e){this.animation.SetRepeat(e)}Start(e){this.animation.Start(e)}},Fi.AnimationCssKeyframes=class extends F.CssKeyframeAnimation{constructor(e,t){super(t.keyframes,t.duration,t.easing,t.width,t.height)}},Fi.AnimationCssTransition=(T(ki=class extends F.CssTransitionAnimation{constructor(e,t){let i=[];for(const e of t){let t={name:e.name,dur:e.duration,tf:e.easing?.Package(),dly:e.delay,from:e.from.data,to:e.to.data};i.push(t)}super(i)}},"AnimationCssTransition"),ki.Value=class{constructor(e){this.data=e}},ki),Fi.AnimationManager=(T(Ri=class{},"AnimationManager"),Ri.AnimationEnable={ReleaseAfterEndCallback:1,KeepTransform:2,AckFinalProgress:4,AckRepeat:8},Ri),Fi.AnimationEnable=F.AnimationEnable,Fi.TextUtils=class{static GetTextWidth(e,t,i,s,n,r){return F.sTextUtils.GetTextWidth(t,i,s,n,r)}static GetOneLineTextDrawWidth(e,t,i,s,n,r,a){F.sTextUtils.GetOneLineTextDrawWidth(t,i,s,n,r,a)}static BuildTextView(e,t,i,s,n,r,a,o,l,h,c){return F.sTextUtils.BuildTextView(e,t,i.GetStylePack(),s,{width:n,height:r},0!=a?a:null,o,l,0!=h,0!=c)}},Fi.TextStyleCache=class{constructor(){this.stylePackData={}}UpdateShadow(e,t,i,s){this.stylePackData.shadow={shadowOffsetX:e,shadowOffsetY:t,shadowBlur:i,shadowColor:s}}UpdateStroke(e,t){this.stylePackData.stroke={strokeWidth:e,strokeColor:t}}CommitChanges(){this.stylePackData.textColor=this.textColor,this.stylePackData.font=this.font,this.stylePackData.italic=this.italic,this.stylePackData.bold=this.bold,this.stylePackData.hAlign=this.hAlign,this.stylePackData.vAlign=this.vAlign,this.stylePackData.vAreaAlign=this.vAreaAlign,this.stylePackData.textOverflow=this.textOverflow,this.stylePackData.wordWrap=this.wordWrap,this.stylePackData.direction=this.direction,this.stylePackData.textInnerDirection=this.textInnerDirection,this.stylePackData.whiteSpace=this.whiteSpace;let e=JSON.stringify(this.stylePackData);this.stylePackData.textColor=null==this.stylePackData.textColor?void 0:this.stylePackData.textColor,this.stylePackData.font=null==this.stylePackData.font?void 0:this.stylePackData.font,this.stylePackData.italic=null==this.stylePackData.italic?void 0:this.stylePackData.italic,this.stylePackData.bold=null==this.stylePackData.bold?void 0:this.stylePackData.bold,this.stylePackData.hAlign=null==this.stylePackData.hAlign?void 0:this.stylePackData.hAlign,this.stylePackData.vAlign=null==this.stylePackData.vAlign?void 0:this.stylePackData.vAlign,this.stylePackData.vAreaAlign=null==this.stylePackData.vAreaAlign?void 0:this.stylePackData.vAreaAlign,this.stylePackData.textOverflow=null==this.stylePackData.textOverflow?void 0:this.stylePackData.textOverflow,this.stylePackData.wordWrap=null==this.stylePackData.wordWrap?void 0:this.stylePackData.wordWrap,this.stylePackData.direction=null==this.stylePackData.direction?void 0:this.stylePackData.direction,this.stylePackData.textInnerDirection=null==this.stylePackData.textInnerDirection?void 0:this.stylePackData.textInnerDirection,this.stylePackData.whiteSpace=null==this.stylePackData.whiteSpace?void 0:this.stylePackData.whiteSpace,"nowrap"===this.stylePackData.whiteSpace&&(this.stylePackData.wordWrap="none");let t=Li.getTempPack(e);t||(t=F.sTextStyleCache.StyleToPack(this.stylePackData),Li.putTempPack(e,t)),this.textStylePack=t}GetStylePack(){return this.textStylePack}},Fi.LayoutView.eVisibility={VIEW_HIDDEN:"hidden",VIEW_VISIBLE:"visible"};class Di{constructor(e,t,i){this.name=e,this.value=t,this.viewType=i}}class Vi{static MakeShared(e,t,i,s){const n=new s(e,t);return n.styleDelegate=new Ii(n,i),n}bindToForgeRootView(e){this.forgeMainView=e.GetRootView(),this.forgeMaskView=this.forgeMainView}insertForgeView(e,t,i){t.ensureForgeMaskView(e);const s=this.forgeMainView.InsertView(t.forgeMaskView,i?i.forgeMaskView:null);S(s||void 0===s),this.linkChild(e,t,i)}removeForgeView(e,t){this.forgeMainView.RemoveView(t.forgeMaskView),this.unlinkChild(e,t)}linkChild(e,t,i){this.childNodes.push(t),t.parentNode=this,(t.attrStore.extendClassAttributeDepth>0||t.hasExtendClassAttributeChildren)&&(this.hasExtendClassAttributeChildren=!0)}unlinkChild(e,t){const i=this.childNodes.indexOf(t);this.childNodes.splice(i,1),t.parentNode=void 0}moveForgeView(e,t,i,s){t.unlinkChild(e,i),this.linkChild(e,i,s),(t.forgeMaskView?t.forgeMaskView:t.forgeMainView).MoveChildView(i.forgeMaskView,this.forgeMainView,s?s.forgeMaskView:null),console.log("moving child")}reOrderForgeView(e,t,i){this.forgeMainView.ReOrderChildView(t.forgeMaskView,i?i.forgeMaskView:null)}addEventListener(e,t,i){if(null==this.eventInfoMap&&(this.eventInfoMap=new Map),0==this.eventInfoMap.has(e)){const i=new Vi.EventInfo;i.listener=t,this.eventInfoMap.set(e,i)}this.eventInfoMap.get(e).count++;const s=this.tryDealWithCustomEvent(e,i);return v(s),s}removeEventListener(e,t){if(null==this.eventInfoMap)return;if(0==this.eventInfoMap.has(e))return;const i=this.eventInfoMap.get(e);i.count--,i.count<=0&&this.eventInfoMap.delete(e)}setAttribute(e,t,i){let s=_.UnsupportedError;if(wi.StringStartsWith(t,"data-v-"))s=this.appendStyleClassAttribute(t),v(s),s=Vi.State.NeedRefreshCssClassAttribute;else if(wi.StringStartsWith(t,"class"))s=this.styleDelegate.setClassNames(i),v(s),s=Vi.State.NeedRefreshCssClass;else if(wi.StringStartsWith(t,"data-jsv-extend-class-attr")){const e=wi.StringToInt32(i);x(e!=P.InvalidInt32,_.InvalidArgument),s=this.setExtendClassAttributeDepth(e),v(s),s=Vi.State.NeedRefreshCssClass}else wi.StringStartsWith(t,"data-jsv-flex-container")&&(this.enableAsFlexContainer(),s=Vi.State.NeedRefreshCssClassAttribute);return v(s),s}getExtendClassAttributeChildren(e,t=0){if(this.attrStore.extendClassAttributeDepth==t)return e.add(this),0;if(0==this.hasExtendClassAttributeChildren)return 0;for(let i of this.childNodes){if(i.attrStore.extendClassAttributeDepth<=0&&0==i.hasExtendClassAttributeChildren)continue;v(i.getExtendClassAttributeChildren(e,t+1))}return 0}onCssStyleChanged(e){const t=this.styleDelegate.getChangedStyleGroups();return t.has(R.Layout.Name)&&this.onFlushViewLayout(e),t.has(R.Flex.Name)&&this.onFlushViewFlex(e),t.has(R.Background.Name)&&this.onFlushViewBackground(e),t.has(R.Effect.Name)&&this.onFlushViewEffect(e),t.has(R.Motion.Name)&&this.onFlushViewMotion(e),this.styleDelegate.clearChangedStyleGroups(),0}onAllChangeFinished(e){if(null==this.onAllChangeFinishTasks)return 0;for(const e of this.onAllChangeFinishTasks)e();return this.onAllChangeFinishTasks=void 0,0}handleAfterAllChangeFinish(e){null==this.onAllChangeFinishTasks&&(this.onAllChangeFinishTasks=[]),this.onAllChangeFinishTasks.push(e)}setForgeViewInnerProps(e,t,i,s){return 1==i?this.forgeMaskView?this.forgeMaskView.SetElementProp(e,t,s):this.forgeInnerPropsCacheList.push(new Di(t,s,i)):this.forgeMainView.SetElementProp(e,t,s),0}getElementView(e){return e?this.forgeMaskView:this.forgeMainView}setClientWidth(e,t){this.clientWidth=t}getClientWidth(e){return this.clientWidth<0?this.styleDelegate.width():this.clientWidth}setClientHeight(e,t){this.clientHeight=t}getClientHeight(e){return this.clientHeight>0?this.clientHeight:this.styleDelegate.jsvValidHeight()}constructor(e,t){this.childNodes=[],this.parentNode=void 0,this.forgeAnimation=null,this.eventInfoMap=void 0,this.onAllChangeFinishTasks=void 0,this.attrStore=new Vi.AttrStore,this.hasExtendClassAttributeChildren=!1,this.transitionSetInfo=new Vi.TransitionSetInfo,this.flexEnabled=!1,this.clientWidth=-1,this.clientHeight=-1,this.forgeInnerPropsCacheList=[],this.nativeId=t,this.forgeMainView=new Fi.LayoutView,this.forgeMaskView=this.forgeMainView}sendEvent(e,t){if(null==this.eventInfoMap||0==this.eventInfoMap.has(e))return;console.log("ElementDelegate.sendEvent(). event="+e);const i=this.eventInfoMap.get(e);let s=[];s.push(new Ai(this.nativeId)),s.push(new Ai(e));for(const e of t)s.push(e);i.listener(s)}getObjectFitClipStatus(e){return!1}flushMaskViewClip(e){if(null==this.forgeMaskView)return;const t=this.forgeMaskView instanceof Fi.ClipView?this.forgeMaskView:null;if(null==t)return;let i={left:0,top:0,width:0,height:0,autoSizeClip:!1,useScissors:!1};if(!this.getObjectFitClipStatus(i)){const e=this.styleDelegate.overflow();null!=e&&"hidden"==e&&(i.autoSizeClip=!0,i.useScissors=!0)}i.autoSizeClip?t.SetWholeSizeScissor(i.useScissors,!0):t.SetClipRect(i.left,i.top,i.width,i.height,i.useScissors)}onFlushViewLayout(e){if(0==this.styleDelegate.hasPropGroup(R.Layout.Name))return;const t=this.styleDelegate.left(),i=this.styleDelegate.top(),s=this.styleDelegate.jsvValidWidth(),n=this.styleDelegate.jsvValidHeight();this.forgeMaskView.ResetLayoutParams({x:t,y:i,width:s,height:n}),this.forgeMaskView!=this.forgeMainView&&this.forgeMainView.ResetLayoutParams({x:0,y:0,width:s,height:n})}onFlushViewFlex(e){if(!this.flexEnabled)return;const t=this.styleDelegate.flexDirection(),i=this.styleDelegate.flexWrap(),s=this.styleDelegate.justifyContent(),n=this.styleDelegate.alignItems(),r=this.styleDelegate.alignContent();let a=new Fi.FlexContainerProps;a.flexDirection=t!=P.InvalidInt32?t:a.flexDirection,a.flexWrap=i!=P.InvalidInt32?i:a.flexWrap,a.justifyContent=s!=P.InvalidInt32?s:a.justifyContent,a.alignItems=n!=P.InvalidInt32?n:a.alignItems,a.alignContent=r!=P.InvalidInt32?r:a.alignContent,this.forgeMainView.ResetFlexContainerCell(a);const o=this.styleDelegate.alignSelf(),l=this.styleDelegate.flexGrow();if(o==P.InvalidInt32&&isNaN(l))this.forgeMainView.ResetFlexItemCell(null);else{let e=new Fi.FlexItemProps;e.alignSelf=o!=P.InvalidInt32?o:e.alignSelf,e.flexGrow=isNaN(l)?e.flexGrow:l,this.forgeMainView.ResetFlexItemCell(e)}}onFlushViewBackground(e){if(0==this.styleDelegate.hasPropGroup(R.Background.Name))return;const t=e.GetTextureManager(),i=this.styleDelegate.backgroundColor(),s=this.styleDelegate.backgroundImage(),n=this.styleDelegate.borderRadius();let r,a=null;s&&s.urlPath&&0!=s.urlPath.length&&(s.type==P.BackgroundImageImpl.eType.LINEAR_GRADIENT?(a=t.GetNamedCachedTexture(s.urlPath),null==a&&(a=t.CreateCssGradientColorTexture(s.urlPath,s.linearGradient.fromX,s.linearGradient.fromY,s.linearGradient.toX,s.linearGradient.toY,s.linearGradient.stops))):a=t.GetImage(s.urlPath,null)),i&&0!=i.length&&(null==a?a=t.GetColorTextureCached(i):console.warn(`Ignore color(${i}) when image(${s?.urlPath}) set(id=${this.nativeId})`)),n&&(r=new Fi.ViewRoundCornerMask(n.topLeft,n.topRight,n.bottomLeft,n.bottomRight)),this.forgeMainView.ResetTexture(a,r)}onFlushViewEffect(e){if(0==this.styleDelegate.hasPropGroup(R.Effect.Name))return;const t=this.styleDelegate.visibility();let i=t&&"hidden"==t?Fi.LayoutView.eVisibility.VIEW_HIDDEN:Fi.LayoutView.eVisibility.VIEW_VISIBLE;"none"==this.styleDelegate.display()&&(i=Fi.LayoutView.eVisibility.VIEW_HIDDEN),this.forgeMaskView.SetVisibility(i),this.flushMaskViewClip(e);const s=this.styleDelegate.perspective();if(s>0){const e=this.styleDelegate.perspectiveOrigin();this.forgeMainView.SetPerspective(s,e)}const n=this.styleDelegate.backfaceVisibility();n&&this.forgeMainView.SetBackfaceVisibility("visible"==n);const r=this.styleDelegate.opacity();isNaN(r)||1==r||this.setOpacity(r),this.styleDelegate.transformStyle()&&this.forgeMainView.SetTransformStyle(this.styleDelegate.transformStyle()),this.forgeMaskView.ResetCssTransform(this.styleDelegate.transform(),this.styleDelegate.transformOrigin()),this.forgeMaskView.SetZIndex(this.styleDelegate.zIndex())}onFlushViewMotion(e){if(null!=this.forgeAnimation&&(this.forgeAnimation.Cancel(),this.forgeAnimation=null),0==this.styleDelegate.hasPropGroup(R.Motion.Name))return;let t="",i="";const s=this.styleDelegate.animation(),n=this.styleDelegate.transition(),r=this.styleDelegate.animationFillMode();if(null!=s&&null!=n&&console.warn("ElementDelegate","Cannot set both animation and transition on a single element at the same time."),null!=s){t="animation",i=s.name;const n=this.styleDelegate.getKeyframes(s.name);this.forgeAnimation=this.makeAnimation(e,s,n),"forwards"===r&&this.forgeAnimation.Enable(Fi.AnimationManager.AnimationEnable.KeepTransform)}if(null!=n&&null==this.forgeAnimation){const i=e.GetRenderBridge().GetSwapCount();if(this.transitionSetInfo.alreadySet&&this.transitionSetInfo.swapCount!=i)t="transition",this.forgeAnimation=this.makeTransition(e,n);else{for(const[e,t]of n.animationMap){let t=new P;const i=A.ToConst(e);null!=i&&(this.styleDelegate.getProperty(i,t),this.attrStore.transitionStyleMap.set(e,t))}this.transitionSetInfo.alreadySet||(this.transitionSetInfo.alreadySet=!0,this.transitionSetInfo.swapCount=i)}}else this.attrStore.transitionStyleMap.clear(),this.transitionSetInfo.swapCount=0,this.transitionSetInfo.alreadySet=!1;if(null!=this.forgeAnimation){const e=this.makeForgeAnimationListener(t,i);null!=e&&this.forgeAnimation.SetAnimationListener(e),this.forgeMaskView.StartAnimation(this.forgeAnimation)}}tryDealWithCustomEvent(e,t){if("jsv-getbound"===e){x(t.has("jsvtoken"),_.InvalidArgument);const i=t.get("jsvtoken"),s=()=>{const t=this;null!=t?t.getBoundingClientRect(e,i,t.forgeMainView):console.error("ElementDelegate.tryDealWithCustomEvent(), Element has been released.")};return this.handleAfterAllChangeFinish(s),Vi.State.NeedCallPostProcess}if("click"===e||"jsv-touchstart"===e||"jsv-touchend"===e){let t=this.convertTouchRecvFeature(e);const i=()=>{if(this.forgeMaskView.TouchRecvEnableAdd(t),!this.forgeMaskView.HasTapCallback()){let e=this,t=t=>{let i=e.convertTapEvent(t);0!=i.length&&e.sendEvent(i,[])};this.forgeMaskView.RegisterTapCallback(t)}};return this.handleAfterAllChangeFinish(i),Vi.State.NeedCallPostProcess}return 0}setOpacity(e){1!=e&&console.error("Error: not support opacity for performance issue(only <img>) value="+e)}static parsePerformAttr(e,t,i){return!(!wi.StringStartsWith(e,"data-jsv-perf-")||"data-jsv-perf-loadtex"!=e)&&(i.outTexInstantLoad="sync"==t?Fi.TextureInstantLoad.SYNC:"async"==t?Fi.TextureInstantLoad.ASYNC:Fi.TextureInstantLoad.AUTO,i.outParseResult=Vi.State.NeedRefreshCssClassAttribute,!0)}makeAnimation(e,t,i){if(null==t||null==i)return null;const s=this.styleDelegate.jsvValidWidth(),n=this.styleDelegate.jsvValidHeight();let r={keyframes:i,duration:t.duration,easing:t.timingFunction,width:s,height:n,left:this.styleDelegate.left(),top:this.styleDelegate.top()};const a=new Fi.AnimationCssKeyframes(e.GetAnimationManager(),r);return a.EnableDelay(t.delay),a.SetRepeat(t.iterationCount),a.Enable(Fi.AnimationEnable.ReleaseAfterEndCallback),a}makeTransition(e,t){if(null==t)return this.attrStore.transitionStyleMap.clear(),null;let i=[];for(const[e,s]of t.animationMap){if(null==s)continue;const t=this.attrStore.transitionStyleMap.get(e)??new P;let n=new P;const r=A.ToConst(e);if(x(r,null,["Failed makeTransition no support:"+e]),this.styleDelegate.getProperty(r,n),n.equals(t))continue;const a={name:e,duration:s.duration,easing:s.timingFunction,delay:s.delay,from:new Fi.AnimationCssTransition.Value,to:new Fi.AnimationCssTransition.Value,origin:""};if(t.is(P.DataType.Int32)){const e=t.get();a.from=new Fi.AnimationCssTransition.Value(e)}else if(t.is(P.DataType.Float)){const e=t.get();a.from=new Fi.AnimationCssTransition.Value(e)}else if(t.is(P.DataType.String)){const e=t.get();a.from=new Fi.AnimationCssTransition.Value(e)}if(n.is(P.DataType.Int32)){const e=n.get();a.to=new Fi.AnimationCssTransition.Value(e)}else if(n.is(P.DataType.Float)){const e=n.get();a.to=new Fi.AnimationCssTransition.Value(e)}else if(n.is(P.DataType.String)){const e=n.get();a.to=new Fi.AnimationCssTransition.Value(e)}e==A.Effect.Transform&&(a.origin=null!=this.styleDelegate.transformOrigin()?this.styleDelegate.transformOrigin():"center center"),i.push(a),this.attrStore.transitionStyleMap.set(e,n)}if(i.length>0){return new Fi.AnimationCssTransition(e.GetAnimationManager(),i)}return null}makeForgeAnimationListener(e,t){const i=new Fi.AnimationListener(null,null,null);return i.OnStart((()=>{const i=e+"start";this.sendEvent(i,[new Ai(t)])})),i.OnRepeat((i=>{const s=e+"iteration";this.sendEvent(s,[new Ai(t)])})),i.OnEnd((i=>{let s;this.forgeAnimation=null,s=i?e+"end":e+"cancel",this.sendEvent(s,[new Ai(t)])})),i}ensureForgeMaskView(e){if(this.forgeMainView.mParentView)return void console.log("ElementDelegate.ensureForgeMaskView(), Failed to ensure forge mask view, main view's parent is not null.");const t=this.styleDelegate.objectFit(),i=this.styleDelegate.overflow();if(null!=t||null!=i?(null!=this.forgeMaskView&&this.forgeMaskView!=this.forgeMainView&&console.error(Vi.TAG,"Jsview: jsvMaskView is conflicting."),this.forgeMaskView=new Fi.ClipView):null==this.forgeMaskView&&(this.forgeMaskView=this.forgeMainView),this.forgeMaskView!==this.forgeMainView&&(this.forgeMaskView.AddView(this.forgeMainView,0,0),this.flexEnabled&&this.forgeMaskView.TransChildFlexInfoPack(this.forgeMainView),this.forgeMaskView.MarkFlexChildrenFromChild0()),this.forgeInnerPropsCacheList.length>0){for(let t of this.forgeInnerPropsCacheList)this.forgeMaskView.SetElementProp(e,t.name,t.value);this.forgeInnerPropsCacheList=[]}}appendStyleClassAttribute(e){const t=e.replace("data-v-","");let i=0;i=parseInt(t,16);let s=this.styleDelegate.appendClassAttribute(i);v(s);const n=new Set;s=this.getExtendClassAttributeChildren(n),v(s);for(let e of n)s=e.styleDelegate.appendClassAttribute(i),v(s);return 0}setExtendClassAttributeDepth(e){if(e<=0)return 0;this.attrStore.extendClassAttributeDepth=e;let t=this;for(let i=0;i<e&&(t=t.parentNode,null!=t);i++);if(t){v(this.styleDelegate.mergeClassAttributes(t.styleDelegate))}return 0}convertObjectFit(e){return e?"fill"==e?"fill":"none"==e?"none":"cover"==e?"cover":"contain"==e?"contain":"scale-down"==e?"scale-down":"fill":"fill"}convertTapEvent(e){switch(e){case 1:return"click";case 4:return"jsv-touchstart";case 5:return"jsv-touchend";default:return""}}convertTouchRecvFeature(e){return"click"==e?1:"jsv-touchstart"==e?3:"jsv-touchend"==e?16:(console.error(`Error: Not touch feature ${e}`),0)}getBoundingClientRect(e,t,i){if(i){const s=i=>{this.sendEvent(e,[new Ai(i),new Ai(t)])};i.GetBoundingClientRect(s)}else{const i='{"status": -100, "error": target LayoutView is null})';this.sendEvent(e,[new Ai(i),new Ai(t)])}}enableAsFlexContainer(){this.flexEnabled=!0}}Vi.TAG="ElementDelegate",Vi.State={NeedRefreshCssClass:1,NeedRefreshCssClassAttribute:2,NeedCallPostProcess:3},Vi.EventInfo=class{constructor(){this.listener=void 0,this.count=0}},Vi.AttrStore=class{constructor(){this.transitionStyleMap=new Map,this.extendClassAttributeDepth=-1}},Vi.TransitionSetInfo=class{constructor(){this.swapCount=0,this.alreadySet=!1}};class Oi{static isRtl(e){for(let t=0;t<e.length;++t){let i=e.charCodeAt(t);if(32!==i)return i>=1536&&i<=1791}return!1}}class Mi extends Vi{setTextContent(e){this.textContent=e}getTextContent(){return this.textContent}onCssStyleChanged(e){const t=this.styleDelegate.getChangedStyleGroups();return(t.has(R.Text.Name)||t.has(R.Layout.Name)&&this.clientWidth!=this.styleDelegate.jsvValidHeight())&&this.onFlushViewText(e),t.has(R.Effect.Name)&&null!=this.styleDelegate.borderImage()&&this.onFlushViewBorder(e),super.onCssStyleChanged(e)}constructor(e,t){super(e,t),this.textContent="",this.instantLoadSet=Fi.TextureInstantLoad.AUTO}setAttribute(e,t,i){let s,n={};return Vi.parsePerformAttr(t,i,n)?(this.instantLoadSet=n.outTexInstantLoad,s=n.outParseResult,s):(s=super.setAttribute(e,t,i),s)}onFlushViewText(e){if(!this.textContent)return void(this.forgeContentView&&(this.forgeMainView.RemoveView(this.forgeContentView),this.forgeContentView=null));null==this.forgeContentView&&(this.forgeContentView=new Fi.LayoutView,this.forgeMainView.InsertView(this.forgeContentView),this.forgeMainView.MarkFlexSizeFromChild(this.forgeContentView)),this.forgeContentView.ClearViews(),this.clientWidth=0,this.clientHeight=0;let t=e.GetTextureManager(),i=new Fi.TextStyleCache;const s=this.styleDelegate.fontSize();let n=this.styleDelegate.lineHeight();n<=0&&(n=s>0?Math.ceil(1.3*s):14);const r=this.styleDelegate.jsvTextEmoji(),a=this.styleDelegate.jsvTextLatex(),o=this.styleDelegate.fontStyle(),l=this.styleDelegate.fontWeight(),h=this.styleDelegate.textShadow(),c=this.styleDelegate.webkitTextStroke();n>=0&&(i.vAlign="middle"),i.textColor=this.styleDelegate.color(),i.font=this.styleDelegate.fontFamily(),i.italic=o&&"italic"==o,i.bold=l&&"bold"==l,i.hAlign=this.styleDelegate.textAlign(),i.vAlign=this.styleDelegate.jsvTextLineAlign(),i.vAreaAlign=this.styleDelegate.jsvTextVerticalAlign(),i.textOverflow=this.styleDelegate.textOverflow(),h&&i.UpdateShadow(h.hShadow,h.vShadow,h.blur,h.color),c&&i.UpdateStroke(c.length,c.color),i.whiteSpace=this.styleDelegate.whiteSpace(),i.wordWrap=this.styleDelegate.wordWrap(),i.direction=this.styleDelegate.direction(),i.textInnerDirection=this.styleDelegate.jsvTextInnerDirection(),i.CommitChanges(t);const u=this.styleDelegate.height();let d=this.styleDelegate.width(),g=u!=P.InvalidInt32?u:0,f=d==P.InvalidInt32;if(f&&(d=Fi.TextUtils.GetTextWidth(t,this.textContent,i.font,s,i.bold,i.italic)),d<=0)return void console.error(Mi.TAG,"Failed to render text: %s, text width is invalid.");let m=d,p=this.styleDelegate.jsvTextAlignMinWidth();p>0&&m<p&&(m=p);const y=u==P.InvalidInt32||0==u,T=y?(e,t,i)=>{this.clientWidth=e,this.clientHeight=t}:null;let _=Math.floor(d*Fi.sRenderBridge.GetScreenInfo().scaleRatio);if(_>3e3){if(!f)return void console.error(`long text only support style.width=undefine. str=${this.textContent}`);console.log(`text too long, start to break down. width(${_})`),this.forgeTextView=new Fi.LayoutView;const e=[];Fi.TextUtils.GetOneLineTextDrawWidth(t,this.textContent,i.font,s,i.bold,i.italic,e);const o=e[0];let l=0;const h="unset"===i.textInnerDirection?Oi.isRtl(this.textContent):"rtl"===i.textInnerDirection;for(let c=1;c<e.length;c+=3){const u=e[c],d=e[c+1],f=e[c+2],m=this.textContent.slice(u,d);let p=Fi.TextUtils.BuildTextView(t,m,i,0==u?T:null,f,g,s,n,this.instantLoadSet,a,r);const y=h?o-l-f:l;this.forgeTextView.AddView(p,y,0,f,g),l+=f}this.clientWidth=o,this.forgeTextView.ResetLayoutParams({x:0,y:0,width:o,height:g})}else this.forgeTextView=Fi.TextUtils.BuildTextView(t,this.textContent,i,T,m,g,s,n,this.instantLoadSet,a,r),this.clientWidth=d;y&&this.forgeTextView.EnableAutoHeight(),this.forgeContentView.InsertView(this.forgeTextView),this.forgeContentView.MarkFlexSizeFromChild(this.forgeTextView)}ensureForgeMaskView(e){null!=this.styleDelegate.borderImage()&&(this.forgeMaskView=new Fi.NinePatchView),super.ensureForgeMaskView(e)}onFlushViewBorder(e){if(null==this.forgeMaskView)return;const t=this.styleDelegate.borderImage();if(null!=t)if(0==t.source.length)this.forgeMaskView.ResetTexture(null,null);else{const i=e.GetTextureManager(),s=t.source,n=i.GetImage(s,null);this.forgeMaskView.ResetTexture(n,null),this.forgeMaskView.WaitTextureToResize(!0);const r=(e,i,s)=>{const n=this.styleDelegate.borderImageWidth(),r=this.styleDelegate.borderImageOutset();if(null==this.forgeMaskView||null==t.slice||null==n||null==r)return void console.log(Mi.TAG,"Nine patch settings are not complete.");const a=this.forgeMaskView,o=Math.floor(e*n.top/t.slice.top),l=Math.floor(i*n.left/t.slice.left);a.SetImageDspSize(o,l);const h={start:r.left,width:Math.max(0,o-r.left-r.right)},c={start:r.top,width:Math.max(0,l-r.top-r.bottom)};a.SetPadding(h,c);const u=[{start:n?.left,width:Math.max(0,o-2*n.left)}],d=[{start:n.top,width:Math.max(0,l-2*n.top)}];a.SetRepeat(u,d),a.WaitTextureToResize(!1)};n.RegisterLoadImageCallback(r)}}getBoundingClientRect(e,t,i){this.styleDelegate.height()!=P.InvalidInt32&&this.styleDelegate.width()!=P.InvalidInt32||null==this.forgeTextView||(i=this.forgeTextView),super.getBoundingClientRect(e,t,i)}}Mi.TAG="DivDelegate";class Ni extends Vi{constructor(e,t){super(e,t)}}class Gi extends Ni{constructor(e,t){super(e,t)}}class Bi extends Vi{setAttribute(e,t,i){const s=()=>{const t=this;null!=t?t.loadImage(e,t.imgAttrStore.src):console.error("ElementDelegate.tryDealWithCustomEvent(), Element has been released.")};if("src"==t)return this.imgAttrStore.src!==i&&(this.imgAttrStore.sizeApplied=!1,this.imgAttrStore.imageWidth=0,this.imgAttrStore.imageHeight=0),this.imgAttrStore.src=i,this.handleAfterAllChangeFinish(s),Bi.State.NeedCallPostProcess;return 0==this.setTextureAttribute(e,t,i)?(this.handleAfterAllChangeFinish(s),Bi.State.NeedCallPostProcess):super.setAttribute(e,t,i)}onCssStyleChanged(e){const t=this.styleDelegate.getChangedStyleGroups();return(t.has(R.Layout.Name)||t.has(R.Effect.Name))&&this.onFlushViewImage(e),super.onCssStyleChanged(e)}constructor(e,t){super(e,t),this.imageInLoading=!1,this.forgeImageTexture=null,this.imageOperatorKey=null,this.loadCallbackSeq=0,this.imgAttrStore=new Bi.ImgAttrStore,this.forgeImageView=new Fi.LayoutView(null,"img"),this.forgeMainView.InsertView(this.forgeImageView),this.forgeMainView.MarkFlexSizeFromChild(this.forgeImageView)}setForgeViewInnerProps(e,t,i,s){return 1==i?super.setForgeViewInnerProps(e,t,i,s):(this.forgeImageView.SetElementProp(e,t,s),0)}getObjectFitClipStatus(e){if(0!=this.imgAttrStore.imageWidth&&0!=this.imgAttrStore.imageHeight){let t=this.convertObjectFit(this.styleDelegate.objectFit());if("fill"!=t){let i=this.forgeImageView.ApplyObjectFit(this.styleDelegate.jsvValidWidth(),this.styleDelegate.jsvValidHeight(),this.imgAttrStore.imageWidth,this.imgAttrStore.imageHeight,t);if(i)return e.left=i.x,e.top=i.y,e.width=i.width,e.height=i.height,e.autoSizeClip=!1,e.useScissors=!0,!0}}return!1}onFlushViewImage(e){if(0!=this.imgAttrStore.imageWidth&&0!=this.imgAttrStore.imageHeight&&!this.imgAttrStore.sizeApplied){this.flushMaskViewClip(e);let t=this.styleDelegate.jsvValidWidth(),i=this.styleDelegate.jsvValidHeight();0==t&&0!=i?t=this.imgAttrStore.imageWidth*i/this.imgAttrStore.imageHeight:0!=t&&0==i&&(i=this.imgAttrStore.imageHeight*t/this.imgAttrStore.imageWidth),this.clientWidth=t,this.clientHeight=i,this.imgAttrStore.sizeApplied=!0}const t=this.styleDelegate.jsvValidWidth(),i=this.styleDelegate.jsvValidHeight(),s={x:0,y:0,width:t>0?t:this.getClientWidth(e),height:i>0?i:this.getClientHeight(e)};this.forgeImageView.ResetLayoutParams({x:s.x,y:s.y,width:s.width,height:s.height})}setTextureAttribute(e,t,i){let s=_.UnsupportedError;return"dataJsvImgColorSpace"==t||"data-jsv-img-color-space"==t?(this.imageInLoading&&console.log("Failed to set attribute "+t+", this attribute must be set before src"),this.imgAttrStore.dataJsvColorSpace=i,s=0):"dataJsvImgScaledownTex"==t||"data-jsv-img-scaledown-tex"==t?(this.imageInLoading&&console.log("Failed to set attribute "+t+", this attribute must be set before src"),this.imgAttrStore.dataJsvScaleDownTex=""==i||"true"==i,s=0):"data-jsv-img-poster-image"==t&&(this.imageInLoading&&console.log("Failed to set attribute "+t+", this attribute must be set before src"),this.imgAttrStore.dataJsvPosterImage="true"==i,s=0),s}loadImage(e,t){if(null==t)return;this.imgAttrStore.imageWidth=0,this.imgAttrStore.imageHeight=0;let i=0,s=0;1==this.imgAttrStore.dataJsvScaleDownTex&&(i=this.styleDelegate.width(),0==i&&console.error("set dataJsvScaleDownTex while style.width is not set"),s=this.styleDelegate.height(),0==s&&console.error("set dataJsvScaleDownTex while style.height is not set"));let n=e.GetTextureManager();this.forgeImageTexture=n.GetImage2(this.imgAttrStore.src,i,s,this.imgAttrStore.dataJsvColorSpace,null,!1,this.imgAttrStore.dataJsvPosterImage),this.imageInLoading=!0;let r,a=++this.loadCallbackSeq;this.imageOperatorKey=this.forgeImageTexture.RegisterLoadImageCallback(((t,i,s)=>{a==this.loadCallbackSeq&&(this.imgAttrStore.imageWidth=t,this.imgAttrStore.imageHeight=i,this.imageInLoading=!1,this.onFlushViewImage(e),this.sendEvent("load",[new Ai(t),new Ai(i)]))}));let o=this.styleDelegate.borderRadius();o&&(r=new Fi.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight)),this.forgeImageView.ResetTexture(this.forgeImageTexture,r)}getClientWidth(e){const t=super.getClientWidth(e);return t<=0&&this.imgAttrStore.imageWidth>0?this.imgAttrStore.imageWidth:t}getClientHeight(e){const t=super.getClientHeight(e);return t<=0&&this.imgAttrStore.imageHeight>0?this.imgAttrStore.imageHeight:t}setOpacity(e){this.forgeImageView.SetViewOpacity(e)}}Bi.ImgAttrStore=class{constructor(){this.src=void 0,this.imageWidth=0,this.imageHeight=0,this.sizeApplied=!1,this.dataJsvColorSpace="RGBA_8888",this.dataJsvScaleDownTex=!1,this.dataJsvPosterImage=!1}};class Wi extends Ni{onCssStyleChanged(e){return this.styleDelegate.getChangedStyleGroups().has(R.Layout.Name)&&this.onFlushViewHole(e),super.onCssStyleChanged(e)}constructor(e,t){super(e,t)}onFlushViewHole(e){this.forgeMainView.Element.style.backgroundColor="#222222"}}class Hi{static SetForgeFrontToContext(e,t){e.forgeFront=t}static GetForgeFrontFromContext(e){return e.forgeFront}}class Yi{constructor(){this.elementDelegateMap=new Map,this.onEventListener=void 0,this.styleClassMgr=new Ci.Manager}static GetInstance(e){const t=Yi.PlatformBridgeInstanceMap.get(e);if(t)return t;const i=new class extends Yi{};return i.jsviewId=e,Yi.PlatformBridgeInstanceMap.set(e,i),Hi.SetForgeFrontToContext(i,new Fi),window.JsvCode.Debug||(window.JsvCode.Debug={}),window.JsvCode.Debug.PlatformBridge=[],window.JsvCode.Debug.PlatformBridge.push(i),i}static SetOnEventListener(...e){w(e.length>=2,null);const t=e[0],i=e[1],s=Yi.GetInstance(t);return s.onEventListener=new Yi.EventListener,s.onEventListener.jseFunction=i,null}static RunSyncTask(...e){x(e.length>=3,_.BadArgumentSize);const t=e[0],i=e[1],s=e[2],n=e,r=Yi.GetInstance(t),a=Hi.GetForgeFrontFromContext(r);let o=new Ai,l=r.runGetterTaskByType(a,i,s,n,o);if(l<0)throw new Error("Failed to run synctask, error: "+l);return Yi.CastFromUnionValue(o)}static RunLazyTaskList(...e){w(e.length>=2,null);const t=e[0],i=e[1],s=JSON.parse(i),n=Yi.GetInstance(t),r=Hi.GetForgeFrontFromContext(n),a=s,o=new Yi.TaskStash;for(const e of a){const t=e[0],i=e[1],s=e;if(o.removedIdSet.has(i))continue;let a=n.runSetterTaskByType(r,t,i,s,o);if(a==_.CssStyleNotChanged&&(a=0),a<0)throw new Error("Failed to run lazytask, error: "+a)}for(const e of o.removedIdSet)o.cssClassChangedIdSet.delete(e),o.cssStyleChangedIdSet.delete(e),o.postprocessingIdSet.delete(e);const l=n.syncCssClasses(o.cssClassChangedIdSet,o.cssStyleChangedIdSet);o.cssClassChangedIdSet.clear(),function(e,t,i=[]){C(e,_.GetErrorMessage(i),t)}(l,null);for(const e of o.cssStyleChangedIdSet){n.getElementById(e).onCssStyleChanged(r)}o.cssStyleChangedIdSet.clear();for(const e of o.postprocessingIdSet){n.getElementById(e).onAllChangeFinished(r)}return o.postprocessingIdSet.clear(),null}static CastFromUnionValue(e){let t;return e.is(Ai.DataType.String)||e.is(Ai.DataType.Int32)||e.is(Ai.DataType.Float)?t=e.get():e.is(Ai.DataType.Null)?t=null:w(!1,null),t}static AppendToJsonObject(e,t,i){let s,n;if(s=t,i.is(P.DataType.String)){const e=i.get();e&&(n=e)}else if(i.is(P.DataType.Int32)){n=i.get()}else if(i.is(P.DataType.Float)){n=i.get()}else i.is(P.DataType.Null)||v(_.CssStyleBadType);return e[s]=n,0}getElementById(e){let t=null;const i=this.elementDelegateMap.get(e);return null!=i&&(t=i),w(t,null),t}forgeElementGetter(e){let t=null;const i=this.elementDelegateMap.get(e);return null!=i&&(t=i),t}syncCssClasses(e,t){for(const i of e){const s=this.getElementById(i),n=[];this.syncCssClassesRecursive(s,n,e,t)}return this.styleClassMgr.clearStyleClassCache(),0}syncCssClassesRecursive(e,t,i,s){let n=new Set;e.styleDelegate.updateClassDeclarations(t,n);for(const e of n)s.add(e)}runSetterTaskByType(e,t,i,s,n){let r=_.BadTaskType;switch(t){case Yi.TaskType.CreateElement:r=this.createElement(e,i,s);break;case Yi.TaskType.BindElementToRootView:r=this.bindElementToRootView(e,i,s);break;case Yi.TaskType.InsertElementChild:r=this.insertElementChild(e,i,s);break;case Yi.TaskType.RemoveElementChild:r=this.removeElementChild(e,i,s,n);break;case Yi.TaskType.MoveElementChild:r=this.moveElementChild(e,i,s);break;case Yi.TaskType.ReOrderElementChild:r=this.reOrderElementChild(e,i,s);break;case Yi.TaskType.AddElementEventListener:r=this.addElementEventListener(e,i,s,n);break;case Yi.TaskType.RemoveElementEventListener:r=this.removeElementEventListener(e,i,s);break;case Yi.TaskType.SetElementText:r=this.setElementText(e,i,s,n);break;case Yi.TaskType.SetElementAttribute:r=this.setElementAttribute(e,i,s,n);break;case Yi.TaskType.SetForgeViewInnerProps:r=this.setForgeViewInnerProps(e,i,s);break;case Yi.TaskType.InsertKeyFrameDefine:r=this.insertKeyFrame(e,i,s);break;case Yi.TaskType.RemoveKeyFrameDefine:r=this.removeKeyFrame(e,i,s);break;case Yi.TaskType.DeclareStyleSheets:r=this.declareStyleSheets(e,i,s);break;case Yi.TaskType.UndeclareStyleSheets:r=this.undeclareStyleSheets(e,i,s);break;case Yi.TaskType.SetStyleProperty:r=this.setStyleProperty(e,i,s,n)}return v(r),0}runGetterTaskByType(e,t,i,s,n){let r=_.BadTaskType;switch(t){case Yi.TaskType.GetElementBoundingClientStyles:r=this.getElementBoundingClientStyles(e,i,s,n);case Yi.TaskType.GetStyleProperties:r=this.getStyleProperties(e,i,s,n);break;case Yi.TaskType.GetElementAttribute:r=this.getElementAttributes(e,i,s,n);break;case Yi.TaskType.GetRelativePosition:r=this.getRelativePosition(e,i,s,n)}return v(r),0}createElement(e,t,i){const s=i;x(s.length>=3,_.BadArgumentSize);const n=s[2];let r;return r="AUDIO"==n?Vi.MakeShared(e,t,this.styleClassMgr,Gi):"DIV"==n?Vi.MakeShared(e,t,this.styleClassMgr,Mi):"IMG"==n?Vi.MakeShared(e,t,this.styleClassMgr,Bi):"VIDEO"==n?Vi.MakeShared(e,t,this.styleClassMgr,Wi):Vi.MakeShared(e,t,this.styleClassMgr,Vi),this.elementDelegateMap.set(t,r),0}bindElementToRootView(e,t,i){x(i.length>=2,_.BadArgumentSize);return this.getElementById(t).bindToForgeRootView(e),0}insertElementChild(e,t,i){const s=i;x(s.length>=3,_.BadArgumentSize);const n=s[2],r=s.length>=4&&s[3]?s[3]:-1,a=this.getElementById(t),o=this.getElementById(n),l=r>0?this.getElementById(r):void 0;return a.insertForgeView(e,o,l),0}removeElementChild(e,t,i,s){const n=i;x(n.length>=3,_.BadArgumentSize);const r=n[2],a=this.getElementById(t),o=this.getElementById(r),l=(e,t,i)=>{for(const s of e.childNodes)l(s,t,i);e.styleDelegate.finalize(),t.add(e.nativeId),i.delete(e.nativeId)};return l(o,s.removedIdSet,this.elementDelegateMap),a.removeForgeView(e,o),0}moveElementChild(e,t,i){const s=i;x(s.length>=4,_.BadArgumentSize);const n=s[2],r=s[3],a=s.length>=5&&s[4]?s[4]:-1,o=this.getElementById(t),l=this.getElementById(n),h=this.getElementById(r),c=a>0?this.getElementById(a):void 0;return o.moveForgeView(e,l,h,c),0}reOrderElementChild(e,t,i){const s=i;x(s.length>=3,_.BadArgumentSize);const n=s[2],r=s.length>=4&&s[3]?s[3]:-1,a=this.getElementById(t),o=this.getElementById(n),l=r>0?this.getElementById(r):void 0;return a.reOrderForgeView(e,o,l),0}addElementEventListener(e,t,i,s){const n=i;x(n.length>=4,_.BadArgumentSize);const r=n[2],a=new Map;if("object"==typeof n[3]&&null!==n[3]){const e=n[3];for(const[t,i]of Object.entries(e))x("number"==typeof i,_.InvalidArgument),a.set(t,i)}const o=this.getElementById(t).addEventListener(r,((e,t,i)=>{S(Yi.GetInstance(e).onEventListener),setTimeout(t.bind(this,e,i),0)}).bind(this,this.jsviewId,((e,t)=>{const i=Yi.GetInstance(e);if(null==i.onEventListener)return;const s=i.onEventListener.jseFunction;let n=[];for(const e of t){const t=Yi.CastFromUnionValue(e);n.push(t)}s(...n)})),a);return v(o),o==Vi.State.NeedCallPostProcess&&s.postprocessingIdSet.add(t),0}removeElementEventListener(e,t,i){const s=i;x(s.length>=4,_.BadArgumentSize);const n=s[2],r=new Map;if("object"==typeof s[3]&&null!==s[3]){const e=s[3];for(const[t,i]of Object.entries(e))x("number"==typeof i,_.InvalidArgument),r.set(t,i)}return this.getElementById(t).removeEventListener(n,r),0}setElementText(e,t,i,s){const n=i;x(n.length>=3,_.BadArgumentSize);const r=n[2],a=this.getElementById(t),o=a instanceof Mi?a:null;return x(o,_.BadElementType),o.setTextContent(r),o.styleDelegate.addChangedStyleGroup(R.Text.Name),s.cssStyleChangedIdSet.add(o.nativeId),0}setElementAttribute(e,t,i,s){const n=i;x(n.length>=4,_.BadArgumentSize);const r=n[2],a=n[3],o=this.getElementById(t);let l=o.setAttribute(e,r,a);if(v(l),l==Vi.State.NeedRefreshCssClass)s.cssClassChangedIdSet.add(t);else if(l==Vi.State.NeedRefreshCssClassAttribute){s.cssClassChangedIdSet.add(t);const e=new Set;l=o.getExtendClassAttributeChildren(e),v(l);for(const t of e)s.cssClassChangedIdSet.add(t.nativeId)}else l==Vi.State.NeedCallPostProcess&&s.postprocessingIdSet.add(t);return 0}getElementBoundingClientStyles(e,t,i,s){const n=i;x(n.length>=4,_.BadArgumentSize);const r=n[3];x(r,_.InvalidElement);const a=JSON.parse(r),o=this.getElementById(t),l=o.styleDelegate,h={},c=a;for(const e of c){const t=e,i=A.ToConst(t);x(i,_.CssStyleBadName);let s=new P;if(i==A.Layout.Left){let e=l.left(),t=o.parentNode;for(;null!=t;){e+=t.styleDelegate.left(),t=t.parentNode}s=new P(e)}else if(i==A.Layout.Top){let e=l.top(),t=o.parentNode;for(;null!=t;){e+=t.styleDelegate.top(),t=t.parentNode}s=new P(e)}else{let e=l.getProperty(i,s);x(e>=0||_.CssStyleNotExists,e,["Failed to get style ",i])}v(Yi.AppendToJsonObject(h,i,s))}const u=JSON.stringify(h),d=new Ai(u);return s.reset(d),0}declareStyleSheets(e,t,i){const s=i;x(s.length>=2,_.BadArgumentSize);const n=s[2];return v(this.styleClassMgr.declareStyleSheets(n)),0}undeclareStyleSheets(e,t,i){const s=i;x(s.length>=2,_.BadArgumentSize);const n=s[2];return v(this.styleClassMgr.undeclareStyleSheets(n)),0}setStyleProperty(e,t,i,s){const n=i;x(n.length>=3,_.BadArgumentSize);const r=n[2],a=n.length>=4?n[3]:null,o=this.getElementById(t).styleDelegate,l=Ci.CastToStyleValue(a);let h=new Set;const c=o.setProperty(r,l,h);if(c==_.CssStyleNotChanged)return 0;v(c,["Failed to set style ",r]);for(const e of h)s.cssStyleChangedIdSet.add(e);return 0}getStyleProperties(e,t,i,s){const n=i;x(n.length>=4,_.BadArgumentSize);const r=n[3];x(r,_.InvalidElement);const a=JSON.parse(r),o=this.getElementById(t).styleDelegate,l={},h=a;for(const e of h){const t=e,i=A.ToConst(t);x(i,_.CssStyleBadName);const s=new P;let n=o.getProperty(i,s);x(n>=0||_.CssStyleNotExists,n,["Failed to get style ",i]),n=Yi.AppendToJsonObject(l,i,s),v(n)}const c=JSON.stringify(l),u=new Ai(c);return s.reset(u),0}getElementAttributes(e,t,i,s){const n=i;x(n.length>=3,_.BadArgumentSize);const r=n[3],a=this.getElementById(t);if("clientWidth"==r){const t=new Ai(a.getClientWidth(e));s.reset(t)}else if("clientHeight"==r){const t=new Ai(a.getClientHeight(e));s.reset(t)}return 0}getRelativePosition(e,t,i,s){const n=i;x(n.length>=3,_.BadArgumentSize);const r=n[3],a=this.getElementById(t),o=this.getElementById(r);let l=0,h=0,c=a.getClientWidth(e),u=a.getClientHeight(e),d=a;for(;null!=d&&d!=o;)l+=d.styleDelegate.left(),h+=d.styleDelegate.top(),d=d.parentNode;const g=new Ai(JSON.stringify({left:l,top:h,width:c,height:u}));return s.reset(g),0}setForgeViewInnerProps(e,t,i){const s=i;x(s.length>=5,_.BadArgumentSize);const n=s[2],r=s[3],a=s[4];return this.getElementById(t).setForgeViewInnerProps(e,n,r,a)}insertKeyFrame(e,t,i){const s=i;x(s.length>=4,_.BadArgumentSize);const n=s[2],r=s[3];return this.styleClassMgr.insertKeyFrame(n,r),0}removeKeyFrame(e,t,i){const s=i;x(s.length>=3,_.BadArgumentSize);const n=s[2];return this.styleClassMgr.removeKeyFrame(n),0}}Yi.TaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42},Yi.TaskStash=class{constructor(){this.removedIdSet=new Set,this.cssClassChangedIdSet=new Set,this.cssStyleChangedIdSet=new Set,this.postprocessingIdSet=new Set}},Yi.EventListener=class{constructor(){this.jseContext=null}},Yi.JsViewId=1,Yi.PlatformBridgeInstanceMap=new Map,Yi.RegisterOriginDocument=function(e){let t=e.createElement("style");t.type="text/css",t.innerHTML="\n * {\n margin: 0px;\n }\n div {\n position: absolute;\n background-size: 100% 100%;\n white-space: pre-wrap;\n pointer-events: none;\n z-index: 0; /* 所有元素都设置zindex以触发DOM为每个view创建单独的zIndex stack context,使和Forge native动作一致 */\n }\n video {\n position: absolute;\n background-size: 100% 100%;\n }\n img {\n position: absolute;\n pointer-events: none;\n }\n ";e.getElementsByTagName("Head")[0].appendChild(t),window.originDocument=e},window.JsvCode.BrowserPlatformDomBridge=Yi,y.LogF=function(e){},y.LogE=function(e){},y.LogW=function(e){},y.LogI=function(e){},y.LogD=function(e){},y.LogM=function(e){},y.ThrowError=function(e){throw new Error(e)},y.Assert=function(e){if(!e)throw new Error("ASSERT!!!!!")},y.EnableLog=function(e){y.LogM=console.log.bind(console),e>0&&(y.LogF=console.error.bind(console)),e>1&&(y.LogE=console.error.bind(console)),e>2&&(y.LogW=console.warn.bind(console)),e>3&&(y.LogI=console.log.bind(console)),e>4&&(y.LogD=console.debug.bind(console))},y.EnableLog(4),y.BaseActivity=class{},console.log("Log debug replace Forge.BaseActivity");{class Cs{constructor(e,t,i){this.PageName=e,this._FocusChild=null,this._LatestFocusChild=null,this.SubPages=[],this._ParentPage=null,this._ConsumeKeycodeUntilUp=-1,this.TouchDispatcher=null,this._Acc=.001,this._KeyLock=!1,this._CVSet=null,this._AutoShow=!1,this._IsShowing=!1,this._HostActivity=i,t&&this.SetContentView(t)}OnRenderFrame(){y.LogE("OnRenderFrame() MUST override")}OnKeyDown(e){return!1}OnKeyUp(e){return!1}DispatchKeyDown(e){if(this._KeyLock)return!0;var t=!1;return Cs.sLastFocusPage=this,this._FocusChild&&(t=this._FocusChild.DispatchKeyDown(e)),t||(t=this.OnKeyDown(e)),t}OnCustomEvent(e){return!1}BubbleCustomEvent(e){this.OnCustomEvent(e)||this._ParentPage&&this._ParentPage.BubbleCustomEvent(e)}DispatchKeyUp(e){if(this._KeyLock)return!0;var t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyUp(e)),t||(t=this.OnKeyUp(e)),t}PrintLastFocusPage(){var e="------"+this.PageName+"\n",t=this._ParentPage;return t&&(e+=t.PrintLastFocusPage()),e}OnMouseDown(e){return!1}EnableTouchDispatcher(){this.TouchDispatcher=new y.TouchDispatcher(this)}DisableTouchDispatcher(){this.TouchDispatcher=null}GetTouchView(){return null}GetSwipeParams(e,t,i){var s=void 0===i||0==i?this._Acc:i,n=e*e/2/s;e<0&&(n=-n);var r=t*t/2/s;return t<0&&(r=-r),{durationX:Math.floor(Math.abs(e/s)),durationY:Math.floor(Math.abs(t/s)),distanceX:n,distanceY:r}}OnTouch(e){return!1}DispatchTouch(e){var t=!1;return this.TouchDispatcher&&(t=this.TouchDispatcher.OnTouch(e)),t}LostTouchFocus(e){}OnJavaKey(e,t){return!0}OnPlatformKey(e,t){return!0}PassPlatformKey(e,t){if(this._KeyLock)return!1;var i=this.OnPlatformKey(e,t);return i&&(i=this.OnJavaKey(e,t)),i}DispatchJavaKey(e,t){if(e==this._ConsumeKeycodeUntilUp)return 1==t&&(this._ConsumeKeycodeUntilUp=-1),y.LogM("Consume Javakey until up keycode="+e+" keyaction="+t),!1;if(this._KeyLock)return!1;-1!=this._ConsumeKeycodeUntilUp&&(y.LogE("ERROR: Other key pressed before locked key release"),this._ConsumeKeycodeUntilUp=-1);var i=this._FocusChild,s=!0;return i&&(s=i.DispatchJavaKey(e,t)),s&&(s=this.PassPlatformKey(e,t)),i!=this._FocusChild&&0==t&&this.CosumeAllKeyUnitlUpForFocusChange(e),s}CosumeAllKeyUnitlUpForFocusChange(e){this._ParentPage?this._ParentPage.CosumeAllKeyUnitlUpForFocusChange(e):this._ConsumeKeycodeUntilUp=e}OnHostActivityGetFocus(){this._ConsumeKeycodeUntilUp=-1}IsFocus(){return!this._ParentPage||this._ParentPage._FocusChild==this}_IsLeafInChain(){return this.IsFocus()&&!this._FocusChild}SetParent(e,t){null!=e?(null!=t&&this.SetContentView(t),e instanceof y.BaseActivity&&(e=e.GetRootPageBase()),this._ParentPage=e,e.SubPages.push(this),this._HostActivity=e._HostActivity,e._IsShowing&&this._AutoShow&&this._OnShowInternal()):y.ThrowError("ERROR: parent is null")}SetParentPage(e){this.SetParent(e)}OnRemoveFromTree(){if(this._ParentPage=null,this.SubPages&&this.SubPages.length>0){for(let e of this.SubPages)e.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(e){e==this._FocusChild&&(this._FocusChild=null),e==this._LatestFocusChild&&(this._LatestFocusChild=null);for(var t=0;t<this.SubPages.length;t++)if(e==this.SubPages[t]){e._OnHideInternal(),this.SubPages.splice(t,1);break}}ClearSubPages(){this.SubPages=[],this._FocusChild=null,this._LatestFocusChild=null}GetParentPage(){return this._ParentPage}Focus(e){if(this.IsFocus()){if(!e)return void y.LogI("requestFocus(): Already focused name="+this.PageName);if(this._IsLeafInChain())return void y.LogI("requestFocus(): Already focused name="+this.PageName)}if(Cs.sChangingFocusLock)return void Cs.sDelayedFocusChanges.push(this);if(Cs.sChangingFocusLock=!0,this._ParentPage){for(var t,i=[],s=this;s._ParentPage&&!s.IsFocus();)i.push(s),s=s._ParentPage;t=e&&0==i.length?this._FocusChild:i[i.length-1]._ParentPage._FocusChild;for(var n=[];t;)n.push(t),t=t._FocusChild;for(var r=n.length-1;r>=0;r--)n[r]._BlurInternal();for(r=i.length-1;r>=0;r--)i[r]._FocusInternal();if(e)this._LatestFocusChild=null;else for(var a=i[0];a._LatestFocusChild&&null==a._FocusChild;)a._LatestFocusChild._FocusInternal(),(a=a._FocusChild)||y.ThrowError("ERROR: focus chain is broken")}Cs.sChangingFocusLock=!1;let o=Cs.sDelayedFocusChanges.length;if(o>0){let e=Cs.sDelayedFocusChanges;Cs.sDelayedFocusChanges=[];for(let t=0;t<o;t++)e[t].Focus()}}ReturnFocusToParent(){this._ParentPage&&(this.IsFocus()&&this._ParentPage.Focus(!0),this._ParentPage._FocusChild==this&&(this._ParentPage._FocusChild=null),this._ParentPage._LatestFocusChild==this&&(this._ParentPage._LatestFocusChild=null))}_FocusInternal(){this._ParentPage?(this._ParentPage._FocusChild=this,this._ParentPage._LatestFocusChild=this,this.OnFocus()):y.LogE("No dispatcher")}_BlurInternal(){this._ParentPage||y.LogE("No dispacher"),this._ParentPage._FocusChild==this?(this._ParentPage._FocusChild=null,this.OnBlur()):y.LogW("Not focus yet, page name="+this.PageName)}GetFocusChild(){return this._FocusChild}Hide(){this._AutoShow=!1,this._OnHideInternal()}Show(e){this._OnShowInternal(),e&&this.Focus()}OnFocus(){y.LogW("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){y.LogW("No overrided Page OnBlur event, page name="+this.PageName)}OnShow(){y.LogW("No overrided Page OnShow event, page name="+this.PageName)}OnHide(){y.LogW("No overrided Page OnHide event, page name="+this.PageName)}_OnShowInternal(){for(var e,t=0;t<this.SubPages.length;t++)(e=this.SubPages[t])._AutoShow&&e._OnShowInternal();this._IsShowing||(this._IsShowing=!0,this.OnShow())}_OnHideInternal(){for(var e,t=0;t<this.SubPages.length;t++)(e=this.SubPages[t])._IsShowing&&e._OnHideInternal();this._IsShowing&&(this._IsShowing=!1,this.OnHide())}GetMainView(){return null==this._CVSet&&(this._CVSet=new y.MainViewSetting(null,null)),this._CVSet}GetContentView(){return null==this._CVSet?null:this._CVSet.View}SetContentView(e){null!=e&&(null!=this._CVSet&&this._CVSet.View.BindedPageBase(null),this._CVSet=new y.MainViewSetting(e,null),e.BindedPageBase(this))}OnContentViewLostInternal(){this.OnContentViewLost()}OnContentViewLost(){}GetHostActivity(){return this._HostActivity}SetHostActivity(e){this._HostActivity=e}GetTextureManager(){return null!=this._HostActivity?this._HostActivity.GetTextureManager():null}SetAutoShow(e){this._AutoShow=e}KeyLock(){this._KeyLock=!0}UnKeyLock(){this._KeyLock=!1}}Cs.sLastFocusPage=null,Cs.sChangingFocusLock=!1,Cs.sDelayedFocusChanges=[],y.PageBase=Cs}y.RectArea=Y;F.FreeMoveActionBuilder=class{static SetSpeed(e,t){return{type:"setSpeed",params:{Xspeed:e,Yspeed:t}}}static SetAccel(e,t){return{type:"setAccel",params:{Xacc:e,Yacc:t}}}static StopMoving(){return{type:"stop"}}static StopMovingExact(e,t){return{type:"stopExtract",params:{x:e,y:t}}}static SetArrowSpeed(e,t,i,s){return{type:"setArrowSpeed",params:{arrowTargetX:e,arrowTargetY:t,absSpeedX:i,absSpeedY:s}}}static BrakeToPos(e,t){return{type:"breakToPos",params:{targetX:e,targetY:t}}}static TeleportTo(e,t,i){return{type:"teleportTo",params:{targetX:e,targetY:t,boolean:i}}}static teleportOffset(e,t){return{type:"teleportOffset",params:{offsetX:e,offsetY:t}}}};F.FreeMoveCmdPackBuilder=class{static InitActCmdPack(e,t,i,s){return{t:1,cmds:s,tkn:isNaN(i)?0:i,spdxye:isNaN(e)?0:e,accxye:isNaN(t)?0:t}}static InitStateCmdPack(e){return{t:2,cmd:e}}},F.FreeMoveExternType={},F.FreeMoveExternType.GroupType_FromAction=10,F.FreeMoveExternType.GroupType_ActionAssoc=10;F.FreeMoveConditionSet=class{static ReachPosition(e,t,i){return{type:"Position",params:{x:e,y:t,groupType:i.g,multiTimes:i.m,actionCheckCount:0}}}static ReachSpeed(e,t,i,s){return{type:"Speed",params:{Xspeed:e,Yspeed:t,direction:s,groupType:i.g,multiTimes:i.m,actionCheckCount:0}}}static AcrossPosition(e,t,i){return{type:"acrossPosition",params:{Xposition:e,Yposition:t,groupType:i.g,multiTimes:i.m,actionCheckCount:0}}}static AppendSubCmd(e,t){const i="cmds";e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(e.hasOwnProperty(i)||(e[i]=[]),e[i].push(t))}static SetCmdList(e,t){t instanceof Array&&(e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):e.cmds=t)}static SetCmdPackList(e,t){t instanceof Array&&(e.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):e.cmdPacks=t)}static InitCommonInfo(){return{g:0,m:!1,s:null}}static UpdateCommonInfo(e,t,i,s){e.g=t??0,e.m=i??!1,e.s=s??null}static AcrossSpeed(e,t,i){return{type:"acrossSpeed",params:{Xspeed:e,Yspeed:t,multiTimes:i.m,groupType:i.g,actionCheckCount:0}}}static OnNexusEvent(e,t,i){return{type:"onNexusEvent",params:{nexusId:e,eventType:t,multiTimes:i.m,groupType:i.g}}}static OnHitBlock(e,t){return{type:"onHitBlock",params:{GID:e,multiTimes:t.m,groupType:t.g,actionCheckCount:0}}}static OnNextTick(e,t){return{type:"onNextTick",params:{gap:e,multiTimes:t.m,groupType:t.g,actionCheckCount:0}}}static OnDragStart(e,t){return{type:"onDragStart",params:{multiTimes:e.m,groupType:e.g}}}static OnDragEnd(e,t){return{type:"onDragEnd",params:{multiTimes:e.m,groupType:e.g}}}static OnTouchDown(e,t){return{type:"onDragDown",params:{multiTimes:e.m,groupType:e.g}}}static OnTouchRelease(e,t){return{type:"onDragRelease",params:{multiTimes:e.m,groupType:e.g}}}static OnFlingStart(e,t){return{type:"onFlingStart",params:{multiTimes:e.m,groupType:e.g}}}static OnFlingProgress(e,t){return{type:"onFlingProgress",params:{multiTimes:e.m,groupType:e.g}}}static OnFlingEnd(e,t){return{type:"onFlingEnd",params:{multiTimes:e.m,groupType:e.g}}}static OnFlingCancel(e,t){return{type:"onFlingCancel",params:{multiTimes:e.m,groupType:e.g}}}static OnFlingDrop(e,t){return{type:"onFlingDrop",params:{multiTimes:e.m,groupType:e.g}}}static BoxPosition(e,t,i,s,n){return{type:"boxPosition",params:{multiTimes:n.m,groupType:n.g}}}};const $i=[];let ji=[];const Ui=new Map,Xi=()=>{if(ji.length>0){let e=[];for(let t=0;t<ji.length;t++)e.push(ji[t]);ji=[];for(const[e,t]of Ui)for(let e=0;e<t.length;e++)0==t[e].available&&t.splice(e,1);for(const[e,t]of Ui)0==t.length&&Ui.delete(e);for(let t=0;t<e.length;t++){const i=Ui.get(e[t].params.nexusEventId);for(let s=0;s<i.length;s++){let n=i[s].conditionItem.actions;i[s].conditionItem.params.eventType==e[t].params.eventType&&i[s].animationItem.doCommandInner(n)}}}};F.sRenderBridge.RegisterPerFrameCallback((()=>{for(let e=0;e<$i.length;e++)$i[e].animationRef.Invoking()}));const zi=(e,t,i,s)=>{var n=(t.y-e.y)*(s.x-i.x)-(e.x-t.x)*(i.y-s.y);if(0==n)return!1;var r=((t.x-e.x)*(s.x-i.x)*(i.y-e.y)+(t.y-e.y)*(s.x-i.x)*e.x-(s.y-i.y)*(t.x-e.x)*i.x)/n,a=-((t.y-e.y)*(s.y-i.y)*(i.x-e.x)+(t.x-e.x)*(s.y-i.y)*e.y-(s.x-i.x)*(t.y-e.y)*i.y)/n;return(r-e.x)*(r-t.x)<=0&&(a-e.y)*(a-t.y)<=0&&(r-i.x)*(r-s.x)<=0&&(a-i.y)*(a-s.y)<=0&&{x:r,y:a}};function Ki(e,t,i,s,n){return"Vertical"==n?!(e.y>s.y||t.y<i.y):"Horizontal"==n?!(e.x>s.x||t.x<i.x):void 0}F.FreeMoveAnimation=class extends F.AnimationDelegate{constructor(e){super(),this.targetElement=null,this.position={x:0,y:0},this.style={top:0,left:0},this.acc={accX:0,accY:0},this.speed={speedX:0,speedY:0},this.prevSpeed={speedX:0,speedY:0},this.Echo=[],this._EchoCallbackFunc=e,this.Invoking=this.Invoking.bind(this),this.recordCount=0,this.sweepCount=0,this.timerConditionList=[],this.speedConditionList=[],this.positionConditionList=[],this.envBlockConditionList=[],this.nexusEventList=[],this.envPosition={x:void 0,y:void 0},this.prePosition={x:void 0,y:void 0},this.realPosition={x:void 0,y:void 0},this.realStartPosition={x:void 0,y:void 0}}Start(e){super.Start(e),this.targetElement=e.Element,this.style.left=0,this.style.top=0,this.realStartPosition.x=this.targetElement.getBoundingClientRect().x,this.realStartPosition.y=this.targetElement.getBoundingClientRect().y,this.differenceX=this.realStartPosition.x-this.style.left,this.differenceY=this.realStartPosition.y-this.style.top,$i.push({animationRef:this})}Cancel(){super.Cancel();for(let e=0;e<$i.length;e++)$i[e].animationRef==this&&$i.splice(e,1)}conditionDeal(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i]);for(let e=0;e<t.length;e++)if(this.testOneCondition(t[e])&&0==t[e].params.multiTimes){if(0==t[e].params.actionCheckCount){t[e].params.actionCheckCount=this.sweepCount;const i=t[e].actions.filter((e=>null!==e));0==t[e].checked&&(t[e].checked=!0,this.doCommandInner(i))}}else if(this.testOneCondition(t[e])&&1==t[e].params.multiTimes){t[e].params.actionCheckCount=this.sweepCount;const i=t[e].actions.filter((e=>null!==e));t[e].checked=!0,this.doCommandInner([{type:"delActionAssocCondition",params:{}}]),this.doCommandInner(i)}}Invoking(){this.realPosition.x=this.targetElement.getBoundingClientRect().x,this.realPosition.y=this.targetElement.getBoundingClientRect().y,this.conditionDeal(this.timerConditionList),this.prevSpeed.speedX=this.speed.speedX,this.prevSpeed.speedY=this.speed.speedY,this.prePosition.x=this.position.x,this.prePosition.y=this.position.y,this.speed.speedX+=this.acc.accX,this.speed.speedY+=this.acc.accY,this.position.y+=this.speed.speedY,this.position.x+=this.speed.speedX,this.conditionDeal(this.speedConditionList);do{Xi()}while(ji.length>0);if(this.conditionDeal(this.positionConditionList),this.envBlockConditionList.length>0){this.conditionDeal(this.envBlockConditionList);do{Xi()}while(ji.length>0);if(this.prePosition.x+this.speed.speedX!==this.position.x||this.prePosition.y+this.speed.speedY!==this.position.y){do{Xi()}while(ji.length>0);this.conditionDeal(this.positionConditionList)}}if(this.targetElement.style.top=this.position.y+"px",this.targetElement.style.left=this.position.x+"px",this.Echo.length>0){let e={retList:this.Echo,xSpd:this.speed.speedX,ySpd:this.speed.speedY,xAcc:this.acc.accX,yAcc:this.acc.accY,xPos:this.position.x,yPos:this.position.y};this._EchoCallbackFunc(JSON.stringify(e)),this.Echo=[]}this.sweepCount++}ParsePackageList(e){let t=[];if(!e)return t;for(let i of e)switch(i.t){case 1:for(let e=0;e<i.cmds.length;e++)t.push({type:i.cmds[e].type,params:i.cmds[e].params});t.unshift({type:"FreshState",params:{spd:i.spdxye,acc:i.accxye}});break;case 2:const e={type:i.cmd.type,params:i.cmd.params};t.push(e)}return t}doCommand(e){const t=this.ParsePackageList(e);this.doCommandInner(t)}doCommandInner(e){for(let t of e)switch(t.type){case"setSpeed":this.setSpeed(t);break;case"setAccel":this.setAcc(t);break;case"stop":this.stopMoving();break;case"newCondition":this.newCondition(t);break;case"FreshState":this.FreshState(t);break;case"setOffset":this.setOffset(t);break;case"callback":t.params();break;case"fireEcho":this.EchoPush(t);break;case"delActionAssocCondition":this.clearGroupTypeCondition();break;case"removeAllCondtions":this.RemoveAllCondtions();break;case"jumpTo":this.jumpToPositon(t);break;case"setArrowSpeed":this.setArrowSpeed(t);break;case"stopExtract":this.stopExtract(t);break;case"fireNexusEvent":this.FireNexusEvent(t);case"breakToPos":this.breakToPos(t);break;case"teleportTo":this.teleportTo(t);break;case"teleportOffset":this.teleportOffset(t);break;case"revertWithHitBlock":this.revertWithHitBlock(t);break;case"removeByGroup":this.removeByGroup(t);break;default:console.error("item的type格式错误",t.type)}e=[]}testOneCondition(e){let t=!1;switch(e.type){case"Position":t=this.checkPosition(e);break;case"Speed":t=this.checkSpeed(e);break;case"acrossPosition":t=this.checkAcrossPosition(e);break;case"acrossSpeed":t=this.checkAcrossSpeed(e);break;case"onNextTick":t=this.onNextTick(e);break;case"onHitBlock":t=this.onHitBlock(e);break;case"boxPosition":t=this.onBoxPostion(e);break;default:console.log("未设定的item类型",e)}return t}FreshState(e){let t=e.params.spd,i=e.params.acc;switch(t){case 1:this.speed.speedY=0;break;case 2:this.speed.speedX=0;break;case 0:this.speed.speedY=0,this.speed.speedX=0}switch(i){case 1:this.acc.accY=0;break;case 2:this.acc.accX=0;break;case 0:this.acc.accY=0,this.acc.accX=0}}setSpeed(e){isNaN(e.params.Xspeed)||(this.speed.speedX=e.params.Xspeed),isNaN(e.params.Yspeed)||(this.speed.speedY=e.params.Yspeed)}setAcc(e){isNaN(e.params.Xacc)||(this.acc.accX=e.params.Xacc),isNaN(e.params.Yacc)||(this.acc.accY=e.params.Yacc)}teleportTo(e){const{targetX:t,targetY:i,boolean:s}=e.params;if(s){const t={params:{offsetX:e.params.targetX,offsetY:e.params.targetY}};this.teleportOffset(t)}else isNaN(t)||(this.targetElement.style.left=`${parseInt(this.style.left)+t}px`,this.position.x=t),isNaN(i)||(this.targetElement.style.top=`${parseInt(this.style.top)+i}px`,this.position.y=i)}teleportOffset(e){const{offsetX:t,offsetY:i}=e.params;isNaN(t)?this.position.x=parseInt(this.targetElement.style.left):(this.targetElement.style.left=`${parseInt(this.position.x)+t}px`,this.position.x+=t),isNaN(i)?this.position.y=parseInt(this.targetElement.style.top):(this.targetElement.style.top=`${parseInt(this.position.y)+i}px`,this.position.y+=i)}setArrowSpeed(e){const{arrowTargetX:t,arrowTargetY:i,absSpeedX:s,absSpeedY:n}=e.params;this.position.x>t&&(this.speed.speedX=-1*s),this.position.x<t&&(this.speed.speedX=1*s),this.position.y>i&&(this.speed.speedY=-1*n),this.position.y<i&&(this.speed.speedY=1*n),t&&i&&s&&null==n&&(this.speed.speedY=this.speed.speedX/(t/i)),t&&i&&null==s&&n&&(this.speed.speedX=this.speed.speedY/(i/t))}jumpToPositon(e){const{xPos:t,yPos:i}=e.params;this.position.x=t,this.targetElement.style.left=`${parseInt(this.style.left)+t}px`,this.position.y=i,this.targetElement.style.top=`${parseInt(this.style.top)+i}px`}RemoveAllCondtions(){if(this.timerConditionList=[],this.speedConditionList=[],this.positionConditionList=[],this.nexusEventList.length>0)for(let e=0;e<this.nexusEventList.length;e++)if(Ui.get(this.nexusEventList[e].params.nexusId)){const t=Ui.get(this.nexusEventList[e].params.nexusId);for(let i=0;i<t.length;i++)t[i].conditionItem.params.eventType==this.nexusEventList[e].params.eventType&&(t[i].available=!1)}}EchoPush(e){const{msg:t}=e.params;return this.Echo.push({rbTkn:0,eTkn:t}),!0}checkPosition(e){const t=e.params.x,i=e.params.y,s=this.acc.accX,n=this.acc.accY,r=this.speed.speedX,a=this.speed.speedY,o=this.position.x,l=this.position.y;if(void 0!==i){const e=i+this.differenceY;if(n>0){if(a>0){if(l>=i)return!0}else if(a<0)if(e<this.realStartPosition.y){if(l<=i)return!0}else if(l>=i)return!0}else{if(!(n<0))return a>0?l>=i:a<0?l<=i:l==i;if(a<0){if(l<=i)return!0}else if(a>0)if(e>this.realStartPosition.y){if(l>=i)return!0}else if(l<=i)return!0}}if(void 0!==t){const e=t+this.differenceX;if(s>0){if(r>0){if(o>=t)return!0}else if(r<0)if(e<this.realStartPosition.x){if(o<=t)return!0}else if(o>=t)return!0}else{if(!(s<0))return r>0?o>=t:r<0?o<=t:o==t;if(r<0){if(o<=t)return!0}else if(r>0)if(e>this.realStartPosition.x){if(o>=t)return!0}else if(o<=t)return!0}}}checkSpeed(e){const{Xspeed:t,Yspeed:i}=e.params;if(void 0!==t)if(this.acc.accX>0){if(this.speed.speedX>=t)return this.speed.speedX=t,!0}else if(this.acc.accX<0){if(this.speed.speedX<=t)return this.speed.speedX=t,!0}else if(this.speed.speedX==t)return!0;if(void 0!==i)if(this.acc.accY>0){if(this.speed.speedY>=i)return this.speed.speedY=i,!0}else if(this.acc.accY<0){if(this.speed.speedY<=i)return this.speed.speedY=i,!0}else if(this.speed.speedY==i)return!0}checkAcrossPosition(e){const t=e.params.x,i=e.params.y,s=this.position.x,n=this.position.y;return 0===this.counter&&t&&s===t&&i&&n===i?(this.counter++,!1):this.checkPosition(e)}checkAcrossSpeed(e){const{Xspeed:t,Yspeed:i}=e.params;return void 0!==t&&null!==this.prevSpeed.speedX&&(this.prevSpeed.speedX<t&&this.speed.speedX>=t||this.speed.speedX>t&&this.speed.speedX<=t)||void 0!==i&&null!==this.prevSpeed.speedY&&(this.prevSpeed.speedY<i&&this.speed.speedY>=i||this.speed.speedY>i&&this.speed.speedY<=i)}newCondition(e){let t,i=e.params.conditionSet;i.cmdPacks?t=this.ParsePackageList(i.cmdPacks):i.cmds&&(t=i.cmds);let s={type:i.type,params:i.params,actions:t,checked:!1};s.actions.some((e=>!(!e||"stopExtract"!==e.type)&&(e.params=s.params,!0))),"onNexusEvent"===s.type?(this.nexusEventList.push(s),Ui.get(s.params.nexusId)||Ui.set(s.params.nexusId,[]),Ui.get(s.params.nexusId).push({conditionItem:s,animationItem:this,available:!0})):s.type.includes("Speed")?this.speedConditionList.push(s):s.type.includes("Position")?this.testOneCondition(s)?this.doCommandInner(s.actions):this.positionConditionList.push(s):"onNextTick"===s.type?(this.recordCount=this.sweepCount,this.timerConditionList.push(s)):"onHitBlock"===s.type?this.envBlockConditionList.push(s):"onDragDown"===s.type||"onDragEnd"===s.type||"onDragRelease"===s.type||"onFlingStart"===s.type||"onFlingEnd"===s.type||"onFlingProgress"===s.type||"onTouchDown"===s.type||"onTouchRelease"===s.type||console.log("未被收录的条件类型",s)}setOffset(e){const{xOffset:t,yOffset:i}=e.params;isNaN(t)||(this.targetElement.style.left=`${parseInt(this.position.x)+t}px`,this.position.x=parseInt(this.position.x)+t),isNaN(i)||(this.targetElement.style.top=`${parseInt(this.position.y)+i}px`,this.position.y=parseInt(this.position.y)+i)}stopMoving(){this.acc.accX=0,this.acc.accY=0,this.speed.speedX=0,this.speed.speedY=0}stopExtract(e){this.acc.accX=0,this.acc.accY=0,this.speed.speedX=0,this.speed.speedY=0,Math.abs(this.position.x-e.params.x)<Math.abs(this.position.y-e.params.y)||e.params.x&&null==e.params.y?(this.position.x=e.params.x,this.targetElement.style.left=`${this.style.left+e.params.x}px`,this.targetElement.style.top=`${this.style.top+this.position.y}px`,this.style.left=parseInt(this.targetElement.style.left),this.style.top=parseInt(this.targetElement.style.top)):Math.abs(this.position.x-e.params.x)>Math.abs(this.position.y-e.params.y)||e.params.y&&null==e.params.x?(this.position.y=e.params.y,this.targetElement.style.top=`${this.style.top+e.params.y}px`,this.targetElement.style.left=`${this.style.left+this.position.x}px`,this.style.top=parseInt(this.targetElement.style.top),this.style.left=parseInt(this.targetElement.style.left)):Math.abs(this.position.x-e.params.x)==Math.abs(this.position.y-e.params.y)&&(this.position.x=e.params.x,this.position.y=e.params.y,this.targetElement.style.left=`${this.style.left+e.params.x}px`,this.targetElement.style.top=`${this.style.top+e.params.y}px`,this.style.left=parseInt(this.targetElement.style.left),this.style.top=parseInt(this.targetElement.style.top))}FireNexusEvent(e){ji.push(e)}onNextTick(e){return e.params.gap+this.recordCount==this.sweepCount}breakToPos(e){const{targetX:t,targetY:i}=e.params;if(t&&null==i){let e=2*(t-this.position.x)/this.speed.speedX+1;this.acc.accX=-this.speed.speedX/e}if(i&&null==t){let e=2*(i-this.position.y)/this.speed.speedY+1;this.acc.accY=-this.speed.speedY/e}if(t&&i){const e=t-this.position.x,s=i-this.position.y;let n=2*e/this.speed.speedX+1;this.acc.accX=-this.speed.speedX/n;let r=2*s/this.speed.speedY+1;this.acc.accY=-this.speed.speedY/r}const s={type:"newCondition",params:{conditionSet:{params:{x:t,y:i,groupType:10,multiTimes:!1},type:"Position",cmds:[{params:{groupType:10,multiTimes:!1,x:t,y:i},type:"stopExtract"}]}}};this.newCondition(s)}clearGroupTypeCondition(){this.timerConditionList.forEach(((e,t)=>{10===e.params.groupType&&this.timerConditionList.splice(t,1)})),this.speedConditionList.forEach(((e,t)=>{10===e.params.groupType&&this.speedConditionList.splice(t,1)})),this.positionConditionList.forEach(((e,t)=>{10===e.params.groupType&&this.positionConditionList.splice(t,1)})),this.nexusEventList.forEach(((e,t)=>{10===e.params.groupType&&this.nexusEventList.splice(t,1)}))}onHitBlock(e){let t=!1,i=li.getSensor(e.params.GID);const s=parseInt(this.targetElement.style.width),n=parseInt(this.targetElement.style.height),r=this.differenceX,a=this.differenceY,o=this.prePosition.x+r,l=this.prePosition.y+a,h=this.position.x+r,c=this.position.y+a;return i.forEach(((e,i)=>{if("left"==e.direction){const i={x:o+s,y:l+n},u={x:h+s,y:c+n};let d=zi({x:o+s,y:l},{x:h+s,y:c},{x:e.start.x,y:0},{x:e.end.x,y:1080}),g=zi(i,u,{x:e.start.x,y:0},{x:e.end.x,y:1080});!1!==d&&!1!==g&&Ki(e.start,e.end,d,g,"Vertical")&&(this.envPosition.x=d.x-s-r,this.envPosition.y=d.y-a,t=!0)}else if("top"==e.direction){const i={x:o+s,y:l+n},u={x:h+s,y:c+n};let d=zi({x:o,y:l+n},{x:h,y:c+n},{x:0,y:e.start.y},{x:1920,y:e.end.y}),g=zi(i,u,{x:0,y:e.start.y},{x:1920,y:e.end.y});!1!==d&&!1!==g&&Ki(e.start,e.end,d,g,"Horizontal")&&(this.envPosition.x=d.x-r,this.envPosition.y=d.y-n-a,t=!0)}else if("right"===e.direction){const i={x:o,y:l+n},s={x:h,y:c+n};let u=zi({x:o,y:l},{x:h,y:c},{x:e.start.x,y:0},{x:e.end.x,y:1080}),d=zi(i,s,{x:e.start.x,y:0},{x:e.end.x,y:1080});!1!==u&&!1!==d&&Ki(e.start,e.end,u,d,"Vertical")&&(this.envPosition.x=u.x-r,this.envPosition.y=u.y-a,t=!0)}else if("bottom"===e.direction){const i={x:o+s,y:l},n={x:h+s,y:c};let u=zi({x:o,y:l},{x:h,y:c},{x:0,y:e.start.y},{x:1920,y:e.end.y}),d=zi(i,n,{x:0,y:e.start.y},{x:1920,y:e.end.y});!1!==u&&!1!==d&&Ki(e.start,e.end,u,d,"Horizontal")&&(this.envPosition.x=u.x-r,this.envPosition.y=u.y-a,t=!0)}})),t}onBoxPostion(e){return!1}revertWithHitBlock(){this.position.x=this.envPosition.x,this.position.y=this.envPosition.y}removeByGroup(e){const t=e.params.groupType;this.timerConditionList.length>0&&this.timerConditionList.forEach(((e,i)=>{e.params.groupType==t&&this.timerConditionList.splice(i,1)})),this.speedConditionList.length>0&&this.speedConditionList.forEach(((e,i)=>{e.params.groupType==t&&this.speedConditionList.splice(i,1)})),this.positionConditionList.length>0&&this.positionConditionList.forEach(((e,i)=>{e.params.groupType==t&&this.positionConditionList.splice(i,1)}))}},F.FreeMoveActEvtType={ActEvent_ActFinish:1,ActEvent_Speed_X_Revert:2,ActEvent_Speed_Y_Revert:3};F.FreeMoveStateBuilder=class{static FireEcho(e){return{type:"fireEcho",params:{msg:e}}}static FireNexusEvent(e,t){return isNaN(e)||0==e?null:{type:"fireNexusEvent",params:{nexusEventId:isNaN(t)?0:t,eventType:e}}}static NewCondition(e){return{type:"newCondition",params:{conditionSet:e}}}static DelActionAssocCondition(){return{type:"delActionAssocCondition"}}static SetOffsetPos(e,t){return{type:"setOffset",params:{xOffset:e,yOffset:t}}}static SetPos(e,t){return{type:"jumpTo",params:{xPos:e,yPos:t}}}static RemoveAllCondtions(){return{type:"removeAllCondtions"}}static RevertWithHitBlock(){return{type:"revertWithHitBlock"}}static RemoveByGroup(e){return{type:"removeByGroup",params:{groupType:e}}}static SetHitWallOverflow(){return{type:"setHitWallOverflow"}}static TouchLockSwitch(e,t,i=-1){return{typ:"touchLockSwitch",set:{il:e,dir:t,ut:i}}}},y.sParticleManager=At,y.AnimationListener=Ke,y.TranslateAnimation=ct,y.RotateAnimation=ut,y.ScaleAnimation=dt,y.TranslateFrameAnimation=gt,y.ThrowAnimation=ft,y.AnimationEnable=mt,y.TextureSetting=be,y.ExternalTextureSetting=Ee,y.DragInfo=Le,y.DragSetting=Pe;let Ji=Tt;y.sRenderBridge=Ji;{let Is=[];function As(){if(Is.length>0){for(let e of Is)e.DoAttachToElement();Is=[]}}Ji.AddAfterSwapListener("NewDomView",(()=>{As()}));class Ps extends Fe{constructor(e,t){super(null,"jsv-element-proxy"),this.ProxiedView=null,this._DomNativeId=e,this._UseMaskView=t,this.DelayedCalls=[],this._OnReadyCallbacks=[],Is.push(this)}DoAttachToElement(){let e=y.DomElementGetter?.(this._DomNativeId);if(e){this.ProxiedView=e?.getElementView(this._UseMaskView),this.InvokeDelayCalls();for(const e of this._OnReadyCallbacks)e();this._OnReadyCallbacks=null}else console.log("domProxyView: attached element removed id="+this._DomNativeId)}RegisterOnProxyReady(e){this.ProxiedView?e():"function"==typeof e&&this._OnReadyCallbacks.push(e)}PushDelayCalls(e,t){this.DelayedCalls.push({name:e,args:t})}InvokeDelayCalls(){if(this.DelayedCalls.length>0)for(let e of this.DelayedCalls)this.ProxiedView[e.name].apply(this.ProxiedView,e.args)}HtmlCanAccessElement(){return null!=this.ProxiedView}}function Ls(e,t){let i=new Ps(e,t);return new Proxy(i,{get(e,t){if("string"!=typeof t||t.startsWith("_"))return e[t];if(null!=e.ProxiedView)return void 0!==e.ProxiedView[t]?"function"==typeof e.ProxiedView[t]?e.ProxiedView[t].bind(e.ProxiedView):e.ProxiedView[t]:Reflect.get(e,t);if("function"==typeof e[t]){if("RegisterOnProxyReady"===t)return e[t].bind(e);{let i=e;return(...e)=>{i.PushDelayCalls(t,e),y.sRenderBridge.RequestSwap()}}}console.warn(`proxy not ready to get prop(${t})`)},set(e,t){console.warn("no support set prop")}})}y.NewDomProxyView=Ls}y.LayoutView=class extends Fe{ResetTexture(e){e?super.ResetTexture(e.Texture,e.MaskSetting?.ImageTexture):super.ResetTexture(null)}AddView(e,t){let i=0,s=0,n=0,r=0;t&&(t instanceof y.LayoutParams?(i=t.MarginLeft,s=t.MarginTop,n=t.Width,r=t.Height):(i=isNaN(t.x)?0:t.x,s=isNaN(t.y)?0:t.y,n=isNaN(t.width)?0:t.width,r=isNaN(t.height)?0:t.height)),super.AddView(e,i,s,n,r)}},y.FilterView=Be,y.EditControlView=Ge,y.DragSetting=Pe,y.DragInfo=Le;y.TextureManager=class extends ge{RegisterLoadImageCallback(e,t,i){return super.RegisterLoadImageCallback(((e,s)=>{t({width:e,height:s},i)}))}},y.sViewStore=Ue,y.ViewInfo=Xe,y.ViewMask=Ce,y.ViewTextureMask=Ie,y.ViewRoundCornerMask=Ae;{class ks{constructor(e,t){this.OnBeginContact=e,this.OnEndContact=t}UpdateImpactCallback(e){this.OnBeginContact=e}UpdateLeaveCallback(e){this.OnEndContact=e}}y.sImpactSensorManager={StartTrace:(e,t,i,s)=>new ei(e,t,i,s),Callback:ks,AutoFroze:ti}}y.ImpactAutoFroze=ti,y.ImpactSensor=ei,y.VisibleSensor=oi,y.TextInputType=He;const qi=window.ForgeFront,Zi=Object.keys(qi);for(let Rs of Zi)Rs in y||(y[Rs]=qi[Rs]);export{y as default};
1
+ /* eslint-disable */ import{parseGIF as A,decompressFrames as e}from"gifuct-js";void 0===window.Forge?(window.Forge={},console.log("Define forge browser")):console.log("Define using JsView forge engine-js");var t,n,i,s,r,o,a,l,c,h,u,g,d,B,f,w=window.Forge;function p(A,e,t){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(A,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}class C{static ToString(A){if(A>=0)return"Success(0)";const e=Object.getOwnPropertyNames(C);for(const t of e)if(C[t]==A)return t+"("+A+")";return"UnknownError("+A+")"}static GetFormattedMethod(A){var e,t;e=A.indexOf(" ")+1,t=A.indexOf("(")-e;return A.substr(e,t)+"()"}static GetErrorMessage(A=[]){var e="";for(const t of A)e+=t;return e}static PrintErrorMessage(A,e,t=[]){const n=C.GetErrorMessage(t);console.error("ForgeDom","Error@ "+A+":"+e+", "+n)}constructor(){throw new Error("new ErrCode() is forbidden.")}}function m(A,e,t=[]){v(A,C.GetErrorMessage(t),e)}function F(A,e,t=[]){v(A,C.GetErrorMessage(t),e)}function y(A,e=[]){v(A,C.GetErrorMessage(e))}function Q(A,e=[]){T(A,C.GetErrorMessage(e),A)}function E(A,e,t=[]){T(A,C.GetErrorMessage(t),e)}function U(A,e,t=[]){T(A,C.GetErrorMessage(t),e)}function I(A,e=[]){T(A,C.GetErrorMessage(e))}function T(A,e,t=void 0){if(A<0)throw C.PrintErrorMessage("__FILE_NAME__","__LINE__",[C.ToString(A),". ",e]),new Error(t)}function v(A,e,t=void 0){if(!A)throw C.PrintErrorMessage("__FILE_NAME__","__LINE__",["ASSERT("+A+")",". ",e]),new Error(t)}C.UnknownError=-1,C.UnimplementedError=-2,C.UnsupportedError=-3,C.NotFoundError=-4,C.InvalidArgument=-5,C.BadArgumentSize=-6,C.InvalidElement=-100,C.BadElementType=-101,C.BadTaskType=-102,C.CssStyleNotExists=-120,C.CssStyleNotChanged=-121,C.CssStyleBadName=-122,C.CssStyleBadType=-123,C.CssClassNotChanged=-124,C.ForgeInsertView=-200;class x{static HasGetterMethod(A){switch(A){case x.Layout.Height:case x.Layout.Left:case x.Layout.Top:case x.Layout.Width:case x.Effect.ObjectFit:return!0;default:return!1}}static ToConst(A){return A==x.Layout.Height?x.Layout.Height:A==x.Layout.Left?x.Layout.Left:A==x.Layout.Top?x.Layout.Top:A==x.Layout.Width?x.Layout.Width:A==x.Flex.FlexDirection?x.Flex.FlexDirection:A==x.Flex.FlexWrap?x.Flex.FlexWrap:A==x.Flex.JustifyContent?x.Flex.JustifyContent:A==x.Flex.AlignItems?x.Flex.AlignItems:A==x.Flex.AlignContent?x.Flex.AlignContent:A==x.Flex.AlignSelf?x.Flex.AlignSelf:A==x.Flex.FlexGrow?x.Flex.FlexGrow:A==x.Background.BackgroundColor?x.Background.BackgroundColor:A==x.Background.BackgroundImage?x.Background.BackgroundImage:A==x.Background.BorderRadius?x.Background.BorderRadius:A==x.Background.JsvImageBlendType?x.Background.JsvImageBlendType:A==x.Effect.BackfaceVisibility?x.Effect.BackfaceVisibility:A==x.Effect.BorderImage?x.Effect.BorderImage:A==x.Effect.BorderImageWidth?x.Effect.BorderImageWidth:A==x.Effect.BorderImageOutset?x.Effect.BorderImageOutset:A==x.Effect.Display?x.Effect.Display:A==x.Effect.ObjectFit?x.Effect.ObjectFit:A==x.Effect.Opacity?x.Effect.Opacity:A==x.Effect.Overflow?x.Effect.Overflow:A==x.Effect.Perspective?x.Effect.Perspective:A==x.Effect.PerspectiveOrigin?x.Effect.PerspectiveOrigin:A==x.Effect.Transform?x.Effect.Transform:A==x.Effect.TransformOrigin?x.Effect.TransformOrigin:A==x.Effect.TransformStyle?x.Effect.TransformStyle:A==x.Effect.Visibility?x.Effect.Visibility:A==x.Effect.ZIndex?x.Effect.ZIndex:A==x.Text.Color?x.Text.Color:A==x.Text.FontFamily?x.Text.FontFamily:A==x.Text.FontSize?x.Text.FontSize:A==x.Text.FontStyle?x.Text.FontStyle:A==x.Text.FontWeight?x.Text.FontWeight:A==x.Text.LineHeight?x.Text.LineHeight:A==x.Text.TextAlign?x.Text.TextAlign:A==x.Text.TextOverflow?x.Text.TextOverflow:A==x.Text.TextShadow?x.Text.TextShadow:A==x.Text.WebkitTextStroke?x.Text.WebkitTextStroke:A==x.Text.WhiteSpace?x.Text.WhiteSpace:A==x.Text.WordWrap?x.Text.WordWrap:A==x.Text.Direction?x.Text.Direction:A==x.Text.JsvTextEmoji?x.Text.JsvTextEmoji:A==x.Text.JsvTextLatex?x.Text.JsvTextLatex:A==x.Text.JsvTextAlignMinWidth?x.Text.JsvTextAlignMinWidth:A==x.Text.JsvTextVerticalAlign?x.Text.JsvTextVerticalAlign:A==x.Text.JsvTextLineAlign?x.Text.JsvTextLineAlign:A==x.Text.JsvTextInnerDirection?x.Text.JsvTextInnerDirection:A==x.Motion.Animation?x.Motion.Animation:A==x.Motion.Transition?x.Motion.Transition:A==x.Motion.AnimationFillMode?x.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}x.Layout=(p(t=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),t.Height="height",t.Left="left",t.Top="top",t.Width="width",t),x.Flex=(p(n=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),n.FlexDirection="flexDirection",n.FlexWrap="flexWrap",n.JustifyContent="justifyContent",n.AlignItems="alignItems",n.AlignContent="alignContent",n.AlignSelf="alignSelf",n.FlexGrow="flexGrow",n),x.Background=(p(i=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),i.BackgroundColor="backgroundColor",i.BackgroundImage="backgroundImage",i.BorderRadius="borderRadius",i.JsvImageBlendType="JsvImageBlendType",i),x.Effect=(p(s=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),s.BackfaceVisibility="backfaceVisibility",s.BorderImage="borderImage",s.BorderImageWidth="borderImageWidth",s.BorderImageOutset="borderImageOutset",s.Display="display",s.ObjectFit="objectFit",s.Opacity="opacity",s.Overflow="overflow",s.Perspective="perspective",s.PerspectiveOrigin="perspectiveOrigin",s.Transform="transform",s.TransformOrigin="transformOrigin",s.TransformStyle="transformStyle",s.Visibility="visibility",s.ZIndex="zIndex",s),x.Text=(p(r=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),r.Color="color",r.FontFamily="fontFamily",r.FontSize="fontSize",r.FontStyle="fontStyle",r.FontWeight="fontWeight",r.LineHeight="lineHeight",r.TextAlign="textAlign",r.TextOverflow="textOverflow",r.TextShadow="textShadow",r.WebkitTextStroke="WebkitTextStroke",r.WhiteSpace="whiteSpace",r.WordWrap="wordWrap",r.Direction="direction",r.JsvTextEmoji="JsvTextEmoji",r.JsvTextLatex="JsvTextLatex",r.JsvTextAlignMinWidth="JsvTextAlignMinWidth",r.JsvTextVerticalAlign="JsvTextVerticalAlign",r.JsvTextLineAlign="JsvTextLineAlign",r.JsvTextInnerDirection="JsvTextInnerDirection",r),x.Motion=(p(o=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),o.Animation="animation",o.Transition="transition",o.AnimationFillMode="animationFillMode",o);class S{constructor(A){let e=-1,t=null;null==A?e=S.DataType.Null:Number(A)===A&&A%1==0?e=S.DataType.Int32:Number(A)===A&&A%1!=0?e=S.DataType.Float:"string"==typeof A||A instanceof String?e=S.DataType.String:A instanceof S.AnimationImpl?e=S.DataType.Animation:A instanceof S.CornerImpl?e=S.DataType.Corner:A instanceof S.RectImpl?e=S.DataType.Rect:A instanceof S.TextShadowImpl?e=S.DataType.TextShadow:A instanceof S.WebkitTextStrokeImpl?e=S.DataType.WebkitTextStroke:A instanceof S.TransitionImpl?e=S.DataType.Transition:A instanceof S.BorderImageImpl&&(e=S.DataType.BorderImage),A!=S.InvalidInt32&&A!=S.InvalidFloat&&A!=S.InvalidPointer?t=A:(e=S.DataType.Null,t=null),this.data=new S.DataInfo,this.data.index=e,this.data.value=t}toString(){let A=null;switch(this.data.index){case S.DataType.Null:return"";case S.DataType.Int32:case S.DataType.Float:return String(this.get());case S.DataType.String:A=this.get();break;case S.DataType.Animation:case S.DataType.Corner:case S.DataType.Rect:case S.DataType.TextShadow:case S.DataType.WebkitTextStroke:case S.DataType.Transition:case S.DataType.BorderImage:case S.DataType.BackgroundImage:A=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return A??""}is(A){return this.data.index==A}get(){return this.data.value}reset(A){this.data.value=A.data.value,this.data.index=A.data.index}equals(A){return this.data.value===A.data.value&&this.data.index===A.data.index}}S.Base=class{constructor(A){this.rawValue=A}},S.AnimationImpl=class extends S.Base{constructor(A){super(A),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},S.CornerImpl=class extends S.Base{constructor(A){super(A),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},S.RectImpl=class extends S.Base{constructor(A){super(A),this.top=0,this.right=0,this.left=0,this.bottom=0}},S.TextShadowImpl=class extends S.Base{constructor(A){super(A),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},S.WebkitTextStrokeImpl=class extends S.Base{constructor(A){super(A),this.length=0,this.color=void 0}},S.TransitionImpl=class extends S.Base{constructor(A){super(A),this.animationMap=new Map}},S.BorderImageImpl=class extends S.Base{constructor(A){super(A),this.source="",this.slice=null}},S.BackgroundImageImpl=(p(a=class extends S.Base{constructor(A){super(A),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),a.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},a.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},a),S.DataType=(p(l=class{},"DataType"),l.Null=0,l.Int32=1,l.Float=2,l.String=3,l.Animation=4,l.Corner=5,l.Rect=6,l.TextShadow=7,l.WebkitTextStroke=8,l.Transition=9,l.BorderImage=10,l.BackgroundImage=11,l),S.InvalidInt32=Number.MIN_VALUE,S.InvalidFloat=Number.NaN,S.InvalidPointer=null,S.DataInfo=class{constructor(){this.value=null,this.index=-1}};class b{}b.Text=(p(c=class{},"Text"),c.Color="#000000",c.FontFamily="黑体",c.FontSize=10,c.FontStyle="normal",c.FontWeight="normal",c.LineHeight=0,c.TextAlign="start",c.TextOverflow="clip",c.TextShadow=null,c.WebkitTextStroke=null,c.WhiteSpace="normal",c.WordWrap="normal",c.Direction="ltr",c.JsvTextEmoji=0,c.JsvTextLatex=0,c.JsvTextAlignMinWidth=0,c.JsvTextVerticalAlign="top",c.JsvTextLineAlign="middle",c.JsvTextInnerDirection="unset",c);class L{static FormatVariableName(A){return A.startsWith("--")?"var("+A+")":A.startsWith("var(--")?A:(F(!1,null),null)}static IsVariable(A){let e;if(A instanceof S){if(0==A.is(S.DataType.String))return!1;e=A.get()}else{if("string"!=typeof A)return!1;e=A}return e.startsWith("--")||e.startsWith("var(--")}constructor(){throw new Error("new StyleVariable() is forbidden.")}}class H{constructor(){throw new Error("new StyleGroup() is forbidden.")}}H.Layout=(p(h=class{constructor(){this.height=S.InvalidInt32,this.left=S.InvalidInt32,this.top=S.InvalidInt32,this.width=S.InvalidInt32}},"Layout"),h.Name="layout",h),H.Flex=(p(u=class{constructor(){this.flexDirection=S.InvalidInt32,this.flexWrap=S.InvalidInt32,this.justifyContent=S.InvalidInt32,this.alignItems=S.InvalidInt32,this.alignContent=S.InvalidInt32,this.alignSelf=S.InvalidInt32,this.flexGrow=S.InvalidFloat}},"Flex"),u.Name="flex",u),H.Background=(p(g=class{constructor(){this.backgroundColor=S.InvalidPointer,this.backgroundImage=S.InvalidPointer,this.borderRadius=S.InvalidPointer,this.JsvImageBlendType=S.InvalidInt32}},"Background"),g.Name="background",g),H.Effect=(p(d=class{constructor(){this.backfaceVisibility=S.InvalidPointer,this.borderImage=S.InvalidPointer,this.borderImageWidth=S.InvalidPointer,this.borderImageOutset=S.InvalidPointer,this.display=S.InvalidPointer,this.objectFit=S.InvalidPointer,this.opacity=S.InvalidFloat,this.overflow=S.InvalidPointer,this.perspective=S.InvalidInt32,this.perspectiveOrigin=S.InvalidPointer,this.transform=S.InvalidPointer,this.transformOrigin=S.InvalidPointer,this.transformStyle=S.InvalidPointer,this.visibility=S.InvalidPointer,this.zIndex=S.InvalidInt32}},"Effect"),d.Name="effect",d),H.Text=(p(B=class{constructor(){this.color=S.InvalidPointer,this.fontFamily=S.InvalidPointer,this.fontSize=S.InvalidInt32,this.fontStyle=S.InvalidPointer,this.fontWeight=S.InvalidPointer,this.lineHeight=S.InvalidInt32,this.textAlign=S.InvalidPointer,this.textOverflow=S.InvalidPointer,this.textShadow=S.InvalidPointer,this.webkitTextStroke=S.InvalidPointer,this.whiteSpace=S.InvalidPointer,this.wordWrap=S.InvalidPointer,this.direction=S.InvalidPointer,this.jsvTextEmoji=S.InvalidInt32,this.jsvTextLatex=S.InvalidInt32,this.jsvTextAlignMinWidth=S.InvalidInt32,this.jsvTextVerticalAlign=S.InvalidPointer,this.jsvTextLineAlign=S.InvalidPointer,this.jsvTextInnerDirection=S.InvalidPointer}},"Text"),B.Name="text",B),H.Motion=(p(f=class{constructor(){this.animation=S.InvalidPointer,this.transition=S.InvalidPointer,this.animationFillMode="none"}},"Motion"),f.Name="motion",f),void 0===window.ForgeFront&&(window.ForgeFront={},console.log("Define global ForgeFront browser"));let _=window.ForgeFront,k=null,P=null,D=null,R=null;function O(){return k}let M=null;class V{static getTextPixelWith(A,e){null===M&&(M=O().createElement("canvas"));const t=M.getContext("2d");t.font=e;const n=t.measureText(A);return Math.ceil(n.width)}static GetOneLineTextDrawWidth(A,e,t,n,i){const s=[];s.push(0);const r=n?"bold":"",o=i?"italic":"",a=Math.floor(2048/t);let l=0,c=0;for(;l<A.length;){const n=l+a;let i;if(l+a>=A.length)i=A.length-l;else{let e=A.lastIndexOf(" ",n);i=e>l?e-l+1:a}const h=A.slice(l,l+i),u=V.getTextPixelWith(h,`${r} ${o} ${t}px ${e}`);s.push(l),s.push(l+i),s.push(u),c+=u,l+=i}return s[0]=c,s}static GetTextWidth(A){let e="";A.bold&&(e="bold");let t="";return A.italic&&(t="italic"),this.getTextPixelWith(A.str,`${e} ${t} ${A.size}px ${A.font}`)}static GetTextRect(A,e,t,n,i){let s=Math.ceil(t.size*A.length/e.width)*i;s>e.height&&(s=e.height);return{width:e.width,height:s}}static GetCursorOffset(A,e,t,n,i,s,r){let o="";t.bold&&(o="bold");let a="";t.italic&&(a="italic");let l=0;if("right"===t.alignment){const n=this.getTextPixelWith(A,`${o} ${a} ${t.size}px ${t.font}`);(s-=e.width-n)<0&&(s=0)}let c=0;for(;s>=c&&l!==A.length;)c=this.getTextPixelWith(A.substr(0,l+1),`${o} ${a} ${t.size}px ${t.font}`),s>=c&&l++;return l}static GetCursorPosition(A,e,t,n,i,s){let r="";t.bold&&(r="bold");let o="";t.italic&&(o="italic");let a=0,l=A;if(s<A.length&&(l=l.substr(0,s)),a=this.getTextPixelWith(l,`${r} ${o} ${t.size}px ${t.font}`),"right"===t.alignment){const n=this.getTextPixelWith(A,`${r} ${o} ${t.size}px ${t.font}`);a=e.width-n+a}return{x:a,y:0}}}class G{constructor(A){this.state={},this.type=A,this._AutoPlay=!1}buildPlatformInstance(){this.Ele=O().createElement(this.type),this.Ele.addEventListener("loadedmetadata",(()=>{this.hasOwnProperty("onload")&&this.onload(),this.hasOwnProperty("onloadedmetadata")&&this.onloadedmetadata()}))}set autoplay(A){void 0!==A&&(this._AutoPlay=!0,this.Ele.paused&&setTimeout((()=>{this.play()}),0))}get currentTime(){return this.Ele.currentTime}set currentTime(A){this.Ele.currentTime=A,this.setState("seek",A,"number")}get duration(){return this.Ele.duration}set loop(A){this.Ele.loop="boolean"==typeof A||void 0!==A}get muted(){return this.getState("muted")}set muted(A){this.setState("muted",A,"boolean")}get paused(){return this.Ele.paused}get playbackRate(){return this.getState("playbackRate")}set playbackRate(A){this.setState("playbackRate",A,"number")}set src(A){this.setState("src",A,"string"),A&&this._AutoPlay&&setTimeout((()=>{this.play()}),0)}get style(){const A=this;return{set bottom(e){A.setState("style",`{"bottom":"${e}"}`,"string")},set left(e){A.setState("style",`{"left":"${e}"}`,"string")},set right(e){A.setState("style",`{"right":"${e}"}`,"string")},set top(e){A.setState("style",`{"top":"${e}"}`,"string")},set height(e){A.setState("style",`{"height":"${e}"}`,"string")},set width(e){A.setState("style",`{"width":"${e}"}`,"string")}}}get volume(){return this.getState("volume")}set volume(A){this.setState("volume",A,"number")}get playableDuration(){return this.Ele.playableDuration}addEventListener(A,e){this[`on${A}`]=e,this.Ele.addEventListener(A,(e=>{this[`on${A}`](e)}))}load(){this.Ele.load()}pause(){this.Ele.pause(),this.setState("paused",!0,"boolean"),this.hasOwnProperty("onpause")&&this.onpause()}play(){this.setState("paused",!1,"boolean"),this.Ele.play(),this.hasOwnProperty("onplay")&&this.onplay()}unload(){this.setState("paused",!0,"boolean"),this.Ele.pause(),this.Ele.removeAttribute("src"),this.Ele.load()}setState(A,e,t){typeof e===t?("playbackRate"==A?this.Ele.playbackRate=e:"muted"==A?this.Ele.muted=e:this.Ele.setAttribute(A,e),this.state[A]=e,console.log(`set ${A} = ${e}`)):console.warn(`invalid paramter type to set ${A}. value is not ${t}`)}getState(A){let e=this.state[A];return console.log(`get ${A} = ${e}`),void 0===e&&(e=this.Ele.getAttribute(A),this.state[A]=e),e}onEnd(A){this.setState("paused",!0,"boolean"),this.hasOwnProperty("onended")&&this.onended()}onError(A){this.hasOwnProperty("onerror")&&this.onerror(A.currentTarget.error.code)}mediaHandler(){return this.Ele}static setDesignMapWidth(A){"number"==typeof A?G.prototype.designMapWidth=A:console.warn(`Invalid paramter type to set ${A}. It is not number.`)}}G.prototype.designMapWidth=0;class K extends G{constructor(A){super(A),super.buildPlatformInstance(A)}}class N extends K{constructor(){super("audio")}}window._ExtAudio=N;class W extends K{constructor(){super("video"),this.state.height=0,this.state.width=0,this.state.aspectRatiow="origin"}get height(){return this.getState("height")}set height(A){this.style.height=A,this.state.height=A}get poster(){return console.log("Video.poster() TODO"),null}set poster(A){console.log("Video.poster() TODO")}get videoAspectRatio(){return this.getState("aspectRatio")}set videoAspectRatio(A){this.setState("aspectRatio",A,"string")}get videoHeight(){return this.Ele.videoHeight}get videoWidth(){return this.Ele.videoWidth}get width(){return this.getState("width")}set width(A){this.style.width=A,this.state.width=A}onLoad(A){super.onLoad(A)}setRotation(A,e,t,n){let i=function(){let i=`rotate3d(0, 0, 1, ${A}deg)`;if(90==A||-90==A){let A,s;if(n?(A=t/e,s=e/t):(A=this.videoHeight/this.videoWidth,s=this.videoWidth/this.videoHeight),isNaN(A)||isNaN(s))return!1;i+=` scale3d(${A}, ${s}, 1)`}return this.Ele.style.transform=i,this.Ele.parentNode&&(this.Ele.parentNode.style.overflow="hidden"),!0};i=i.bind(this);i()||this.Ele.addEventListener("loadedmetadata",(()=>{i()}))}}window._ExtVideo=W;class Y extends G{constructor(){super("video"),this._ReleaseCallbacks=[],this._ResourceTerminater=null,super.buildPlatformInstance()}setResourceTerminator(A){this._ResourceTerminater=A}hasTerminator(){return null!==this._ResourceTerminater}listenToRelease(A){this._ReleaseCallbacks.push(A)}unload(){super.unload(),null!==this._ResourceTerminater&&this._ResourceTerminater(),this._ResourceTerminater=null}releaseResource(){for(let A=0;A<this._ReleaseCallbacks.length;A++)this._ReleaseCallbacks[A]();null!==this._ResourceTerminater&&this._ResourceTerminater(),this._ResourceTerminater=null}confirmInitSetup(){}setRotation(){console.log("media.setRotation no implemented")}onPlatformDestroy(){}get videoHeight(){return this.Ele.videoHeight}get videoWidth(){return this.Ele.videoWidth}}window._ExtOVP=Y,window.Audio=N,window.Video=W,window.OffscreenVideoPlayer=Y;class X{constructor(A,e=!0){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!A)return;if(!0===A.startsWith("url")){const e=A.indexOf("(")+1,t=A.lastIndexOf(")");A=A.substring(e,t).trim()}if(!0===A.startsWith("data:"))return void(this.href=A);if(!0===A.startsWith("/")&&(A=window.location.origin+A),!0===A.startsWith("./")){const e=window.location.pathname.lastIndexOf("/");let t="";e>0&&(t=window.location.pathname.substring(0,e)),A=window.location.origin+t+A.substring(1)}if(this.href=A,!e)return;let t=this.href.indexOf("?");const n=t>0?this.href.substring(0,t):this.href;this.search=t>1?this.href.substring(t):"",t=n.indexOf("://"),this.protocol=t>0?n.substring(0,t+1):"";const i=t>1?n.substring(t+3):"";t=i.indexOf("/"),this.host=t>0?i.substring(0,t):"",this.pathname=t>1?i.substring(t):"",this.origin=t>0?`${this.protocol}//${this.host}`:"",t=this.host.indexOf(":"),this.hostname=t>0?this.host.substring(0,t):this.host,this.port=t>1?this.host.substring(t+1):"",console.log("create total parse URL, this=",this)}replace(A){this.href=A}}const J=window.AudioContext||window.webkitAudioContext;if(J){const Qi=new J;let Ei=0,Ui=0;class Ii{constructor(A,e,t){this._Context=A,this._BufferSource=e,this._Gain=t,this._BufferSource.connect(this._Gain),this._Gain.connect(this._Context.destination)}start(A,e,t){this._BufferSource.start(A,e,t)}setVolume(A){this._Gain.gain.setValueAtTime(A,this._Context.currentTime)}stop(A){this._BufferSource.stop(A)}}class Ti{constructor(){this._SoundBufferMap={},this._StreamMap={}}load(A,e,t,n){const i=new X(A).href,s=Ei++;return this._requestBuffer(i,((A,e)=>{0===A?Qi.decodeAudioData(e,(A=>{this._SoundBufferMap[s]=A,n(s,0)})):n(-1,-1)})),s}unload(A){delete this._SoundBufferMap[A]}autoPause(){}autoResume(){}play(A,e,t,n,i,s){if(this._SoundBufferMap[A]){const t=Ui++,n=Qi.createBufferSource();n.buffer=this._SoundBufferMap[A],n.playbackRate.value=s,n.onended=A=>{this.stop(t)},i>0&&(n.loop=!0);const r=Qi.createGain();r.gain.setValueAtTime(e,Qi.currentTime);const o=new Ii(Qi,n,r);return this._StreamMap[t]=o,console.log("loop test",(i+1)*this._SoundBufferMap[A].duration),o.start(0,0,(i+1)*this._SoundBufferMap[A].duration),t}return-1}pause(A){}resume(A){}stop(A){this._StreamMap[A]&&(this._StreamMap[A].stop(),delete this._StreamMap[A])}release(){this._SoundBufferMap={},this._StreamMap={}}setVolume(A,e,t){this._StreamMap[A]&&this._StreamMap[A].setVolume(e)}setPriority(A,e){}setRate(A,e){}setLoop(A,e){}_requestBuffer(A,e){const t=new XMLHttpRequest;t.open("GET",A,!0),t.responseType="arraybuffer",t.onload=()=>{200===t.status?(console.log("http request succeed"),e(0,t.response)):(console.error(`download audio ${A} failed.`,t.status),e(-1,null))},t.send()}}window.SoundPool=Ti}else window.SoundPool=null;var j;!function(A){A[A.EasingTypeIn=0]="EasingTypeIn",A[A.EasingTypeOut=1]="EasingTypeOut",A[A.EasingTypeInOut=2]="EasingTypeInOut",A[A.EasingTypeBezier=3]="EasingTypeBezier",A[A.EasingTypeBlink=4]="EasingTypeBlink",A[A.EasingTypeDeceleration=5]="EasingTypeDeceleration",A[A.EasingTypeSteps=6]="EasingTypeSteps"}(j||(j={}));class z{constructor(){}Package(){}_GetBasePackage(A){return{T:A,St:null}}}class Z{}Z.Circular={In:new class extends z{Package(){return this._GetBasePackage(j.EasingTypeIn)}},Out:new class extends z{Package(){return this._GetBasePackage(j.EasingTypeOut)}},InOut:new class extends z{Package(){return this._GetBasePackage(j.EasingTypeInOut)}},Deceleration:new class extends z{Package(){return this._GetBasePackage(j.EasingTypeDeceleration)}}};const $={STRING:Symbol("STRING"),FUNCTION:Symbol("FUNCTION"),LINE_FEED:Symbol("LINE_FEED"),LEFT_BRACE:Symbol("LEFT_BRACE"),RIGHT_BRACE:Symbol("RIGHT_BRACE")};const q={},AA={BASE:Symbol("BASE"),COLOR:Symbol("COLOR"),BOLD:Symbol("BOLD"),ITALIC:Symbol("ITALIC"),DECORATION:Symbol("DECORATION"),SUPERSCRIPT:Symbol("SUPERSCRIPT"),SUBSCRIPT:Symbol("SUBSCRIPT")};class eA{constructor(){this.style,this.styleValue=""}}class tA{constructor(){this.textStyle=new eA,this.childNodes=[],this.parent}}class nA extends tA{constructor(){super(),this.styleList=[],this.indexPair,this.lineFeedNode=!1,this.testValue}}function iA(A){if(null===A||0===A.length)return null;const e=function(A){const e=[];let t=0;for(;t<A.length;)if("\\"===A[t])if(t<A.length-1)if("\\"===A[t+1]||"{"===A[t+1]||"}"===A[t+1]){const A=[t+1,t+2],n={type:$.STRING,indexPair:A};e.push(n),t+=2}else{++t;const n=t;let i=t,s=!1;for(;t<A.length&&"{"!==A[t]&&"}"!==A[t];)" "!==A[t]&&(s=!0)," "===A[t]&&s?++t:i=++t;const r=[n,i],o={type:$.FUNCTION,indexPair:r};e.push(o)}else console.error("backslash at end.");else if("{"===A[t]){const A={type:$.LEFT_BRACE,indexPair:null};e.push(A),++t}else if("}"===A[t]){const A={type:$.RIGHT_BRACE,indexPair:null};e.push(A),++t}else if("\n"===A[t]){const A={type:$.LINE_FEED,indexPair:null};e.push(A),++t}else{const n=t;let i=t;for(;t<A.length&&"\\"!==A[t]&&"{"!==A[t]&&"}"!==A[t]&&"\n"!==A[t];)++t,i=t;const s=[n,i],r={type:$.STRING,indexPair:s};e.push(r)}for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.type===$.STRING){let i=!0;for(let e=n.indexPair[0];e<n.indexPair[1];e++)if(" "!==A[e]){i=!1;break}!(i&&t>0&&t<e.length-1)||e[t-1].type!==$.LEFT_BRACE&&e[t-1].type!==$.RIGHT_BRACE||e[t+1].type!==$.RIGHT_BRACE&&e[t+1].type!==$.LEFT_BRACE||e.splice(t,1)}}return e}(A),t=[],n=[];let i=0;for(;i<e.length;){const s=e[i];if(s.type===$.STRING){const A=new nA;n.push(A),A.indexPair=s.indexPair,A.textStyle.style=AA.BASE,t.push(A)}else if(s.type===$.LINE_FEED){const A=new nA;n.push(A),A.lineFeedNode=!0}else if(s.type===$.LEFT_BRACE)t.push(q);else if(s.type===$.RIGHT_BRACE)if(t.length>0){const A=[];let e=t.pop();for(;e!==q&&(A.push(e),t.length>0);)e=t.pop();if(t.length>0){const e=t[t.length-1];if(e.textStyle.style===AA.BASE)console.error("lack of function");else for(;A.length>0;){const t=A.pop();e.childNodes.push(t),t.parent=e}}else console.error("lack of function")}else console.error("extra }");else if(s.type===$.FUNCTION){const n=A.substring(s.indexPair[0],s.indexPair[1]),r=new tA;switch(n){case"textcolor":if(i<e.length-3){r.textStyle.style=AA.COLOR;const t=e[i+1],n=e[i+2],s=e[i+3];t.type===$.LEFT_BRACE&&n.type===$.STRING&&s.type===$.RIGHT_BRACE?(r.textStyle.styleValue=A.substring(n.indexPair[0],n.indexPair[1]),i+=3):console.error("textcolor param format error.")}else console.error("textcolor param format error.");break;case"textb":r.textStyle.style=AA.BOLD;break;case"texti":r.textStyle.style=AA.ITALIC;break;case"textdecoration":if(i<e.length-3){r.textStyle.style=AA.DECORATION;const t=e[i+1],n=e[i+2],s=e[i+3];t.type===$.LEFT_BRACE&&n.type===$.STRING&&s.type===$.RIGHT_BRACE?(r.textStyle.styleValue=A.substring(n.indexPair[0],n.indexPair[1]),i+=3):console.error("textdecoration param format error.")}else console.error("textdecoration param format error.");break;case"textsup":r.textStyle.style=AA.SUPERSCRIPT;break;case"textsub":r.textStyle.style=AA.SUBSCRIPT;break;default:console.error(`undefined style type: ${n}`)}t.push(r)}++i}return n.forEach(((A,e,t)=>{let n=A.parent;for(;n;)A.styleList.push(n.textStyle),n=n.parent})),{nodeList:n,text:A}}class sA{static setTimeout(A,e){return window.setTimeout(A,e)}static clearTimeout(A){window.clearTimeout(A)}static setInterval(A,e){return window.setInterval(A,e)}static clearInterval(A){window.clearInterval(A)}}class rA{}rA.F=console.error.bind(console),rA.E=console.error.bind(console),rA.W=function(A){},rA.I=function(A){},rA.D=function(A){},rA.M=function(A){},rA.Assert=function(A){if(!A)throw new Error("ASSERT!!!!!")},rA.ThrowError=function(A){throw new Error(A)};class oA{constructor(A,e,t,n){this.x="number"==typeof A?A:0,this.y="number"==typeof e?e:0,("number"!=typeof t||t<0)&&(t=0),this.width=t,("number"!=typeof n||n<0)&&(n=0),this.height=n}Equals(A){return null!==A&&(A.x===this.x&&A.y===this.y&&A.width===this.width&&A.height===this.height)}}class aA{FormatRectArea(A){let e=null;if(A instanceof oA)e=A;else if("object"==typeof A&&null!==A){if(isNaN(A.width)||isNaN(A.height))throw new Error("ERROR: target_size format should be {width:XXXX, height:XXXX}");e=new oA(0,0,A.width,A.height)}return e}}let lA;function cA(){return lA||(lA=new aA),lA}let hA=new class{constructor(){this.EnableTextureTracer=!1}SetTextureTracer(A){}GetTextureTracer(){return null}};window.ForgeDebug=hA;let uA,gA,dA,BA=new class{constructor(){this._IdTokenGenerator=66,this._CheckExpiredTime=0}CreateTextureHeadStatus(){const A=new fA(this,0);return A.DoRef(),A}CreateTextureStatus(){const A=new fA(this,0);return A.DoRef(),A}CreateTexture(){const A=new fA(this,this._IdTokenGenerator++);return A.DoRef(),A}RecycleTexture(A){}CreateResourceInfo(A,e){return{Id:0,Nam:e,Set:null,TmId:A,NdLd:0}}AppendFontStatusIfNeed(A,e){const t={};t.Fo=e.font,t.Si=e.size,t.It=e.italic,t.Bo=e.bold,t.Al=e.alignment,t.Ve=e.vertical_align,t.Vaa=e.vertical_area_align,t.Tx=e.textColour,t.Ba=e.backgroundColour,t.En=e.enableBlend,t.Sh=e.shadow,e.stroke_width?t.Stk=e.stroke_width:t.Stk=-1,A.FO=JSON.stringify(t)}};class fA{constructor(A,e){this.Width=0,this.Height=0,this.Stack=void 0,this.IdToken=e,this._Manager=A,this._Reference=0,this._SyncingResourceInfo=null,this._OnloadCallbacks=[],this._OnloadCallbacksSize=0,this._OnloadCallbackIdGenerator=1,this.Unloaded=!0,this.LoadTime=0,this.RequireTime=0,this.ForceExpire=!1,this.NeedCheckExpired=!1;if(hA.GetTextureTracer()){const A=new Error;this.Stack=A.stack}}DoRef(){this._Reference++}UndoRef(){this._Reference--,0===this._Reference&&(this._OnloadCallbacksSize>0&&(this._OnloadCallbacks=[]),this._Manager.RecycleTexture(this))}SetResourceInfo(A){A.Id=this.IdToken,this._SyncingResourceInfo=A}GetResourceInfo(){return this._SyncingResourceInfo}ReadSyncInfo(){const A=this._SyncingResourceInfo;return this._SyncingResourceInfo=null,A}RegisterOnloadCallback(A){const e=this._OnloadCallbackIdGenerator++;return this._OnloadCallbacks[`${e}`]=A,this._OnloadCallbacksSize++,null!==this._SyncingResourceInfo&&(this._SyncingResourceInfo.NdLd=1),e}UnregisterOnloadCallback(A){delete this._OnloadCallbacks[`${A}`],this._OnloadCallbacksSize--}InvokeOnloadCallbacks(A,e){if(this._OnloadCallbacksSize>0)for(const t in this._OnloadCallbacks)this._OnloadCallbacks.hasOwnProperty(t)&&this._OnloadCallbacks[t](A,e)}IsLoaded(){return 0!==this.LoadTime&&!this.Unloaded}}class wA{constructor(){this._OnRequesting=!1,this._ScreenInfo={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this._FrameLoopFunc=null,this._CallbacksPerFrame=new Set,this._WillSwapCallbacks=new Map,this._DoWillSwapCallback=this._OnWillSwap.bind(this),this._AfterSwapCallbacks=new Map,this._DoAfterSwapCallback=this._OnAfterSwap.bind(this)}BeginHtmlFrameLoop(){null===this._FrameLoopFunc&&window.requestAnimationFrame&&(this._FrameLoopFunc=this._OnAnimation.bind(this),window.requestAnimationFrame(this._FrameLoopFunc))}_OnAnimation(){let A=!1;if(Tt.sViewSensorManager?.HtmlHasActiveSensor()&&(Tt.sViewSensorManager?.HtmlDoWorkOnFrame(),Tt.sViewSensorManager?.HtmlHasActiveSensor()&&(A=!0)),this._CallbacksPerFrame.size>0){for(const A of this._CallbacksPerFrame)A();this._CallbacksPerFrame.size>0&&(A=!0)}A&&null!=this._FrameLoopFunc?window.requestAnimationFrame(this._FrameLoopFunc):this._FrameLoopFunc=null}GetScreenInfo(){return this._ScreenInfo}InitScreenBuffer(A,e){isNaN(A)&&(A=1),isNaN(e)&&(e=1280);const t=e*A,n=t/16*9;var i,s;this._ScreenInfo.width=Math.floor(t),this._ScreenInfo.height=Math.floor(n),this._ScreenInfo.x=2/this._ScreenInfo.width,this._ScreenInfo.y=2/this._ScreenInfo.height,this._ScreenInfo.perspective=this._ScreenInfo.x,this._ScreenInfo.scaleRatio=A,this._ScreenInfo.designedWidth=e,i=Math.floor(t/A),s=Math.floor(n/A),console.log(`ResizeRenderWindow w=${i} h=${s}`),D.width=i,D.height=s}RequestSwap(){this._OnRequesting||(this._OnRequesting=!0,Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then((()=>{Promise.resolve().then(this._DoRequestSwap.bind(this))}))}))}))})))}SetGlobalConfig(A){}AddWillSwapListener(A,e){this._WillSwapCallbacks.set(A,e)}AddAfterSwapListener(A,e){this._AfterSwapCallbacks.set(A,e)}_DoRequestSwap(){this._WillSwapCallbacks.size>0&&this._WillSwapCallbacks.forEach(this._DoWillSwapCallback),this._AfterSwapCallbacks.size>0&&this._AfterSwapCallbacks.forEach(this._DoAfterSwapCallback),this._OnRequesting=!1,Tt.sFrameCount.update()}GetSwapCount(){return Tt.sFrameCount.count}InstantPerformSwap(){this._OnRequesting&&(this._OnRequesting=!1,this._DoRequestSwap())}_OnWillSwap(A){A()}_OnAfterSwap(A){A()}RegisterPerFrameCallback(A){this._CallbacksPerFrame.add(A),this.BeginHtmlFrameLoop()}UnregisterPerFrameCallback(A){this._CallbacksPerFrame.delete(A)}HasPendingRenderBreak(){return!1}FinishRenderBreak(){}}function pA(){return uA||(uA=new wA),uA}class CA{constructor(){this._SensorMaps=new Map,this.IdTokenGenerator=77}HtmlDoWorkOnFrame(){for(let A in this._SensorMaps){let e=this._SensorMaps[A];e.Expired()?delete this._SensorMaps[A]:e.HtmlDoWorkOnFrame()}}HtmlHasActiveSensor(){for(let A in this._SensorMaps)if(this._SensorMaps[A].HtmlNeedWorkOnFrame())return!0;return!1}AddSensor(A){if(A){A.OnManaged(this)&&(this._SensorMaps[A.IdToken]=A),this.RequestSwap()}}AddToSyncList(A){this._SensorMaps.hasOwnProperty(A.IdToken)||console.error("Error: (Add)No in map",this._SensorMaps,A)}RecycleSensor(A){this._SensorMaps.hasOwnProperty(A.IdToken)?(delete this._SensorMaps[A.IdToken],this.RequestSwap()):console.error("Error: (del)No in map",this._SensorMaps,A)}RequestSwap(){Tt.sRenderBridge.BeginHtmlFrameLoop()}}class mA{constructor(){this._InnerViews={},this._ViewToken=1}add(A){const e=++this._ViewToken;return this._InnerViews[`${e}`]=A,e}remove(A){this._InnerViews[A]&&delete this._InnerViews[A]}get(A){return this._InnerViews[A]}clear(){this._InnerViews={},this._ViewToken=1}}class FA{constructor(A,e){this.view=A,this.layout_params=e}}function yA(){return dA||(dA=new mA),dA}let QA=0;class EA{constructor(A,e){this._ID=e||(A?A+QA++:"InvalidID"),this.Describe={},this._RefCount=0,this._Recycled=!1}ManualSetId(A){this._ID=A}GetId(){return this._ID}DoRef(){this._RefCount++}UnRef(){this._RefCount>0?this._RefCount--:console.warn("Already 0...")}GetSyncData(){return{}}}const UA=new class extends EA{constructor(A){super(null,A)}}("DISABLE"),IA="left",TA="top",vA="top",xA="clip",SA="normal",bA=["alignment","vertical_align","vertical_area_align","text_overflow","word_wrap","direction"];class LA extends EA{constructor(A,e,t,n,i,s){super("DS",null),this.Describe.alignment=A,this.Describe.vertical_align=e,this.Describe.vertical_area_align=t,this.Describe.text_overflow=n,this.Describe.word_wrap=i,this.Describe.direction=s}GetSyncData(){return{T:0,ID:this._ID,A:this.Describe.alignment,VA:this.Describe.vertical_align,VAA:this.Describe.vertical_area_align,TO:this.Describe.text_overflow,WW:this.Describe.word_wrap,DIR:this.Describe.direction}}}const HA="黑体",_A=!1,kA=!1,PA=["font","italic","bold"];class DA extends EA{constructor(A,e,t){super("FS",null),this.Describe.font=A,this.Describe.italic=e,this.Describe.bold=t}GetSyncData(){return{T:1,ID:this._ID,F:this.Describe.font,I:this.Describe.italic,B:this.Describe.bold}}}const RA="#000000",OA="#FFFFFF00",MA=["text_color","bg_color"];class VA extends EA{constructor(A,e){super("CS",null),this.Describe.text_color=A,this.Describe.bg_color=e}GetSyncData(){return{T:2,ID:this._ID,TC:this.Describe.text_color,BC:this.Describe.bg_color}}}const GA=["shadow_offset_x","shadow_offset_y","shadow_blur","shadow_color","stroke_width","stroke_color"];class KA extends EA{constructor(A,e,t,n,i,s){super("SS",null),this.Describe.shadow_offset_x=A,this.Describe.shadow_offset_y=e,this.Describe.shadow_blur=t,this.Describe.shadow_color=n,this.Describe.stroke_width=i,this.Describe.stroke_color=s}GetSyncData(){return{T:3,ID:this._ID,OX:this.Describe.shadow_offset_x,OY:this.Describe.shadow_offset_y,B:this.Describe.shadow_blur,C:this.Describe.shadow_color,SW:this.Describe.stroke_width,SC:this.Describe.stroke_color}}}class NA{constructor(A){this.DS=YA.GetDisplayStyle(A),this.FS=YA.GetFontStyle(A),this.CS=YA.GetColorStyle(A),this.SS=YA.GetSpecialStyle(A),this._IdsCache=null}DoRef(){this.DS.DoRef(),this.FS.DoRef(),this.CS.DoRef(),this.SS.DoRef()}UnRef(){this.DS.UnRef(),this.FS.UnRef(),this.CS.UnRef(),this.SS.UnRef()}GetIdsPack(){return this._IdsCache||(this._IdsCache={DS:this.DS.GetId(),FS:this.FS.GetId(),CS:this.CS.GetId(),SS:this.SS.GetId()}),this._IdsCache}}class WA{constructor(){this._DisplayStyleMap=new Map,this._DisplayStyleIds=new Map,this._FontStyleMap=new Map,this._FontStyleIds=new Map,this._ColorStyleMap=new Map,this._ColorStyleIds=new Map,this._SpecialStyleMap=new Map,this._SpecialStyleIds=new Map,this._NewStyleList=[]}StyleToPack(A){let e={alignment:void 0!==A.hAlign?A.hAlign:IA,vertical_align:void 0!==A.vAlign?A.vAlign:TA,vertical_area_align:void 0!==A.vAreaAlign?A.vAreaAlign:vA,text_overflow:void 0!==A.textOverflow?A.textOverflow:xA,word_wrap:void 0!==A.wordWrap?A.wordWrap:SA,font:void 0!==A.font?A.font:HA,italic:void 0!==A.italic?A.italic:_A,bold:void 0!==A.bold?A.bold:kA,text_color:void 0!==A.textColor?A.textColor:RA,bg_color:void 0!==A.backgroundColor?A.backgroundColor:OA,direction:void 0!==A.direction?A.direction:"ltr",shadow_offset_x:0,shadow_offset_y:0,shadow_blur:0,shadow_color:null,stroke_width:0,stroke_color:null};if(A.shadow){const t=A.shadow;e.shadow_offset_x=t.shadowOffsetX,e.shadow_offset_y=t.shadowOffsetY,e.shadow_blur=t.shadowBlur,e.shadow_color=t.shadowColor}if(A.stroke){const t=A.stroke;e.stroke_width=t.strokeWidth,e.stroke_color=t.strokeColor}return new NA(e)}PrepareSyncNewStyles(){if(this._NewStyleList.length>0){let A=[];for(let e of this._NewStyleList)A.push(e.GetSyncData());BA.CreateTextureHeadStatus().SetResourceInfo({STA:{Nam:"TST",Sta:A}}),this._NewStyleList=[]}}GetDisplayStyle(A){return this._GetStyle(A,bA,LA,this._DisplayStyleMap,this._DisplayStyleIds)}GetFontStyle(A){return this._GetStyle(A,PA,DA,this._FontStyleMap,this._FontStyleIds)}GetColorStyle(A){return this._GetStyle(A,MA,VA,this._ColorStyleMap,this._ColorStyleIds)}GetSpecialStyle(A){return 0===A.shadow_blur&&0===A.stroke_width?UA:this._GetStyle(A,GA,KA,this._SpecialStyleMap,this._SpecialStyleIds)}GetDsFromId(A){return this._DisplayStyleIds.get(A)}GetFsFromId(A){return this._FontStyleIds.get(A)}GetCsFromId(A){return this._ColorStyleIds.get(A)}GetSsFromId(A){return this._SpecialStyleIds.get(A)}_GetStyle(A,e,t,n,i){let s=[];for(let t of e)s.push(A[t]);let r=s.join(":"),o=null;return n.has(r)?o=n.get(r):(o=new t(...s),n.set(r,o),i.set(o.GetId(),o),window.JsView&&this._NewStyleList.push(o)),o}}let YA=null;let XA,JA=null,jA=null,zA=null;class ZA{GetDataUrl(A){return JSON.parse(A).forEach(((A,e)=>{switch(A.cmd){case 1:JA=O().createElement("canvas"),jA=JA.getContext("2d"),JA.setAttribute("width",`${A.w}px`),JA.setAttribute("height",`${A.h}px`);break;case 2:"stroke"==A.type?(jA.strokeStyle=A.clr,jA.lineWidth=A.lineWidth,jA.fillStyle=null,zA="stroke"):(jA.fillStyle=A.clr,jA.strokeStyle=null,zA="fill");break;case 3:jA.beginPath();break;case 30:this.myMoveTo(A.x,A.y);break;case 31:this.myLineTo(A.x,A.y);break;case 32:this.myArcTo(A);break;case 33:jA.closePath();break;case 14:"stroke"===zA?jA.stroke():"fill"===zA&&jA.fill();break;case 13:this.myRect(A);break;case 12:this.circleDraw(A);break;case 15:this.drawLine(A);break;case 16:this.drawLinearGradientRect(A);break;case 11:this.drawColor(A.clr);break;case 10:this.clearCanvas()}})),JA.toDataURL("image/png")}myMoveTo(A,e){void 0!==A&&void 0!==e&&jA.moveTo(A,e)}myLineTo(A,e){void 0!==A&&void 0!==e&&jA.lineTo(A,e)}myArcTo(A){let e=(A.left+A.right)/2,t=(A.top+A.bottom)/2,n=(A.right-A.left)/2,i=(A.bottom-A.top)/2;const s={x:e+n*Math.cos(A.startAngle*Math.PI/180),y:t-i*Math.sin(A.startAngle*Math.PI/180)};let r=A.startAngle*Math.PI/180,o=(A.startAngle+A.sweepAngle)*Math.PI/180,a=1!=Math.sign(A.sweepAngle);jA.moveTo(s.x,s.y),jA.ellipse(e,t,n,i,0,r,o,a)}circleDraw(A){void 0!==A.x&&void 0!==A.y&&void 0!==A.radius&&(jA.arc(A.x,A.y,A.radius,0,2*Math.PI),"stroke"===zA?jA.stroke():"fill"===zA&&jA.fill())}myRect(A){let e=A.right-A.left,t=A.bottom-A.top,n=A.left,i=A.top;jA.rect(n,i,e,t),"stroke"===zA?jA.stroke():"fill"===zA&&jA.fill()}drawLine(A){jA.moveTo(A.x0,A.y0),jA.lineTo(A.x1,A.y1),jA.lineWidth=A.lineWidth,jA.strokeStyle=A.clr,jA.stroke()}drawLinearGradientRect(A){const e=A.clrs,t=A.stops;if(!e||!t||e.length!==t.length)return void console.error("drawLinearGradientRect error: stopList size is not equal to colorList size.");const n=jA.createLinearGradient(A.x0,A.y0,A.x1,A.y1);for(let A=0;A<e.length;++A)n.addColorStop(t[A],e[A]);jA.fillStyle=n,jA.fillRect(0,0,JA.width,JA.height)}drawColor(A){let e=JA.getContext("2d");e.fillStyle=A,e.fillRect(0,0,JA.width,JA.height)}clearCanvas(){JA.getContext("2d").clearRect(0,0,JA.width,JA.height)}}class $A{constructor(A,e,t){this._GL=null,this._Loaded=!1,this._OnLoad=null,this._TextureSource=null,this.TextureId=null,this._TextureManager=A,this._GL=e,this._Loaded=!1,this._OnLoad=t,this.TextureId=null,this._TextureSource=null}_setGLTexture(){this.TextureId=this._GL.createTexture(),this._GL.activeTexture(this._GL.TEXTURE0),this._GL.bindTexture(this._GL.TEXTURE_2D,this.TextureId),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_WRAP_S,this._GL.CLAMP_TO_EDGE),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_WRAP_T,this._GL.CLAMP_TO_EDGE),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_MIN_FILTER,this._GL.NEAREST),this._GL.texParameteri(this._GL.TEXTURE_2D,this._GL.TEXTURE_MAG_FILTER,this._GL.LINEAR),this._GL.texImage2D(this._GL.TEXTURE_2D,0,this._GL.RGBA,this._GL.RGBA,this._GL.UNSIGNED_BYTE,this._TextureSource)}loaded(){return this._Loaded}recycle(){this._TextureManager.recycle(this._TextureSource)}}$A.IMAGE=Symbol("Texture.IMAGE"),$A.COLOR=Symbol("Texture.COLOR");class qA extends $A{constructor(A,e,t,n){if(super(A,e,t),this.Url=null,n){const A=n.trim();if(0===A.indexOf("http"))this.Url=A;else if(0===A.indexOf("url")){const e=A.indexOf("("),t=A.indexOf(")");this.Url=A.substring(e+1,t)}else this.Url=n;this._TextureSource=new Image,this._TextureSource.onload=()=>{this._setGLTexture(),this._Loaded=!0,this._OnLoad&&this._OnLoad()},this._TextureSource.src=this.Url,this._TextureSource.crossOrigin="*",this._TextureSource.crossOrigin="Anonymous"}}}class Ae{constructor(){this._Canvas=null,this._GL=null,this._Canvas=O().createElement("canvas"),this._Canvas.setAttribute("width","1px"),this._Canvas.setAttribute("height","1px"),this._Canvas.setAttribute("style","position: absolute; pointer-events: none;"),O().body.appendChild(this._Canvas),this._GL=this._Canvas.getContext("2d")}getColorImageData(A,e,t,n){const i=this._GL.createImageData(1,1);return i.data[0]=A,i.data[1]=e,i.data[2]=t,i.data[3]=n,i}}let ee=null;class te extends $A{constructor(A,e,t,n){super(A,e,t),null===ee&&(ee=new Ae),this.Color=n;const i=(A=>{if(!A)return null;if(0===(A=A.trim()).indexOf("rgba")){const e=A.indexOf("("),t=A.indexOf(")");return A.substr(e+1,t-e-1).split(",").map(((A,e)=>3===e?Math.ceil(255*parseFloat(A)):parseInt(A,10)))}if(0===A.indexOf("#")){let e=A.substr(1);const t=e.length;if(6===t||8===t){6===t&&(e+="FF");const A=parseInt(`0x${e}`,10);return[A>>24&255,A>>16&255,A>>8&255,255&A]}return null}return null})(this.Color);this._TextureSource=ee.getColorImageData(i[0],i[1],i[2],i[3]),this._setGLTexture(),this._Loaded=!0,this._OnLoad&&this._OnLoad()}}const ne=new class{constructor(){this._TextureMap={}}getTexture(A,e,t,n){let i;if(this._TextureMap[n])i=this._TextureMap[n].texture,this._TextureMap[n].useCount++;else{switch(A){case $A.IMAGE:i=new qA(this,e,t,n);break;case $A.COLOR:i=new te(this,e,t,n);break;default:console.log(`getTexture type is error:${A}`)}this._TextureMap[n]={texture:i,useCount:1}}return i}recycle(A){this._TextureMap[A]&&(this._TextureMap[A].useCount--,this._TextureMap[A].useCount<0&&delete this._TextureMap[A])}},ie=(A,e)=>Math.random()*(e-A)+A;class se{constructor(A,e,t,n,i){this._ViewId=A,this._Type=e.type,this._ParticleNum=e.particleNum,this._DeltaAngle=e.deltaAngle/180*Math.PI,this._DeltaWidthFact=e.deltaWidth/n.width,this._DeltaHeightFact=e.deltaHeight/n.height,this._PointSizeMin=e.pointSizeMin,this._PointSizeMax=e.pointSizeMax,this._SpeedMin=e.speedMin,this._SpeedMax=e.speedMax,this._LifeMin=e.lifeMin/1e3,this._LifeMax=e.lifeMax/1e3,this._AddNumSpeed=e.addNumSpeed,this._AcceletateX=e.accelerateX,this._AcceletateY=e.accelerateY,this._EnableFade=e.enableFade,this._EnableShrink=e.enableShrink,this._AngularVelocityMin=0,this._AngularVelocityMax=0,"number"==typeof e.angularVelocityMin&&"number"==typeof e.angularVelocityMax&&(this._AngularVelocityMin=e.angularVelocityMin,this._AngularVelocityMax=e.angularVelocityMax),this._AlphaMin=1,this._AlphaMax=1,"number"==typeof e.alphaMin&&"number"==typeof e.alphaMax&&(this._AlphaMin=e.alphaMin,this._AlphaMax=e.alphaMax),this._Texture=t,this._Buffer=new Float32Array(9*this._ParticleNum),this._AddedParticleNum=0,this._DomProxyView=i,this._StartTime=-1,this._LastFrameTime=-1,this._Stopped=!1,this._getTransform=this._getTransform.bind(this)}_getTransform(){let A=this._DomProxyView.HtmlGetElement();const e=le(A.style.width),t=le(A.style.height);let n=new window.WebKitCSSMatrix;for(;A.parentNode;){const e=getComputedStyle(A);if(e.transform){const t=e.transformOrigin?e.transformOrigin:e.webkitTransformOrigin;if(t){const i=le(t),s=new window.WebKitCSSMatrix(`translate(-${i[0]}px,-${i[1]}px)`),r=new window.WebKitCSSMatrix(`translate(${i[0]}px,${i[1]}px)`),o=new window.WebKitCSSMatrix(`translate(${A.offsetLeft}px,${A.offsetTop}px)`),a=new window.WebKitCSSMatrix(e.transform);n=o.multiply(r.multiply(a.multiply(s.multiply(n))))}else n=new window.WebKitCSSMatrix(e.transform).multiply(n)}A=A.parentNode}const i=new window.WebKitCSSMatrix;i.m11=0,i.m12=0,i.m14=1,i.m21=e,i.m22=0,i.m24=1,i.m31=0,i.m32=t,i.m34=1,i.m41=e,i.m42=t,i.m44=1,n=n.multiply(i);return[n.m11,n.m12,n.m21,n.m22,n.m31,n.m32,n.m41,n.m42]}_updateParticleInfo(A,e,t,n,i,s){const r=ie(0,2*this._DeltaWidthFact),o=ie(0,2*this._DeltaHeightFact);this._Buffer[9*A]=r*t[0]+o*n[0]+e[0],this._Buffer[9*A+1]=r*t[1]+o*n[1]+e[1],this._Buffer[9*A+2]=i+ie(-this._DeltaAngle,this._DeltaAngle),this._Buffer[9*A+3]=ie(this._SpeedMin,this._SpeedMax),this._Buffer[9*A+4]=s,this._Buffer[9*A+5]=ie(this._LifeMin,this._LifeMax),this._Buffer[9*A+6]=ie(this._PointSizeMin,this._PointSizeMax),this._Buffer[9*A+7]=ie(this._AngularVelocityMin,this._AngularVelocityMax),this._Buffer[9*A+8]=ie(this._AlphaMin,this._AlphaMax)}onDrawFrame(A,e,t){if(!this._DomProxyView||!this._DomProxyView.HtmlCanAccessElement())return;if(!this._Texture.loaded()||this._Stopped)return;this._StartTime<0&&(this._StartTime=Date.now()),this._LastFrameTime<0&&(this._LastFrameTime=this._StartTime);const n=this._getTransform();for(let A=0;A<n.length;A++)n[A]=A%2==0?2*n[A]/window.innerWidth-1:1-2*n[A]/window.innerHeight;const i=(Date.now()-this._StartTime)/1e3,s=[n[0],n[1]],r=[n[2]-n[0],n[3]-n[1]],o=[n[4]-n[0],n[5]-n[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),l=-r[1]/a,c=r[0]/a>0?Math.acos(l):2*Math.PI-Math.acos(l);if(0===this._Type)if(this._AddedParticleNum<this._ParticleNum){for(let A=0;A<this._ParticleNum;A++)this._updateParticleInfo(A,s,r,o,c,i);this._AddedParticleNum=this._ParticleNum}else{let A=!0;for(let e=0;e<this._ParticleNum;e++)if(this._Buffer[9*e+4]+this._Buffer[9*e+5]>i){A=!1;break}A&&(this._Stopped=!0)}else if(this._AddedParticleNum<this._ParticleNum){let A=Math.round((Date.now()-this._LastFrameTime)*this._AddNumSpeed);this._AddedParticleNum+A>this._ParticleNum&&(A=this._ParticleNum-this._AddedParticleNum);for(let e=0;e<A;e++)this._updateParticleInfo(this._AddedParticleNum+e,s,r,o,c,i);this._AddedParticleNum+=A}else for(let A=0;A<this._ParticleNum;A++)this._Buffer[9*A+4]+this._Buffer[9*A+5]<i&&this._updateParticleInfo(A,s,r,o,c,i);const h=A.getUniformLocation(e,"uTime");A.uniform1f(h,i);const u=A.getUniformLocation(e,"uAccelerate");A.uniform2f(u,this._AcceletateX,this._AcceletateY);const g=A.getUniformLocation(e,"uEnableFade");A.uniform1i(g,this._EnableFade?1:0);const d=A.getUniformLocation(e,"uEnableShrink");A.uniform1i(d,this._EnableShrink?1:0),A.bindBuffer(A.ARRAY_BUFFER,t),A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,this._Texture.TextureId),A.bufferSubData(A.ARRAY_BUFFER,0,this._Buffer);const B=this._Buffer.BYTES_PER_ELEMENT,f=A.getAttribLocation(e,"aPosition");A.vertexAttribPointer(f,2,A.FLOAT,!1,9*B,0),A.enableVertexAttribArray(f);const w=A.getAttribLocation(e,"aSpeed");A.vertexAttribPointer(w,2,A.FLOAT,!1,9*B,2*B),A.enableVertexAttribArray(w);const p=A.getAttribLocation(e,"aLife");A.vertexAttribPointer(p,2,A.FLOAT,!1,9*B,4*B),A.enableVertexAttribArray(p);const C=A.getAttribLocation(e,"aPointSize");A.vertexAttribPointer(C,1,A.FLOAT,!1,9*B,6*B),A.enableVertexAttribArray(C);const m=A.getAttribLocation(e,"aAngularVelocity");A.vertexAttribPointer(m,1,A.FLOAT,!1,9*B,7*B),A.enableVertexAttribArray(m);const F=A.getAttribLocation(e,"aAlpha");A.vertexAttribPointer(F,1,A.FLOAT,!1,9*B,8*B),A.enableVertexAttribArray(F),A.drawArrays(A.POINTS,0,this._AddedParticleNum)}recycle(){this._Buffer=null,this._Texture.recycle(),this._Stopped=!0}}let re=0;class oe{constructor(){this._Inited=!1,this._Canvas=null,this._GL=null,this._GLProgram=null,this._VBO=null,this._ParticleViewMap={},this._LoopStarted=!1,this._onDrawFrameFunc=this._onDrawFrame.bind(this)}_initCanvas(){if(this._Canvas=O().createElement("canvas"),this._Canvas.setAttribute("width",`${window.innerWidth}px`),this._Canvas.setAttribute("height",`${window.innerHeight}px`),this._Canvas.setAttribute("style","position: absolute; pointer-events: none;"),O().body.appendChild(this._Canvas),this._GL=this._Canvas.getContext("webgl"),!this._GL)return void console.error("init webgl failed");console.log("webgl info: ",this._GL.getParameter(this._GL.VERSION),this._GL.getParameter(this._GL.SHADING_LANGUAGE_VERSION),this._GL.getParameter(this._GL.VENDOR));const A=this._GL.createShader(this._GL.VERTEX_SHADER);this._GL.shaderSource(A,"attribute vec2 aPosition;attribute vec2 aSpeed;attribute vec2 aLife;attribute float aPointSize;attribute float aAngularVelocity;attribute float aAlpha;uniform float uTime;uniform vec2 uAccelerate;uniform bool uEnableFade;uniform bool uEnableShrink;varying float vAlpha;varying mat2 vTextureRotate;void main() { float use_time = (uTime - aLife.x) / 10.0; float x = aSpeed.y * cos(aSpeed.x) * use_time + 0.5 * uAccelerate.x * use_time * use_time; float y = aSpeed.y * sin(aSpeed.x) * use_time + 0.5 * uAccelerate.y * use_time * use_time; float percent = (uTime - aLife.x) / aLife.y; percent = percent > 1.0 ? 0.0 : cos(1.57 * percent); vAlpha = aAlpha * (uEnableFade ? percent : 1.0); float angular = aAngularVelocity * use_time; vTextureRotate = mat2(cos(angular), sin(angular), -sin(angular), cos(angular)); gl_PointSize = uEnableShrink ? aPointSize * percent : aPointSize; gl_Position = vec4(x + aPosition.x, y + aPosition.y, 0.0, 1.0);}"),this._GL.compileShader(A);const e=this._GL.createShader(this._GL.FRAGMENT_SHADER);this._GL.shaderSource(e,"precision mediump float;uniform sampler2D uTexture;varying float vAlpha;varying mat2 vTextureRotate;void main(void) { vec2 center = vec2(0.5, 0.5); vec2 rotateCoord = vTextureRotate * (gl_PointCoord - center) + center; vec4 texture = texture2D(uTexture, rotateCoord) * vAlpha; gl_FragColor = texture;}"),this._GL.compileShader(e),this._GLProgram=this._GL.createProgram(),this._GL.attachShader(this._GLProgram,A),this._GL.attachShader(this._GLProgram,e),this._GL.linkProgram(this._GLProgram);const t=new Float32Array(4500),n=t.BYTES_PER_ELEMENT;this._VBO=this._GL.createBuffer(),this._GL.bindBuffer(this._GL.ARRAY_BUFFER,this._VBO),this._GL.bufferData(this._GL.ARRAY_BUFFER,t,this._GL.DYNAMIC_DRAW);const i=this._GL.getAttribLocation(this._GLProgram,"aPosition");this._GL.vertexAttribPointer(i,2,this._GL.FLOAT,!1,9*n,0),this._GL.enableVertexAttribArray(i);const s=this._GL.getAttribLocation(this._GLProgram,"aSpeed");this._GL.vertexAttribPointer(s,2,this._GL.FLOAT,!1,9*n,2*n),this._GL.enableVertexAttribArray(s);const r=this._GL.getAttribLocation(this._GLProgram,"aLife");this._GL.vertexAttribPointer(r,2,this._GL.FLOAT,!1,9*n,4*n),this._GL.enableVertexAttribArray(r);const o=this._GL.getAttribLocation(this._GLProgram,"aPointSize");this._GL.vertexAttribPointer(o,1,this._GL.FLOAT,!1,9*n,6*n),this._GL.enableVertexAttribArray(o);const a=this._GL.getAttribLocation(this._GLProgram,"aAngularVelocity");this._GL.vertexAttribPointer(a,1,this._GL.FLOAT,!1,9*n,7*n),this._GL.enableVertexAttribArray(a);const l=this._GL.getAttribLocation(this._GLProgram,"aAlpha");this._GL.vertexAttribPointer(l,1,this._GL.FLOAT,!1,9*n,8*n),this._GL.enableVertexAttribArray(l),this._GL.useProgram(this._GLProgram);const c=this._GL.getUniformLocation(this._GLProgram,"uTexture");this._GL.uniform1i(c,0),this._GL.enable(this._GL.BLEND),this._GL.enable(this._GL.SAMPLE_ALPHA_TO_COVERAGE),this._GL.blendFunc(this._GL.ONE,this._GL.ONE_MINUS_SRC_ALPHA),this._Inited=!0}_onDrawFrame(){this._GL.clear(this._GL.COLOR_BUFFER_BIT),this._GL.useProgram(this._GLProgram);for(const A in this._ParticleViewMap)this._ParticleViewMap.hasOwnProperty(A)&&this._ParticleViewMap[A].onDrawFrame(this._GL,this._GLProgram,this._VBO);window.requestAnimationFrame(this._onDrawFrameFunc)}addParticle(A,e,t,n){this._Inited||this._initCanvas();const i=re++;let s;return s=0===e.indexOf("rgba")||0===e.indexOf("#")?ne.getTexture($A.COLOR,this._GL,null,e):ne.getTexture($A.IMAGE,this._GL,null,e),this._ParticleViewMap[i]=new se(i,A,s,t,n),this._LoopStarted||(this._LoopStarted=!0,window.requestAnimationFrame(this._onDrawFrameFunc)),i}recycleView(A){this._ParticleViewMap[A]&&(this._ParticleViewMap[A].recycle(),delete this._ParticleViewMap[A])}}let ae,le=A=>{if(A.indexOf(" ")>=0){return A.split(" ").map((A=>parseInt(A.substr(0,A.length-2),10)))}return parseInt(A.substr(0,A.length-2),10)};function ce(){return ae||(ae=new oe),ae}class he{StringWithFont(A,e,t,n,i,s,r,o,a,l,c){e||(e=he._sDefaultFontSize),t||(t=he._sDefaultFont);let h="";!0===r&&(h="italic");let u="";return!0===o&&(u="bold"),n||(n="left"),i||(i="middle"),s||(s=he._sDefaultFontColor),a||(a=null),c||(c="top"),l||(l=-1),{str:`${A}`,font:t,size:e,italic:h,bold:u,stroke_width:l,alignment:n,vertical_align:i,textColour:s,backgroundColour:he._sDefaultBackgroundColor,enableBlend:!0,shadow:a,vertical_area_align:c}}TextAttr(A,e){return A||(A="none"),e||(e="none"),{text_overflow:A,word_wrap:e}}GetTextWidth(...A){if(A.length<=1){let e=A[0];return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextWidth(e):e.str.length*e.size+1}{let e=A[0];if(void 0!==window.PlatformUtils){let t={str:e,font:A[1]?A[1]:"黑体",size:A[2],bold:A[3],italic:A[4]};return window.PlatformUtils.GetTextWidth(t)}return e.length*e.size+1}}GetOneLineTextDrawWidth(A,e,t,n,i,s){if(void 0!==window.PlatformUtils){let r=window.PlatformUtils.GetOneLineTextDrawWidth(A,e??"黑体",t,n,i);s.push(...r)}else console.error("GetOneLineTextDrawWidth: window.PlatformUtils undefined.")}GetTextRect(A,e,t,n,i){return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextRect(A,e,t,n,i):{width:e.width,height:e.height}}GetTextInfo(A,e,t,n,i){return void 0!==window.PlatformUtils?window.PlatformUtils.GetTextInfo(A,e,t,n,i):{start:0,end:A.length,width:e.width,height:e.height}}GetCursorOffset(A,e,t,n,i,s,r){return void 0!==window.PlatformUtils?window.PlatformUtils.GetCursorOffset(A,e,t,n,i,s,r):0}GetCursorPosition(A,e,t,n,i,s){return void 0!==window.PlatformUtils?window.PlatformUtils.GetCursorPosition(A,e,t,n,i,s):{x:0,y:0}}BuildTextView(A,e,t,n,i,s,r,o,a,l,c){i.width=isNaN(i.width)?0:i.width,i.height=isNaN(i.height)?0:i.height,s=isNaN(s)?10:s,r=isNaN(r)?0:r;let h=new En;const u=A.GetTextTextureFromStylePack(e,t,!!n,i,s,r,2!=o,a,l,c);return n&&setTimeout((()=>{n(h.Element.clientWidth,h.Element.clientHeight)})),null===u?(console.error("Error: Build text texture failed!"),null):(h.ResetTexture(u),e.length<10?h.SetId("Text-"+e):h.SetId("Text-Long-"+e.length),h.ResetLayoutParams({x:0,y:0,width:i.width,height:i.height}),h)}}he._sDefaultFont="黑体",he._sDefaultFontSize=30,he._sDefaultFontColor="#FFFFFF",he._sDefaultBackgroundColor="rgba(0, 0, 0, 0)";let ue=null;class ge{constructor(){this._count=1}get count(){return this._count}update(){this._count<Number.MAX_SAFE_INTEGER?++this._count:this._count=1}}let de=null;const Be=Number.MAX_SAFE_INTEGER-1e3;class fe{constructor(){this.mCount=0}update(){return this.mCount=(this.mCount+1)%(Be+1),this}get(){return this.mCount}static getCustomDataStr(A){return`{"tc": ${A}}`}}const we="TouchRecv";class pe{constructor(A){this.mFeatureFlagBits=0,this.mTargetFreeMove=null,this.mTargetView=A}updateFeatureFlags(A,e){if(this.mFeatureFlagBits=A,0!=(4&this.mFeatureFlagBits)){const A=e;if(null===A)return void console.error(we,"Error: NOT found bind freeMoveAnim");if("FreeMove"!==A.typeName)return void console.error(we,"Error: bind anim is NOT freeMove");this.mTargetFreeMove=A}}}class Ce{constructor(A=0,e=0){this.mX=A,this.mY=e}}var me,Fe,ye,Qe,Ee,Ue;!function(A){A[A.OnDown=1]="OnDown",A[A.OnTap=2]="OnTap",A[A.OnLongPress=3]="OnLongPress",A[A.OnLongPressRelease=4]="OnLongPressRelease",A[A.OnLongPressCancel=5]="OnLongPressCancel",A[A.OnDragStart=6]="OnDragStart",A[A.OnDragMove=7]="OnDragMove",A[A.OnDragEnd=8]="OnDragEnd",A[A.OnFling=9]="OnFling",A[A.OnRelease=10]="OnRelease"}(me||(me={}));class Ie extends Ce{constructor(A,e,t,n,i,s,r,o,a){super(),this.mEvent1=null,this.mEvent2=null,this.mEventType=A??null,this.mEvent1=n??null,this.mEvent2=i??null,this.mX=e??0,this.mY=t??0,this.mDistanceX=s??0,this.mDistanceY=r??0,this.mVelocityX=o??0,this.mVelocityY=a??0,this.mTimeStamp=Date.now()}getJSEventType(){let A=-1;switch(this.mEventType){case me.OnDown:A=0;break;case me.OnTap:A=1;break;case me.OnLongPress:A=2;break;case me.OnDragStart:A=3;break;case me.OnDragMove:A=4;break;case me.OnDragEnd:A=5;break;case me.OnRelease:A=6;break;case me.OnFling:A=7}return A}}!function(A){A[A.Cancel=0]="Cancel",A[A.Click=1]="Click",A[A.LongPress=2]="LongPress",A[A.LongPressRelease=3]="LongPressRelease",A[A.TouchFirstStart=4]="TouchFirstStart",A[A.TouchLastEnd=5]="TouchLastEnd"}(Fe||(Fe={})),function(A){A[A.FireEcho=1]="FireEcho",A[A.FireNexusEvent=2]="FireNexusEvent",A[A.NewCondition=3]="NewCondition",A[A.DelActionAssocCondition=4]="DelActionAssocCondition",A[A.SetOffsetPos=5]="SetOffsetPos",A[A.JumpTo=6]="JumpTo",A[A.RemoveAllCondtions=7]="RemoveAllCondtions",A[A.RevertWithHitBlock=8]="RevertWithHitBlock",A[A.RemoveByGroup=9]="RemoveByGroup",A[A.SetHitWallOverflow=10]="SetHitWallOverflow",A[A.TouchLockSwitch=11]="TouchLockSwitch",A[A.DuringFling=12]="DuringFling",A[A.SetTouchAttractChild=13]="SetTouchAttractChild",A[A.StartMovementSync=14]="StartMovementSync",A[A.StopMovementSync=15]="StopMovementSync"}(ye||(ye={})),function(A){A[A.SetSpeed=100]="SetSpeed",A[A.SetAccel=101]="SetAccel",A[A.Stop=102]="Stop",A[A.StopExact=103]="StopExact",A[A.SetArrowSpeed=104]="SetArrowSpeed",A[A.BrakeToPos=105]="BrakeToPos",A[A.TeleportTo=106]="TeleportTo",A[A.TeleportOffset=107]="TeleportOffset",A[A.FreshState=108]="FreshState",A[A.AckMovementSync=109]="AckMovementSync"}(Qe||(Qe={})),function(A){A[A.Position=200]="Position",A[A.Speed=201]="Speed",A[A.AcrossPosition=202]="AcrossPosition",A[A.AcrossSpeed=203]="AcrossSpeed",A[A.OnNexusEvent=204]="OnNexusEvent",A[A.OnHitBlock=205]="OnHitBlock",A[A.OnNextTick=206]="OnNextTick",A[A.BoxPosition=207]="BoxPosition",A[A.WallPosition=208]="WallPosition",A[A.StartMove=209]="StartMove",A[A.OffsetPosition=210]="OffsetPosition",A[A.TouchCount=211]="TouchCount",A[A.OnMovement=212]="OnMovement",A[A.MovementSyncNexus=213]="MovementSyncNexus"}(Ee||(Ee={})),function(A){A[A.Invalid=0]="Invalid",A[A.ActFinish=1]="ActFinish",A[A.SpeedXRevert=2]="SpeedXRevert",A[A.SpeedYRevert=3]="SpeedYRevert",A[A.ActReject=4]="ActReject",A[A.DragStart=5]="DragStart",A[A.DragEnd=6]="DragEnd",A[A.FlingStart=7]="FlingStart",A[A.FlingProgress=8]="FlingProgress",A[A.FlingEnd=9]="FlingEnd",A[A.TouchDown=10]="TouchDown",A[A.TouchRelease=11]="TouchRelease",A[A.FlingCancel=12]="FlingCancel",A[A.FlingDrop=13]="FlingDrop",A[A.NexusEvent_CustomDefine=1e3]="NexusEvent_CustomDefine"}(Ue||(Ue={}));const Te="__nexusCustomDataStr";var ve,xe,Se;!function(A){A[A.ActEvent_ActFinish=1]="ActEvent_ActFinish",A[A.ActEvent_Speed_X_Revert=2]="ActEvent_Speed_X_Revert",A[A.ActEvent_Speed_Y_Revert=3]="ActEvent_Speed_Y_Revert"}(ve||(ve={}));class be{static FireEcho(A){return{type:ye.FireEcho,params:{msg:A}}}static FireNexusEvent(A,e,t){return isNaN(A)||0==A?null:{type:ye.FireNexusEvent,params:{nexusEventId:isNaN(e)?0:e,eventType:A,customDataStr:t}}}static NewCondition(A){return{type:ye.NewCondition,params:{conditionSet:A}}}static DelActionAssocCondition(){return{type:ye.DelActionAssocCondition}}static SetOffsetPos(A,e){return{type:ye.SetOffsetPos,params:{xOffset:A,yOffset:e}}}static SetPos(A,e){return{type:ye.JumpTo,params:{xPos:A,yPos:e}}}static RemoveAllCondtions(){return{type:ye.RemoveAllCondtions}}static RevertWithHitBlock(){return{type:ye.RevertWithHitBlock}}static RemoveByGroup(A){return{type:ye.RemoveByGroup,params:{groupType:A}}}static SetHitWallOverflow(){return{type:ye.SetHitWallOverflow}}static TouchLockSwitch(A,e,t){return{type:ye.TouchLockSwitch,params:{isLock:A,direction:e,unlockThreshold:t}}}static DuringFling(A){return{type:ye.DuringFling,params:{state:A}}}static SetTouchAttractChild(A){return{type:ye.SetTouchAttractChild,params:{childRef:A}}}static StartMovementSync(A,e,t,n,i,s){return{type:ye.StartMovementSync,params:{nexusId:A,horizontalStart:e,horizontalEnd:t,verticalStart:n,verticalEnd:i,xyEnable:s}}}static StopMovementSync(){return{type:ye.StopMovementSync,params:{}}}}!function(A){A[A.BubbleEvent=1]="BubbleEvent",A[A.NexusEvent=2]="NexusEvent"}(xe||(xe={}));class Le{constructor(A){this.mEventType=A}GetEventType(){return this.mEventType}}!function(A){A[A.WallOverflow=1]="WallOverflow",A[A.DragEvent=2]="DragEvent"}(Se||(Se={}));class He extends Le{constructor(A){super(xe.BubbleEvent),this.mTargetAnim=null,this.mSubEventType=A}OnEventFire(){this.mTargetAnim?.onBubbleEvent(this)}}class _e extends He{constructor(){super(Se.WallOverflow),this.mOverflowPixelX=0,this.mOverflowPixelY=0,this.mSpeedX=0,this.mSpeedY=0}}class ke extends He{constructor(){super(Se.DragEvent),this.actEventType=null}}class Pe{static InitActCmdPack(A,e,t,n){return{t:1,cmds:n,tkn:isNaN(t)?0:t,spdxye:isNaN(A)?0:A,accxye:isNaN(e)?0:e}}static InitStateCmdPack(A){return{t:2,cmd:A}}}const De=(A,e)=>{let t=0,n=0,i=0;return Number.isNaN(A)||(t|=1,n=A),Number.isNaN(e)||(t|=2,i=e),{e:t,x:n,y:i}};class Re{static SetSpeed(A,e){return{type:Qe.SetSpeed,params:{Xspeed:A,Yspeed:e}}}static SetAccel(A,e){return{type:Qe.SetAccel,params:{Xacc:A,Yacc:e}}}static StopMoving(){return{type:Qe.Stop}}static StopMovingExact(A,e){return{type:Qe.StopExact,params:{x:A,y:e}}}static SetArrowSpeed(A,e,t,n){return{type:Qe.SetArrowSpeed,params:{arrowTargetX:A,arrowTargetY:e,absSpeedX:t,absSpeedY:n}}}static _BrakeToPosInner(A,e,t,n){return{type:Qe.BrakeToPos,params:{targetX:A,targetY:e,xyEnables:t,nexusEventId:n}}}static BrakeToPos(A,e,t){const n=De(A,e);return Re._BrakeToPosInner(n.x,n.y,n.e,void 0)}static TeleportTo(A,e,t){return{type:Qe.TeleportTo,params:{targetX:A,targetY:e,isOffset:t}}}static teleportOffset(A,e){return{type:Qe.TeleportOffset,params:{offsetX:A,offsetY:e}}}static FreshState(A,e){return{type:Qe.FreshState,params:{spd:A,acc:e}}}static AckMovementSync(A,e,t,n,i,s){return{type:Qe.AckMovementSync,params:{horizontalStart:A,horizontalEnd:e,verticalStart:t,verticalEnd:n,xyEnable:i,syncType:s}}}}const Oe=[];let Me=[];const Ve=new Map,Ge=()=>{if(Me.length>0){let A=[];for(let e=0;e<Me.length;e++)A.push(Me[e]);Me=[];for(const[A,e]of Ve)for(let A=0;A<e.length;A++)0==e[A].avaliable&&e.splice(A,1);for(const[A,e]of Ve)0==e.length&&Ve.delete(A);for(let e=0;e<A.length;e++){const t=A[e];if(t instanceof He)t.OnEventFire();else{const A=Ve.get(t.params.nexusEventId);if(A)for(let e=0;e<A.length;e++){let n=A[e].conditionItem.actions;A[e].conditionItem.params.eventType==t.params.eventType&&(n.forEach((A=>{A[Te]=t.params.customDataStr})),A[e].animationItem.doCommandInner(n))}}}}};const Ke=new class{constructor(){this.allEnvBlockList=[]}getSensor(A){const e=[];for(let t=0;t<this.allEnvBlockList.length;t++)this.allEnvBlockList[t].topGID==A&&e.push({direction:"top",start:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)}}),this.allEnvBlockList[t].bottomGID==A&&e.push({direction:"bottom",start:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)},end:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}}),this.allEnvBlockList[t].leftGID==A&&e.push({direction:"left",start:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().left),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}}),this.allEnvBlockList[t].rightGID===A&&e.push({direction:"right",start:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().top)},end:{x:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().right),y:parseInt(this.allEnvBlockList[t]._HtmlConfig.view.HtmlGetElement().getBoundingClientRect().bottom)}});return e}addSensor(A){this.allEnvBlockList.push(A)}deleteSensor(A){for(let e=0;e<this.allEnvBlockList.length;e++)this.allEnvBlockList[e]===A&&this.allEnvBlockList.splice(e,1)}},Ne=(A,e,t,n)=>{var i=(e.y-A.y)*(n.x-t.x)-(A.x-e.x)*(t.y-n.y);if(0==i)return!1;var s=((e.x-A.x)*(n.x-t.x)*(t.y-A.y)+(e.y-A.y)*(n.x-t.x)*A.x-(n.y-t.y)*(e.x-A.x)*t.x)/i,r=-((e.y-A.y)*(n.y-t.y)*(t.x-A.x)+(e.x-A.x)*(n.y-t.y)*A.y-(n.x-t.x)*(e.y-A.y)*t.y)/i;return(s-A.x)*(s-e.x)<=0&&(r-A.y)*(r-e.y)<=0&&(s-t.x)*(s-n.x)<=0&&(r-t.y)*(r-n.y)<=0&&{x:s,y:r}};function We(A,e,t,n,i){return"Vertical"==i?!(A.y>n.y||e.y<t.y):"Horizontal"==i?!(A.x>n.x||e.x<t.x):void 0}class Ye{constructor(A){this._SS=A}insertRule(A){window.jsvInAndroidWebView&&(A=(A=A.replace(/@keyframes/,"@-webkit-keyframes")).replace(/transform/g,"-webkit-transform"));const e=this._SS.cssRules.length;this._SS.insertRule(A,e)}removeRule(A){this.removeMultiRules([A])}hasRule(A){const e=this._SS.cssRules;for(let t=e.length-1;t>=0;t--)if(e[t].name===A)return!0;return!1}getRule(A){let e=null;const t=this._SS;for(let n=0;n<t.length;++n)if(t[n]&&t[n].cssRules){for(const i in t[n].cssRules)if(t[n].cssRules[i].name===A){e=t[n].cssRules[i];break}if(e)break}return e}removeMultiRules(A){const e=this._SS,t=this._SS.cssRules;for(let n=t.length-1;n>=0;n--)for(const i in A)if(t[n].name===A[i]){A.splice(parseInt(i),1),e.deleteRule(n);break}}}let Xe=null;function Je(){return null===Xe&&(Xe=function(A){let e=null,t=O().styleSheets;if(!t||0===t.length)return console.error("Error: styleSheet fetch failed"),null;if(A){for(let n=0;n<t.length;++n){const i=t[n];if(i.cssRules[0]&&i.cssRules[0].name&&i.cssRules[0].name===A){e=i;break}}if(null===e)return console.error(`Error: no found tag=${A}`),null}else e=t[t.length-1];return new Ye(e)}()),Xe}function je(A){let e="linear";if(A&&void 0!==A.T)switch(A.T){case j.EasingTypeIn:e="ease-in";break;case j.EasingTypeOut:e="ease-out";break;case j.EasingTypeInOut:e="ease-in-out";break;case j.EasingTypeBezier:e=`cubic-bezier(${A.St.X1},${A.St.Y1},${A.St.X2},${A.St.Y2})`;break;case j.EasingTypeSteps:e=`steps(${A.St.S},${0===A.St.T?"start":"end"})`;case j.EasingTypeBlink:case j.EasingTypeDeceleration:}return e}function ze(A,e){const t=-1===A.repeatTimes?"infinite":A.repeatTimes;let n="linear";A.easing&&(n=je(A.easing));return`${e} ${A.duration/1e3}s ${n} ${A.delayedTime/1e3}s ${t}`}const Ze=(A,e,t)=>{A.hasOwnProperty("__jsvHookListeners")||(A.__jsvHookListeners=new Map);const n=A.__jsvHookListeners;n.has(e)&&n.forEach((t=>{A.removeEventListener(e,t),A.__jsvHookListeners.delete(e)})),A.addEventListener(e,t),A.__jsvHookListeners.set(e,t)},$e=A=>A>=65&&A<=90||A>=97&&A<=122,qe=A=>A>=48&&A<=57;let At=0;class et{constructor(A){this._TracerDiv=function(A){const e=A.Element.children;let t=null;for(let A=0;A<e.length;A++)if("_AnimateProgressTracer"===e[A].id){t=e[A];break}return null===t&&(t=A.Element.ownerDocument.createElement("div"),t.id="_AnimateProgressTracer",A.Element.appendChild(t)),t}(A),this._IdToken=At++,this._KeyFrameName=null,this._AdvanceTimer=null,this._AdvanceListener=null,this._TracerDiv.hasOwnProperty("_ForgeProgressToken")||(this._TracerDiv._ForgeProgressToken=0),this._OnEndListener=A=>{A.stopPropagation()},Ze(this._TracerDiv,"animationend",this._OnEndListener)}_ClearAdvanceTimer(){null!==this._AdvanceTimer&&(clearInterval(this._AdvanceTimer),this._AdvanceTimer=null)}_NotifyAdvance(){this._ClearAdvanceTimer(),null!==this._AdvanceListener&&(this._AdvanceTimer=setInterval((()=>{const A=this.GetProgress();this._AdvanceListener(A),1===A&&this._ClearAdvanceTimer()}),100))}Start(A,e,t){this._AdvanceListener=t,this._KeyFrameName&&console.error("Error: Asset!! should Stop before start"),this._TracerDiv._ForgeProgressToken=(this._TracerDiv._ForgeProgressToken+1)%2,this._KeyFrameName=this._BuildTraceKeyFrame(e,this._IdToken,this._TracerDiv._ForgeProgressToken),this._TracerDiv.style.animation=ze(A,this._KeyFrameName),Ze(this._TracerDiv,"animationend",this._OnEndListener),this._NotifyAdvance()}Stop(){const A=this.GetProgress();return this._TracerDiv.style.animation=null,this._KeyFrameName&&(this._RemoveTraceKeyFrame(this._KeyFrameName),this._KeyFrameName=null),this._AdvanceListener&&(this._ClearAdvanceTimer(),this._AdvanceListener(A),this._AdvanceListener=null),A}GetProgress(){const A=window.getComputedStyle(this._TracerDiv);if(0===A.transform.length);else if(A.transform.length>0&&"none"!==A.transform){const e=(A=>{if(!A)return null;let e="",t="",n=[],i=0;for(let s=0;s<A.length;s++){const r=A.charCodeAt(s);if(0===i?($e(r)||qe(r))&&(e+=A[s]):(qe(r)||46===r||45===r||101===r)&&(t+=A[s]),40===r)i=1,t="",n=[];else{if(41===r)return n.push(parseFloat(t)),{name:e,params:n};44===r&&(n.push(parseFloat(t)),t="")}}return console.error("transform error",A),null})(A.transform);return null!==e?e.params[4]/1e3:(console.error("Error:internal error"),0)}return 1}_BuildTraceKeyFrame(A,e,t){const n=`_AnimateProgress_${e}_${t}`,i=Je(),s=`@keyframes ${n}\n {0%{transform:translate3d(${Math.floor(1e3*A)}px,0,0)}\n 100%{transform:translate3d(1000px,0,0)}}`;return i.insertRule(s),n}_RemoveTraceKeyFrame(A){Je().removeRule(A)}}let tt=0;class nt{constructor(){this.IdToken=tt++,this._AttachedGroup=null,this.AnimationListenerObj=null,this._AnimationClose=!1,this._LayoutViewRef=null,this._IsTextureAnim=!1}SetAnimationListener(A){this.AnimationListenerObj=A,this.OnNewListener(A)}AddAnimationListener(A){this.AnimationListenerObj&&A.AddInherit(this.AnimationListenerObj),this.AnimationListenerObj=A,this.OnNewListener(A)}RemoveAnimationListener(){this.AnimationListenerObj=null}OnNewListener(A){}GetAnimationListener(){return this.AnimationListenerObj}Cancel(A=null){this._LayoutViewRef&&this._LayoutViewRef.DetachAnimation(this);const e=this.AnimationListenerObj;if(e&&e.OnAnimationEnd&&!this._AnimationClose&&(this._AnimationClose=!0,e.OnAnimationEnd(!1)),this._AttachedGroup){let e=!0;A&&(e=A._AttachedGroup!==this._AttachedGroup),e&&(this._AttachedGroup.CancelFromInternalAnimation(this),this._AttachedGroup=null)}}AttachToGroup(A){null!==this._AttachedGroup&&rA.ThrowError("ERROR: In TransformAnimation.AttachToGroup(), animation already attached to other group"),this._AttachedGroup=A}RemoveFromGroup(){this._AttachedGroup=null}AsTextureAnimation(){this._IsTextureAnim=!0}Start(A){this._LayoutViewRef=A}SetCannotDisable(A){}OnStart(){const A=this.AnimationListenerObj;A&&A.OnAnimationStart&&A.OnAnimationStart()}OnEnd(A=!1){this._LayoutViewRef&&!A&&(this._LayoutViewRef.DetachAnimation(this),this._LayoutViewRef=null);const e=this.AnimationListenerObj;e&&e.OnAnimationEnd&&!this._AnimationClose&&(this._AnimationClose=!0,e.OnAnimationEnd(!0))}OnRepeatEvent(){const A=this.AnimationListenerObj;A&&A.OnAnimRepeat&&A.OnAnimRepeat()}OnViewHide(){const A=this.AnimationListenerObj;A&&A.OnViewNoVisible&&A.OnViewNoVisible()}OnFinalProgress(A){const e=this.AnimationListenerObj;e&&e.OnAnimFinal&&e.OnAnimFinal(A)}OnAnimAdvance(A){const e=this.AnimationListenerObj;e&&e.OnAnimAdvance&&e.OnAnimAdvance(A)}}class it{constructor(A=null,e=null,t=null){this.OnAnimationStart=A,this._OnAnimationStart=A,this.OnAnimationEnd=e,this._OnAnimationEnd=e,this.OnViewNoVisible=t,this._OnViewNoVisible=t,this.OnAnimFinal=null,this._OnAnimFinal=null,this.OnAnimRepeat=null,this._OnAnimRepeat=null,this._AttachedGroup=null,this._InheritListener=[],this._OnAnimAdvance=null,this.OnAnimAdvance=null}OnStart(A){return this._OnAnimationStart=A,this.OnAnimationStart=A,this}OnEnd(A){return this._OnAnimationEnd=A,this.OnAnimationEnd=A,this}OnAdvance(A){return this._OnAnimAdvance=A,this.OnAnimAdvance=A,this}OnFinalProgress(A){return this._OnAnimFinal=A,this.OnAnimFinal=A,this}OnRepeat(A){return this._OnAnimRepeat=A,this.OnAnimRepeat=A,this}AddInherit(A){if(A){if(0===this._InheritListener.length){const A=this;this.OnAnimationStart=function(){A._OnAnimationStart&&A._OnAnimationStart();for(let e=0;e<A._InheritListener.length;e++)A._InheritListener[e].OnAnimationStart&&A._InheritListener[e].OnAnimationStart?.()},this.OnAnimationEnd=function(e){A._OnAnimationEnd&&A._OnAnimationEnd(e);for(let t=0;t<A._InheritListener.length;t++)A._InheritListener[t].OnAnimationEnd&&A._InheritListener[t].OnAnimationEnd?.(e)},this.OnViewNoVisible=function(){A._OnViewNoVisible&&A._OnViewNoVisible();for(let e=0;e<A._InheritListener.length;e++)A._InheritListener[e].OnViewNoVisible&&A._InheritListener[e].OnViewNoVisible?.()},this.OnAnimFinal=function(e){A._OnAnimFinal&&A._OnAnimFinal(e);for(let t=0;t<A._InheritListener.length;t++)A._InheritListener[t].OnAnimFinal&&A._InheritListener[t].OnAnimFinal?.(e)},this.OnAnimRepeat=function(){A._OnAnimRepeat&&A._OnAnimRepeat();for(let e=0;e<A._InheritListener.length;e++)A._InheritListener[e].OnAnimRepeat&&A._InheritListener[e].OnAnimRepeat?.()},this.OnAnimAdvance=function(){A._OnAnimAdvance&&A._OnAnimAdvance();for(let e=0;e<A._InheritListener.length;e++)A._InheritListener[e].OnAnimAdvance&&A._InheritListener[e].OnAnimAdvance?.()}}this._InheritListener.push(A)}}}let st=0;class rt extends nt{constructor(A,e,t){super();let n=null;t&&(n=t.Package()),this.typeName=A,this.duration=e,this.easing=n,this.repeatTimes=1,this.delayedTime=0,this.enableFlags=0,this._Progress=null}EnableDelay(A){return this.delayedTime=A,this}EnableInfinite(){return this.repeatTimes=-1,this}SetRepeat(A){return this.repeatTimes=A,this}Enable(A){return this._EnableFlagsInner(A),this}OnNewListener(A){let e=0;A.OnAnimFinal&&(e|=lt.AckFinalProgress),A.OnAnimRepeat&&(e|=lt.AckRepeat),0!==e&&this._EnableFlagsInner(e)}_EnableFlagsInner(A){-1!==this.enableFlags?this.enableFlags|=A:this.enableFlags=A}CheckCssAnimationFormat(A){const e=Je().getRule(A);if(e&&e.cssRules)for(const t in e.cssRules){if(!e.cssRules[t]||!e.cssRules[t].style)continue;if(!e.cssRules[t].style.opacity&&!e.cssRules[t].style.transform)continue;const n=e.cssRules[t].style.transform;n&&(-1!==n.indexOf("rotate(")?console.error(`@keyframe ${A}, only support rotate3d, current transform:${n}`):-1!==n.indexOf("translate(")?console.error(`@keyframe ${A}, only support translate3d, current transform:${n}`):-1!==n.indexOf("scale(")&&console.error(`@keyframe ${A}, only support scale3d, current transform:${n}`))}}}class ot extends rt{constructor(A,e,t){super(A,e,t),this._KeyFrameNameToRecycle=null,this._TestRepeat=this._TestRepeat.bind(this),this._LatestProgressValue=0;const n=this;this._OnEndEvent=A=>{A.stopPropagation(),n._PerformAnimationEnd(!0)},this._CurrentEndEventFunc=null}Start(A){super.Start(A),A.ResetCssTransform(null,null),A.Element&&(A.Element.style.pointerEvents="auto"),this._EnableCssAnimation(this._BuildKeyFrame(),this._OnEndEvent)}Cancel(){super.Cancel(),this._PerformAnimationEnd(!1)}_EnableStarterAnimation(){let A=this._OnEndEvent;if(1!==this.repeatTimes){const e=this;A=A=>{A.stopPropagation(),null!==e._Progress&&e._Progress.Stop(),e.delayedTime=0,e.repeatTimes>0&&(e.repeatTimes-=1),this.OnRepeatEvent(),e._EnableCssAnimation(e._BuildKeyFrame(),e._OnEndEvent)}}const e=this.repeatTimes,t=this.duration;this.repeatTimes=1,this.duration*=1,this._EnableCssAnimation(this._BuildStarterKeyFrame(),A),this.repeatTimes=e,this.duration=t}_CreateAnimation(A){const e=Je();e.removeRule(A.name),e.insertRule(A.keyFrameString)}_EnableCssAnimation(A,e){if(null===A)return;A.tmp?null!==A.keyFrameString&&(Je().insertRule(A.keyFrameString),this._KeyFrameNameToRecycle=A.name):this._CreateAnimation(A);const t=A.name;this.CheckCssAnimationFormat(t);const n=this._LayoutViewRef.Element;0==(this.enableFlags&lt.AckFinalProgress)&&0==(this.enableFlags&lt.KeepTransform)&&0==(this.enableFlags&lt.AckRepeat)||(this._Progress=new et(this._LayoutViewRef),this._Progress.Start(this,0,(A=>{this.OnAnimAdvance(A)})),0!=(this.enableFlags&lt.AckRepeat)&&(this._LatestProgressValue=0,Tt.sRenderBridge.RegisterPerFrameCallback(this._TestRepeat)));const i=ze(this,t);window.jsvInAndroidWebView?(n.style.webkitAnimation=i,n.addEventListener("webkitAnimationEnd",e)):(n.style.animation=i,n.addEventListener("animationend",e)),this._CurrentEndEventFunc=e}_PerformAnimationEnd(A){if(null!==this._CurrentEndEventFunc){const A=this._LayoutViewRef.Element,e=this._CurrentEndEventFunc;setTimeout((()=>{window.jsvInAndroidWebView?A.removeEventListener("webkitAnimationEnd",e):A.removeEventListener("animationend",e)}),0),this._CurrentEndEventFunc=null}if(null===this._Progress)return void(A&&this.OnEnd());0!=(this.enableFlags&lt.AckRepeat)&&Tt.sRenderBridge.UnregisterPerFrameCallback(this._TestRepeat);let e=this._Progress.Stop();if(A&&(e=1),0!=(this.enableFlags&lt.KeepTransform)){const A=this._GetFrozenTransform(e);this._LayoutViewRef?.ResetCssTransform(A.transform,A.transformOrigin)}A&&this.OnEnd(),0!=(this.enableFlags&lt.AckFinalProgress)&&window.setTimeout((()=>{this.OnFinalProgress(e)}),0),null!==this._KeyFrameNameToRecycle&&(Je().removeRule(this._KeyFrameNameToRecycle),this._KeyFrameNameToRecycle=null)}_TestRepeat(){const A=this._Progress.GetProgress();this._LatestProgressValue>A&&this.OnRepeatEvent(),this._LatestProgressValue=A}_BuildStarterKeyFrame(){return console.warn("Warning:Should override and return keyframe name"),null}_BuildKeyFrame(){return console.warn("Warning:Should override and return keyframe name"),null}_GetFrozenTransform(A){return console.warn("Warning:Should override and keep view transform by ResetCssTransform()"),null}}class at extends ot{constructor(A,e,t,n,i,s){super("TL",i,s),this.startX=A,this.startY=t,this.endX=e,this.endY=n}_BuildStarterKeyFrame(){return this._BuildKeyFrame()}_BuildKeyFrame(){const A="_ForgeAnim_TL_"+st++;return{name:A,keyFrameString:`@keyframes ${A} {0%{transform:translate3d(${this.startX}px,${this.startY}px,0);}100%{transform:translate3d(${this.endX}px,${this.endY}px,0);}}`,tmp:!0}}_GetFrozenTransform(A){return{transform:`translate3d(${Math.floor((this.endX-this.startX)*A+this.startX)}px,${Math.floor((this.endY-this.startY)*A+this.startY)}px,0)`,transformOrigin:null}}}let lt={ReleaseAfterEndCallback:1,KeepTransform:2,AckFinalProgress:4,AckRepeat:8};class ct{static ReachPosition(A,e,t){const n=De(A,e);return{type:Ee.Position,params:{x:n.x,y:n.y,xyEnables:n.e,groupType:t.g,multiTimes:t.m,actionCheckCount:0}}}static ReachSpeed(A,e,t,n){return{type:Ee.Speed,params:{Xspeed:A,Yspeed:e,direction:n,groupType:t.g,multiTimes:t.m,actionCheckCount:0}}}static AcrossPosition(A,e,t){const n=De(A,e);return{type:Ee.AcrossPosition,params:{x:n.x,y:n.y,xyEnables:n.e,groupType:t.g,multiTimes:t.m,actionCheckCount:0}}}static AppendSubCmd(A,e){const t="cmds";A.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(A.hasOwnProperty(t)||(A[t]=[]),A[t].push(e))}static SetCmdList(A,e){e instanceof Array&&(A.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):A.cmds=e)}static SetCmdPackList(A,e){e instanceof Array&&(A.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):A.cmdPacks=e)}static InitCommonInfo(){return{g:0,m:!1,s:null}}static GetCommonObject(A,e,t=void 0){return{g:A,m:e,s:t??null}}static UpdateCommonInfo(A,e,t,n){A.g=e??0,A.m=t??!1,A.s=n??null}static AcrossSpeed(A,e,t){return{type:Ee.AcrossSpeed,params:{Xspeed:A,Yspeed:e,multiTimes:t.m,groupType:t.g,actionCheckCount:0}}}static OnNexusEvent(A,e,t){return{type:Ee.OnNexusEvent,params:{nexusId:A,eventType:e,multiTimes:t.m,groupType:t.g,actionCheckCount:0}}}static OnHitBlock(A,e){return{type:Ee.OnHitBlock,params:{GID:A,multiTimes:e.m,groupType:e.g,actionCheckCount:0}}}static WallPosition(A,e,t,n){let i=De(e,t);return{type:Ee.WallPosition,params:{direction:A,xyEnable:i.e,x:i.x,y:i.y,myltiTimes:n.m,groupType:n.g,actionCheckCount:0}}}static BoxPosition(A,e,t,n,i){let s=0,r=0,o=0,a=0,l=0;return isNaN(A)||(s=A,l|=1),isNaN(e)||(r=e,l|=2),isNaN(t)||(o=t,l|=4),isNaN(n)||(a=n,l|=8),{type:Ee.BoxPosition,params:{left:s,top:r,right:o,bottom:a,enables:l,multiTimes:i.m,groupType:i.g,actionCheckCount:0}}}static StartMove(A,e){return{type:Ee.StartMove,params:{xyEnable:A,multiTimes:e.m,groupType:e.g,actionCheckCount:0}}}static OffsetPosition(A,e,t,n,i){let s=0,r=0,o=0,a=0,l=0;return isNaN(A)||(s=A,l|=1),isNaN(e)||(r=e,l|=2),isNaN(t)||(o=t,l|=4),isNaN(n)||(a=n,l|=8),{type:Ee.OffsetPosition,params:{left:s,top:r,right:o,bottom:a,enables:l,multiTimes:i.m,groupType:i.g,actionCheckCount:0}}}static OnNextTick(A,e){return{type:Ee.OnNextTick,params:{gap:A,multiTimes:e.m,groupType:e.g,actionCheckCount:0}}}static OnDragStart(A,e){return ct.OnNexusEvent(e,Ue.DragStart,A)}static OnDragEnd(A,e){return ct.OnNexusEvent(e,Ue.DragEnd,A)}static OnTouchDown(A,e){return ct.OnNexusEvent(e,Ue.TouchDown,A)}static OnTouchRelease(A,e){return ct.OnNexusEvent(e,Ue.TouchRelease,A)}static OnFlingStart(A,e){return ct.OnNexusEvent(e,Ue.FlingStart,A)}static OnFlingProgress(A,e){return ct.OnNexusEvent(e,Ue.FlingProgress,A)}static OnFlingEnd(A,e){return ct.OnNexusEvent(e,Ue.FlingEnd,A)}static OnFlingCancel(A,e){return ct.OnNexusEvent(e,Ue.FlingCancel,A)}static OnFlingDrop(A,e){return ct.OnNexusEvent(e,Ue.FlingDrop,A)}static TouchCount(A,e){return{type:Ee.TouchCount,params:{touchCount:e,multiTimes:A.m,groupType:A.g,actionCheckCount:0}}}static OnMovement(A,e,t,n){return{type:Ee.OnMovement,params:{xSensitivity:e,ySensitivity:t,xyEnables:n,multiTimes:A.m,groupType:A.g,actionCheckCount:0}}}static MovementSyncNexus(A,e){return{type:Ee.MovementSyncNexus,params:{nexusNodeId:e,multiTimes:A.m,groupType:A.g,actionCheckCount:0}}}}const ht="__onAddInnerInfo",ut="__afterCheckInfo";var gt;!function(A){A[A.FromAppConst=0]="FromAppConst",A[A.FromAppVar1=1]="FromAppVar1",A[A.FromAppVar2=2]="FromAppVar2",A[A.FromAppVar3=3]="FromAppVar3",A[A.FromAppVar4=4]="FromAppVar4",A[A.FromAppVar5=5]="FromAppVar5",A[A.FromAppVar6=6]="FromAppVar6",A[A.FromAppVar7=7]="FromAppVar7",A[A.FromAppVar8=8]="FromAppVar8",A[A.ActionAssociated=10]="ActionAssociated",A[A.Fling=11]="Fling",A[A.InvalidGroup=65535]="InvalidGroup"}(gt||(gt={}));let dt=0;class Bt extends rt{constructor(A,e){super(Bt.sName,0,null),this.differenceX=0,this.differenceY=0,this.counter=0,this.selfNexusId=-1,this.flingState=0,this.touchAttractChild=null,this.token=dt++,this.selfNexusId=e,this.targetElement=null,this.position={x:0,y:0},this.style={top:0,left:0},this.acc={accX:0,accY:0},this.speed={speedX:0,speedY:0},this.prevSpeed={speedX:0,speedY:0},this.Echo=[],this._EchoCallbackFunc=A,this.Invoking=this.Invoking.bind(this),this.recordCount=0,this.swapCount=0,this.timerConditionList=[],this.speedConditionList=[],this.positionConditionList=[],this.envBlockConditionList=[],this.nexusConditionList=[],this.envPosition={x:0,y:0},this.prePosition={x:0,y:0},this.realPosition={x:0,y:0},this.realStartPosition={x:0,y:0}}Start(A){super.Start(A),this.targetElement=A.Element,this.style.left=parseInt(this.targetElement.style.left),this.style.top=parseInt(this.targetElement.style.top),this.realStartPosition.x=this.targetElement.getBoundingClientRect().x??0,this.realStartPosition.y=this.targetElement.getBoundingClientRect().y??0,this.differenceX=this.realStartPosition.x-this.style.left,this.differenceY=this.realStartPosition.y-this.style.top,Oe.push({animationRef:this})}GetSwapCount(){return Tt.sFrameCount.count}GetPosition(){return{...this.position}}Cancel(){super.Cancel();for(let A=Oe.length-1;A>=0;--A)Oe[A].animationRef==this&&Oe.splice(A,1)}cleanCondition(){const A=A=>{for(let e=A.length-1;e>=0;--e)!A[e].params.multiTimes&&A[e].checked&&A.splice(e,1)};A(this.positionConditionList),A(this.speedConditionList),A(this.timerConditionList),A(this.nexusConditionList)}conditionDeal(A){let e=[];for(let t=0;t<A.length;t++)e.push(A[t]);for(let A=0;A<e.length;A++){const t=e[A],n=this.testOneCondition(t);if(n&&0==t.params.multiTimes){if(0==t.params.actionCheckCount){t.params.actionCheckCount=this.swapCount;const A=t.actions.filter((A=>null!==A));0==t.checked&&(t.checked=!0,this.doCommandInner(A))}}else if(n&&1==t.params.multiTimes){t.params.actionCheckCount=this.swapCount;const A=t.actions.filter((A=>null!==A));t.checked=!0,this.doCommandInner([{type:ye.DelActionAssocCondition,params:{}}]),this.doCommandInner(A)}}}Invoking(){this.cleanCondition(),this.realPosition.x=this.targetElement.getBoundingClientRect().x,this.realPosition.y=this.targetElement.getBoundingClientRect().y,this.conditionDeal(this.timerConditionList),this.prevSpeed.speedX=this.speed.speedX,this.prevSpeed.speedY=this.speed.speedY,this.prePosition.x=this.position.x,this.prePosition.y=this.position.y,this.speed.speedX+=this.acc.accX,this.speed.speedY+=this.acc.accY,this.position.y+=this.speed.speedY,this.position.x+=this.speed.speedX,this.conditionDeal(this.speedConditionList),this.conditionDeal(this.nexusConditionList);do{Ge()}while(Me.length>0);if(this.conditionDeal(this.positionConditionList),this.envBlockConditionList.length>0){this.conditionDeal(this.envBlockConditionList);do{Ge()}while(Me.length>0);if(this.prePosition.x+this.speed.speedX!==this.position.x||this.prePosition.y+this.speed.speedY!==this.position.y){do{Ge()}while(Me.length>0);this.conditionDeal(this.positionConditionList)}}if(this.targetElement.style.top=this.style.top+this.position.y+"px",this.targetElement.style.left=this.style.left+this.position.x+"px",this.Echo.length>0){let A={retList:this.Echo,xSpd:this.speed.speedX,ySpd:this.speed.speedY,xAcc:this.acc.accX,yAcc:this.acc.accY,xPos:this.position.x,yPos:this.position.y};this._EchoCallbackFunc(JSON.stringify(A)),this.Echo=[]}this.swapCount++}ParsePackageList(A){let e=[];if(!A)return e;for(let t of A)switch(t.t){case 1:for(let A=0;A<t.cmds.length;A++)e.push({type:t.cmds[A].type,params:t.cmds[A].params});e.unshift({type:Qe.FreshState,params:{spd:t.spdxye,acc:t.accxye}});break;case 2:const A={type:t.cmd.type,params:t.cmd.params};e.push(A)}return e}doCommand(A){const e=this.ParsePackageList(A);this.doCommandInner(e)}doCommandInner(A){for(let e of A)switch(e.type){case Qe.FreshState:this.FreshState(e);break;case"callback":e.params();break;case Qe.SetSpeed:this.setSpeed(e);break;case Qe.SetAccel:this.setAcc(e);break;case Qe.Stop:this.stopMoving();break;case Qe.SetArrowSpeed:this.setArrowSpeed(e);break;case Qe.StopExact:this.stopExact(e);break;case Qe.BrakeToPos:this.brakeToPos(e);break;case Qe.TeleportTo:this.teleportTo(e);break;case Qe.TeleportOffset:this.teleportOffset(e);break;case ye.NewCondition:this.newCondition(e);break;case ye.SetOffsetPos:this.setOffset(e);break;case ye.FireEcho:this.EchoPush(e);break;case ye.DelActionAssocCondition:this.clearGroupTypeCondition();break;case ye.RemoveAllCondtions:this.RemoveAllCondtions();break;case ye.JumpTo:this.jumpToPositon(e);break;case ye.FireNexusEvent:this.FireNexusEvent(e);break;case ye.RevertWithHitBlock:this.revertWithHitBlock();break;case ye.RemoveByGroup:this.removeByGroup(e);break;case ye.SetHitWallOverflow:this.setHitWallOverflow(e);break;case ye.TouchLockSwitch:this.touchLockSwitch(e);break;case ye.DuringFling:this.setFlingState(e);break;case ye.SetTouchAttractChild:this.setTouchAttractChild(e);break;case ye.StartMovementSync:case ye.StopMovementSync:break;default:console.error("item的type格式未支持",e.type)}A=[]}testOneCondition(A){let e=!1;switch(A.type){case Ee.Position:e=this.checkPositionInner(A,!1);break;case Ee.Speed:e=this.checkSpeed(A);break;case Ee.AcrossPosition:e=this.checkPositionInner(A,!0);break;case Ee.AcrossSpeed:e=this.checkAcrossSpeed(A);break;case Ee.OnNextTick:e=this.onNextTick(A);break;case Ee.OnHitBlock:e=this.onHitBlock(A);break;case Ee.BoxPosition:e=this.boxPosition(A);break;case Ee.WallPosition:e=this.checkWallPosition(A);break;case Ee.StartMove:e=this.startMove(A);break;case Ee.OffsetPosition:e=this.offsetCondition(A);break;case Ee.OnNexusEvent:e=this.checkNexusEventCondition(A);break;case Ee.TouchCount:e=this.checkTouchCount(A);break;default:console.warn("未设定的item类型",A)}return e&&A.actions&&A.actions.length>0&&A.actions.forEach((e=>{e&&(ut in A&&(e[ut]=A[ut]),e.__triggerCondition=A)})),e}checkNexusEventCondition(A){return Me.some((e=>e.params?.eventType==A.params.eventType&&e.params.nexusId==A.params.nexusId))}checkTouchCount(A){return Tt.sTouchRecvManager.GetTouchCount()==A.params.touchCount}FreshState(A){let e=A.params.spd,t=A.params.acc;switch(e){case 1:this.speed.speedY=0;break;case 2:this.speed.speedX=0;break;case 0:this.speed.speedY=0,this.speed.speedX=0}switch(t){case 1:this.acc.accY=0;break;case 2:this.acc.accX=0;break;case 0:this.acc.accY=0,this.acc.accX=0}}setSpeed(A){isNaN(A.params.Xspeed)||(this.speed.speedX=A.params.Xspeed),isNaN(A.params.Yspeed)||(this.speed.speedY=A.params.Yspeed)}setAcc(A){isNaN(A.params.Xacc)||(this.acc.accX=A.params.Xacc),isNaN(A.params.Yacc)||(this.acc.accY=A.params.Yacc)}teleportTo(A){const{targetX:e,targetY:t,isOffset:n}=A.params;if(n){const e={params:{offsetX:A.params.targetX,offsetY:A.params.targetY}};this.teleportOffset(e)}else isNaN(e)||(this.targetElement.style.left=`${this.style.left+e}px`,this.position.x=e),isNaN(t)||(this.targetElement.style.top=`${this.style.top+t}px`,this.position.y=t)}teleportOffset(A){const{offsetX:e,offsetY:t}=A.params;isNaN(e)?this.position.x=parseInt(this.targetElement.style.left):(this.targetElement.style.left=`${this.style.left+this.position.x+e}px`,this.position.x+=e),isNaN(t)?this.position.y=parseInt(this.targetElement.style.top):(this.targetElement.style.top=`${this.style.top+this.position.y+t}px`,this.position.y+=t)}setArrowSpeed(A){const{arrowTargetX:e,arrowTargetY:t,absSpeedX:n,absSpeedY:i}=A.params;this.position.x>e&&(this.speed.speedX=-1*n),this.position.x<e&&(this.speed.speedX=1*n),this.position.y>t&&(this.speed.speedY=-1*i),this.position.y<t&&(this.speed.speedY=1*i),e&&t&&n&&null==i&&(this.speed.speedY=this.speed.speedX/(e/t)),e&&t&&null==n&&i&&(this.speed.speedX=this.speed.speedY/(t/e))}jumpToPositon(A){const{xPos:e,yPos:t}=A.params;this.position.x=e,this.targetElement.style.left=`${this.style.left+e}px`,this.position.y=t,this.targetElement.style.top=`${this.style.top+t}px`}RemoveAllCondtions(){this.timerConditionList=[],this.speedConditionList=[],this.positionConditionList=[];for(let A=0;A<this.nexusConditionList.length;A++)if(Ve.get(this.nexusConditionList[A].params.nexusId)){const e=Ve.get(this.nexusConditionList[A].params.nexusId);for(let t=0;t<e.length;t++)e[t].conditionItem.params.eventType==this.nexusConditionList[A].params.eventType&&(e[t].avaliable=!1)}this.nexusConditionList=[]}EchoPush(A){const{msg:e}=A.params;return this.Echo.push({rbTkn:0,eTkn:e,ncds:A[Te],cds:A.__customDataStr}),!0}checkPositionInner(A,e){let t=!1,n=!1;const{x:i,y:s}=this.position,{x:r,y:o}=this.prePosition,{x:a,y:l,xyEnables:c}=A.params;let h=!1;if(1&c&&(t=r<=a&&a<=i||i<=a&&a<=r),2&c&&(n=o<=l&&l<=s||s<=l&&l<=o),t||n)if(e){h=t&&r!==i||n&&o!==s}else h=!0;return h}checkSpeed(A){const{Xspeed:e,Yspeed:t}=A.params;if(void 0!==e)if(this.acc.accX>0){if(this.speed.speedX>=e)return this.speed.speedX=e,!0}else if(this.acc.accX<0){if(this.speed.speedX<=e)return this.speed.speedX=e,!0}else if(this.speed.speedX==e)return!0;if(void 0!==t)if(this.acc.accY>0){if(this.speed.speedY>=t)return this.speed.speedY=t,!0}else if(this.acc.accY<0){if(this.speed.speedY<=t)return this.speed.speedY=t,!0}else if(this.speed.speedY==t)return!0;return!1}checkAcrossSpeed(A){const{Xspeed:e,Yspeed:t}=A.params;return void 0!==e&&null!==this.prevSpeed.speedX&&(this.prevSpeed.speedX<e&&this.speed.speedX>=e||this.speed.speedX>e&&this.speed.speedX<=e)||void 0!==t&&null!==this.prevSpeed.speedY&&(this.prevSpeed.speedY<t&&this.speed.speedY>=t||this.speed.speedY>t&&this.speed.speedY<=t)}conditionOnAddInnerInfo(A){A[ht]={x:this.position.x,y:this.position.y,timestamp:Date.now()}}newCondition(A){let e,t=A.params.conditionSet;t.cmdPacks?e=this.ParsePackageList(t.cmdPacks):t.cmds&&(e=t.cmds);let n={type:t.type,params:t.params,actions:e,checked:!1};switch(n.actions?.forEach((A=>{if(A)switch(A.type){case Qe.StopExact:A.params=n.params;case ye.SetHitWallOverflow:}})),this.conditionOnAddInnerInfo(n),n.type){case Ee.OnNexusEvent:const A=n.params.nexusId;this.nexusConditionList.push(n),Ve.has(A)||Ve.set(A,[]),Ve.get(A).push({conditionItem:n,animationItem:this,avaliable:!0});break;case Ee.Speed:this.speedConditionList.push(n);break;case Ee.BoxPosition:case Ee.AcrossPosition:case Ee.WallPosition:case Ee.Position:this.testOneCondition(n)?(this.doCommandInner(n.actions),n.params.multiTimes&&this.positionConditionList.push(n)):this.positionConditionList.push(n);break;case Ee.OnNextTick:this.recordCount=this.swapCount,this.timerConditionList.push(n);break;case Ee.OnHitBlock:this.envBlockConditionList.push(n);break;case Ee.AcrossSpeed:this.speedConditionList.push(n);break;case Ee.StartMove:case Ee.OffsetPosition:this.positionConditionList.push(n);break;case Ee.TouchCount:this.timerConditionList.push(n);break;case Ee.OnMovement:case Ee.MovementSyncNexus:break;default:console.warn("未定义的条件类型",n)}}setOffset(A){const{xOffset:e,yOffset:t}=A.params;isNaN(e)||(this.targetElement.style.left=`${this.position.x+e}px`,this.position.x=this.position.x+e),isNaN(t)||(this.targetElement.style.top=`${this.position.y+t}px`,this.position.y=this.position.y+t)}stopMoving(){this.acc.accX=0,this.acc.accY=0,this.speed.speedX=0,this.speed.speedY=0}stopExact(A){this.acc.accX=0,this.acc.accY=0,this.speed.speedX=0,this.speed.speedY=0,this.position.x,this.position.y,Math.abs(this.position.x-A.params.x)<Math.abs(this.position.y-A.params.y)||A.params.x&&null==A.params.y?(this.position.x=A.params.x,this.targetElement.style.left=`${this.style.left+A.params.x}px`,this.targetElement.style.top=`${this.style.top+this.position.y}px`):Math.abs(this.position.x-A.params.x)>Math.abs(this.position.y-A.params.y)||A.params.y&&null==A.params.x?(this.position.y=A.params.y,this.targetElement.style.top=`${this.style.top+A.params.y}px`,this.targetElement.style.left=`${this.style.left+this.position.x}px`):Math.abs(this.position.x-A.params.x)==Math.abs(this.position.y-A.params.y)&&(this.position.x=A.params.x,this.position.y=A.params.y,this.targetElement.style.left=`${this.style.left+A.params.x}px`,this.targetElement.style.top=`${this.style.top+A.params.y}px`)}FireNexusEvent(A){Me.push(A)}onNextTick(A){return A.params.gap+this.recordCount==this.swapCount}brakeToPos(A){let{targetX:e,targetY:t,xyEnables:n}=A.params;0==(1&n)&&(e=void 0),0==(2&n)&&(t=void 0);const i=A.params?.nexusEventId??this.selfNexusId;if(e&&null==t){let A=2*(e-this.position.x)/this.speed.speedX+1;this.acc.accX=-this.speed.speedX/A}if(t&&null==e){let A=2*(t-this.position.y)/this.speed.speedY+1;this.acc.accY=-this.speed.speedY/A}if(e&&t){const A=e-this.position.x,n=t-this.position.y;let i=2*A/this.speed.speedX+1;this.acc.accX=-this.speed.speedX/i;let s=2*n/this.speed.speedY+1;this.acc.accY=-this.speed.speedY/s}const s={type:ye.NewCondition,params:{conditionSet:{...ct.ReachPosition(e,t,ct.GetCommonObject(gt.ActionAssociated,!1)),cmds:[Re.StopMovingExact(e,t),be.FireNexusEvent(Ue.ActFinish,i,null)]}}};this.newCondition(s)}clearGroupTypeCondition(){this.removeConditionItemByGroup(this.timerConditionList,gt.ActionAssociated),this.removeConditionItemByGroup(this.speedConditionList,gt.ActionAssociated),this.removeConditionItemByGroup(this.positionConditionList,gt.ActionAssociated),this.removeConditionItemByGroup(this.nexusConditionList,gt.ActionAssociated)}onHitBlock(A){let e=!1,t=Ke.getSensor(A.params.GID);const n=parseInt(this.targetElement.style.width),i=parseInt(this.targetElement.style.height),s=this.differenceX,r=this.differenceY,o=this.prePosition.x+s,a=this.prePosition.y+r,l=this.position.x+s,c=this.position.y+r;return t.forEach(((A,t)=>{if("left"==A.direction){const t={x:o+n,y:a+i},h={x:l+n,y:c+i};let u=Ne({x:o+n,y:a},{x:l+n,y:c},{x:A.start.x,y:0},{x:A.end.x,y:1080}),g=Ne(t,h,{x:A.start.x,y:0},{x:A.end.x,y:1080});!1!==u&&!1!==g&&We(A.start,A.end,u,g,"Vertical")&&(this.envPosition.x=u.x-n-s,this.envPosition.y=u.y-r,e=!0)}else if("top"==A.direction){const t={x:o+n,y:a+i},h={x:l+n,y:c+i};let u=Ne({x:o,y:a+i},{x:l,y:c+i},{x:0,y:A.start.y},{x:1920,y:A.end.y}),g=Ne(t,h,{x:0,y:A.start.y},{x:1920,y:A.end.y});!1!==u&&!1!==g&&We(A.start,A.end,u,g,"Horizontal")&&(this.envPosition.x=u.x-s,this.envPosition.y=u.y-i-r,e=!0)}else if("right"===A.direction){const t={x:o,y:a+i},n={x:l,y:c+i};let h=Ne({x:o,y:a},{x:l,y:c},{x:A.start.x,y:0},{x:A.end.x,y:1080}),u=Ne(t,n,{x:A.start.x,y:0},{x:A.end.x,y:1080});!1!==h&&!1!==u&&We(A.start,A.end,h,u,"Vertical")&&(this.envPosition.x=h.x-s,this.envPosition.y=h.y-r,e=!0)}else if("bottom"===A.direction){const t={x:o+n,y:a},i={x:l+n,y:c};let h=Ne({x:o,y:a},{x:l,y:c},{x:0,y:A.start.y},{x:1920,y:A.end.y}),u=Ne(t,i,{x:0,y:A.start.y},{x:1920,y:A.end.y});!1!==h&&!1!==u&&We(A.start,A.end,h,u,"Horizontal")&&(this.envPosition.x=h.x-s,this.envPosition.y=h.y-r,e=!0)}})),e}boxPosition(A){let e=!1;const{left:t,top:n,right:i,bottom:s,enables:r}=A.params,o=this.position.x,a=this.position.y;let l=0,c=0,h=0;return 1&r&&o<t?(e=!0,h|=1,l=t):4&r&&o>i&&(e=!0,h|=1,l=i),2&r&&a<n?(e=!0,h|=2,c=n):8&r&&a>s&&(e=!0,h|=2,c=s),A[ut]={type:"box",reactedX:l,reactedY:c,reactedXYEnables:h},e}checkWallPosition(A){if(!A)return!1;let e=!1;const{xyEnable:t,x:n,y:i,direction:s}=A.params;switch(s){case"left":e=this.position.x<n;break;case"top":e=this.position.y<i;break;case"right":e=this.position.x>n;break;case"bottom":e=this.position.y>i;break;default:console.error(`FreeMoveAnimation: undefined WallPositionCondition direction: ${A.react}`)}return A[ut]={type:s,reactedX:n,reactedY:i,reactedXYEnables:t},e}startMove(A){if(!A||!A[ht])return console.error("invalid startMove info",A),!1;const e=A.params.xyEnable,t=A[ht];let n=!1;return 1&e&&(n=Math.abs(t.x-this.position.x)>.01),2&e&&(n=Math.abs(t.y-this.position.y)>.01),n}offsetCondition(A){if(!A||!A[ht])return console.error("invalid offsetCondition info",A),!1;let e=!1;const{left:t,top:n,right:i,bottom:s,enables:r}=A.params,o=this.position.x,a=this.position.y,l=A[ht].x,c=A[ht].y;return(1&r&&o-l<-t||4&r&&o-l>i)&&(e=!0),(2&r&&a-c<-n||8&r&&a-c>s)&&(e=!0),e}revertWithHitBlock(){this.position.x=this.envPosition.x,this.position.y=this.envPosition.y}removeConditionItemByGroup(A,e){for(let t=A.length-1;t>=0;--t)A[t].params.groupType==e&&A.splice(t,1)}removeByGroup(A){const e=A.params.groupType;this.removeConditionItemByGroup(this.timerConditionList,e),this.removeConditionItemByGroup(this.speedConditionList,e),this.removeConditionItemByGroup(this.positionConditionList,e),this.removeConditionItemByGroup(this.nexusConditionList,e)}setHitWallOverflow(A){if(!A||!A[ut])return void console.error("invalid hitWallOverflow");const{type:e,reactedX:t,reactedY:n,reactedXYEnables:i}=A[ut],{x:s,y:r}=this.position,o=0==this.flingState?1:0,a=new _e;let l=0;switch(e){case"top":case"bottom":l=2,a.mOverflowPixelX=0,a.mSpeedX=0,a.mOverflowPixelY=o*(r-n),a.mSpeedY=o*this.speed.speedY,this.position.y=n,this.speed.speedY=0;break;case"left":case"right":l=1,a.mOverflowPixelX=o*(s-t),a.mSpeedX=o*this.speed.speedX,a.mOverflowPixelY=0,a.mSpeedY=0,this.position.x=t,this.speed.speedX=0;break;case"box":1&i&&(l=1,a.mOverflowPixelX=o*(s-t),a.mSpeedX=o*this.speed.speedX,this.position.x=t,this.speed.speedX=0),2&i&&(l=2,a.mOverflowPixelY=o*(r-n),a.mSpeedY=o*this.speed.speedY,this.position.y=n,this.speed.speedY=0)}o>0?this.fireBubbleEvent(a):l&this.flingState&&wt.Cancel(this,!1,Tt.sTouchRecvManager.GetTouchCount())}touchLockSwitch(A){if(A&&A.params){const{isLock:e,direction:t,unlockThreshold:n}=A.params;e?Tt.sTouchRecvManager.Lock(t,n):Tt.sTouchRecvManager.Unlock()}}getParentAnim(){let A=null;null!=this._LayoutViewRef&&null!=this._LayoutViewRef.ParentView&&(A=this._LayoutViewRef.ParentView);let e=null;do{let t=A?.TransformAnimationObj;if(t&&t.typeName==Bt.sName){e=t;break}A=A?.ParentView}while(null!=A);return e}fireBubbleEvent(A){let e=this.getParentAnim();e&&(A.mTargetAnim=e,Me.push(A))}onBubbleEvent(A){switch(A.mSubEventType){case Se.WallOverflow:const e=A;this.position.x+=e.mOverflowPixelX,this.speed.speedX+=e.mSpeedX,this.position.y+=e.mOverflowPixelY,this.speed.speedY+=e.mSpeedY;break;case Se.DragEvent:const t=A;this.FireNexusEvent(be.FireNexusEvent(t.actEventType,this.selfNexusId,fe.getCustomDataStr(Tt.sTouchRecvManager.GetTouchCount())));let n=new ke;n.actEventType=t.actEventType,this.fireBubbleEvent(n)}}GetSelfNexusId(){return this.selfNexusId}setFlingState(A){this.flingState=A.params.state}getFlingState(){return this.flingState}setSpeedX(A){this.speed.speedX=A}setSpeedY(A){this.speed.speedY=A}setTouchAttractChild(A){this.touchAttractChild=A.params.childRef}}Bt.sName="FreeMove";class ft{constructor(){this._IdGeneratorList=[],this._IdGeneratorList=[{curId:1,start:1,count:1073741823}]}static GetInstance(){if(null===ft._Instance){class A extends ft{}ft._Instance=new A}return ft._Instance}GenerateIdGroup(A,e,t){const n=this._IdGeneratorList[e];if(t>n.count)return void console.error("IdGenerator: Error: GenerateIdGroup oversize");const i=n.curId-n.start+1;n.count-i<t?A[0]=n.start:A[0]=n.curId+1,A[1]=A[0]+t-1,this._IdGeneratorList[e].curId=A[1]}GenerateId(A){const e=this._IdGeneratorList[A];return e.curId=(e.curId+1-e.start)%e.count+e.start,e.curId}}ft._Instance=null;class wt{static Start(A,e,t,n,i){let{x:s,y:r}=A.GetPosition(),o=Math.max(Math.abs(t)/.1,Math.abs(n)/.1),a=s+.5*t*o,l=r+.5*n*o;if(s!==a||r!==l){let o=ft.GetInstance().GenerateId(0);console.log(`start fling xyenable:${e} v(${t},${n}) cur(${s}, ${r}), target(${a},${l}) brakeNexusId:${o}`),A.doCommand([Pe.InitStateCmdPack(be.DuringFling(e)),Pe.InitActCmdPack(0,0,0,[Re.SetSpeed(1&e?t:0,2&e?n:0)]),Pe.InitActCmdPack(0,0,0,[Re._BrakeToPosInner(a,l,e,o)]),Pe.InitStateCmdPack(be.FireNexusEvent(Ue.FlingStart,A.GetSelfNexusId(),fe.getCustomDataStr(i)))]);let c,h=0,u=0;Math.abs(a-s)>Math.abs(l-r)?(h=1,c=a,u=s):(h=2,c=l,u=r);let g=200/Math.abs(c-u),d=g;for(;d<1;){const e={params:{x:1===h?(1-d)*u+d*c:0,y:2===h?(1-d)*u+d*c:0,xyEnables:h,groupType:gt.Fling,multiTimes:!1,actionCheckCount:0},type:Ee.Position,cmds:[be.FireNexusEvent(Ue.FlingProgress,A.GetSelfNexusId(),fe.getCustomDataStr(i))]};A.newCondition(be.NewCondition(e)),d+=g}const B={params:{nexusId:o,eventType:Ue.ActFinish,groupType:gt.Fling,multiTimes:!1,actionCheckCount:0},type:Ee.OnNexusEvent,cmds:[be.RemoveByGroup(gt.Fling),be.FireNexusEvent(Ue.FlingEnd,A.GetSelfNexusId(),fe.getCustomDataStr(i))]};A.newCondition(be.NewCondition(B))}}static Cancel(A,e,t){if(!A)return;console.log("testtest fling cancel");const n=A;n.getFlingState()>0&&(n.setSpeedX(0),n.setSpeedY(0),n.doCommand([Pe.InitActCmdPack(0,0,0,Re.FreshState(0,0)),Pe.InitStateCmdPack(be.DelActionAssocCondition()),Pe.InitStateCmdPack(be.RemoveByGroup(gt.Fling)),Pe.InitStateCmdPack(be.DuringFling(0)),Pe.InitStateCmdPack(be.FireNexusEvent(e?Ue.FlingCancel:Ue.FlingEnd,n.GetSelfNexusId(),fe.getCustomDataStr(t)))]))}}var pt,Ct;!function(A){A[A.NONE=0]="NONE",A[A.HORIZONTAL=1]="HORIZONTAL",A[A.VERTICAL=2]="VERTICAL"}(pt||(pt={})),function(A){A[A.Init=0]="Init",A[A.Accum=1]="Accum",A[A.NotAccum=2]="NotAccum"}(Ct||(Ct={}));class mt{constructor(A){this.PreX=0,this.PreY=0,this.PreSwapCount=0,this.X=0,this.Y=0,this.SwapCount=0,this.FreeMoveAnim=A}Update(){if(this.FreeMoveAnim){this.PreX=this.X,this.PreY=this.Y,this.PreSwapCount=this.SwapCount,this.SwapCount=this.FreeMoveAnim.GetSwapCount();const A=this.FreeMoveAnim.GetPosition();this.X=A.x,this.Y=A.y}}Moved(){if(this.SwapCount!=this.PreSwapCount){if(this.X!=this.PreX)return this.Y!=this.PreY?3:1;if(this.Y!=this.PreY)return 2}return 0}}class Ft{constructor(){this.mPendingTouchEventList=[],this.mStashedReceiverList=[],this.mDirectionLockState=pt.NONE,this.mUnlockThreshold=-1,this.mLockAccumX=0,this.mLockAccumY=0,this.mTouchEventList=[],this.mReceiverList=[],this.mFocusReceivers=[],this.mLockedReceiver=null,this.mFocusReceiverLocked=!1,this.mEventAccumState=Ct.Init,this.mCurTouchAnimList=[],this.mTouchCount=new fe}GetTouchCountStr(A){return`{"tc":${A}}`}OnTouchEvent(A){this.mPendingTouchEventList.push(A),Tt.sFrameCount.update()}GetTouchReceiver(A){const e=new pe(A);return A.IsVisibleInTree()?this.AddToReceiverList(e):this.mStashedReceiverList.push(e),e}GetTouchCount(){return this.mTouchCount.get()}Lock(A,e){this.mDirectionLockState=A,this.mUnlockThreshold=e}Unlock(){this.mDirectionLockState=pt.NONE,this.mLockAccumX=0,this.mLockAccumY=0}LockThresholdTest(){this.mUnlockThreshold>0&&(this.mDirectionLockState===pt.HORIZONTAL&&Math.abs(this.mLockAccumX)>=this.mUnlockThreshold&&(this.mDirectionLockState=pt.VERTICAL,this.mLockAccumX=0,this.mLockAccumY=0),this.mDirectionLockState===pt.VERTICAL&&Math.abs(this.mLockAccumY)>=this.mUnlockThreshold&&(this.mDirectionLockState=pt.HORIZONTAL,this.mLockAccumX=0,this.mLockAccumY=0))}GetDistanceWithLock(A){let e=A.mDistanceX,t=A.mDistanceY;return this.mDirectionLockState===pt.VERTICAL&&(this.mLockAccumY+=t,t=0),this.mDirectionLockState===pt.HORIZONTAL&&(this.mLockAccumX+=e,e=0),{dx:e,dy:t}}GetVelocityWithLock(A){let e=A.mVelocityX,t=A.mVelocityY;return this.mDirectionLockState===pt.VERTICAL&&(t=0),this.mDirectionLockState===pt.HORIZONTAL&&(e=0),{vx:e,vy:t}}AddToReceiverList(A){let e=this.mReceiverList.values(),t=!1;for(const n of e)if(null!=A.mTargetView&&null!=n.mTargetView&&A.mTargetView.IsParentView(n.mTargetView)){this.mReceiverList.splice(this.mReceiverList.indexOf(n),0,A),t=!0;break}t||this.mReceiverList.push(A)}CleanReceiverList(){this.mReceiverList=this.mReceiverList.filter((A=>!!A.mTargetView))}ProcessTouchEvent(A){this.CleanReceiverList();let e=!1;for(;this.mPendingTouchEventList.length>0;){if(this.mPendingTouchEventList[0].mEventType===me.OnRelease){if(e)break;if(this.mTouchEventList.length>0&&this.mEventAccumState===Ct.Accum){this.mTouchEventList=[],this.mPendingTouchEventList.shift(),this.mEventAccumState=Ct.NotAccum;continue}}e=!0,this.mTouchEventList.push(this.mPendingTouchEventList[0]),this.mPendingTouchEventList.shift()}if(0!==this.mTouchEventList.length)if(0===this.mFocusReceivers.length&&this.CheckAndSelectFocus(),this.DoFocusReceiverVisibleCheck())for(this.mEventAccumState=Ct.NotAccum;this.mTouchEventList.length>0;){let A=this.mTouchEventList.shift();if(this.ProcessEventInner(A))break}else this.mEventAccumState=Ct.Accum}CheckAndSelectFocus(){if(0!==this.mTouchEventList.length&&!(this.mFocusReceivers.length>0)&&(this.AddStashedReceiver(),0!==this.mReceiverList.length))for(;this.mTouchEventList.length>0;){let A=this.mTouchEventList[0];if(A.mEventType===me.OnDown&&!A.mUseAsSelect)return this.SelectFocusReceiverTree(A.mX,A.mY),void(A.mUseAsSelect=!0);this.mTouchEventList.shift()}}ProcessEventInner(A){let e=!1;switch(A.mEventType){case me.OnDown:this.OnDownEvent(A);break;case me.OnTap:this.OnTapEvent(A);break;case me.OnLongPress:this.OnLongPressEvent(A);break;case me.OnLongPressRelease:this.OnLongPressReleaseEvent(A);break;case me.OnLongPressCancel:this.OnLongPressCancelEvent(A);break;case me.OnDragStart:this.OnDragStartEvent(A);break;case me.OnDragMove:this.OnDragMoveEvent(A);break;case me.OnDragEnd:this.OnDragEndEvent(A);break;case me.OnFling:this.OnFlingEvent(A);break;case me.OnRelease:e=!0,this.OnReleaseEvent(A)}return e}SelectFocusReceiverTree(A,e){let t=this.mReceiverList.values();for(const n of t){let t=n;if(t.mTargetView&&t.mTargetView.PointIn(A,e)){this.BuildFocusReceiverTree(t);break}}}DoFocusReceiverVisibleCheck(){return this.mFocusReceivers=this.mFocusReceivers.filter((A=>null!=A&&A.mTargetView.IsVisibleInTree())),0!=this.mFocusReceivers.length}BuildFocusReceiverTree(A){if(null!=A.mTargetView){let e=A.mTargetView;for(;;){let A=e.GetTouchReceiver();if(A&&this.mFocusReceivers.push(A),!e.ParentView)break;e=e.ParentView}}}SelectReceiverFromFeature(A){if(this.mFocusReceiverLocked){const e=this.mLockedReceiver;return e&&0!=(e.mFeatureFlagBits&A)?e:null}for(const e of this.mFocusReceivers){const t=e;if(0!=(t.mFeatureFlagBits&A))return t}return null}LockFocusReceiver(A){this.mFocusReceiverLocked||(this.mLockedReceiver=A,this.mFocusReceiverLocked=!0)}OnDownEvent(A){this.mTouchCount.update();for(const A of this.mFocusReceivers){const e=A;8&e.mFeatureFlagBits&&e.mTargetView&&e.mTargetView.DispatchTapEvent(Fe.TouchFirstStart)}{let A=this.SelectReceiverFromFeature(4);if(null==A)return;if(A.mTargetFreeMove){const e=A.mTargetFreeMove;for(const A of this.mCurTouchAnimList)wt.Cancel(A.FreeMoveAnim,!0,this.mTouchCount.get());this.mCurTouchAnimList=[];let t=e;for(;null!==t;){const A=new mt(t);this.mCurTouchAnimList.push(A),t.FireNexusEvent(be.FireNexusEvent(Ue.TouchDown,t.GetSelfNexusId(),fe.getCustomDataStr(this.mTouchCount.get()))),t=t.getParentAnim()}}this.mFocusReceiverLocked=!1}}OnTapEvent(A){let e=this.SelectReceiverFromFeature(1);null!=e&&e.mTargetView&&e.mTargetView.DispatchTapEvent(Fe.Click)}OnLongPressEvent(A){let e=this.SelectReceiverFromFeature(2);null!=e&&(this.LockFocusReceiver(e),e.mTargetView&&e.mTargetView.DispatchTapEvent(Fe.LongPress))}OnLongPressReleaseEvent(A){let e=this.SelectReceiverFromFeature(2);null!=e&&e.mTargetView&&e.mTargetView.DispatchTapEvent(Fe.LongPressRelease)}OnLongPressCancelEvent(A){let e=this.SelectReceiverFromFeature(2);null!=e&&e.mTargetView&&e.mTargetView.DispatchTapEvent(Fe.Cancel)}BubbleDragEvent(A,e){const t=new ke;t.actEventType=A,e.fireBubbleEvent(t)}OnDragStartEvent(A){let e=this.SelectReceiverFromFeature(4);if(null!=e&&(this.LockFocusReceiver(e),e.mTargetFreeMove)){const t=e.mTargetFreeMove,{dx:n,dy:i}=this.GetDistanceWithLock(A);if(this.LockThresholdTest(),t?.doCommand([Pe.InitActCmdPack(0,0,0,[Re.TeleportTo(n,i,!0)])]),0!=this.mCurTouchAnimList.length)for(const A of this.mCurTouchAnimList)A.Update();const s=e.mTargetFreeMove;s.FireNexusEvent(be.FireNexusEvent(Ue.DragStart,s.GetSelfNexusId(),fe.getCustomDataStr(this.mTouchCount.get())))}}OnDragMoveEvent(A){let e=this.SelectReceiverFromFeature(4);if(null!=e&&e.mTargetFreeMove){const t=e.mTargetFreeMove;if(0!=this.mCurTouchAnimList.length)for(const A of this.mCurTouchAnimList)A.SwapCount!==t.GetSwapCount()&&A.Update();const{dx:n,dy:i}=this.GetDistanceWithLock(A);this.LockThresholdTest(),t?.doCommand([Pe.InitActCmdPack(0,0,0,[Re.TeleportTo(n,i,!0)])])}}OnDragEndEvent(A){let e=this.SelectReceiverFromFeature(4);if(null!=e&&e.mTargetFreeMove){const A=e.mTargetFreeMove;A.FireNexusEvent(be.FireNexusEvent(Ue.DragEnd,A.GetSelfNexusId(),fe.getCustomDataStr(this.mTouchCount.get()))),this.BubbleDragEvent(Ue.DragEnd,A)}}OnFlingEvent(A){let e=this.SelectReceiverFromFeature(4);if(null!=e&&e.mTargetFreeMove&&0!=this.mCurTouchAnimList.length){const{vx:e,vy:t}=this.GetVelocityWithLock(A),n=e/55,i=t/55;for(const s of this.mCurTouchAnimList){const r=s.Moved();if(s.FreeMoveAnim){const o=s.FreeMoveAnim;0!==r?(console.log("fling event start",A,e,t,this.mDirectionLockState),wt.Start(o,r,n,i,this.mTouchCount.get())):(console.log("fling event drop"),o.doCommand([be.FireNexusEvent(Ue.FlingDrop,o.GetSelfNexusId(),fe.getCustomDataStr(this.mTouchCount.get()))]))}}}}OnReleaseEvent(A){for(const A of this.mFocusReceivers)16&A.mFeatureFlagBits&&A.mTargetView&&A.mTargetView.DispatchTapEvent(Fe.TouchLastEnd);const e=this.SelectReceiverFromFeature(16777215);if(this.mFocusReceivers=[],this.mFocusReceiverLocked=!1,null!==e&&e.mTargetFreeMove){const A=e.mTargetFreeMove;A.FireNexusEvent(be.FireNexusEvent(Ue.TouchRelease,A.GetSelfNexusId(),fe.getCustomDataStr(this.mTouchCount.get()))),this.BubbleDragEvent(Ue.TouchRelease,A)}}AddStashedReceiver(){if(!this.mStashedReceiverList.length){let A=0;for(;A<this.mStashedReceiverList.length;){const e=this.mStashedReceiverList[A];null!=e.mTargetView&&e.mTargetView.IsVisibleInTree()?(this.AddToReceiverList(e),this.mStashedReceiverList.splice(A,1)):A++}}}}let yt=null;class Qt{constructor(A,e){}CancelTask(A){clearTimeout(A)}PostDelayTask(A,e){return A?setTimeout(A,e):-1}}Qt.MainThread=0;var Et;!function(A){A[A.NATIVE_DOWN=0]="NATIVE_DOWN",A[A.NATIVE_MOVE=1]="NATIVE_MOVE",A[A.NATIVE_UP=2]="NATIVE_UP",A[A.NATIVE_CANCEL=3]="NATIVE_CANCEL"}(Et||(Et={}));class Ut{constructor(){this.mInDragging=!1,this.mInLongPress=!1,this.mAlwaysInTapRegion=!1,this.mLastFocusX=0,this.mLastFocusY=0,this.mDownFocusX=0,this.mDownFocusY=0,this.mCurrentDownEvent=null,this.mLongPressDelayRequestTaskId=0,this.mMoveDirectionX=0,this.mMoveDirectionY=0,this.mTouchSlopSquare=64,this.mDelayRequestTaskRunnder=new Qt(Qt.MainThread,null),this.mLongPressDelayRequestTaskId=-1,this.ClearStatus()}OnTouchEvent(A,e,t,n,i){let s,r,o=e/1,a=t/1,l=n/1*1e3,c=i/1*1e3,h=o,u=a,g=0,d=0;switch(A){case Et.NATIVE_DOWN:{this.mDownFocusX=this.mLastFocusX=h,this.mDownFocusY=this.mLastFocusY=u,null!=this.mCurrentDownEvent&&(this.mCurrentDownEvent=null),this.mCurrentDownEvent=new Ce(o,a),this.mAlwaysInTapRegion=!0,this.mInLongPress=!1;let A=this;-1!=this.mLongPressDelayRequestTaskId&&this.mDelayRequestTaskRunnder.CancelTask(this.mLongPressDelayRequestTaskId),this.mLongPressDelayRequestTaskId=this.mDelayRequestTaskRunnder.PostDelayTask((()=>this.DispatchLongPress(A)),600),this.OnDown(this.mCurrentDownEvent);break}case Et.NATIVE_MOVE:{s=new Ce(o,a),g=h-this.mLastFocusX,d=u-this.mLastFocusY;let A=g<0?0:1,e=d<0?0:1;if(this.mAlwaysInTapRegion){let t=h-this.mDownFocusX,n=u-this.mDownFocusY;t*t+n*n>this.mTouchSlopSquare&&(this.mInLongPress&&(this.OnLongPressCancel(this.mCurrentDownEvent),this.mInLongPress=!1),this.OnDragStart(this.mCurrentDownEvent,s,o,a,g,d,l,c),this.mLastFocusX=h,this.mLastFocusY=u,this.mMoveDirectionX=A,this.mMoveDirectionY=e,this.mAlwaysInTapRegion=!1,this.mInLongPress=!1,this.mInDragging=!0,-1!=this.mLongPressDelayRequestTaskId&&this.mDelayRequestTaskRunnder.CancelTask(this.mLongPressDelayRequestTaskId))}else this.mInDragging&&(Math.abs(g)>=1||Math.abs(d)>=1)&&(A!=this.mMoveDirectionX&&(Math.abs(g)>=3?this.mMoveDirectionX=A:s.mX=this.mLastFocusX),e!=this.mMoveDirectionY&&(Math.abs(d)>=3?this.mMoveDirectionY=e:s.mY=this.mLastFocusY),this.OnDragMove(this.mCurrentDownEvent,s,o,a,g,d,l,c),this.mLastFocusX=h,this.mLastFocusY=u);break}case Et.NATIVE_CANCEL:case Et.NATIVE_UP:r=new Ce(o,a),console.log("TouchEventProxy touch up"),this.mInLongPress?this.OnLongPressRelease(r):this.mAlwaysInTapRegion?this.OnTap(r):Math.abs(c)>70||Math.abs(l)>70?this.OnFling(this.mCurrentDownEvent,r,o,a,g,d,l,c):this.OnDragEnd(this.mCurrentDownEvent,r,o,a,g,d,l,c),this.OnRelease(r)}}ClearStatus(){-1!=this.mLongPressDelayRequestTaskId&&this.mDelayRequestTaskRunnder.CancelTask(this.mLongPressDelayRequestTaskId),this.mAlwaysInTapRegion=!1,this.mInLongPress=!1,this.mInDragging=!1}OnTap(A){let e=new Ie(me.OnTap,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}OnLongPress(A){let e=new Ie(me.OnLongPress,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}OnDragStart(A,e,t,n,i,s,r,o){let a=new Ie(me.OnDragStart,t,n,A,e,i,s,r,o);Tt.sTouchRecvManager.OnTouchEvent(a)}OnDragMove(A,e,t,n,i,s,r,o){let a=new Ie(me.OnDragMove,t,n,A,e,i,s,r,o);Tt.sTouchRecvManager.OnTouchEvent(a)}OnFling(A,e,t,n,i,s,r,o){let a=new Ie(me.OnFling,t,n,A,e,i,s,r,o);Tt.sTouchRecvManager.OnTouchEvent(a)}OnDragEnd(A,e,t,n,i,s,r,o){this.mInDragging=!1;let a=new Ie(me.OnDragEnd,t,n,A,e,i,s,r,o);Tt.sTouchRecvManager.OnTouchEvent(a)}OnRelease(A){this.ClearStatus();let e=new Ie(me.OnRelease,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}OnLongPressRelease(A){let e=new Ie(me.OnLongPressRelease,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}OnLongPressCancel(A){let e=new Ie(me.OnLongPressCancel,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}OnDown(A){const e=new Ie(me.OnDown,A.mX,A.mY);Tt.sTouchRecvManager.OnTouchEvent(e)}DispatchLongPress(A){null!==A&&(this.mLongPressDelayRequestTaskId=-1,this.mInLongPress=!0,this.OnLongPress(this.mCurrentDownEvent))}}let It=null;let Tt=new class{DoInit(){this.sRenderBridge=pA(),this.sViewSensorManager=(gA||(gA=new CA),gA),this.sTextureManager=function(){Ht||(Ht=new Ot);return Ht}(),this.sViewStore=yA(),this.sTextStyleCache=(YA||(YA=new WA),YA),this.sCustomCanvasResProvider=(XA||(XA=new ZA),XA),this.sParticleManager=ce(),this.sTextUtils=(ue||(ue=new he),ue),this.sFrameCount=(null==de&&(de=new ge),de),this.sTouchRecvManager=(null==yt&&(yt=new Ft),yt),this.sTouchEventProxy=(null==It&&(It=new Ut),It)}};class vt{}vt.RGBA_8888="RGBA_8888",vt.RGBA_4444="RGBA_4444",vt.RGBA_5551="RGBA_5551",vt.RGB_565="RGB_565",vt.RGB_ETC1="RGB_ETC1",vt.RGBA_ETC1="RGBA_ETC1";class xt{}xt.L=1,xt.M=0,xt.Q=3,xt.H=2;class St{}St.AUTO=0,St.SYNC=1,St.ASYNC=2;class bt{constructor(A,e,t=null){if(this._TracerDescript="",this._Manager=A,t){BA.CreateTextureStatus().SetResourceInfo(t)}this.RenderTexture=BA.CreateTexture(),this.RenderTexture.SetResourceInfo(e),this._CallbackIdToken=0,this._OnLoadCallback=[],hA.EnableTextureTracer&&(A._ImageTextureTracer.push(this),this._TracerDescript="")}get Unloaded(){return null===this.RenderTexture||this.RenderTexture.Unloaded}set Unloaded(A){}get LoadTime(){return null!==this.RenderTexture?this.RenderTexture.LoadTime:0}set LoadTime(A){}get Width(){return null!==this.RenderTexture?this.RenderTexture.Width:0}set Width(A){}get Height(){return null!==this.RenderTexture?this.RenderTexture.Height:0}set Height(A){}GetTextureId(){return this.RenderTexture.IdToken}UnloadTex(){this._OnLoadCallback=[],null!==this.RenderTexture&&(this._CallbackIdToken>0&&(this.RenderTexture.UnregisterOnloadCallback(this._CallbackIdToken),this._CallbackIdToken=0),this.RenderTexture.UndoRef(),this.RenderTexture=null),this._TracerDescript=""}RequestToUnload(){this.UnloadTex()}RegisterLoadImageCallback(A){if(this.IsLoaded()&&null!=A)return this.RenderTexture&&A(this.RenderTexture.Width,this.RenderTexture.Height),null;let e=null;return null!=A&&(e={callback:A},this._OnLoadCallback.push(e),0===this._CallbackIdToken&&(rA.Assert(null!==this.RenderTexture),null!=this.RenderTexture&&(this._CallbackIdToken=this.RenderTexture.RegisterOnloadCallback(bt.prototype._InvokeOnLoadCallbacks.bind(this))))),e}UnregisterLoadImageCallback(A){A&&this._OnLoadCallback.some(((e,t,n)=>{if(e===A)return n.splice(t,1),!0}))}EnableBackgroundLoad(A){}DisableBackgroundLoad(A){}_InvokeOnLoadCallbacks(A,e){const t=this._OnLoadCallback;this._OnLoadCallback=[];for(let n=0;n<t.length;n++){t[n].callback(A,e)}this.RenderTexture&&this.RenderTexture.UnregisterOnloadCallback(this._CallbackIdToken)}IsLoaded(){return 0!==this.LoadTime&&!this.Unloaded}SetTextureTracerDescript(A){this._TracerDescript=A}ReallocRenderTexture(){}}class Lt extends bt{constructor(A,e,t,n,i,s){const r=BA.CreateResourceInfo(A.GetId(),"IMG");r.Set={URL:e,Siz:n,Clr:i||"",IsF:t?1:0,NtS:s,ILd:0},super(A,r),this.Name="",this.Source="",this.IsForever=0,this.TargetSize=null,this.VisibleMark=-1,this.Name="IMG",this.Source=e,this.IsForever=t?1:0,this.TargetSize=n,this.ColorSpace=i||vt.RGBA_8888,this.NetSetting=s||null,this._InstantLoad=0,this._ImageElement=new Image;let o=this;this._ImageElement.onload=function(){o._Loaded()},this._ImageElement.onerror=function(){o._Loaded()},this._ImageElement.src=e,this.RenderTexture.NeedCheckExpired=!0}_Loaded(){null!=this.RenderTexture&&(this.RenderTexture.Unloaded=!1,this.RenderTexture.LoadTime=Date.now(),this.RenderTexture.Width=this._ImageElement.width,this.RenderTexture.Height=this._ImageElement.height,this.RenderTexture.InvokeOnloadCallbacks(this._ImageElement.width,this._ImageElement.height))}UnloadTex(){super.UnloadTex(),this._ImageElement&&(this._ImageElement.onload=null,this._ImageElement.onerror=null,this._ImageElement.src=null,this._ImageElement=null)}InstantLoad(A){if(this._InstantLoad=A?1:0,this.RenderTexture){const A=this.RenderTexture.GetResourceInfo();null!==A&&(A.Set.ILd=this._InstantLoad,this.RenderTexture.SetResourceInfo(A))}return this}ReallocRenderTexture(){if(this.IsForever)return void rA.E("ReallocRenderTexture(): NOT need for forever texture");const A=this.Source,e=this.TargetSize,t=this.ColorSpace,n=this.IsForever,i=BA.CreateResourceInfo(this._Manager.GetId(),this.Name);i.Set={URL:A,Siz:e,Clr:t,IsF:n,ILd:this._InstantLoad},this.RenderTexture=BA.CreateTexture(),this.RenderTexture.SetResourceInfo(i)}}let Ht,_t=new Map;class kt extends Lt{constructor(A,e,t,n,i,s){super(A,e,t,n,i,s),_t.set(this.RenderTexture.IdToken,this)}RequestToUnload(){_t.delete(this.RenderTexture.IdToken),super.RequestToUnload()}}class Pt extends bt{constructor(A,e,t,n,i){const s=BA.CreateResourceInfo(A.GetId(),"GRAD");s.Set={URL:i},super(A,s),this.Gradient=i}}class Dt extends bt{constructor(A,e,t,n){const i=BA.CreateResourceInfo(A.GetId(),"LGT");i.Set={L:e,S:t},super(A,i),this.Gradient=n}}Dt.StopPoint=class{constructor(){this.stopPosition=0,this.color=""}};class Rt extends bt{constructor(A,e,t,n,i,s,r,o,a,l,c){const h=BA.CreateResourceInfo(A.GetId(),"TST");let u=null;c&&(u={x:0,y:0,w:0,h:0},Object.assign(u,c)),h.Set={ST:e,IDS:t.GetIdsPack(),W:Math.floor(i.width+.5),H:Math.floor(i.height+.5),FS:s,LA:a,EM:l,LH:Math.floor(r+.5),ILD:o?1:0,TLC:n?1:0,EA:u},super(A,h),this.Name="TST",this._TextStylePack=t,t.DoRef()}UnloadTex(){this._TextStylePack.UnRef(),super.UnloadTex()}}class Ot{constructor(){this._AtlasDataInfo={atlas_data:[],buffer_data_offset:0,textures:[]},this._ClearTimer=-1,this._ImageTextureTracer=[],this._Id=Ot.sTextureManagerToken++,this._CacheMaxSize=100,this.StartScavengerCachedTimer()}StartScavengerCachedTimer(){-1===this._ClearTimer&&(this._ClearTimer=sA.setInterval(this.ScavengerCached.bind(this),3e4))}GetId(){return this._Id}GetGifImage(A,e,t){return this.GetImage(A,e,t)}GetImage(A,e,t){return A?this.GetImage2(A,e,null,vt.RGBA_8888,t,!1,!1):(rA.I("GetImage, url is null!"),null)}GetImage2(A,e,t,n,i,s,r){if(!A)return rA.I("GetImage2, url is null!"),null;if(0==A.indexOf("jsvtexturestore://")){const e=A.lastIndexOf("-");if(-1!==e){const t=A.substr(e+1),n=parseInt(t,10);if(!isNaN(n))return this.GetTextureById(n)}return console.error("Error: jsvtexturestore:// parse failed url="+A),null}let o=null;t&&(o=cA().FormatRectArea(t)),"string"!=typeof n&&(n=A.indexOf(".pkm")>=0?A.indexOf(".pkma")>=0?vt.RGBA_ETC1:vt.RGB_ETC1:vt.RGB_565);return this._GetImageInternal(A,o,n,e,!1,i)}CreateMiniGradientTexture(A,e,t,n){return new Pt(this,A,e,t,n)}_GetImageInternal(A,e,t,n,i,s){return new Lt(this,A,n,e,t,s)}GetRoundCornerMask(A,e){return this.GetCustomCornerMask(A,e,e,e,e)}GetCustomCornerMask(A,e,t,n,i){const s=cA().FormatRectArea(A);if(null==s)return null;const r=Math.max(e,t,n,i);if(r>s.width/2||r>s.height/2)return rA.E(`TextureManager.GetRoundCornerMask(): radius is too large, radius=${r} w=${s.width} h=${s.height}`),null;const o=BA.CreateResourceInfo(this._Id,"CCM");o.Set={W:s.width,H:s.height,LT:e,RT:t,LB:n,RB:i};const a=new bt(this,o);return hA.EnableTextureTracer&&a.SetTextureTracerDescript("CornerMask"),a}GetOneCornerMask(A){const e=BA.CreateResourceInfo(this._Id,"OCM");e.Set={Rad:A};const t=new bt(this,e);return hA.EnableTextureTracer&&t.SetTextureTracerDescript("OneCornerMask"),t}GetTextTextureFromStylePack(A,e,t,n,i,s,r,o,a,l){return A&&0!==A.length?new Rt(this,A,e,t,n,i,s,r,o,a,l):null}GetCanvasTexture(A,e){return new kt(this,Tt.sCustomCanvasResProvider.GetDataUrl(A),!1,null,vt.RGBA_8888,null)}GetColorTexture(A){const e=BA.CreateResourceInfo(this._Id,"CT");e.Set={Clr:A};const t=new bt(this,e);return hA.EnableTextureTracer&&t.SetTextureTracerDescript(`Color[${A}]`),t}GetColorTextureCached(A){return this.GetColorTexture(A)}GetNamedCachedTexture(A){return null}GetCapturedTexture(){return new Lt(this,"",!1,null,vt.RGBA_8888,null)}CreateCssGradientColorTexture(A,e,t,n,i,s){let r=[];for(let A of s){let e={stop:A.stopPosition,color:A.color};r.push(e)}return new Dt(this,JSON.stringify({x0:e,y0:t,x1:n,y1:i}),JSON.stringify(r),A)}ScavengerCached(){}GetTextureById(A){return _t.has(A)?_t.get(A):null}}Ot.sTextureManagerToken=100;class Mt{constructor(){this.Width=0,this.Height=0,this.MarginTop=0,this.MarginLeft=0,this.MarginRight=0,this.MarginBottom=0,this.Z=0}SetPosition(A,e,t){this.MarginTop=e,this.MarginLeft=A,t&&(this.Z=t)}SetSize(A,e){this.Width=A,this.Height=e}Clone(){const A=new Mt;return A.Width=this.Width,A.Height=this.Height,A.MarginTop=this.MarginTop,A.MarginLeft=this.MarginLeft,A.MarginRight=this.MarginRight,A.MarginBottom=this.MarginBottom,A.Z=this.Z,A}Equals(A){return A.Width===this.Width&&A.Height===this.Height&&A.MarginTop===this.MarginTop&&A.MarginLeft===this.MarginLeft&&A.MarginRight===this.MarginRight&&A.MarginBottom===this.MarginBottom&&A.Z===this.Z}}class Vt extends Mt{constructor(A){super(),A instanceof oA&&(A={x:A.x,y:A.y,width:A.width,height:A.height}),A&&(A.x?this.MarginLeft=A.x:A.marginLeft&&(this.MarginLeft=A.marginLeft),A.y?this.MarginTop=A.y:A.marginTop&&(this.MarginTop=A.marginTop),A.z&&(this.Z=A.z),A.width&&(this.Width=A.width),A.height&&(this.Height=A.height),isNaN(this.MarginTop)&&(rA.E("isNaN(this.MarginTop)!"),this.MarginTop=0),isNaN(this.MarginLeft)&&(rA.E("isNaN(this.MarginLeft)!"),this.MarginLeft=0))}}const Gt={NoSet:1,Auto:2,Row:3,RowReverse:4,Column:5,ColumnReverse:6,NoWrap:7,Wrap:8,WrapReverse:9,FlexStart:10,FlexEnd:11,Center:12,SpaceBetween:13,SpaceAround:14,SpaceEvenly:15,Stretch:16,Baseline:17};let Kt;
2
+ /*!
3
+ * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
4
+ * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
5
+ * Released under MIT License
6
+ */
7
+ let Nt=null;function Wt(A,e){return function(){if(null!=Nt)return;let A=window.JsvCode.Dom.RenderDocument;e=function(){
8
+ /*! *****************************************************************************
9
+ Copyright (c) Microsoft Corporation.
10
+
11
+ Permission to use, copy, modify, and/or distribute this software for any
12
+ purpose with or without fee is hereby granted.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ PERFORMANCE OF THIS SOFTWARE.
21
+ ***************************************************************************** */
22
+ var e=function(A,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},e(A,t)};function t(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=A}e(A,t),A.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var n=function(){return n=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(A[i]=e[i]);return A},n.apply(this,arguments)};function i(A,e,t,n){function i(A){return A instanceof t?A:new t((function(e){e(A)}))}return new(t||(t=Promise))((function(t,s){function r(A){try{a(n.next(A))}catch(A){s(A)}}function o(A){try{a(n.throw(A))}catch(A){s(A)}}function a(A){A.done?t(A.value):i(A.value).then(r,o)}a((n=n.apply(A,e||[])).next())}))}function s(A,e){var t,n,i,s,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(A){return function(e){return a([A,e])}}function a(s){if(t)throw new TypeError("Generator is already executing.");for(;r;)try{if(t=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,n=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(A,r)}catch(A){s=[6,A],n=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function r(A,e,t){if(t||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return A.concat(n||e)}for(var o=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,i){return new A(this.left+e,this.top+t,this.width+n,this.height+i)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find((function(A){return 0!==A.width}));return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),a=function(A,e){return o.fromClientRect(A,e.getBoundingClientRect())},l=function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),i=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new o(0,0,n,i)},c=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var s=A.charCodeAt(t++);56320==(64512&s)?e.push(((1023&i)<<10)+(1023&s)+65536):(e.push(i),t--)}else e.push(i)}return e},h=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,s="";++i<t;){var r=A[i];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(i+1===t||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<u.length;d++)g[u.charCodeAt(d)]=d;for(var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<B.length;w++)f[B.charCodeAt(w)]=w;for(var p=function(A){var e,t,n,i,s,r=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),c=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<o;e+=4)t=f[A.charCodeAt(e)],n=f[A.charCodeAt(e+1)],i=f[A.charCodeAt(e+2)],s=f[A.charCodeAt(e+3)],c[a++]=t<<2|n>>4,c[a++]=(15&n)<<4|i>>2,c[a++]=(3&i)<<6|63&s;return l},C=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},m=function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t},F=5,y=11,Q=2,E=65536>>F,U=(1<<F)-1,I=E+(1024>>F)+32,T=65536>>y,v=(1<<y-F)-1,x=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},S=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},b=function(A,e){var t=p(A),n=Array.isArray(t)?m(t):new Uint32Array(t),i=Array.isArray(t)?C(t):new Uint16Array(t),s=24,r=x(i,s/2,n[4]/2),o=2===n[5]?x(i,(s+n[4])/2):S(n,Math.ceil((s+n[4])/4));return new L(n[0],n[1],n[2],n[3],r,o)},L=function(){function A(A,e,t,n,i,s){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=s}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>F])<<Q)+(A&U),this.data[e];if(A<=65535)return e=((e=this.index[E+(A-55296>>F)])<<Q)+(A&U),this.data[e];if(A<this.highStart)return e=I-T+(A>>y),e=this.index[e],e+=A>>F&v,e=((e=this.index[e])<<Q)+(A&U),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),k=0;k<H.length;k++)_[H.charCodeAt(k)]=k;var P=50,D=1,R=2,O=3,M=4,V=5,G=7,K=8,N=9,W=10,Y=11,X=12,J=13,j=14,z=15,Z=16,$=17,q=18,AA=19,eA=20,tA=21,nA=22,iA=23,sA=24,rA=25,oA=26,aA=27,lA=28,cA=29,hA=30,uA=31,gA=32,dA=33,BA=34,fA=35,wA=36,pA=37,CA=38,mA=39,FA=40,yA=41,QA=42,EA=43,UA=[9001,65288],IA="!",TA="×",vA="÷",xA=b("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),SA=[hA,wA],bA=[D,R,O,V],LA=[W,K],HA=[aA,oA],_A=bA.concat(LA),kA=[CA,mA,FA,BA,fA],PA=[z,J],DA=function(A,e){void 0===e&&(e="strict");var t=[],n=[],i=[];return A.forEach((function(A,s){var r=xA.get(A);if(r>P?(i.push(!0),r-=P):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(s),t.push(Z);if(r===M||r===Y){if(0===s)return n.push(s),t.push(hA);var o=t[s-1];return-1===_A.indexOf(o)?(n.push(n[s-1]),t.push(o)):(n.push(s),t.push(hA))}return n.push(s),r===uA?t.push("strict"===e?tA:pA):r===QA||r===cA?t.push(hA):r===EA?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(pA):t.push(hA):void t.push(r)})),[n,t,i]},RA=function(A,e,t,n){var i=n[t];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var s=t;s<=n.length;){if((a=n[++s])===e)return!0;if(a!==W)break}if(i===W)for(s=t;s>0;){var r=n[--s];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var o=t;o<=n.length;){var a;if((a=n[++o])===e)return!0;if(a!==W)break}if(r!==W)break}return!1},OA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==W)return n;t--}return 0},MA=function(A,e,t,n,i){if(0===t[n])return TA;var s=n-1;if(Array.isArray(i)&&!0===i[s])return TA;var r=s-1,o=s+1,a=e[s],l=r>=0?e[r]:0,c=e[o];if(a===R&&c===O)return TA;if(-1!==bA.indexOf(a))return IA;if(-1!==bA.indexOf(c))return TA;if(-1!==LA.indexOf(c))return TA;if(OA(s,e)===K)return vA;if(xA.get(A[s])===Y)return TA;if((a===gA||a===dA)&&xA.get(A[o])===Y)return TA;if(a===G||c===G)return TA;if(a===N)return TA;if(-1===[W,J,z].indexOf(a)&&c===N)return TA;if(-1!==[$,q,AA,sA,lA].indexOf(c))return TA;if(OA(s,e)===nA)return TA;if(RA(iA,nA,s,e))return TA;if(RA([$,q],tA,s,e))return TA;if(RA(X,X,s,e))return TA;if(a===W)return vA;if(a===iA||c===iA)return TA;if(c===Z||a===Z)return vA;if(-1!==[J,z,tA].indexOf(c)||a===j)return TA;if(l===wA&&-1!==PA.indexOf(a))return TA;if(a===lA&&c===wA)return TA;if(c===eA)return TA;if(-1!==SA.indexOf(c)&&a===rA||-1!==SA.indexOf(a)&&c===rA)return TA;if(a===aA&&-1!==[pA,gA,dA].indexOf(c)||-1!==[pA,gA,dA].indexOf(a)&&c===oA)return TA;if(-1!==SA.indexOf(a)&&-1!==HA.indexOf(c)||-1!==HA.indexOf(a)&&-1!==SA.indexOf(c))return TA;if(-1!==[aA,oA].indexOf(a)&&(c===rA||-1!==[nA,z].indexOf(c)&&e[o+1]===rA)||-1!==[nA,z].indexOf(a)&&c===rA||a===rA&&-1!==[rA,lA,sA].indexOf(c))return TA;if(-1!==[rA,lA,sA,$,q].indexOf(c))for(var h=s;h>=0;){if((u=e[h])===rA)return TA;if(-1===[lA,sA].indexOf(u))break;h--}if(-1!==[aA,oA].indexOf(c))for(h=-1!==[$,q].indexOf(a)?r:s;h>=0;){var u;if((u=e[h])===rA)return TA;if(-1===[lA,sA].indexOf(u))break;h--}if(CA===a&&-1!==[CA,mA,BA,fA].indexOf(c)||-1!==[mA,BA].indexOf(a)&&-1!==[mA,FA].indexOf(c)||-1!==[FA,fA].indexOf(a)&&c===FA)return TA;if(-1!==kA.indexOf(a)&&-1!==[eA,oA].indexOf(c)||-1!==kA.indexOf(c)&&a===aA)return TA;if(-1!==SA.indexOf(a)&&-1!==SA.indexOf(c))return TA;if(a===sA&&-1!==SA.indexOf(c))return TA;if(-1!==SA.concat(rA).indexOf(a)&&c===nA&&-1===UA.indexOf(A[o])||-1!==SA.concat(rA).indexOf(c)&&a===q)return TA;if(a===yA&&c===yA){for(var g=t[s],d=1;g>0&&e[--g]===yA;)d++;if(d%2!=0)return TA}return a===gA&&c===dA?TA:vA},VA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=DA(A,e.lineBreak),n=t[0],i=t[1],s=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(i=i.map((function(A){return-1!==[rA,hA,QA].indexOf(A)?pA:A})));var r="keep-all"===e.wordBreak?s.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0;return[n,i,r]},GA=function(){function A(A,e,t,n){this.codePoints=A,this.required=e===IA,this.start=t,this.end=n}return A.prototype.slice=function(){return h.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),KA=function(A,e){var t=c(A),n=VA(t,e),i=n[0],s=n[1],r=n[2],o=t.length,a=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var A=TA;l<o&&(A=MA(t,s,i,++l,r))===TA;);if(A!==TA||l===o){var e=new GA(t,A,a,l);return a=l,{value:e,done:!1}}return{done:!0,value:null}}}},NA=1,WA=2,YA=4,XA=8,JA=10,jA=47,zA=92,ZA=9,$A=32,qA=34,Ae=61,ee=35,te=36,ne=37,ie=39,se=40,re=41,oe=95,ae=45,le=33,ce=60,he=62,ue=64,ge=91,de=93,Be=61,fe=123,we=63,pe=125,Ce=124,me=126,Fe=128,ye=65533,Qe=42,Ee=43,Ue=44,Ie=58,Te=59,ve=46,xe=0,Se=8,be=11,Le=14,He=31,_e=127,ke=-1,Pe=48,De=97,Re=101,Oe=102,Me=117,Ve=122,Ge=65,Ke=69,Ne=70,We=85,Ye=90,Xe=function(A){return A>=Pe&&A<=57},Je=function(A){return A>=55296&&A<=57343},je=function(A){return Xe(A)||A>=Ge&&A<=Ne||A>=De&&A<=Oe},ze=function(A){return A>=De&&A<=Ve},Ze=function(A){return A>=Ge&&A<=Ye},$e=function(A){return ze(A)||Ze(A)},qe=function(A){return A>=Fe},At=function(A){return A===JA||A===ZA||A===$A},et=function(A){return $e(A)||qe(A)||A===oe},tt=function(A){return et(A)||Xe(A)||A===ae},nt=function(A){return A>=xe&&A<=Se||A===be||A>=Le&&A<=He||A===_e},it=function(A,e){return A===zA&&e!==JA},st=function(A,e,t){return A===ae?et(e)||it(e,t):!!et(A)||!(A!==zA||!it(A,e))},rt=function(A,e,t){return A===Ee||A===ae?!!Xe(e)||e===ve&&Xe(t):Xe(A===ve?e:A)},ot=function(A){var e=0,t=1;A[e]!==Ee&&A[e]!==ae||(A[e]===ae&&(t=-1),e++);for(var n=[];Xe(A[e]);)n.push(A[e++]);var i=n.length?parseInt(h.apply(void 0,n),10):0;A[e]===ve&&e++;for(var s=[];Xe(A[e]);)s.push(A[e++]);var r=s.length,o=r?parseInt(h.apply(void 0,s),10):0;A[e]!==Ke&&A[e]!==Re||e++;var a=1;A[e]!==Ee&&A[e]!==ae||(A[e]===ae&&(a=-1),e++);for(var l=[];Xe(A[e]);)l.push(A[e++]);var c=l.length?parseInt(h.apply(void 0,l),10):0;return t*(i+o*Math.pow(10,-r))*Math.pow(10,a*c)},at={type:2},lt={type:3},ct={type:4},ht={type:13},ut={type:8},gt={type:21},dt={type:9},Bt={type:10},ft={type:11},wt={type:12},pt={type:14},Ct={type:23},mt={type:1},Ft={type:25},yt={type:24},Qt={type:26},Et={type:27},Ut={type:28},It={type:29},Tt={type:31},vt={type:32},xt=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(c(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==vt;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case qA:return this.consumeStringToken(qA);case ee:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(tt(e)||it(t,n)){var i=st(e,t,n)?WA:NA;return{type:5,value:this.consumeName(),flags:i}}break;case te:if(this.peekCodePoint(0)===Ae)return this.consumeCodePoint(),ht;break;case ie:return this.consumeStringToken(ie);case se:return at;case re:return lt;case Qe:if(this.peekCodePoint(0)===Ae)return this.consumeCodePoint(),pt;break;case Ee:if(rt(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case Ue:return ct;case ae:var s=A,r=this.peekCodePoint(0),o=this.peekCodePoint(1);if(rt(s,r,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(st(s,r,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(r===ae&&o===he)return this.consumeCodePoint(),this.consumeCodePoint(),yt;break;case ve:if(rt(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case jA:if(this.peekCodePoint(0)===Qe)for(this.consumeCodePoint();;){var a=this.consumeCodePoint();if(a===Qe&&(a=this.consumeCodePoint())===jA)return this.consumeToken();if(a===ke)return this.consumeToken()}break;case Ie:return Qt;case Te:return Et;case ce:if(this.peekCodePoint(0)===le&&this.peekCodePoint(1)===ae&&this.peekCodePoint(2)===ae)return this.consumeCodePoint(),this.consumeCodePoint(),Ft;break;case ue:var l=this.peekCodePoint(0),c=this.peekCodePoint(1),u=this.peekCodePoint(2);if(st(l,c,u))return{type:7,value:this.consumeName()};break;case ge:return Ut;case zA:if(it(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case de:return It;case Be:if(this.peekCodePoint(0)===Ae)return this.consumeCodePoint(),ut;break;case fe:return ft;case pe:return wt;case Me:case We:var g=this.peekCodePoint(0),d=this.peekCodePoint(1);return g!==Ee||!je(d)&&d!==we||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case Ce:if(this.peekCodePoint(0)===Ae)return this.consumeCodePoint(),dt;if(this.peekCodePoint(0)===Ce)return this.consumeCodePoint(),gt;break;case me:if(this.peekCodePoint(0)===Ae)return this.consumeCodePoint(),Bt;break;case ke:return vt}return At(A)?(this.consumeWhiteSpace(),Tt):Xe(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):et(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:h(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();je(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;e===we&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(h.apply(void 0,A.map((function(A){return A===we?Pe:A}))),16),end:parseInt(h.apply(void 0,A.map((function(A){return A===we?Ne:A}))),16)};var n=parseInt(h.apply(void 0,A),16);if(this.peekCodePoint(0)===ae&&je(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var i=[];je(e)&&i.length<6;)i.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(h.apply(void 0,i),16)}}return{type:30,start:n,end:n}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&this.peekCodePoint(0)===se?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===se?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===ke)return{type:22,value:""};var e=this.peekCodePoint(0);if(e===ie||e===qA){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===ke||this.peekCodePoint(0)===re)?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),Ct)}for(;;){var n=this.consumeCodePoint();if(n===ke||n===re)return{type:22,value:h.apply(void 0,A)};if(At(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===ke||this.peekCodePoint(0)===re?(this.consumeCodePoint(),{type:22,value:h.apply(void 0,A)}):(this.consumeBadUrlRemnants(),Ct);if(n===qA||n===ie||n===se||nt(n))return this.consumeBadUrlRemnants(),Ct;if(n===zA){if(!it(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Ct;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;At(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(A===re||A===ke)return;it(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e=5e4,t="";A>0;){var n=Math.min(e,A);t+=h.apply(void 0,this._value.splice(0,n)),A-=n}return this._value.shift(),t},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===ke||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(n===JA)return this._value.splice(0,t),mt;if(n===zA){var i=this._value[t+1];i!==ke&&void 0!==i&&(i===JA?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):it(n,i)&&(e+=this.consumeStringSlice(t),e+=h(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=YA,t=this.peekCodePoint(0);for(t!==Ee&&t!==ae||A.push(this.consumeCodePoint());Xe(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(t===ve&&Xe(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=XA;Xe(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((t===Ke||t===Re)&&((n===Ee||n===ae)&&Xe(i)||Xe(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=XA;Xe(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[ot(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),i=this.peekCodePoint(1),s=this.peekCodePoint(2);return st(n,i,s)?{type:15,number:e,flags:t,unit:this.consumeName()}:n===ne?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(je(A)){for(var e=h(A);je(this.peekCodePoint(0))&&e.length<6;)e+=h(this.consumeCodePoint());At(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||Je(t)||t>1114111?ye:t}return A===ke?ye:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(tt(e))A+=h(e);else{if(!it(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=h(this.consumeEscapedCodePoint())}}},A}(),St=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new xt;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||Ot(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?vt:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),bt=function(A){return 15===A.type},Lt=function(A){return 17===A.type},Ht=function(A){return 20===A.type},_t=function(A){return 0===A.type},kt=function(A,e){return Ht(A)&&A.value===e},Pt=function(A){return 31!==A.type},Dt=function(A){return 31!==A.type&&4!==A.type},Rt=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},Ot=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},Mt=function(A){return 17===A.type||15===A.type},Vt=function(A){return 16===A.type||Mt(A)},Gt=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},Kt={type:17,number:0,flags:YA},Nt={type:16,number:50,flags:YA},Wt={type:16,number:100,flags:YA},Yt=function(A,e,t){var n=A[0],i=A[1];return[Xt(n,e),Xt(void 0!==i?i:n,t)]},Xt=function(A,e){if(16===A.type)return A.number/100*e;if(bt(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Jt="deg",jt="grad",zt="rad",Zt="turn",$t={name:"angle",parse:function(A,e){if(15===e.type)switch(e.unit){case Jt:return Math.PI*e.number/180;case jt:return Math.PI/200*e.number;case zt:return e.number;case Zt:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")}},qt=function(A){return 15===A.type&&(A.unit===Jt||A.unit===jt||A.unit===zt||A.unit===Zt)},An=function(A){switch(A.filter(Ht).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Kt,Kt];case"to top":case"bottom":return en(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Kt,Wt];case"to right":case"left":return en(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Wt,Wt];case"to bottom":case"top":return en(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Wt,Kt];case"to left":case"right":return en(270)}return 0},en=function(A){return Math.PI*A/180},tn={name:"color",parse:function(A,e){if(18===e.type){var t=hn[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var n=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3);return rn(parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(4===e.value.length){n=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3);var r=e.value.substring(3,4);return rn(parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(r+r,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6),rn(parseInt(n,16),parseInt(i,16),parseInt(s,16),1);if(8===e.value.length)return n=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6),r=e.value.substring(6,8),rn(parseInt(n,16),parseInt(i,16),parseInt(s,16),parseInt(r,16)/255)}if(20===e.type){var o=gn[e.value.toUpperCase()];if(void 0!==o)return o}return gn.TRANSPARENT}},nn=function(A){return 0==(255&A)},sn=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,i=255&A>>24;return e<255?"rgba("+i+","+n+","+t+","+e/255+")":"rgb("+i+","+n+","+t+")"},rn=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n)<<0)>>>0},on=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},an=function(A,e){var t=e.filter(Dt);if(3===t.length){var n=t.map(on),i=n[0],s=n[1],r=n[2];return rn(i,s,r,1)}if(4===t.length){var o=t.map(on),a=(i=o[0],s=o[1],r=o[2],o[3]);return rn(i,s,r,a)}return 0};function ln(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var cn=function(A,e){var t=e.filter(Dt),n=t[0],i=t[1],s=t[2],r=t[3],o=(17===n.type?en(n.number):$t.parse(A,n))/(2*Math.PI),a=Vt(i)?i.number/100:0,l=Vt(s)?s.number/100:0,c=void 0!==r&&Vt(r)?Xt(r,1):1;if(0===a)return rn(255*l,255*l,255*l,1);var h=l<=.5?l*(a+1):l+a-l*a,u=2*l-h,g=ln(u,h,o+1/3),d=ln(u,h,o),B=ln(u,h,o-1/3);return rn(255*g,255*d,255*B,c)},hn={hsl:cn,hsla:cn,rgb:an,rgba:an},un=function(A,e){return tn.parse(A,St.create(e).parseComponentValue())},gn={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},dn={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Ht(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Bn={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fn=function(A,e){var t=tn.parse(A,e[0]),n=e[1];return n&&Vt(n)?{color:t,stop:n}:{color:t,stop:null}},wn=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=Kt),null===n.stop&&(n.stop=Wt);for(var i=[],s=0,r=0;r<A.length;r++){var o=A[r].stop;if(null!==o){var a=Xt(o,e);a>s?i.push(a):i.push(s),s=a}else i.push(null)}var l=null;for(r=0;r<i.length;r++){var c=i[r];if(null===c)null===l&&(l=r);else if(null!==l){for(var h=r-l,u=(c-i[l-1])/(h+1),g=1;g<=h;g++)i[l+g-1]=u*g;l=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,i[t]/e),0)}}))},pn=function(A,e,t){var n=e/2,i=t/2,s=Xt(A[0],e)-n,r=i-Xt(A[1],t);return(Math.atan2(r,s)+2*Math.PI)%(2*Math.PI)},Cn=function(A,e,t){var n="number"==typeof A?A:pn(A,e,t),i=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),s=e/2,r=t/2,o=i/2,a=Math.sin(n-Math.PI/2)*o,l=Math.cos(n-Math.PI/2)*o;return[i,s-l,s+l,r-a,r+a]},mn=function(A,e){return Math.sqrt(A*A+e*e)},Fn=function(A,e,t,n,i){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var s=e[0],r=e[1],o=mn(t-s,n-r);return(i?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},yn=function(A,e,t,n,i){var s=0,r=0;switch(A.size){case 0:0===A.shape?s=r=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(s=Math.min(Math.abs(e),Math.abs(e-n)),r=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(0===A.shape)s=r=Math.min(mn(e,t),mn(e,t-i),mn(e-n,t),mn(e-n,t-i));else if(1===A.shape){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-n)),a=Fn(n,i,e,t,!0),l=a[0],c=a[1];r=o*(s=mn(l-e,(c-t)/o))}break;case 1:0===A.shape?s=r=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(s=Math.max(Math.abs(e),Math.abs(e-n)),r=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(0===A.shape)s=r=Math.max(mn(e,t),mn(e,t-i),mn(e-n,t),mn(e-n,t-i));else if(1===A.shape){o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-n));var h=Fn(n,i,e,t,!1);l=h[0],c=h[1],r=o*(s=mn(l-e,(c-t)/o))}}return Array.isArray(A.size)&&(s=Xt(A.size[0],n),r=2===A.size.length?Xt(A.size[1],i):s),[s,r]},Qn=function(A,e){var t=en(180),n=[];return Rt(e).forEach((function(e,i){if(0===i){var s=e[0];if(20===s.type&&"to"===s.value)return void(t=An(e));if(qt(s))return void(t=$t.parse(A,s))}var r=fn(A,e);n.push(r)})),{angle:t,stops:n,type:1}},En=function(A,e){var t=en(180),n=[];return Rt(e).forEach((function(e,i){if(0===i){var s=e[0];if(20===s.type&&-1!==["top","left","right","bottom"].indexOf(s.value))return void(t=An(e));if(qt(s))return void(t=($t.parse(A,s)+en(270))%en(360))}var r=fn(A,e);n.push(r)})),{angle:t,stops:n,type:1}},Un=function(A,e){var t=en(180),n=[],i=1,s=0,r=3,o=[];return Rt(e).forEach((function(e,t){var s=e[0];if(0===t){if(Ht(s)&&"linear"===s.value)return void(i=1);if(Ht(s)&&"radial"===s.value)return void(i=2)}if(18===s.type)if("from"===s.name){var r=tn.parse(A,s.values[0]);n.push({stop:Kt,color:r})}else if("to"===s.name)r=tn.parse(A,s.values[0]),n.push({stop:Wt,color:r});else if("color-stop"===s.name){var o=s.values.filter(Dt);if(2===o.length){r=tn.parse(A,o[1]);var a=o[0];Lt(a)&&n.push({stop:{type:16,number:100*a.number,flags:a.flags},color:r})}}})),1===i?{angle:(t+en(180))%en(360),stops:n,type:i}:{size:r,shape:s,stops:n,position:o,type:i}},In="closest-side",Tn="farthest-side",vn="closest-corner",xn="farthest-corner",Sn="circle",bn="ellipse",Ln="cover",Hn="contain",_n=function(A,e){var t=0,n=3,i=[],s=[];return Rt(e).forEach((function(e,r){var o=!0;if(0===r){var a=!1;o=e.reduce((function(A,e){if(a)if(Ht(e))switch(e.value){case"center":return s.push(Nt),A;case"top":case"left":return s.push(Kt),A;case"right":case"bottom":return s.push(Wt),A}else(Vt(e)||Mt(e))&&s.push(e);else if(Ht(e))switch(e.value){case Sn:return t=0,!1;case bn:return t=1,!1;case"at":return a=!0,!1;case In:return n=0,!1;case Ln:case Tn:return n=1,!1;case Hn:case vn:return n=2,!1;case xn:return n=3,!1}else if(Mt(e)||Vt(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)}if(o){var l=fn(A,e);i.push(l)}})),{size:n,shape:t,stops:i,position:s,type:2}},kn=function(A,e){var t=0,n=3,i=[],s=[];return Rt(e).forEach((function(e,r){var o=!0;if(0===r?o=e.reduce((function(A,e){if(Ht(e))switch(e.value){case"center":return s.push(Nt),!1;case"top":case"left":return s.push(Kt),!1;case"right":case"bottom":return s.push(Wt),!1}else if(Vt(e)||Mt(e))return s.push(e),!1;return A}),o):1===r&&(o=e.reduce((function(A,e){if(Ht(e))switch(e.value){case Sn:return t=0,!1;case bn:return t=1,!1;case Hn:case In:return n=0,!1;case Tn:return n=1,!1;case vn:return n=2,!1;case Ln:case xn:return n=3,!1}else if(Mt(e)||Vt(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)),o){var a=fn(A,e);i.push(a)}})),{size:n,shape:t,stops:i,position:s,type:2}},Pn=function(A){return 1===A.type},Dn=function(A){return 2===A.type},Rn={name:"image",parse:function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=Vn[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(A,e.values)}throw new Error("Unsupported image type "+e.type)}};function On(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Vn[A.name])}var Mn,Vn={"linear-gradient":Qn,"-moz-linear-gradient":En,"-ms-linear-gradient":En,"-o-linear-gradient":En,"-webkit-linear-gradient":En,"radial-gradient":_n,"-moz-radial-gradient":kn,"-ms-radial-gradient":kn,"-o-radial-gradient":kn,"-webkit-radial-gradient":kn,"-webkit-gradient":Un},Gn={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return Dt(A)&&On(A)})).map((function(e){return Rn.parse(A,e)}))}},Kn={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Ht(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Nn={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return Rt(e).map((function(A){return A.filter(Vt)})).map(Gt)}},Wn={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return Rt(e).map((function(A){return A.filter(Ht).map((function(A){return A.value})).join(" ")})).map(Yn)}},Yn=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Mn||(Mn={}));var Xn,Jn={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return Rt(e).map((function(A){return A.filter(jn)}))}},jn=function(A){return Ht(A)||Vt(A)},zn=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Zn=zn("top"),$n=zn("right"),qn=zn("bottom"),Ai=zn("left"),ei=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Gt(e.filter(Vt))}}},ti=ei("top-left"),ni=ei("top-right"),ii=ei("bottom-right"),si=ei("bottom-left"),ri=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},oi=ri("top"),ai=ri("right"),li=ri("bottom"),ci=ri("left"),hi=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return bt(e)?e.number:0}}},ui=hi("top"),gi=hi("right"),di=hi("bottom"),Bi=hi("left"),fi={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wi={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},pi={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(Ht).reduce((function(A,e){return A|Ci(e.value)}),0)}},Ci=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},mi={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Fi={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Xn||(Xn={}));var yi,Qi={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xn.STRICT:Xn.NORMAL}},Ei={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ui=function(A,e){return Ht(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:Vt(A)?Xt(A,e):e},Ii={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Rn.parse(A,e)}},Ti={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},vi={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},xi=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},Si=xi("top"),bi=xi("right"),Li=xi("bottom"),Hi=xi("left"),_i={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(Ht).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},ki={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Pi=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Di=Pi("top"),Ri=Pi("right"),Oi=Pi("bottom"),Mi=Pi("left"),Vi={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Gi={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Ki={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&kt(e[0],"none")?[]:Rt(e).map((function(e){for(var t={color:gn.TRANSPARENT,offsetX:Kt,offsetY:Kt,blur:Kt},n=0,i=0;i<e.length;i++){var s=e[i];Mt(s)?(0===n?t.offsetX=s:1===n?t.offsetY=s:t.blur=s,n++):t.color=tn.parse(A,s)}return t}))}},Ni={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Wi={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=Yi[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Yi={matrix:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number}));return 6===e.length?e:null},matrix3d:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number})),t=e[0],n=e[1];e[2],e[3];var i=e[4],s=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var r=e[12],o=e[13];return e[14],e[15],16===e.length?[t,n,i,s,r,o]:null}},Xi={type:16,number:50,flags:YA},Ji=[Xi,Xi],ji={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter(Vt);return 2!==t.length?Ji:[t[0],t[1]]}},zi={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(yi||(yi={}));for(var Zi={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return yi.BREAK_ALL;case"keep-all":return yi.KEEP_ALL;default:return yi.NORMAL}}},$i={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(Lt(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},qi={name:"time",parse:function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},As={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return Lt(e)?e.number:1}},es={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ts={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(Ht).map((function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(A){return 0!==A}))}},ns={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach((function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}})),t.length&&n.push(t.join(" ")),n.map((function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"}))}},is={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},ss={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return Lt(e)?e.number:Ht(e)&&"bold"===e.value?700:400}},rs={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(Ht).map((function(A){return A.value}))}},os={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},as=function(A,e){return 0!=(A&e)},ls={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},cs={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],i=e.filter(Pt),s=0;s<i.length;s++){var r=i[s],o=i[s+1];if(20===r.type){var a=o&&Lt(o)?o.number:1;n.push({counter:r.value,increment:a})}}return n}},hs={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(Pt),i=0;i<n.length;i++){var s=n[i],r=n[i+1];if(Ht(s)&&"none"!==s.value){var o=r&&Lt(r)?r.number:0;t.push({counter:s.value,reset:o})}}return t}},us={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(bt).map((function(e){return qi.parse(A,e)}))}},gs={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],i=e.filter(_t);if(i.length%2!=0)return null;for(var s=0;s<i.length;s+=2){var r=i[s].value,o=i[s+1].value;n.push({open:r,close:o})}return n}},ds=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},Bs={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&kt(e[0],"none")?[]:Rt(e).map((function(e){for(var t={color:255,offsetX:Kt,offsetY:Kt,blur:Kt,spread:Kt,inset:!1},n=0,i=0;i<e.length;i++){var s=e[i];kt(s,"inset")?t.inset=!0:Mt(s)?(0===n?t.offsetX=s:1===n?t.offsetY=s:2===n?t.blur=s:t.spread=s,n++):t.color=tn.parse(A,s)}return t}))}},fs={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[0,1,2],n=[];return e.filter(Ht).forEach((function(A){switch(A.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2)}})),t.forEach((function(A){-1===n.indexOf(A)&&n.push(A)})),n}},ws={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},ps={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return bt(e)?e.number:0}},Cs=function(){function A(A,e){var t,n;this.animationDuration=ys(A,us,e.animationDuration),this.backgroundClip=ys(A,dn,e.backgroundClip),this.backgroundColor=ys(A,Bn,e.backgroundColor),this.backgroundImage=ys(A,Gn,e.backgroundImage),this.backgroundOrigin=ys(A,Kn,e.backgroundOrigin),this.backgroundPosition=ys(A,Nn,e.backgroundPosition),this.backgroundRepeat=ys(A,Wn,e.backgroundRepeat),this.backgroundSize=ys(A,Jn,e.backgroundSize),this.borderTopColor=ys(A,Zn,e.borderTopColor),this.borderRightColor=ys(A,$n,e.borderRightColor),this.borderBottomColor=ys(A,qn,e.borderBottomColor),this.borderLeftColor=ys(A,Ai,e.borderLeftColor),this.borderTopLeftRadius=ys(A,ti,e.borderTopLeftRadius),this.borderTopRightRadius=ys(A,ni,e.borderTopRightRadius),this.borderBottomRightRadius=ys(A,ii,e.borderBottomRightRadius),this.borderBottomLeftRadius=ys(A,si,e.borderBottomLeftRadius),this.borderTopStyle=ys(A,oi,e.borderTopStyle),this.borderRightStyle=ys(A,ai,e.borderRightStyle),this.borderBottomStyle=ys(A,li,e.borderBottomStyle),this.borderLeftStyle=ys(A,ci,e.borderLeftStyle),this.borderTopWidth=ys(A,ui,e.borderTopWidth),this.borderRightWidth=ys(A,gi,e.borderRightWidth),this.borderBottomWidth=ys(A,di,e.borderBottomWidth),this.borderLeftWidth=ys(A,Bi,e.borderLeftWidth),this.boxShadow=ys(A,Bs,e.boxShadow),this.color=ys(A,fi,e.color),this.direction=ys(A,wi,e.direction),this.display=ys(A,pi,e.display),this.float=ys(A,mi,e.cssFloat),this.fontFamily=ys(A,ns,e.fontFamily),this.fontSize=ys(A,is,e.fontSize),this.fontStyle=ys(A,os,e.fontStyle),this.fontVariant=ys(A,rs,e.fontVariant),this.fontWeight=ys(A,ss,e.fontWeight),this.letterSpacing=ys(A,Fi,e.letterSpacing),this.lineBreak=ys(A,Qi,e.lineBreak),this.lineHeight=ys(A,Ei,e.lineHeight),this.listStyleImage=ys(A,Ii,e.listStyleImage),this.listStylePosition=ys(A,Ti,e.listStylePosition),this.listStyleType=ys(A,vi,e.listStyleType),this.marginTop=ys(A,Si,e.marginTop),this.marginRight=ys(A,bi,e.marginRight),this.marginBottom=ys(A,Li,e.marginBottom),this.marginLeft=ys(A,Hi,e.marginLeft),this.opacity=ys(A,As,e.opacity);var i=ys(A,_i,e.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=ys(A,ki,e.overflowWrap),this.paddingTop=ys(A,Di,e.paddingTop),this.paddingRight=ys(A,Ri,e.paddingRight),this.paddingBottom=ys(A,Oi,e.paddingBottom),this.paddingLeft=ys(A,Mi,e.paddingLeft),this.paintOrder=ys(A,fs,e.paintOrder),this.position=ys(A,Gi,e.position),this.textAlign=ys(A,Vi,e.textAlign),this.textDecorationColor=ys(A,es,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=ys(A,ts,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=ys(A,Ki,e.textShadow),this.textTransform=ys(A,Ni,e.textTransform),this.transform=ys(A,Wi,e.transform),this.transformOrigin=ys(A,ji,e.transformOrigin),this.visibility=ys(A,zi,e.visibility),this.webkitTextStrokeColor=ys(A,ws,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=ys(A,ps,e.webkitTextStrokeWidth),this.wordBreak=ys(A,Zi,e.wordBreak),this.zIndex=ys(A,$i,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return nn(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return as(this.display,4)||as(this.display,33554432)||as(this.display,268435456)||as(this.display,536870912)||as(this.display,67108864)||as(this.display,134217728)},A}(),ms=function(){function A(A,e){this.content=ys(A,ls,e.content),this.quotes=ys(A,gs,e.quotes)}return A}(),Fs=function(){function A(A,e){this.counterIncrement=ys(A,cs,e.counterIncrement),this.counterReset=ys(A,hs,e.counterReset)}return A}(),ys=function(A,e,t){var n=new xt,i=null!=t?t.toString():e.initialValue;n.write(i);var s=new St(n.read());switch(e.type){case 2:var r=s.parseComponentValue();return e.parse(A,Ht(r)?r.value:e.initialValue);case 0:return e.parse(A,s.parseComponentValue());case 1:return e.parse(A,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(e.format){case"angle":return $t.parse(A,s.parseComponentValue());case"color":return tn.parse(A,s.parseComponentValue());case"image":return Rn.parse(A,s.parseComponentValue());case"length":var o=s.parseComponentValue();return Mt(o)?o:Kt;case"length-percentage":var a=s.parseComponentValue();return Vt(a)?a:Kt;case"time":return qi.parse(A,s.parseComponentValue())}}},Qs="data-html2canvas-debug",Es=function(A){switch(A.getAttribute(Qs)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Us=function(A,e){var t=Es(A);return 1===t||e===t},Is=function(){function A(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Us(e,3),this.styles=new Cs(A,window.getComputedStyle(e,null)),go(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=a(this.context,e),Us(e,4)&&(this.flags|=16)}return A}(),Ts="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",vs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ss=0;Ss<vs.length;Ss++)xs[vs.charCodeAt(Ss)]=Ss;for(var bs=function(A){var e,t,n,i,s,r=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),c=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<o;e+=4)t=xs[A.charCodeAt(e)],n=xs[A.charCodeAt(e+1)],i=xs[A.charCodeAt(e+2)],s=xs[A.charCodeAt(e+3)],c[a++]=t<<2|n>>4,c[a++]=(15&n)<<4|i>>2,c[a++]=(3&i)<<6|63&s;return l},Ls=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},Hs=function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t},_s=5,ks=11,Ps=2,Ds=65536>>_s,Rs=(1<<_s)-1,Os=Ds+(1024>>_s)+32,Ms=65536>>ks,Vs=(1<<ks-_s)-1,Gs=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Ks=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},Ns=function(A,e){var t=bs(A),n=Array.isArray(t)?Hs(t):new Uint32Array(t),i=Array.isArray(t)?Ls(t):new Uint16Array(t),s=24,r=Gs(i,s/2,n[4]/2),o=2===n[5]?Gs(i,(s+n[4])/2):Ks(n,Math.ceil((s+n[4])/4));return new Ws(n[0],n[1],n[2],n[3],r,o)},Ws=function(){function A(A,e,t,n,i,s){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=s}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>_s])<<Ps)+(A&Rs),this.data[e];if(A<=65535)return e=((e=this.index[Ds+(A-55296>>_s)])<<Ps)+(A&Rs),this.data[e];if(A<this.highStart)return e=Os-Ms+(A>>ks),e=this.index[e],e+=A>>_s&Vs,e=((e=this.index[e])<<Ps)+(A&Rs),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Ys="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Js=0;Js<Ys.length;Js++)Xs[Ys.charCodeAt(Js)]=Js;var js,zs=1,Zs=2,$s=3,qs=4,Ar=5,er=7,tr=8,nr=9,ir=10,sr=11,rr=12,or=13,ar=14,lr=15,cr=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var s=A.charCodeAt(t++);56320==(64512&s)?e.push(((1023&i)<<10)+(1023&s)+65536):(e.push(i),t--)}else e.push(i)}return e},hr=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,s="";++i<t;){var r=A[i];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(i+1===t||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},ur=Ns(Ts),gr="×",dr="÷",Br=function(A){return ur.get(A)},fr=function(A,e,t){var n=t-2,i=e[n],s=e[t-1],r=e[t];if(s===Zs&&r===$s)return gr;if(s===Zs||s===$s||s===qs)return dr;if(r===Zs||r===$s||r===qs)return dr;if(s===tr&&-1!==[tr,nr,sr,rr].indexOf(r))return gr;if(!(s!==sr&&s!==nr||r!==nr&&r!==ir))return gr;if((s===rr||s===ir)&&r===ir)return gr;if(r===or||r===Ar)return gr;if(r===er)return gr;if(s===zs)return gr;if(s===or&&r===ar){for(;i===Ar;)i=e[--n];if(i===ar)return gr}if(s===lr&&r===lr){for(var o=0;i===lr;)o++,i=e[--n];if(o%2==0)return gr}return dr},wr=function(A){var e=cr(A),t=e.length,n=0,i=0,s=e.map(Br);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=gr;n<t&&(A=fr(e,s,++n))===gr;);if(A!==gr||n===t){var r=hr.apply(null,e.slice(i,n));return i=n,{value:r,done:!1}}return{done:!0,value:null}}}},pr=function(A){for(var e,t=wr(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n},Cr=function(A){var e=123;if(A.createRange){var t=A.createRange();if(t.getBoundingClientRect){var n=A.createElement("boundtest");n.style.height=e+"px",n.style.display="block",A.body.appendChild(n),t.selectNode(n);var i=t.getBoundingClientRect(),s=Math.round(i.height);if(A.body.removeChild(n),s===e)return!0}}return!1},mr=function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=e.firstChild,i=c(n.data).map((function(A){return h(A)})),s=0,r={},o=i.every((function(A,e){t.setStart(n,s),t.setEnd(n,s+A.length);var i=t.getBoundingClientRect();s+=A.length;var o=i.x>r.x||i.y>r.y;return r=i,0===e||o}));return A.body.removeChild(e),o},Fr=function(){return void 0!==(new Image).crossOrigin},yr=function(){return"string"==typeof(new XMLHttpRequest).responseType},Qr=function(A){var e=new Image,t=A.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0},Er=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},Ur=function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var i=new Image,s=e.toDataURL();i.src=s;var r=Ir(t,t,0,0,i);return n.fillStyle="red",n.fillRect(0,0,t,t),Tr(r).then((function(e){n.drawImage(e,0,0);var i=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var r=A.createElement("div");return r.style.backgroundImage="url("+s+")",r.style.height=t+"px",Er(i)?Tr(Ir(t,t,0,0,r)):Promise.reject(!1)})).then((function(A){return n.drawImage(A,0,0),Er(n.getImageData(0,0,t,t).data)})).catch((function(){return!1}))},Ir=function(A,e,t,n,i){var s="http://www.w3.org/2000/svg",r=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return r.setAttributeNS(null,"width",A.toString()),r.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",n.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),r.appendChild(o),o.appendChild(i),r},Tr=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},vr={get SUPPORT_RANGE_BOUNDS(){var A=Cr(document);return Object.defineProperty(vr,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=vr.SUPPORT_RANGE_BOUNDS&&mr(document);return Object.defineProperty(vr,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var e=Qr(A);return Object.defineProperty(vr,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?Ur(document):Promise.resolve(!1);return Object.defineProperty(vr,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=Fr();return Object.defineProperty(vr,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A=yr();return Object.defineProperty(vr,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(vr,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(vr,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},xr=function(){function A(A,e){this.text=A,this.bounds=e}return A}(),Sr=function(A,e,t,n){var i=kr(e,t),s=[],r=0;return i.forEach((function(e){if(t.textDecorationLine.length||e.trim().length>0)if(vr.SUPPORT_RANGE_BOUNDS){var i=Lr(n,r,e.length).getClientRects();if(i.length>1){var a=Hr(e),l=0;a.forEach((function(e){s.push(new xr(e,o.fromDOMRectList(A,Lr(n,l+r,e.length).getClientRects()))),l+=e.length}))}else s.push(new xr(e,o.fromDOMRectList(A,i)))}else{var c=n.splitText(e.length);s.push(new xr(e,br(A,n))),n=c}else vr.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));r+=e.length})),s},br=function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var s=a(A,n);return n.firstChild&&i.replaceChild(n.firstChild,n),s}}return o.EMPTY},Lr=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(A,e),i.setEnd(A,e+t),i},Hr=function(A){if(vr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return pr(A)},_r=function(A,e){if(vr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return Dr(A,e)},kr=function(A,e){return 0!==e.letterSpacing?Hr(A):_r(A,e)},Pr=[32,160,4961,65792,65793,4153,4241],Dr=function(A,e){for(var t,n=KA(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),i=[],s=function(){if(t.value){var A=t.value.slice(),e=c(A),n="";e.forEach((function(A){-1===Pr.indexOf(A)?n+=h(A):(n.length&&i.push(n),i.push(h(A)),n="")})),n.length&&i.push(n)}};!(t=n.next()).done;)s();return i},Rr=function(){function A(A,e,t){this.text=Or(e.data,t.textTransform),this.textBounds=Sr(A,this.text,t,e)}return A}(),Or=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(Mr,Vr);case 2:return A.toUpperCase();default:return A}},Mr=/(^|\s|:|-|\(|\))([a-z])/g,Vr=function(A,e,t){return A.length>0?e+t.toUpperCase():A},Gr=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return t(e,A),e}(Is),Kr=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return t(e,A),e}(Is),Nr=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=new XMLSerializer,s=a(e,t);return t.setAttribute("width",s.width+"px"),t.setAttribute("height",s.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return t(e,A),e}(Is),Wr=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return t(e,A),e}(Is),Yr=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return t(e,A),e}(Is),Xr=[{type:15,flags:0,unit:"px",number:3}],Jr=[{type:16,flags:0,number:50}],jr=function(A){return A.width>A.height?new o(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new o(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A},zr=function(A){var e=A.type===qr?new Array(A.value.length+1).join("•"):A.value;return 0===e.length?A.placeholder||"":e},Zr="checkbox",$r="radio",qr="password",Ao=707406591,eo=function(A){function e(e,t){var n=A.call(this,e,t)||this;switch(n.type=t.type.toLowerCase(),n.checked=t.checked,n.value=zr(t),n.type!==Zr&&n.type!==$r||(n.styles.backgroundColor=3739148031,n.styles.borderTopColor=n.styles.borderRightColor=n.styles.borderBottomColor=n.styles.borderLeftColor=2779096575,n.styles.borderTopWidth=n.styles.borderRightWidth=n.styles.borderBottomWidth=n.styles.borderLeftWidth=1,n.styles.borderTopStyle=n.styles.borderRightStyle=n.styles.borderBottomStyle=n.styles.borderLeftStyle=1,n.styles.backgroundClip=[0],n.styles.backgroundOrigin=[0],n.bounds=jr(n.bounds)),n.type){case Zr:n.styles.borderTopRightRadius=n.styles.borderTopLeftRadius=n.styles.borderBottomRightRadius=n.styles.borderBottomLeftRadius=Xr;break;case $r:n.styles.borderTopRightRadius=n.styles.borderTopLeftRadius=n.styles.borderBottomRightRadius=n.styles.borderBottomLeftRadius=Jr}return n}return t(e,A),e}(Is),to=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=t.options[t.selectedIndex||0];return n.value=i&&i.text||"",n}return t(e,A),e}(Is),no=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return t(e,A),e}(Is),io=function(A){function e(e,t){var n=A.call(this,e,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=ao(e,t.contentWindow.document.documentElement);var i=t.contentWindow.document.documentElement?un(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):gn.TRANSPARENT,s=t.contentWindow.document.body?un(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):gn.TRANSPARENT;n.backgroundColor=nn(i)?nn(s)?n.styles.backgroundColor:s:i}}catch(A){}return n}return t(e,A),e}(Is),so=["OL","UL","MENU"],ro=function(A,e,t,n){for(var i=e.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,ho(i)&&i.data.trim().length>0)t.textNodes.push(new Rr(A,i,t.styles));else if(uo(i))if(So(i)&&i.assignedNodes)i.assignedNodes().forEach((function(e){return ro(A,e,t,n)}));else{var r=oo(A,i);r.styles.isVisible()&&(lo(i,r,n)?r.flags|=4:co(r.styles)&&(r.flags|=2),-1!==so.indexOf(i.tagName)&&(r.flags|=8),t.elements.push(r),i.slot,i.shadowRoot?ro(A,i.shadowRoot,r,n):vo(i)||mo(i)||xo(i)||ro(A,i,r,n))}},oo=function(A,e){return Eo(e)?new Gr(A,e):yo(e)?new Kr(A,e):mo(e)?new Nr(A,e):fo(e)?new Wr(A,e):wo(e)?new Yr(A,e):po(e)?new eo(A,e):xo(e)?new to(A,e):vo(e)?new no(A,e):Uo(e)?new io(A,e):new Is(A,e)},ao=function(A,e){var t=oo(A,e);return t.flags|=4,ro(A,e,t,t),t},lo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Fo(A)&&t.styles.isTransparent()},co=function(A){return A.isPositioned()||A.isFloating()},ho=function(A){return A.nodeType===Node.TEXT_NODE},uo=function(A){return A.nodeType===Node.ELEMENT_NODE},go=function(A){return uo(A)&&void 0!==A.style&&!Bo(A)},Bo=function(A){return"object"==typeof A.className},fo=function(A){return"LI"===A.tagName},wo=function(A){return"OL"===A.tagName},po=function(A){return"INPUT"===A.tagName},Co=function(A){return"HTML"===A.tagName},mo=function(A){return"svg"===A.tagName},Fo=function(A){return"BODY"===A.tagName},yo=function(A){return"CANVAS"===A.tagName},Qo=function(A){return"VIDEO"===A.tagName},Eo=function(A){return"IMG"===A.tagName},Uo=function(A){return"IFRAME"===A.tagName},Io=function(A){return"STYLE"===A.tagName},To=function(A){return"SCRIPT"===A.tagName},vo=function(A){return"TEXTAREA"===A.tagName},xo=function(A){return"SELECT"===A.tagName},So=function(A){return"SLOT"===A.tagName},bo=function(A){return A.tagName.indexOf("-")>0},Lo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,i=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(i=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var s=[];return i&&n.forEach((function(A){var t=e.counters[A.counter];s.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),s},A}(),Ho={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},_o={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},ko={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Po={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Do=function(A,e,t,n,i,s){return A<e||A>t?zo(A,i,s.length>0):n.integers.reduce((function(e,t,i){for(;A>=t;)A-=t,e+=n.values[i];return e}),"")+s},Ro=function(A,e,t,n){var i="";do{t||A--,i=n(A)+i,A/=e}while(A*e>=e);return i},Oo=function(A,e,t,n,i){var s=t-e+1;return(A<0?"-":"")+(Ro(Math.abs(A),s,n,(function(A){return h(Math.floor(A%s)+e)}))+i)},Mo=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return Ro(Math.abs(A),n,!1,(function(A){return e[Math.floor(A%n)]}))+t},Vo=1,Go=2,Ko=4,No=8,Wo=function(A,e,t,n,i,s){if(A<-9999||A>9999)return zo(A,4,i.length>0);var r=Math.abs(A),o=i;if(0===r)return e[0]+o;for(var a=0;r>0&&a<=4;a++){var l=r%10;0===l&&as(s,Vo)&&""!==o?o=e[l]+o:l>1||1===l&&0===a||1===l&&1===a&&as(s,Go)||1===l&&1===a&&as(s,Ko)&&A>100||1===l&&a>1&&as(s,No)?o=e[l]+(a>0?t[a-1]:"")+o:1===l&&a>0&&(o=t[a-1]+o),r=Math.floor(r/10)}return(A<0?n:"")+o},Yo="十百千萬",Xo="拾佰仟萬",Jo="マイナス",jo="마이너스",zo=function(A,e,t){var n=t?". ":"",i=t?"、":"",s=t?", ":"",r=t?" ":"";switch(e){case 0:return"•"+r;case 1:return"◦"+r;case 2:return"◾"+r;case 5:var o=Oo(A,48,57,!0,n);return o.length<4?"0"+o:o;case 4:return Mo(A,"〇一二三四五六七八九",i);case 6:return Do(A,1,3999,Ho,3,n).toLowerCase();case 7:return Do(A,1,3999,Ho,3,n);case 8:return Oo(A,945,969,!1,n);case 9:return Oo(A,97,122,!1,n);case 10:return Oo(A,65,90,!1,n);case 11:return Oo(A,1632,1641,!0,n);case 12:case 49:return Do(A,1,9999,_o,3,n);case 35:return Do(A,1,9999,_o,3,n).toLowerCase();case 13:return Oo(A,2534,2543,!0,n);case 14:case 30:return Oo(A,6112,6121,!0,n);case 15:return Mo(A,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Mo(A,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Wo(A,"零一二三四五六七八九",Yo,"負",i,Go|Ko|No);case 47:return Wo(A,"零壹貳參肆伍陸柒捌玖",Xo,"負",i,Vo|Go|Ko|No);case 42:return Wo(A,"零一二三四五六七八九",Yo,"负",i,Go|Ko|No);case 41:return Wo(A,"零壹贰叁肆伍陆柒捌玖",Xo,"负",i,Vo|Go|Ko|No);case 26:return Wo(A,"〇一二三四五六七八九","十百千万",Jo,i,0);case 25:return Wo(A,"零壱弐参四伍六七八九","拾百千万",Jo,i,Vo|Go|Ko);case 31:return Wo(A,"영일이삼사오육칠팔구","십백천만",jo,s,Vo|Go|Ko);case 33:return Wo(A,"零一二三四五六七八九","十百千萬",jo,s,0);case 32:return Wo(A,"零壹貳參四五六七八九","拾百千",jo,s,Vo|Go|Ko);case 18:return Oo(A,2406,2415,!0,n);case 20:return Do(A,1,19999,Po,3,n);case 21:return Oo(A,2790,2799,!0,n);case 22:return Oo(A,2662,2671,!0,n);case 22:return Do(A,1,10999,ko,3,n);case 23:return Mo(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Mo(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Oo(A,3302,3311,!0,n);case 28:return Mo(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Mo(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return Oo(A,3792,3801,!0,n);case 37:return Oo(A,6160,6169,!0,n);case 38:return Oo(A,4160,4169,!0,n);case 39:return Oo(A,2918,2927,!0,n);case 40:return Oo(A,1776,1785,!0,n);case 43:return Oo(A,3046,3055,!0,n);case 44:return Oo(A,3174,3183,!0,n);case 45:return Oo(A,3664,3673,!0,n);case 46:return Oo(A,3872,3881,!0,n);default:return Oo(A,48,57,!0,n)}},Zo="data-html2canvas-ignore",$o=function(){function e(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Lo,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(A,e){var t=this,n=Aa(A,e);if(!n.contentWindow)return Promise.reject("Unable to find iframe window");var r=A.defaultView.pageXOffset,o=A.defaultView.pageYOffset,a=n.contentWindow,l=a.document,c=na(n).then((function(){return i(t,void 0,void 0,(function(){var A,t;return s(this,(function(i){switch(i.label){case 0:return this.scrolledElements.forEach(aa),a&&(a.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||a.scrollY===e.top&&a.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(a.scrollX-e.left,a.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,ta(l)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(l,t)})).then((function(){return n}))]:[2,n]}}))}))}));return l.open(),l.write(ra(document.doctype)+"<html></html>"),oa(this.referenceElement.ownerDocument,r,o),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),c},e.prototype.createElementClone=function(A){if(Us(A,2),yo(A))return this.createCanvasClone(A);if(Qo(A))return this.createVideoClone(A);if(Io(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Eo(e)&&(Eo(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),bo(e)?this.createCustomElementClone(e):e},e.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return sa(A.style,e),e},e.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},e.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var i=A.getContext("2d"),s=n.getContext("2d");if(s)if(!this.options.allowTaint&&i)s.putImageData(i.getImageData(0,0,A.width,A.height),0,0);else{var r=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(r){var o=r.getContextAttributes();!1===(null==o?void 0:o.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return n}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},e.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},e.prototype.appendChildNode=function(A,e,t){if(!(uo(e)&&(To(e)||e.hasAttribute(Zo)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&uo(e)&&Io(e))){let n=this.cloneNode(e,t);A.appendChild(n)}},e.prototype.cloneChildNodes=function(A,e,t){for(var n=this,i=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;i;i=i.nextSibling)if(uo(i)&&So(i)&&"function"==typeof i.assignedNodes){var s=i.assignedNodes();s.length&&s.forEach((function(A){return n.appendChildNode(e,A,t)}))}else this.appendChildNode(e,i,t)},e.prototype.cloneNode=function(e,t){if(ho(e))return A.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&uo(e)&&(go(e)||Bo(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var s=n.getComputedStyle(e),r=n.getComputedStyle(e,":before"),o=n.getComputedStyle(e,":after");this.referenceElement===e&&go(i)&&(this.clonedReferenceElement=i),Fo(i)&&da(i);var a=this.counters.parse(new Fs(this.context,s)),l=this.resolvePseudoContent(e,i,r,js.BEFORE);bo(e)&&(t=!0),Qo(e)||this.cloneChildNodes(e,i,t),l&&i.insertBefore(l,i.firstChild);var c=this.resolvePseudoContent(e,i,o,js.AFTER);return c&&i.appendChild(c),this.counters.pop(a),(s&&(this.options.copyStyles||Bo(e))&&!Uo(e)||t)&&sa(s,i),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(vo(e)||xo(e))&&(vo(i)||xo(i))&&(i.value=e.value),i}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(A,e,t,n){var i=this;if(t){var s=t.content,r=e.ownerDocument;if(r&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==t.display){this.counters.parse(new Fs(this.context,t));var o=new ms(this.context,t),a=r.createElement("html2canvaspseudoelement");sa(t,a),o.content.forEach((function(e){if(0===e.type)a.appendChild(r.createTextNode(e.value));else if(22===e.type){var t=r.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(Ht);n.length&&a.appendChild(r.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var s=e.values.filter(Dt),l=s[0],c=s[1];if(l&&Ht(l)){var h=i.counters.getCounterValue(l.value),u=c&&Ht(c)?vi.parse(i.context,c.value):3;a.appendChild(r.createTextNode(zo(h,u,!1)))}}else if("counters"===e.name){var g=e.values.filter(Dt),d=(l=g[0],g[1]);if(c=g[2],l&&Ht(l)){var B=i.counters.getCounterValues(l.value),f=c&&Ht(c)?vi.parse(i.context,c.value):3,w=d&&0===d.type?d.value:"",p=B.map((function(A){return zo(A,f,!1)})).join(w);a.appendChild(r.createTextNode(p))}}}else if(20===e.type)switch(e.value){case"open-quote":a.appendChild(r.createTextNode(ds(o.quotes,i.quoteDepth++,!0)));break;case"close-quote":a.appendChild(r.createTextNode(ds(o.quotes,--i.quoteDepth,!1)));break;default:a.appendChild(r.createTextNode(e.value))}})),a.className=ha+" "+ua;var l=n===js.BEFORE?" "+ha:" "+ua;return Bo(e)?e.className.baseValue+=l:e.className+=l,a}}},e.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},e}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(js||(js={}));var qo,Aa=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Zo,"true"),A.body.appendChild(t),t},ea=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},ta=function(A){return Promise.all([].slice.call(A.images,0).map(ea))},na=function(A){return new Promise((function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var i=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(t),e(A))}),50)}}))},ia=["all","d","content"],sa=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===ia.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},ra=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},oa=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},aa=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},la=":before",ca=":after",ha="___html2canvas___pseudoelement_before",ua="___html2canvas___pseudoelement_after",ga='{\n content: "" !important;\n display: none !important;\n}',da=function(A){Ba(A,"."+ha+la+ga+"\n ."+ua+ca+ga)},Ba=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},fa=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),wa=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:ya(A)||ma(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return i(this,void 0,void 0,(function(){var e,t,n,i,r=this;return s(this,(function(s){switch(s.label){case 0:return e=fa.isSameOrigin(A),t=!Fa(A)&&!0===this._options.useCORS&&vr.SUPPORT_CORS_IMAGES&&!e,n=!Fa(A)&&!e&&!ya(A)&&"string"==typeof this._options.proxy&&vr.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Fa(A)||ya(A)||n||t?(i=A,n?[4,this.proxy(i)]:[3,2]):[2];case 1:i=s.sent(),s.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.crossOrigin="anonymous",t.src=i,!0===t.complete&&setTimeout((function(){return A(t)}),500),r._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+r._options.imageTimeout+"ms) loading image")}),r._options.imageTimeout)}))];case 3:return[2,s.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise((function(i,s){var r=vr.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===r)i(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return i(A.result)}),!1),A.addEventListener("error",(function(A){return s(A)}),!1),A.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var a=t.indexOf("?")>-1?"&":"?";if(o.open("GET",""+t+a+"url="+encodeURIComponent(A)+"&responseType="+r),"text"!==r&&o instanceof XMLHttpRequest&&(o.responseType=r),e._options.imageTimeout){var l=e._options.imageTimeout;o.timeout=l,o.ontimeout=function(){return s("Timed out ("+l+"ms) proxying "+n)}}o.send()}))},A}(),pa=/^data:image\/svg\+xml/i,Ca=/^data:image\/.*/i,ma=function(A){return vr.SUPPORT_SVG_DRAWING||!Qa(A)},Fa=function(A){return Ca.test(A)},ya=function(A){return"blob"===A.substr(0,4)},Qa=function(A){return"svg"===A.substr(-3).toLowerCase()||pa.test(A)},Ea=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Ua=function(A,e,t){return new Ea(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Ia=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Ua(this.start,this.startControl,e),i=Ua(this.startControl,this.endControl,e),s=Ua(this.endControl,this.end,e),r=Ua(n,i,e),o=Ua(i,s,e),a=Ua(r,o,e);return t?new A(this.start,n,r,a):new A(a,o,s,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Ta=function(A){return 1===A.type},va=function(){function A(A){var e=A.styles,t=A.bounds,n=Yt(e.borderTopLeftRadius,t.width,t.height),i=n[0],s=n[1],r=Yt(e.borderTopRightRadius,t.width,t.height),o=r[0],a=r[1],l=Yt(e.borderBottomRightRadius,t.width,t.height),c=l[0],h=l[1],u=Yt(e.borderBottomLeftRadius,t.width,t.height),g=u[0],d=u[1],B=[];B.push((i+o)/t.width),B.push((g+c)/t.width),B.push((s+d)/t.height),B.push((a+h)/t.height);var f=Math.max.apply(Math,B);f>1&&(i/=f,s/=f,o/=f,a/=f,c/=f,h/=f,g/=f,d/=f);var w=t.width-o,p=t.height-h,C=t.width-c,m=t.height-d,F=e.borderTopWidth,y=e.borderRightWidth,Q=e.borderBottomWidth,E=e.borderLeftWidth,U=Xt(e.paddingTop,A.bounds.width),I=Xt(e.paddingRight,A.bounds.width),T=Xt(e.paddingBottom,A.bounds.width),v=Xt(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?xa(t.left+E/3,t.top+F/3,i-E/3,s-F/3,qo.TOP_LEFT):new Ea(t.left+E/3,t.top+F/3),this.topRightBorderDoubleOuterBox=i>0||s>0?xa(t.left+w,t.top+F/3,o-y/3,a-F/3,qo.TOP_RIGHT):new Ea(t.left+t.width-y/3,t.top+F/3),this.bottomRightBorderDoubleOuterBox=c>0||h>0?xa(t.left+C,t.top+p,c-y/3,h-Q/3,qo.BOTTOM_RIGHT):new Ea(t.left+t.width-y/3,t.top+t.height-Q/3),this.bottomLeftBorderDoubleOuterBox=g>0||d>0?xa(t.left+E/3,t.top+m,g-E/3,d-Q/3,qo.BOTTOM_LEFT):new Ea(t.left+E/3,t.top+t.height-Q/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?xa(t.left+2*E/3,t.top+2*F/3,i-2*E/3,s-2*F/3,qo.TOP_LEFT):new Ea(t.left+2*E/3,t.top+2*F/3),this.topRightBorderDoubleInnerBox=i>0||s>0?xa(t.left+w,t.top+2*F/3,o-2*y/3,a-2*F/3,qo.TOP_RIGHT):new Ea(t.left+t.width-2*y/3,t.top+2*F/3),this.bottomRightBorderDoubleInnerBox=c>0||h>0?xa(t.left+C,t.top+p,c-2*y/3,h-2*Q/3,qo.BOTTOM_RIGHT):new Ea(t.left+t.width-2*y/3,t.top+t.height-2*Q/3),this.bottomLeftBorderDoubleInnerBox=g>0||d>0?xa(t.left+2*E/3,t.top+m,g-2*E/3,d-2*Q/3,qo.BOTTOM_LEFT):new Ea(t.left+2*E/3,t.top+t.height-2*Q/3),this.topLeftBorderStroke=i>0||s>0?xa(t.left+E/2,t.top+F/2,i-E/2,s-F/2,qo.TOP_LEFT):new Ea(t.left+E/2,t.top+F/2),this.topRightBorderStroke=i>0||s>0?xa(t.left+w,t.top+F/2,o-y/2,a-F/2,qo.TOP_RIGHT):new Ea(t.left+t.width-y/2,t.top+F/2),this.bottomRightBorderStroke=c>0||h>0?xa(t.left+C,t.top+p,c-y/2,h-Q/2,qo.BOTTOM_RIGHT):new Ea(t.left+t.width-y/2,t.top+t.height-Q/2),this.bottomLeftBorderStroke=g>0||d>0?xa(t.left+E/2,t.top+m,g-E/2,d-Q/2,qo.BOTTOM_LEFT):new Ea(t.left+E/2,t.top+t.height-Q/2),this.topLeftBorderBox=i>0||s>0?xa(t.left,t.top,i,s,qo.TOP_LEFT):new Ea(t.left,t.top),this.topRightBorderBox=o>0||a>0?xa(t.left+w,t.top,o,a,qo.TOP_RIGHT):new Ea(t.left+t.width,t.top),this.bottomRightBorderBox=c>0||h>0?xa(t.left+C,t.top+p,c,h,qo.BOTTOM_RIGHT):new Ea(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||d>0?xa(t.left,t.top+m,g,d,qo.BOTTOM_LEFT):new Ea(t.left,t.top+t.height),this.topLeftPaddingBox=i>0||s>0?xa(t.left+E,t.top+F,Math.max(0,i-E),Math.max(0,s-F),qo.TOP_LEFT):new Ea(t.left+E,t.top+F),this.topRightPaddingBox=o>0||a>0?xa(t.left+Math.min(w,t.width-y),t.top+F,w>t.width+y?0:Math.max(0,o-y),Math.max(0,a-F),qo.TOP_RIGHT):new Ea(t.left+t.width-y,t.top+F),this.bottomRightPaddingBox=c>0||h>0?xa(t.left+Math.min(C,t.width-E),t.top+Math.min(p,t.height-Q),Math.max(0,c-y),Math.max(0,h-Q),qo.BOTTOM_RIGHT):new Ea(t.left+t.width-y,t.top+t.height-Q),this.bottomLeftPaddingBox=g>0||d>0?xa(t.left+E,t.top+Math.min(m,t.height-Q),Math.max(0,g-E),Math.max(0,d-Q),qo.BOTTOM_LEFT):new Ea(t.left+E,t.top+t.height-Q),this.topLeftContentBox=i>0||s>0?xa(t.left+E+v,t.top+F+U,Math.max(0,i-(E+v)),Math.max(0,s-(F+U)),qo.TOP_LEFT):new Ea(t.left+E+v,t.top+F+U),this.topRightContentBox=o>0||a>0?xa(t.left+Math.min(w,t.width+E+v),t.top+F+U,w>t.width+E+v?0:o-E+v,a-(F+U),qo.TOP_RIGHT):new Ea(t.left+t.width-(y+I),t.top+F+U),this.bottomRightContentBox=c>0||h>0?xa(t.left+Math.min(C,t.width-(E+v)),t.top+Math.min(p,t.height+F+U),Math.max(0,c-(y+I)),h-(Q+T),qo.BOTTOM_RIGHT):new Ea(t.left+t.width-(y+I),t.top+t.height-(Q+T)),this.bottomLeftContentBox=g>0||d>0?xa(t.left+E+v,t.top+m,Math.max(0,g-(E+v)),d-(Q+T),qo.BOTTOM_LEFT):new Ea(t.left+E+v,t.top+t.height-(Q+T))}return A}();!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(qo||(qo={}));var xa=function(A,e,t,n,i){var s=(Math.sqrt(2)-1)/3*4,r=t*s,o=n*s,a=A+t,l=e+n;switch(i){case qo.TOP_LEFT:return new Ia(new Ea(A,l),new Ea(A,l-o),new Ea(a-r,e),new Ea(a,e));case qo.TOP_RIGHT:return new Ia(new Ea(A,e),new Ea(A+r,e),new Ea(a,l-o),new Ea(a,l));case qo.BOTTOM_RIGHT:return new Ia(new Ea(a,e),new Ea(a,e+o),new Ea(A+r,l),new Ea(A,l));case qo.BOTTOM_LEFT:default:return new Ia(new Ea(a,l),new Ea(a-r,l),new Ea(A,e+o),new Ea(A,e))}},Sa=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},ba=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},La=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Ha=function(){function A(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}return A}(),_a=function(){function A(A,e){this.path=A,this.target=e,this.type=1}return A}(),ka=function(){function A(A){this.opacity=A,this.type=2,this.target=6}return A}(),Pa=function(A){return 0===A.type},Da=function(A){return 1===A.type},Ra=function(A){return 2===A.type},Oa=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},Ma=function(A,e,t,n,i){return A.map((function(A,s){switch(s){case 0:return A.add(e,t);case 1:return A.add(e+n,t);case 2:return A.add(e+n,t+i);case 3:return A.add(e,t+i)}return A}))},Va=function(){function A(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A}(),Ga=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new va(this.container),this.container.styles.opacity<1&&this.effects.push(new ka(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Ha(t,n,i))}if(0!==this.container.styles.overflowX){var s=Sa(this.curves),r=La(this.curves);Oa(s,r)?this.effects.push(new _a(s,6)):(this.effects.push(new _a(s,2)),this.effects.push(new _a(r,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var i=t.effects.filter((function(A){return!Da(A)}));if(e||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,i),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var s=Sa(t.curves),r=La(t.curves);Oa(s,r)||n.unshift(new _a(r,6))}}else n.unshift.apply(n,i);t=t.parent}return n.filter((function(e){return as(e.target,A)}))},A}(),Ka=function(A,e,t,n){A.container.elements.forEach((function(i){var s=as(i.flags,4),r=as(i.flags,2),o=new Ga(i,A);as(i.styles.display,2048)&&n.push(o);var a=as(i.flags,8)?[]:n;if(s||r){var l=s||i.styles.isPositioned()?t:e,c=new Va(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var h=i.styles.zIndex.order;if(h<0){var u=0;l.negativeZIndex.some((function(A,e){return h>A.element.container.styles.zIndex.order?(u=e,!1):u>0})),l.negativeZIndex.splice(u,0,c)}else if(h>0){var g=0;l.positiveZIndex.some((function(A,e){return h>=A.element.container.styles.zIndex.order?(g=e+1,!1):g>0})),l.positiveZIndex.splice(g,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Ka(o,c,s?c:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Ka(o,e,t,a);as(i.flags,8)&&Na(i,a)}))},Na=function(A,e){for(var t=A instanceof Yr?A.start:1,n=A instanceof Yr&&A.reversed,i=0;i<e.length;i++){var s=e[i];s.container instanceof Wr&&"number"==typeof s.container.value&&0!==s.container.value&&(t=s.container.value),s.listValue=zo(t,s.container.styles.listStyleType,!0),t+=n?-1:1}},Wa=function(A){var e=new Ga(A,null),t=new Va(e),n=[];return Ka(e,t,t,n),Na(e.container,n),t},Ya=function(A,e){switch(e){case 0:return Za(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Za(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Za(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Za(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Xa=function(A,e){switch(e){case 0:return Za(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Za(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Za(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Za(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Ja=function(A,e){switch(e){case 0:return Za(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Za(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Za(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Za(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},ja=function(A,e){switch(e){case 0:return za(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return za(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return za(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return za(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},za=function(A,e){var t=[];return Ta(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ta(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Za=function(A,e,t,n){var i=[];return Ta(A)?i.push(A.subdivide(.5,!1)):i.push(A),Ta(t)?i.push(t.subdivide(.5,!0)):i.push(t),Ta(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),Ta(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},$a=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},qa=function(A){var e=A.styles,t=A.bounds,n=Xt(e.paddingLeft,t.width),i=Xt(e.paddingRight,t.width),s=Xt(e.paddingTop,t.width),r=Xt(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+s+r))},Al=function(A,e){return 0===A?e.bounds:2===A?qa(e):$a(e)},el=function(A,e){return 0===A?e.bounds:2===A?qa(e):$a(e)},tl=function(A,e,t){var n=Al(rl(A.styles.backgroundOrigin,e),A),i=el(rl(A.styles.backgroundClip,e),A),s=sl(rl(A.styles.backgroundSize,e),t,n),r=s[0],o=s[1],a=Yt(rl(A.styles.backgroundPosition,e),n.width-r,n.height-o);return[ol(rl(A.styles.backgroundRepeat,e),a,s,n,i),Math.round(n.left+a[0]),Math.round(n.top+a[1]),r,o]},nl=function(A){return Ht(A)&&A.value===Mn.AUTO},il=function(A){return"number"==typeof A},sl=function(A,e,t){var n=e[0],i=e[1],s=e[2],r=A[0],o=A[1];if(!r)return[0,0];if(Vt(r)&&o&&Vt(o))return[Xt(r,t.width),Xt(o,t.height)];var a=il(s);if(Ht(r)&&(r.value===Mn.CONTAIN||r.value===Mn.COVER))return il(s)?t.width/t.height<s!=(r.value===Mn.COVER)?[t.width,t.width/s]:[t.height*s,t.height]:[t.width,t.height];var l=il(n),c=il(i),h=l||c;if(nl(r)&&(!o||nl(o)))return l&&c?[n,i]:a||h?h&&a?[l?n:i*s,c?i:n/s]:[l?n:t.width,c?i:t.height]:[t.width,t.height];if(a){var u=0,g=0;return Vt(r)?u=Xt(r,t.width):Vt(o)&&(g=Xt(o,t.height)),nl(r)?u=g*s:o&&!nl(o)||(g=u/s),[u,g]}var d=null,B=null;if(Vt(r)?d=Xt(r,t.width):o&&Vt(o)&&(B=Xt(o,t.height)),null===d||o&&!nl(o)||(B=l&&c?d/n*i:t.height),null!==B&&nl(r)&&(d=l&&c?B/i*n:t.width),null!==d&&null!==B)return[d,B];throw new Error("Unable to calculate background-size for element")},rl=function(A,e){var t=A[e];return void 0===t?A[0]:t},ol=function(A,e,t,n,i){var s=e[0],r=e[1],o=t[0],a=t[1];switch(A){case 2:return[new Ea(Math.round(n.left),Math.round(n.top+r)),new Ea(Math.round(n.left+n.width),Math.round(n.top+r)),new Ea(Math.round(n.left+n.width),Math.round(a+n.top+r)),new Ea(Math.round(n.left),Math.round(a+n.top+r))];case 3:return[new Ea(Math.round(n.left+s),Math.round(n.top)),new Ea(Math.round(n.left+s+o),Math.round(n.top)),new Ea(Math.round(n.left+s+o),Math.round(n.height+n.top)),new Ea(Math.round(n.left+s),Math.round(n.height+n.top))];case 1:return[new Ea(Math.round(n.left+s),Math.round(n.top+r)),new Ea(Math.round(n.left+s+o),Math.round(n.top+r)),new Ea(Math.round(n.left+s+o),Math.round(n.top+r+a)),new Ea(Math.round(n.left+s),Math.round(n.top+r+a))];default:return[new Ea(Math.round(i.left),Math.round(i.top)),new Ea(Math.round(i.left+i.width),Math.round(i.top)),new Ea(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Ea(Math.round(i.left),Math.round(i.height+i.top))]}},al="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ll="Hidden Text",cl=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",s.appendChild(t),n.src=al,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=A,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(ll)),t.appendChild(i),t.appendChild(n);var r=n.offsetTop-i.offsetTop+2;t.removeChild(i),t.appendChild(this._document.createTextNode(ll)),t.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-t.offsetTop+2;return s.removeChild(t),{baseline:r,middle:o}},A.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),hl=function(){function A(A,e){this.context=A,this.options=e}return A}(),ul=1e4,gl=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:A.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new cl(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return t(n,e),n.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach((function(A){return e.applyEffect(A)}))},n.prototype.applyEffect=function(A){this.ctx.save(),Ra(A)&&(this.ctx.globalAlpha=A.opacity),Pa(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),Da(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(A){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.renderNode=function(A){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return as(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},n.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):Hr(A.text).reduce((function(e,i){return n.ctx.fillText(i,e,A.bounds.top+t),e+n.ctx.measureText(i).width}),A.bounds.left)},n.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=pl(A.fontFamily).join(", "),n=bt(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},n.prototype.renderTextNode=function(A,e){return i(this,void 0,void 0,(function(){var t,n,i,r,o,a,l,c,h=this;return s(this,(function(s){return t=this.createFontStyle(e),n=t[0],i=t[1],r=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(i,r),a=o.baseline,l=o.middle,c=e.paintOrder,A.textBounds.forEach((function(A){c.forEach((function(t){switch(t){case 0:h.ctx.fillStyle=sn(e.color),h.renderTextWithLetterSpacing(A,e.letterSpacing,a);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach((function(t){h.ctx.shadowColor=sn(t.color),h.ctx.shadowOffsetX=t.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=t.offsetY.number*h.options.scale,h.ctx.shadowBlur=t.blur.number,h.renderTextWithLetterSpacing(A,e.letterSpacing,a)})),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),e.textDecorationLine.length&&(h.ctx.fillStyle=sn(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:h.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+a),A.bounds.width,1);break;case 2:h.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:h.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+l),A.bounds.width,1)}})));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(h.ctx.strokeStyle=sn(e.webkitTextStrokeColor),h.ctx.lineWidth=e.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+a)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter"}}))})),[2]}))}))},n.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=qa(A),i=La(e);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(A){return i(this,void 0,void 0,(function(){var e,t,i,r,a,l,c,h,u,g,d,B,f,w,p,C,m,F;return s(this,(function(s){switch(s.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,t=A.curves,i=e.styles,r=0,a=e.textNodes,s.label=1;case 1:return r<a.length?(l=a[r],[4,this.renderTextNode(l,i)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[3,1];case 4:if(!(e instanceof Gr))return[3,8];s.label=5;case 5:return s.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return p=s.sent(),this.renderReplacedElement(e,t,p),[3,8];case 7:return s.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof Kr&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof Nr))return[3,12];s.label=9;case 9:return s.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return p=s.sent(),this.renderReplacedElement(e,t,p),[3,12];case 11:return s.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof io&&e.tree?[4,new n(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:c=s.sent(),e.width&&e.height&&this.ctx.drawImage(c,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),s.label=14;case 14:if(e instanceof eo&&(h=Math.min(e.bounds.width,e.bounds.height),e.type===Zr?e.checked&&(this.ctx.save(),this.path([new Ea(e.bounds.left+.39363*h,e.bounds.top+.79*h),new Ea(e.bounds.left+.16*h,e.bounds.top+.5549*h),new Ea(e.bounds.left+.27347*h,e.bounds.top+.44071*h),new Ea(e.bounds.left+.39694*h,e.bounds.top+.5649*h),new Ea(e.bounds.left+.72983*h,e.bounds.top+.23*h),new Ea(e.bounds.left+.84*h,e.bounds.top+.34085*h),new Ea(e.bounds.left+.39363*h,e.bounds.top+.79*h)]),this.ctx.fillStyle=sn(Ao),this.ctx.fill(),this.ctx.restore()):e.type===$r&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+h/2,e.bounds.top+h/2,h/4,0,2*Math.PI,!0),this.ctx.fillStyle=sn(Ao),this.ctx.fill(),this.ctx.restore())),dl(e)&&e.value.length){switch(u=this.createFontStyle(i),m=u[0],g=u[1],d=this.fontMetrics.getMetrics(m,g).baseline,this.ctx.font=m,this.ctx.fillStyle=sn(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=fl(e.styles.textAlign),F=qa(e),B=0,e.styles.textAlign){case 1:B+=F.width/2;break;case 2:B+=F.width}f=F.add(B,0,0,-F.height/2+1),this.ctx.save(),this.path([new Ea(F.left,F.top),new Ea(F.left+F.width,F.top),new Ea(F.left+F.width,F.top+F.height),new Ea(F.left,F.top+F.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new xr(e.value,f),i.letterSpacing,d),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!as(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(w=e.styles.listStyleImage).type)return[3,18];p=void 0,C=w.url,s.label=15;case 15:return s.trys.push([15,17,,18]),[4,this.context.cache.match(C)];case 16:return p=s.sent(),this.ctx.drawImage(p,e.bounds.left-(p.width+10),e.bounds.top),[3,18];case 17:return s.sent(),this.context.logger.error("Error loading list-style-image "+C),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(m=this.createFontStyle(i)[0],this.ctx.font=m,this.ctx.fillStyle=sn(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",F=new o(e.bounds.left,e.bounds.top+Xt(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ui(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new xr(A.listValue,F),i.letterSpacing,Ui(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),s.label=20;case 20:return[2]}}))}))},n.prototype.renderStackContent=function(A){return i(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,c,h,u,g,d,B,f;return s(this,(function(s){switch(s.label){case 0:return as(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:s.sent(),e=0,t=A.negativeZIndex,s.label=2;case 2:return e<t.length?(f=t[e],[4,this.renderStack(f)]):[3,5];case 3:s.sent(),s.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:s.sent(),n=0,i=A.nonInlineLevel,s.label=7;case 7:return n<i.length?(f=i[n],[4,this.renderNode(f)]):[3,10];case 8:s.sent(),s.label=9;case 9:return n++,[3,7];case 10:r=0,o=A.nonPositionedFloats,s.label=11;case 11:return r<o.length?(f=o[r],[4,this.renderStack(f)]):[3,14];case 12:s.sent(),s.label=13;case 13:return r++,[3,11];case 14:a=0,l=A.nonPositionedInlineLevel,s.label=15;case 15:return a<l.length?(f=l[a],[4,this.renderStack(f)]):[3,18];case 16:s.sent(),s.label=17;case 17:return a++,[3,15];case 18:c=0,h=A.inlineLevel,s.label=19;case 19:return c<h.length?(f=h[c],[4,this.renderNode(f)]):[3,22];case 20:s.sent(),s.label=21;case 21:return c++,[3,19];case 22:u=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,s.label=23;case 23:return u<g.length?(f=g[u],[4,this.renderStack(f)]):[3,26];case 24:s.sent(),s.label=25;case 25:return u++,[3,23];case 26:d=0,B=A.positiveZIndex,s.label=27;case 27:return d<B.length?(f=B[d],[4,this.renderStack(f)]):[3,30];case 28:s.sent(),s.label=29;case 29:return d++,[3,27];case 30:return[2]}}))}))},n.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},n.prototype.formatPath=function(A){var e=this;A.forEach((function(A,t){var n=Ta(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Ta(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},n.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},n.prototype.resizeImage=function(A,e,t){var n;if(A.width===e&&A.height===t)return A;var i=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return i.width=Math.max(1,e),i.height=Math.max(1,t),i.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),i},n.prototype.renderBackgroundImage=function(A){return i(this,void 0,void 0,(function(){var e,t,n,i,r,o;return s(this,(function(a){switch(a.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var i,r,o,a,l,c,h,u,g,d,B,f,w,p,C,m,F,y,Q,E,U,I,T,v,x,S,b,L,H,_,k;return s(this,(function(s){switch(s.label){case 0:if(0!==t.type)return[3,5];i=void 0,r=t.url,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.context.cache.match(r)];case 2:return i=s.sent(),[3,4];case 3:return s.sent(),n.context.logger.error("Error loading background-image "+r),[3,4];case 4:return i&&(o=tl(A,e,[i.width,i.height,i.width/i.height]),m=o[0],I=o[1],T=o[2],Q=o[3],E=o[4],p=n.ctx.createPattern(n.resizeImage(i,Q,E),"repeat"),n.renderRepeat(m,p,I,T)),[3,6];case 5:Pn(t)?(a=tl(A,e,[null,null,null]),m=a[0],I=a[1],T=a[2],Q=a[3],E=a[4],l=Cn(t.angle,Q,E),c=l[0],h=l[1],u=l[2],g=l[3],d=l[4],(B=document.createElement("canvas")).width=Q,B.height=E,f=B.getContext("2d"),w=f.createLinearGradient(h,g,u,d),wn(t.stops,c).forEach((function(A){return w.addColorStop(A.stop,sn(A.color))})),f.fillStyle=w,f.fillRect(0,0,Q,E),Q>0&&E>0&&(p=n.ctx.createPattern(B,"repeat"),n.renderRepeat(m,p,I,T))):Dn(t)&&(C=tl(A,e,[null,null,null]),m=C[0],F=C[1],y=C[2],Q=C[3],E=C[4],U=0===t.position.length?[Nt]:t.position,I=Xt(U[0],Q),T=Xt(U[U.length-1],E),v=yn(t,I,T,Q,E),x=v[0],S=v[1],x>0&&S>0&&(b=n.ctx.createRadialGradient(F+I,y+T,0,F+I,y+T,x),wn(t.stops,2*x).forEach((function(A){return b.addColorStop(A.stop,sn(A.color))})),n.path(m),n.ctx.fillStyle=b,x!==S?(L=A.bounds.left+.5*A.bounds.width,H=A.bounds.top+.5*A.bounds.height,k=1/(_=S/x),n.ctx.save(),n.ctx.translate(L,H),n.ctx.transform(1,0,0,_,0,0),n.ctx.translate(-L,-H),n.ctx.fillRect(F,k*(y-H)+H,Q,E*k),n.ctx.restore()):n.ctx.fill())),s.label=6;case 6:return e--,[2]}}))},n=this,i=0,r=A.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return i<r.length?(o=r[i],[5,t(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},n.prototype.renderSolidBorder=function(A,e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){return this.path(Ya(t,e)),this.ctx.fillStyle=sn(A),this.ctx.fill(),[2]}))}))},n.prototype.renderDoubleBorder=function(A,e,t,n){return i(this,void 0,void 0,(function(){var i,r;return s(this,(function(s){switch(s.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,n)]:[3,2];case 1:return s.sent(),[2];case 2:return i=Xa(n,t),this.path(i),this.ctx.fillStyle=sn(A),this.ctx.fill(),r=Ja(n,t),this.path(r),this.ctx.fill(),[2]}}))}))},n.prototype.renderNodeBackgroundAndBorders=function(A){return i(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,c=this;return s(this,(function(s){switch(s.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!nn(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],i=Bl(rl(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),nn(e.backgroundColor)||(this.ctx.fillStyle=sn(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:s.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){c.ctx.save();var t=Sa(A.curves),n=e.inset?0:ul,i=Ma(t,-n+(e.inset?1:-1)*e.spread.number,(e.inset?1:-1)*e.spread.number,e.spread.number*(e.inset?-2:2),e.spread.number*(e.inset?-2:2));e.inset?(c.path(t),c.ctx.clip(),c.mask(i)):(c.mask(t),c.ctx.clip(),c.path(i)),c.ctx.shadowOffsetX=e.offsetX.number+n,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=sn(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?sn(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),s.label=2;case 2:r=0,o=0,a=n,s.label=3;case 3:return o<a.length?0!==(l=a[o]).style&&!nn(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,r,A.curves,2)]:[3,11]:[3,13];case 4:return s.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,r,A.curves,3)];case 6:return s.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,r,A.curves)];case 8:return s.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,r,A.curves)];case 10:s.sent(),s.label=11;case 11:r++,s.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},n.prototype.renderDashedDottedBorder=function(A,e,t,n,r){return i(this,void 0,void 0,(function(){var i,o,a,l,c,h,u,g,d,B,f,w,p,C,m,F;return s(this,(function(s){return this.ctx.save(),i=ja(n,t),o=Ya(n,t),2===r&&(this.path(o),this.ctx.clip()),Ta(o[0])?(a=o[0].start.x,l=o[0].start.y):(a=o[0].x,l=o[0].y),Ta(o[1])?(c=o[1].end.x,h=o[1].end.y):(c=o[1].x,h=o[1].y),u=0===t||2===t?Math.abs(a-c):Math.abs(l-h),this.ctx.beginPath(),3===r?this.formatPath(i):this.formatPath(o.slice(0,2)),g=e<3?3*e:2*e,d=e<3?2*e:e,3===r&&(g=e,d=e),B=!0,u<=2*g?B=!1:u<=2*g+d?(g*=f=u/(2*g+d),d*=f):(w=Math.floor((u+d)/(g+d)),p=(u-w*g)/(w-1),d=(C=(u-(w+1)*g)/w)<=0||Math.abs(d-p)<Math.abs(d-C)?p:C),B&&(3===r?this.ctx.setLineDash([0,g+d]):this.ctx.setLineDash([g,d])),3===r?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=sn(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===r&&(Ta(o[0])&&(m=o[3],F=o[0],this.ctx.beginPath(),this.formatPath([new Ea(m.end.x,m.end.y),new Ea(F.start.x,F.start.y)]),this.ctx.stroke()),Ta(o[1])&&(m=o[1],F=o[2],this.ctx.beginPath(),this.formatPath([new Ea(m.end.x,m.end.y),new Ea(F.start.x,F.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},n.prototype.render=function(A){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=sn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),e=Wa(A),[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},n}(hl),dl=function(A){return A instanceof no||A instanceof to||A instanceof eo&&A.type!==$r&&A.type!==Zr},Bl=function(A,e){switch(A){case 0:return Sa(e);case 2:return ba(e);default:return La(e)}},fl=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},wl=["-apple-system","system-ui"],pl=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter((function(A){return-1===wl.indexOf(A)})):A},Cl=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.canvas=n.canvas?n.canvas:A.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),i}return t(n,e),n.prototype.render=function(A){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return e=Ir(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,ml(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=sn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},n}(hl),ml=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},Fl=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,r([this.id,this.getTime()+"ms"],A))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),yl=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new Fl({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new wa(this,e)}return A.instanceCount=1,A}(),Ql=function(A,e){return void 0===e&&(e={}),El(A,e)};"undefined"!=typeof window&&fa.setContext(window);var El=function(A,e){return i(void 0,void 0,void 0,(function(){var t,i,r,c,h,u,g,d,B,f,w,p,C,m,F,y,Q,E,U,I,T,v,x,S,b,L,H,_,k,P,D,R,O,M,V,G,K,N;return s(this,(function(s){switch(s.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(t=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=t.defaultView))throw new Error("Document is not attached to a Window");return r={allowTaint:null!==(v=e.allowTaint)&&void 0!==v&&v,imageTimeout:null!==(x=e.imageTimeout)&&void 0!==x?x:15e3,proxy:e.proxy,useCORS:null!==(S=e.useCORS)&&void 0!==S&&S},c=n({logging:null===(b=e.logging)||void 0===b||b,cache:e.cache},r),h={windowWidth:null!==(L=e.windowWidth)&&void 0!==L?L:i.innerWidth,windowHeight:null!==(H=e.windowHeight)&&void 0!==H?H:i.innerHeight,scrollX:null!==(_=e.scrollX)&&void 0!==_?_:i.pageXOffset,scrollY:null!==(k=e.scrollY)&&void 0!==k?k:i.pageYOffset},u=new o(h.scrollX,h.scrollY,h.windowWidth,h.windowHeight),g=new yl(c,u),d=null!==(P=e.foreignObjectRendering)&&void 0!==P&&P,B={allowTaint:null!==(D=e.allowTaint)&&void 0!==D&&D,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:d,copyStyles:d},g.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),f=new $o(g,A,B),(w=f.clonedReferenceElement)?[4,f.toIFrame(t,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return p=s.sent(),C=Fo(w)||Co(w)?l(w.ownerDocument):a(g,w),m=C.width,F=C.height,y=C.left,Q=C.top,E=Ul(g,w,e.backgroundColor),U={canvas:e.canvas,backgroundColor:E,scale:null!==(O=null!==(R=e.scale)&&void 0!==R?R:i.devicePixelRatio)&&void 0!==O?O:1,x:(null!==(M=e.x)&&void 0!==M?M:0)+y,y:(null!==(V=e.y)&&void 0!==V?V:0)+Q,width:null!==(G=e.width)&&void 0!==G?G:Math.ceil(m),height:null!==(K=e.height)&&void 0!==K?K:Math.ceil(F)},d?(g.logger.debug("Document cloned, using foreign object rendering"),[4,new Cl(g,U).render(w)]):[3,3];case 2:return I=s.sent(),[3,5];case 3:return g.logger.debug("Document cloned, element located at "+y+","+Q+" with size "+m+"x"+F+" using computed rendering"),g.logger.debug("Starting DOM parsing"),T=ao(g,w),E===T.styles.backgroundColor&&(T.styles.backgroundColor=gn.TRANSPARENT),g.logger.debug("Starting renderer for element at "+U.x+","+U.y+" with size "+U.width+"x"+U.height),[4,new gl(g,U).render(T)];case 4:I=s.sent(),s.label=5;case 5:return(null===(N=e.removeContainer)||void 0===N||N)&&($o.destroy(p)||g.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),g.logger.debug("Finished rendering"),[2,I]}}))}))},Ul=function(A,e,t){var n=e.ownerDocument,i=n.documentElement?un(A,getComputedStyle(n.documentElement).backgroundColor):gn.TRANSPARENT,s=n.body?un(A,getComputedStyle(n.body).backgroundColor):gn.TRANSPARENT,r="string"==typeof t?un(A,t):null===t?gn.TRANSPARENT:4294967295;return e===n.documentElement?nn(i)?nn(s)?r:s:i:r};return Ql},Nt=e();var e}(),Nt(A,e)}class Yt{constructor(A,e,t){this.element=t,this.row=A,this.column=e}toString(){return`[${this.element[0]},${this.element[1]},${this.element[2]},${this.element[3]},${this.element[4]},${this.element[5]},${this.element[6]},${this.element[7]},${this.element[8]},${this.element[9]},${this.element[10]},${this.element[11]},${this.element[12]},${this.element[13]},${this.element[14]},${this.element[15]}]`}multiply(A){if(this.column!==A.row)throw new Error("matrix multiply error");const e=[];for(let t=0;t<this.row;t++)for(let n=0;n<A.column;n++){e[t+n*A.column]=0;for(let i=0;i<this.column;i++)e[t+n*A.column]+=this.element[t+i*this.column]*A.element[i+n*A.column]}return new Yt(this.row,A.column,e)}static identity(){return new Yt(4,4,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}static translate(A,e,t){return new Yt(4,4,[1,0,0,0,0,1,0,0,0,0,1,0,A,e,t,1])}static scale(A,e,t){return new Yt(4,4,[A,0,0,0,0,e,0,0,0,0,t,0,0,0,0,1])}static rotate(A,e,t,n){const i=Math.cos(n/180*Math.PI),s=Math.sin(n/180*Math.PI),r=Math.sqrt(A*A+e*e+t*t);if(1!==r){const n=1/r;A*=n,e*=n,t*=n}const o=1-i,a=A*e,l=e*t,c=t*A,h=A*s,u=e*s,g=t*s,d=[];return d[0]=A*A*o+i,d[1]=a*o+g,d[2]=c*o-u,d[3]=0,d[4]=a*o-g,d[5]=e*e*o+i,d[6]=l*o+h,d[7]=0,d[8]=c*o+u,d[9]=l*o-h,d[10]=t*t*o+i,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,new Yt(4,4,d)}static skew(A,e){const t=new Array(16).fill(0),n=2*Math.PI*(e/360),i=-2*Math.PI*(A/360);return t[0]=1-i*n,t[1]=-Math.tan(n),t[4]=Math.tan(i),t[5]=1,t[10]=1,t[15]=1,new Yt(4,4,t)}static transform2d(A,e,t,n,i,s){return new Yt(4,4,[A,e,0,0,t,n,0,0,0,0,1,0,i,s,0,1])}}const Xt=A=>A>=65&&A<=90||A>=97&&A<=122,Jt=A=>A>=48&&A<=57,jt=(A,e)=>{switch(A){case"translate3d":return Yt.translate(e[0],e[1],e[2]);case"scale3d":return Yt.scale(e[0],e[1],e[2]);case"rotate3d":return Yt.rotate(e[0],e[1],e[2],e[3]);case"skew":return Yt.skew(e[0],e[1]);case"matrix":return Yt.transform2d(e[0],e[1],e[2],e[3],e[4],e[5]);case"matrix3d":return new Yt(4,4,e);default:throw new Error(`no support type ${A}`)}},zt=A=>{let e=Yt.identity();if(!A)return e;let t="",n="",i=[],s=0;for(let r=0;r<A.length;r++){const o=A.charCodeAt(r);0===s?(Xt(o)||Jt(o))&&(t+=A[r]):(Jt(o)||46===o||45===o||101===o)&&(n+=A[r]),40===o?(s=1,n="",i=[]):41===o?(i.push(parseFloat(n)),e=e.multiply(jt(t,i)),t="",s=0):44===o&&(i.push(parseFloat(n)),n="")}return e},Zt=A=>{if(A.indexOf(" ")>=0){return A.split(" ").map((A=>parseInt(A.substr(0,A.length-2),10)))}return parseInt(A.substr(0,A.length-2),10)},$t=A=>{let e=A;const t=Zt(e.style.width),n=Zt(e.style.height);let i=Yt.identity();for(;e.parentNode;){const A=getComputedStyle(e),t=A.transform?A.transform:A.webkitTransform;if(t){const n=A.transformOrigin?A.transformOrigin:A.webkitTransformOrigin,s=zt(t);if(n){const A=Zt(n),t=Yt.translate(-A[0],-A[1],0),r=Yt.translate(A[0],A[1],0);i=Yt.translate(e.offsetLeft,e.offsetTop,0).multiply(r.multiply(s.multiply(t.multiply(i))))}else i=s.multiply(i)}e=e.parentNode}const s=new Yt(4,4,[0,0,0,1,t,0,0,1,0,n,0,1,t,n,0,1]);i=i.multiply(s);const r=i.element;return[r[0],r[1],r[4],r[5],r[8],r[9],r[12],r[13]]};function qt(A){let e=$t(A),t=Math.min(e[0],e[2],e[4],e[6]),n=Math.max(e[0],e[2],e[4],e[6]);return[Math.min(e[1],e[3],e[5],e[7]),Math.max(e[1],e[3],e[5],e[7]),t,n]}class An{constructor(A,e){this.set(A,e)}add(A,e){return A instanceof An?(this.x+=A.x,this.y+=A.y):(this.x+=A||0,this.y+=e||0),this}angle(A){if(void 0!==A)return this.set(this.length(),0).rotate(A);let e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e}angleDeg(A){return void 0!==A?this.angle(A/180*Math.PI):180*this.angle()/Math.PI}clone(){return new An(this.x,this.y)}cross(A,e){return A instanceof An?this.x*A.y-this.y*A.x:this.x*e-this.y*A}distance(A,e){const t=this.distanceSq(A,e);if(void 0!==t)return Math.sqrt(t)}distanceSq(A,e){let t,n;if(A instanceof An)t=A.x-this.x,n=A.y-this.y;else{if(void 0===e)return;t=A-this.x,n=e-this.y}return t*t+n*n}dot(A,e){return A instanceof An?this.x*A.x+this.y*A.y:this.x*A+this.y*e}equals(A,e,t){return A instanceof An?(e=e||0,Math.abs(this.x-A.x)<=e&&Math.abs(this.y-A.y)<=e):void 0!==e&&(t=t||0,Math.abs(this.x-A)<=t&&Math.abs(this.y-e)<=t)}length(){return Math.sqrt(this.lengthSq())}lengthSq(){return this.x*this.x+this.y*this.y}negate(){return this.scale(-1)}normalize(){return this.scale(1/this.length())}rotate(A){const e=Math.cos(A),t=Math.sin(A);return this.set(this.x*e-this.y*t,this.x*t+this.y*e)}rotateDeg(A){return this.rotate(A/180*Math.PI)}scale(A,e){return this.x*=A,this.y*=e||A,this}set(A,e){return A instanceof An?(this.x=A.x,this.y=A.y):(this.x=A||0,this.y=e||0),this}setPolar(A,e){return this.set(e,0).rotate(A)}setPolarDeg(A,e){return this.setPolar(A/180*Math.PI,e)}sub(A,e){return void 0!==e?(this.x-=A,this.y-=e):(this.x-=A.x,this.y-=A.y),this}toString(){return`(${this.x}, ${this.y})`}}function en(A,e,t){return t=t||0,Math.abs(A-e)<Math.abs(t)}const tn={isEqual:en,isZero:(A,e)=>en(A,0,e),clamp:(A,e,t)=>A>e?A<t?A:t:e},nn=tn.isZero,sn=tn.clamp,rn=1/3,on=new An(0,0),an=1e-4;function ln(A){return"[object Array]"===Object.prototype.toString.call(A)}function cn(A){if(!ln(A))throw new Error("Polygon must be an array of points");switch(typeof A[0]){case"number":{if(A.length%2!=0)throw new Error("Polygon that contains array of numbers must has even length ([x0, y0, x1, y1, ...., xn, yn])");const e=[];for(let t=0;t<A.length;t+=2)e.push(new An(A[t],A[t+1]));return e}case"object":return A.map(ln(A[0])?A=>new An(A[0],A[1]):A=>new An(A.x,A.y));default:throw new Error("Passed polygon is not an array of 2D coordinates")}}function hn(A){if(1===A.length)return new An(A[0]);const e=new An(0,0);A.forEach((A=>e.add(A))),e.scale(1/A.length);const t=new An;let n=0;return A.forEach(((i,s)=>{const r=new An(i),o=new An(s+1===A.length?A[0]:A[s+1]);r.add(-e.x,-e.y),o.add(-e.x,-e.y);const a=.5*r.cross(o);n+=a,t.add(r.add(o).scale(rn).scale(a))})),nn(n,an)?t.set(A[0]):t.scale(1/n).add(e)}function un(A,e){let t=A[0],n=e.dot(A[0]),i=0;for(let s=1;s<A.length;s++)i=e.dot(A[s]),i>n&&(n=i,t=A[s]);return new An(t)}function gn(A,e,t){const n=un(A,t),i=un(e,t.negate());return new An(n.sub(i))}function dn(A,e){const t=new An(0,0),n=new An(A).negate(),i=new An(e).sub(A),s=i.dot(i);if(nn(s,an))return t.set(A);let r=n.dot(i)/s;return r=sn(r,0,1),t.set(i.scale(r).add(A))}function Bn(A,e){A=cn(A),e=cn(e);const t=hn(A),n=hn(e).add(t.negate());let i,s,r;i=gn(A,e,n),s=gn(A,e,n.negate());for(let t=0;t<30;t++){const t=dn(i,s);if(nn(t.length(),an))return 0;n.set(t.negate().normalize()),r=gn(A,e,n);const o=r.dot(n),a=i.dot(n);if(nn(o-a,an))return o;i.distanceSq(on)<s.distanceSq(on)?s=r:i=r}return 0}const fn={intersect:(A,e)=>nn(Bn(A,e),an),distance:Bn};class wn{constructor(A,e=null,t,n=!0){this.Texture=A,this._IsTextureExternal=!1,e instanceof bt?(e&&e.RenderTexture&&e.RenderTexture.NeedCheckExpired&&(e.RenderTexture.RequireTime=0),this.MaskSetting=new mn(e)):this.MaskSetting=e,A&&A.RenderTexture&&A.RenderTexture.NeedCheckExpired&&(A.RenderTexture.RequireTime=0),this._IsMaskTextureExternal=!1,this.HasAlpha=n}SetExternal(A,e,t){this._IsTextureExternal=A,this._IsMaskTextureExternal=e}ReleaseInternalTexture(){this.Texture?.UnloadTex(),this.Texture=null,this.MaskSetting?.UnLoad(),this.MaskSetting=null}DebugPrint(){return` _IsTextureExternal=${this._IsTextureExternal}`}}class pn extends wn{constructor(A,e=null,t=null,n=!0){super(A,e,t,n),this.SetExternal(!0,!0,!0)}}class Cn{constructor(){this._MaskType="COMMON"}Type(){return this._MaskType}UnLoad(){}}class mn extends Cn{constructor(A){super(),this._MaskType="TEXTURE",this.ImageTexture=A}UnLoad(){this.ImageTexture.UnloadTex()}}class Fn extends Cn{constructor(A,e,t,n){super(),this._MaskType="CORNER",this._TopLeft=A,this._TopRight=isNaN(e)?A:e,this._BottomLeft=isNaN(t)?A:t,this._BottomRight=isNaN(n)?A:n,this._CornersWidth=[0,0,0,0],this._CornersDisable=[0===this._TopLeft?1:0,0===this._TopRight?1:0,0===this._BottomLeft?1:0,0===this._BottomRight?1:0]}UnLoad(){}}let yn=0;class Qn{constructor(A,e){this.Id=null,this._ViewType=0,this._AutoHeight=!1,this._TransformStyle=null,this._CssTransform=null,this._CssTransformOrigin=null,this.TransformAnimationObj=null,this.Expired=!1,this._ObjectFitTestCache=null,this._ProxyView=null,this._SizeFromChild=null,this._ChildrenFromChild0=!1,this._FlexAssignedCallback=null,this._MySizeObserver=null,this.FlexInfoPack=null,this.FlexInfoPackWeak=null,this._EnableVisibleTestRect=!1,this._ChildrenListDirty=!1,this._TouchReceiver=null,this.TextureSetting=A,this.Visibility="VISIBLE",this.LayoutParams=null,this.ParentView=null,this.ChildViews=[],this.zIndex=0,this._Perspective=0,this._PerspectiveAnchor=[.5,.5],this._BackfaceVisibility=1,this._DebugCount=++yn,this.childZIndexCount=0,this._IsChildOfRootView=!1,this._DetachFromSystemCallbacks=null,this.Element=null,this.InnerChildElement=null,this.TouchFeatureBit=0,this.TapCallback=null,"root"===e?this.Element=P:"jsv-element-proxy"===e?this.Element=null:e&&(this.Element=O().createElement(e),this.Element.style.position="absolute"),this.TransitionStore={}}SetElementProp(A,e,t){switch(e){case"innerview":{const A=Tt.sViewStore.get(t);if(A){const e=A.view;null==this.LayoutParams&&this.ResetLayoutParams({x:0,y:0,width:0,height:0});let t=this.LayoutParams;this.ResetLayoutParams({x:0,y:0,width:0,height:0}),e&&(null===this._ProxyView?this._InsertProxyLayer(e,t):e!==this._ProxyView&&console.error("Error: Can not reset proxy view"))}break}case"drift":case"dock":case"enable-fade":case"poster-on-top":case"text-definition":case"test-rect":break;case"id":this.Element&&this.Element.setAttribute("id",t);break;default:rA.E(`Error: View Unknown prop name=${e}`)}}InsertView(A,e,t){this._InsertView(A,e,t)}AddView(A,e=0,t=0,n=0,i=0){this._InsertView(A,null,{x:e,y:t,width:n,height:i})}ReOrderChildView(A,e){if(null!=this._ProxyView&&A!=this._ProxyView)return void this._ProxyView.ReOrderChildView(A,e);let t=!1;for(var n=0;n<this.ChildViews.length;n++)if(this.ChildViews[n]==A){this.ChildViews.splice(n,1),t=!0;break}if(t||rA.E("ReOrderChildView(): view is not in child list stack="),e){let t=this.ChildViews.indexOf(e);t<0&&(t=this.ChildViews.length),this.ChildViews.splice(t,0,A)}else this.ChildViews.push(A);this._ChildrenListDirty=!0}MoveChildView(A,e,t){if(null!=this._ProxyView&&A!=this._ProxyView)return void this._ProxyView.MoveChildView(A,e,t);let n=!1;for(var i=0;i<this.ChildViews.length;i++)if(this.ChildViews[i]==A){0!=A.zIndex&&this.childZIndexCount--,this.ChildViews.splice(i,1),A.ParentView=null,n=!0;break}n||rA.E("MoveChildView(): view is not in child list stack="),e._InsertView(A,t,A.LayoutParams);let s=null;t&&(s=e.ChildViews[e.ChildViews.indexOf(t)+1]),s&&e.Element.contains(s.Element)?e.Element.insertBefore(A.Element,s.Element):e.Element.appendChild(A.Element)}IsVisibleInTree(){if(!this._IsChildOfRootView)return!1;let A=this,e=this;for(;e;){if("hidden"==e.Element?.style?.visibility)return!1;A=e,e=e.ParentView}return A instanceof Un}IsAliveInRender(){this.IsVisibleInTree()}_InsertView(A,e,t){if(t?A.LayoutParams=t instanceof Vt?t.Clone():new Vt(t):A.LayoutParams||(A.LayoutParams=new Vt({x:0,y:0})),null!==A.LayoutParams&&(A.LayoutParams.MarginLeft&&(A.Element.style.left=`${A.LayoutParams.MarginLeft}px`),A.LayoutParams.MarginTop&&(A.Element.style.top=`${A.LayoutParams.MarginTop}px`),A.LayoutParams.Width&&(A.Element.style.width=`${A.LayoutParams.Width}px`),A.LayoutParams.Height?A.Element.style.height=`${A.LayoutParams.Height}px`:A.Element.style.height=""),A.ParentView=this,e){let t=this.ChildViews.indexOf(e);t<0&&(t=this.ChildViews.length),this.ChildViews.splice(t,0,A)}else this.ChildViews.push(A);this._ChildrenListDirty=!0,this._IsChildOfRootView&&A._OnAttachToSystem(),0!=A.zIndex&&this.childZIndexCount++,this.childZIndexCount>0&&this._RequestZIndexReorder()}SetZIndex(A){if(A!=this.zIndex){var e=this.zIndex;this.zIndex=A;var t=this.ParentView;t&&(0==e&&0!=A?t.childZIndexCount++:0!=e&&0==A&&t.childZIndexCount--,t.childZIndexCount<0&&rA.ThrowError("ERROR: LayoutViewBase, child z-index count ERROR"),t._RequestZIndexReorder())}}_RequestZIndexReorder(){let A=[],e=[],t=0,n=this.ChildViews.length;for(var i=0;i<n;i++){let n=this.ChildViews[i].zIndex;n<0?(n<t&&(t=n),A.push(this.ChildViews[i])):n>0&&e.push(this.ChildViews[i])}t=1e3*Math.floor(-t/1e3)+1e3;let s=A.length,r=e.length;if(s>0){A.sort(((A,e)=>A.zIndex-e.zIndex));for(i=0;i<s;i++)A[i].Element.style.zIndex=A[i].zIndex+t}if(this.ChildViews.length-A.length-e.length>0)for(i=0;i<n;i++)0==this.ChildViews[i].zIndex&&(this.ChildViews[i].Element.style.zIndex=t);if(r>0){e.sort(((A,e)=>A.zIndex-e.zIndex));for(i=0;i<r;i++)e[i].Element.style.zIndex=e[i].zIndex+t}}SetPerspective(A,e){this.Element.style.perspective=`${A}px`,this.Element.style.webkitPerspective=`${A}px`,this.Element.style.perspectiveOrigin=e,this.Element.style.webkitPerspectiveOrigin=e,this._Perspective=A,this._PerspectiveOrigin=e}SetBackfaceVisibility(A){this.Element.style.backfaceVisibility=A?"visible":"hidden",this.Element.style.webkitBackfaceVisibility=A?"visible":"hidden",console.log(`back face style ${this.Element.style.backfaceVisibility}`),this._BackfaceVisibility=A?1:0}SetTransformStyle(A){this.Element.style.transformStyle=A,this.Element.style.webkitTransformStyle=A,this._TransformStyle=A}RemoveView(A){for(let e=0;e<this.ChildViews.length;e++)if(this.ChildViews[e]===A){A.IsChildOfRootView()&&A._OnDetachFromSystem(),this.ChildViews.splice(e,1),A.ParentView=null;break}}_OnDetachFromSystem(){this._IsChildOfRootView=!1,this._DetachFromSystemCallbacks?(this._DetachFromSystemCallbacks.some(((A,e,t)=>{A()})),this._DetachFromSystemCallbacks=null):this.OnDettachFromSystem();for(let A=0;A<this.ChildViews.length;A++){this.ChildViews[A]._OnDetachFromSystem()}this.ParentView.Element.removeChild(this.Element),this._releaseViewResources(),this._TouchReceiver&&(this._TouchReceiver.mTargetView=null,this._TouchReceiver.mTargetFreeMove=null)}RegisterDetachCallback(A){A&&(null==this._DetachFromSystemCallbacks&&(this._DetachFromSystemCallbacks=[]),this._DetachFromSystemCallbacks.push(A))}UnregisterDetachCallback(A){if(A&&this._DetachFromSystemCallbacks){let e=!1,t=this._DetachFromSystemCallbacks;for(let n=0;n<t.length;n++)if(t[n]===A){t.splice(n,1),e=!0;break}e?0==t.length&&(this._DetachFromSystemCallbacks=null):console.error("no found")}else console.error("Unregister nothing...")}OnDettachFromSystem(){}_releaseViewResources(){this.Expired||(this.StopAnimation(),this.Expired=!0,this.TextureSetting?.ReleaseInternalTexture(),this.TextureSetting=null,this.Element=null)}ClearViews(){const A=this.ChildViews.length;if(0!==A){for(let e=0;e<A;e++){const A=this.ChildViews[e];A&&A.IsChildOfRootView()&&A._OnDetachFromSystem()}this.ChildViews=[]}}_ResetTextStyle(A){this.Element.style.overflow="hidden";let e=Tt.sTextStyleCache.GetDsFromId(A.Set.IDS.DS).Describe,t=Tt.sTextStyleCache.GetFsFromId(A.Set.IDS.FS).Describe,n=Tt.sTextStyleCache.GetCsFromId(A.Set.IDS.CS).Describe,i=null;"DISABLE"!==A.Set.IDS.SS&&(i=Tt.sTextStyleCache.GetSsFromId(A.Set.IDS.SS).Describe),this.Element.style.fontFamily=t.font,this.Element.style.fontSize=`${A.Set.FS}px`,t.italic&&(this.Element.style.fontStyle="italic"),t.bold?this.Element.style.fontWeight="bold":this.Element.style.fontWeight="normal",this.Element.style.textAlign=e.alignment,this.Element.style.verticalAlign=e.vertical_area_align,this.Element.style.direction=e.direction;let s=n.text_color;this.Element.style.color=s;let r=n.bg_color;this.Element.style.backgroundColor=r,i&&(i.shadow_blur>0&&(this.Element.style.textShadow=`${i.shadow_offset_x}px ${i.shadow_offset_y}px ${i.shadow_blur}px ${i.shadow_color}`),i.stroke_width>0&&(this.Element.style.WebkitTextStroke=`${i.stroke_width}px ${i.stroke_color}`)),this.Element.style.width=`${A.Set.W}px`,this.Element.style.height=`${A.Set.H}px`;let o=parseInt(this.Element.style.fontSize);if(A.Set.LH&&(this.Element.style.lineHeight=`${A.Set.LH}px`,o=parseInt(this.Element.style.lineHeight)),A.Set.EA){let e=A.Set.EA,t=O().createElement("div");t.style.float=e.x>0?"right":"left",t.style.width=e.w+"px",t.style.height=e.h-1+"px",t.style.backgroundColor="rgba(0,0,0,0)",t.style.position="relative",this.Element.appendChild(t)}this.Element.style.textOverflow=e.text_overflow,this.Element.style.wordBreak="normal";let a=!1,l=e.word_wrap;if("none"===l?this.Element.style.whiteSpace="nowrap":l&&(this.Element.style.wordWrap=l.replace("_","-"),a=!0),a&&"ellipsis"==this.Element.style.textOverflow&&(this.Element.style.display="-webkit-box",this.Element.style.webkitLineClamp=""+Math.floor(parseInt(this.Element.style.height)/o),this.Element.style.webkitBoxOrient="vertical"),A.Set.LA){const e=iA(A.Set.ST);!function(A,e){const t=e.text;for(const n of e.nodeList){if(n.lineFeedNode){A.appendChild(O().createElement("br"));continue}const e=t.substring(n.indexPair[0],n.indexPair[1]),i=O().createElement("span");let s,r=i;for(const A of n.styleList)switch(A.style){case AA.BASE:break;case AA.BOLD:s=O().createElement("b"),r.appendChild(s),r=s;break;case AA.ITALIC:s=O().createElement("i"),r.appendChild(s),r=s;break;case AA.COLOR:i.style.color=A.styleValue;break;case AA.DECORATION:i.style.textDecoration=A.styleValue;break;case AA.SUPERSCRIPT:s=O().createElement("sup"),r.appendChild(s),r=s;break;case AA.SUBSCRIPT:s=O().createElement("sub"),r.appendChild(s),r=s}r.textContent=e,A.appendChild(i)}}(this.Element,e)}else{let e=O().createElement("span");e.textContent=A.Set.ST,this.Element.appendChild(e)}}_SetBorderRadius(A){(this.InnerChildElement?this.InnerChildElement:this.Element).style.borderRadius=`${A._TopLeft}px ${A._TopRight}px ${A._BottomRight}px ${A._BottomLeft}px`}_InsertProxyLayer(A,e){if(A.ParentView=this,this._IsChildOfRootView){for(let A of this.ChildViews)A._AdvanceDepthForProxyLayer();A._OnAttachToSystem()}A.ChildViews=A.ChildViews.concat(this.ChildViews),A._ChildrenListDirty=!0;for(let e=0;e<A.ChildViews.length;e++)A.ChildViews[e].ParentView=A,A._RequestLayoutForAddingView(A.ChildViews[e]);null!==e?A.LayoutParams=e instanceof Vt?e.Clone():new Vt(e):null===A.LayoutParams&&(A.LayoutParams=new Vt({x:0,y:0})),A.ResetLayoutParams(A.LayoutParams),this.ChildViews=[A],this._ChildrenListDirty=!0,this._RequestLayoutForAddingView(A),this._ProxyView=A,this._IsChildOfRootView&&A._OnAttachToSystem()}_AdvanceDepthForProxyLayer(){}_RequestLayoutForAddingView(A){this._RequestLayout()}ResetTexture(A,e=null){let t=null;if(A&&(t=new pn(A,e,null)),this.TextureSetting=t,t){if(t.Texture.Source)"IMG"===this.Element.tagName?this.Element.src=t.Texture.Source:(this.Element.style.backgroundImage=`url(${t.Texture.Source})`,this.Element.style.backgroundSize="100% 100%",this.Element.style.backgroundColor=null);else if(t.Texture.Gradient)this.Element.style.backgroundImage=t.Texture.Gradient,this.Element.style.backgroundColor=null;else if(t.Texture.RenderTexture&&t.Texture.RenderTexture._SyncingResourceInfo){const A=t.Texture.RenderTexture._SyncingResourceInfo;if("TST"===A.Nam)this._ResetTextStyle(A);else if("CT"===A.Nam)this.Element.style.backgroundColor=A.Set.Clr,this.Element.style.backgroundImage=null;else if("VPLY"===A.Nam){const e=A.Set.Hdl;e.style.width="100%",e.style.height="100%",e.style.objectFit="fill",this.Element.appendChild(e),this.InnerChildElement=e}}t.MaskSetting&&"CORNER"===t.MaskSetting._MaskType&&this._SetBorderRadius(t.MaskSetting)}else this.Element.style.backgroundColor="",this.Element.style.backgroundImage="",this.Element.style.borderRadius=""}SetVisibility(A){if("string"==typeof A){let e=A.toLocaleLowerCase();this.Element.style.visibility="visible"==e?"inherit":e}else this.Element.style.visibility="inherit"}SetViewOpacity(A){this.Element.style.opacity=A}_OnAttachToSystem(){"svg"!==this.Element.id&&"path"!==this.Element.id||console.log("_OnAttachToSystem appendChild");let A=this.ParentView.ChildViews[this.ParentView.ChildViews.indexOf(this)+1];A&&this.ParentView.Element.contains(A.Element)?this.ParentView.Element.insertBefore(this.Element,A.Element):this.ParentView.Element.appendChild(this.Element),this._IsChildOfRootView=!0;const e=this.ChildViews;let t;for(let A=0;A<e.length;A++)t=e[A],t._OnAttachToSystem();this._FlushFlexDiv()}IsChildOfRootView(){return this._IsChildOfRootView}StartAnimation(A,e=!1,t=0){void 0!==this.TransformAnimationObj&&this.TransformAnimationObj&&(this.TransformAnimationObj.Cancel(A),this.TransformAnimationObj=null,window.jsvInAndroidWebView?this.Element.style.webkitAnimation=null:this.Element.style.animation=null),null==this._ProxyView?(this.TransformAnimationObj=A,!isNaN(t)&&t>0&&A.EnableDelay(t),A.Start(this)):this._ProxyView.StartAnimation(A,e,t)}ApplyStyleTransition(A){this.TransitionStore={...this.TransitionStore,...A};let e="";Object.values(this.TransitionStore).forEach((A=>{e&&(e+=","),e+=A})),window.jsvInAndroidWebView?this.Element.style.webkitTransition=e:this.Element.style.transition=e}StopAnimation(){void 0!==this.TransformAnimationObj&&this.TransformAnimationObj&&(this.TransformAnimationObj.Cancel(),this.TransformAnimationObj=null),null==this._ProxyView||this._ProxyView.StopAnimation()}_RequestLayout(){}StopAllAnimations(){this.StopAnimation();for(let A=0;A<this.ChildViews.length;A++)this.ChildViews[A].StopAllAnimations()}GetAnimation(){return this.TransformAnimationObj}DetachAnimation(A){this.TransformAnimationObj===A&&(this.TransformAnimationObj=null,window.jsvInAndroidWebView?(this.Element.style.webkitAnimation=null,this.Element.style.webkitTransition=null):(this.Element.style.animation=null,this.Element.style.transition=null))}ResetCssTransform(A,e){if(A){const e=A.split("translate3d");for(let A=1;A<e.length;A++){let t=!1,n=e[A].replace(/\).*/,"");n=n.replace(/.*\(/,"");const i=n.split(",");for(let A=0;A<i.length;A++){const e=i[A].trim();e.match(/[0-9]$/)&&(i[A]=e+"px",t=!0)}t&&(n=i.join(","),e[A]=e[A].replace(/\(.*?\)/,"("+n+")"))}A=e.join("translate3d")}A===this._CssTransform&&e===this._CssTransformOrigin||(window.jsvInAndroidWebView?(this.Element.style.webkitTransform=A,this.Element.style.webkitTransformOrigin=e):(this.Element.style.transform=A,this.Element.style.transformOrigin=e),this._CssTransform=A,this._CssTransformOrigin=e)}ResetTextureCssTransform(A,e){this.ResetCssTransform(A,e)}SetId(A){this.Id=A}ResetLayoutParams(A){if(this._IsChildOfRootView)if(null==this._ProxyView)if(null!==A)if(this.LayoutParams=A instanceof Vt?A.Clone():new Vt(A),null==this.FlexInfoPackWeak)this.ParentView?.FlexInfoPackWeak?.container||(this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`),isNaN(this.LayoutParams.Width)||this._SizeFromChild&&0==this.LayoutParams.Width||(this.Element.style.width=`${this.LayoutParams.Width}px`),isNaN(this.LayoutParams.Height)||this._SizeFromChild&&0==this.LayoutParams.Height||(this.Element.style.height=`${this.LayoutParams.Height}px`);else{this.ParentView.FlexInfoPackWeak||(this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`);let A=this;for(;A._ChildrenFromChild0;)A=A.ChildViews[0];A._SizeFromChild||(A.Element.width=0==this.LayoutParams.Width?void 0:this.LayoutParams.Width+"px",A.Element.height=0==this.LayoutParams.Height?void 0:this.LayoutParams.Height+"px")}else rA.ThrowError("ResetLayoutParams(): new params is null");else this._ProxyView.ResetLayoutParams(A)}GetRenderer(){throw Error("Deprecated")}GetLayoutParams(){return this.LayoutParams?this.LayoutParams.Clone():new Vt({})}EnableAutoHeight(){this._AutoHeight=!0}WaitTextureToResize(A){}ApplyObjectFit(A,e,t,n,i){if(this._ProxyView)return console.warn("ProxiedView not support ApplyObjectFit"),null;null===this._ObjectFitTestCache&&(this._ObjectFitTestCache={frameWidth:NaN,frameHeight:NaN,textureWidth:NaN,textureHeight:NaN,objectFit:"fill",clipLayout:null});let s=this._ObjectFitTestCache;if(s.frameWidth===A&&s.objectFit===i&&s.frameHeight===e&&s.textureWidth===t&&s.textureHeight===n)return s.clipLayout;s.frameWidth=A,s.frameHeight=e,s.textureWidth=t,s.textureHeight=n,s.objectFit=i;let r={width:0,height:0},o=A/e;const a=t/n;if(!a)return console.warn("Warning:Texture size is 0!"),null;if(0===A||0===e){if(0===A&&0===e)return null;0===A?A=e*a:e=A/a,o=A/e}let l="";switch(i){case"fill":r.width=A,r.height=e,l="fill";break;case"none":r.width=t,r.height=n,l="none";break;case"cover":r=this._StretchSize(A,e,a,a<o),l="cover";break;case"scale-down":r=this._StretchSize(A,e,a,a>o),r.width>t&&(r.width=t,r.height=n),l="scale-down";break;case"contain":r=this._StretchSize(A,e,a,a>o),l="contain"}if(r.width=Math.floor(r.width),r.height=Math.floor(r.height),r.width!=A||r.height!=e){let t={x:0,y:0,width:0,height:0};t.width=Math.min(r.width,A),t.height=Math.min(r.height,e),t.x=Math.floor((A-t.width)/2),t.y=Math.floor((e-t.height)/2),s.clipLayout=t;return(this.InnerChildElement?this.InnerChildElement:this.Element).style.objectFit=l,t}return null}_StretchSize(A,e,t,n){const i={width:0,height:0};return n?(i.width=A,i.height=A/t):(i.height=e,i.width=e*t),i}_FindFirstRectChild(){if(0!=this.Element.clientWidth&&0!=this.Element.clientHeight)return this;let A,e;if(this.ChildViews.length>0)for(let t=0;t<this.ChildViews.length;t++)if(e=this.ChildViews[t],e&&(A=e._FindFirstRectChild(),null!=A))return A;return null}GetBoundingClientRect(A){this.Element?setTimeout((()=>{let e=this,t=0;for(;e;)e.TransformAnimationObj&&e.TransformAnimationObj.repeatTimes>0&&(t++,e.TransformAnimationObj.AddAnimationListener(new it(null,(e=>{if(t--,t<=0){let e=this._FindFirstRectChild();e||(e=this);const{left:t,top:n,width:i,height:s}=e.Element.getBoundingClientRect();A?.(JSON.stringify({status:0,data:{left:t,top:n,width:i,height:s}}))}})))),e=e.ParentView;if(0==t){let e=this._FindFirstRectChild();e||(e=this);const{left:t,top:n,width:i,height:s}=e.Element.getBoundingClientRect();A?.(JSON.stringify({status:0,data:{left:t,top:n,width:i,height:s}}))}}),1):A?.(JSON.stringify({status:-1,error:"BrowserError: dom element is null."}))}ChildViewsCount(){return this.ChildViews.length}MarkFlexSizeFromChild(A){this._ChildrenFromChild0&&console.error("Error: from child0 冲突 size"),this._SizeFromChild=A,this.Element.style.display="flex","0px"==this.Element.style.width&&(this.Element.style.width=""),"0px"==this.Element.style.height&&(this.Element.style.height=""),this._SizeFromChild?this._SizeFromChild.Element.style.position="relative":console.error("Error: Need insert child0 before mark")}MarkFlexChildrenFromChild0(){this._SizeFromChild&&console.error("Error: from child0 冲突 child"),this._ChildrenFromChild0=!0}TransChildFlexInfoPack(A){A.FlexInfoPack?(this.FlexInfoPack=A.FlexInfoPack,A.FlexInfoPack=null):this.FlexInfoPack!=A.FlexInfoPackWeak&&console.error("Error: TransChildFlexInfoPack dismatch")}RegisterFlexAssigned(A){this._FlexAssignedCallback=A,null==this._MySizeObserver&&(this._MySizeObserver=new ResizeObserver((e=>{for(let t of e)t.target==this.Element&&A?.(0,0,t.contentRect.width,t.contentRect.height)}))),A?(this._MySizeObserver.disconnect(),this._MySizeObserver.observe(this.Element)):this._MySizeObserver.disconnect()}ResetFlexContainerCell(A){A?(this._EnsureFlexInfoPack(),this.FlexInfoPackWeak.container=A,this._FlushFlexDiv()):console.error("Error: Can NOT cancel flex container")}ResetFlexItemCell(A){this._EnsureFlexInfoPack(),this.FlexInfoPackWeak.item=A,this._FlushFlexDiv()}_EnsureFlexInfoPack(){null==this.FlexInfoPackWeak&&(this.FlexInfoPack={container:null,item:null},this.FlexInfoPackWeak=this.FlexInfoPack)}_FlushFlexDiv(){if(this._IsChildOfRootView){if(null!=this.FlexInfoPackWeak){if(null!=this.FlexInfoPackWeak.container)if(this._ChildrenFromChild0)this.Element.style.width="",this.Element.style.height="",this.Element.style.display="flex";else{this.Element.style.display="flex";let A=this.FlexInfoPackWeak.container;this.Element.style.flexDirection=this._ConvertFlexSetToString(A.flexDirection),this.Element.style.flexWrap=this._ConvertFlexSetToString(A.flexWrap),this.Element.style.justifyContent=this._ConvertFlexSetToString(A.justifyContent),this.Element.style.alignItems=this._ConvertFlexSetToString(A.alignItems),this.Element.style.alignContent=this._ConvertFlexSetToString(A.alignContent);let e=this;for(;e.ParentView._ChildrenFromChild0;)e=e.ParentView;this.Element.style.width=e.LayoutParams.Width>0?e.LayoutParams.Width+"px":"",this.Element.style.height=e.LayoutParams.Height>0?e.LayoutParams.Height+"px":"";for(let A=0;A<this.ChildViews.length;A++){let e=this.ChildViews[A].Element;e.style.position="relative",e.style.left="",e.style.top=""}}else this.Element.style.flexDirection="",this.Element.style.flexWrap="",this.Element.style.justifyContent="",this.Element.style.alignItems="",this.Element.style.alignContent="";if(this.FlexInfoPack&&this.FlexInfoPack.item){let A=this.FlexInfoPack.item;this.Element.style.alignSelf=this._ConvertFlexSetToString(A.alignSelf),this.Element.style.flexGrow=A.flexGrow}}this.ParentView.FlexInfoPackWeak?.container?this.Element.style.position="relative":this.ParentView._SizeFromChild||(this.Element.style.position="absolute")}}_ConvertFlexSetToString(A){switch(A){case Gt.NoSet:return"";case Gt.Auto:return"auto";case Gt.Row:return"row";case Gt.RowReverse:return"row-reverse";case Gt.Column:return"column";case Gt.ColumnReverse:return"column-reverse";case Gt.NoWrap:return"nowrap";case Gt.Wrap:return"wrap";case Gt.FlexStart:return"flex-start";case Gt.FlexEnd:return"flex-end";case Gt.Center:return"center";case Gt.Stretch:return"stretch";default:return console.error("No support flex set, value="+A),""}}EnableVisibleTestRect(){this._EnableVisibleTestRect=!0}GetTouchReceiver(){return this._TouchReceiver}DragEnables(A){this.TouchRecvEnableAdd(A)}SetTapListener(A){this.RegisterTapCallback(A)}RegisterTapCallback(A){this.TapCallback=A}DispatchTapEvent(A){this.TapCallback?.(A)}TouchRecvEnableAdd(A){A>0&&(this._TouchReceiver=Tt.sTouchRecvManager.GetTouchReceiver(this),this._TouchReceiver.updateFeatureFlags(A,this.TransformAnimationObj)),0==(1&this.TouchFeatureBit)&&(1&A)>0&&(this.TouchFeatureBit=A)}HasTapCallback(){return null!=this.TapCallback}IsParentView(A){let e=this.ParentView;for(;e;){if(e==A)return!0;e=e.ParentView}return!1}_checkPointIn(A,e){const t=$t(this.Element),n=[A,e,A+1,e,A,e-1,A+1,e-1];return fn.intersect(t,n)}PointIn(A,e){let t=!0;if(null===this.Element)return!t;if(t=this._checkPointIn(A,e),t){let n=this.ParentView;for(;;){if(n instanceof Un)break;if(null!==n&&n instanceof Tn&&!n.PointIn(A,e)){t=!1;break}if(!n?.ParentView)break;n=n?.ParentView}}return t}}class En extends Qn{constructor(A=null,e=null){!A||A instanceof wn||rA.ThrowError("ERROR:LayoutView need TextureSetting as parameter"),super(A,e=e||"div")}HtmlCanAccessElement(){return!0}HtmlGetElement(){return this.Element}Capture2Texture(A,e){Wt(this.HtmlGetElement(),{allowTaint:!0,useCORS:!0,windowWidth:this.LayoutParams.Width,windowHeight:this.LayoutParams.Height}).then((t=>{A.Source=t.toDataURL(),e?.(JSON.stringify({width:t.width,height:t.height}))}))}}class Un extends En{constructor(){super(null,"root"),this._ViewType=1,this._IsChildOfRootView=!0,Kt(this),this.ResetLayoutParams({x:0,y:0,width:4096,height:2500})}HtmlGetTouchRoot(){return this.HtmlGetElement()}}class In{constructor(A,e,t,n,i){this.coordX=A,this.coordY=e,this.width=t,this.height=n,this.useScissors=i,this.maskStencil=null}updateInfo(A,e,t,n,i){this.coordX=A,this.coordY=e,this.width=t,this.height=n,this.useScissors=i}setMaskStencil(A){this.maskStencil=A}}class Tn extends En{constructor(A){super(A,"div"),this._ClipRectInfo=null,this.Id="ClipView",this.TextureSetting=null}SetId(A){this.Id=`${A}_ClipView`}SetClipRect(A,e,t,n,i){null===this._ClipRectInfo?this._ClipRectInfo=new In(A,e,t,n,i):this._ClipRectInfo.updateInfo(A,e,t,n,i);const s=A,r=e,o=this.LayoutParams.Width-s-t,a=this.LayoutParams.Height-r-n;i?(this.Element.style.overflow="hidden",this.Element.style.clipPath=`inset(${r}px ${o}px ${a}px ${s}px)`):(this.Element.style.overflow="visible",this.Element.style.clipPath="unset")}SetWholeSizeScissor(A,e){this.Element.style.overflow=A&&e?"hidden":"visible"}}class vn extends En{constructor(){super(null,"input"),this._ViewType=5,this._InputType=Sn.TEXT,this.Id="EditControlView"}_OnAttachToSystem(){super._OnAttachToSystem(),this.Element.style.left="-1920px",this.Element.style.top="-1080px",this.Element.style.width="1px",this.Element.style.height="1px",this.Element.style.pointerEvents="auto",this.Element.addEventListener("keydown",(A=>{A=A||window.event;let e=this.Element.selectionStart;console.log(`keydown cur_offset:${e}`),37===A.keyCode?(--e,e<0&&(e=0),e!==this.Element.selectionStart?(this.OnTextChanged(this.Element.value,e,!0),A.stopPropagation&&A.stopPropagation()):this.Element.blur()):39===A.keyCode?(++e,e>this.Element.value.length&&(e=this.Element.value.length),e!==this.Element.selectionStart?(this.OnTextChanged(this.Element.value,e,!0),A.stopPropagation&&A.stopPropagation()):this.Element.blur()):38===A.keyCode||40===A.keyCode?this.Element.blur():27!==A.keyCode&&1e4!==A.keyCode||this.Element.blur()})),this.Element.onfocus=A=>{console.log("onfocus in"),this.OnStatusChanged(1)},this.Element.onblur=A=>{console.log("onblur in"),this.OnStatusChanged(0)};this.Element.oninput=A=>{if(console.log("oninput:",A),A.target.value.length>0&&A.target.selectionStart>0){const t=A.target.selectionStart-1,n=A.target.selectionStart,i=A.target.value.slice(t,n);e=i,"0".charCodeAt()<=e.charCodeAt()&&e.charCodeAt()<="9".charCodeAt()||this._InputType!==Sn.NUMBER||(A.target.value=A.target.value.substr(0,t)+A.target.value.substr(n),A.target.selectionStart=t)}var e;const t=A.target.value,n=A.target.selectionStart;this.OnTextChanged(decodeURIComponent(t),n)}}SetId(A){this.Id=`${A}_EditControlView`}showIme(A,e,t){this.Element?A!==Sn.NONE?(null==t&&(t=e.length>0?e.length:0),t<0?t=0:t>e.length&&(t=e.length>0?e.length:0),this._InputType=A,this.Element.type="text",this.Element.value=e,this.Element.focus(),this.Element.selectionStart=t,this.Element.selectionEnd=t):console.log("showIme input_type error"):console.log("showIme but ele is null!")}hideIme(){this.Element?this.Element.blur():console.log("hideIme, but ele is null!")}updateCursorOffset(A,e){this.Element?(this.Element.selectionStart=e,this.Element.selectionEnd=e,this.Element.value=A):console.log("updateCursorOffset, but ele is null!")}OnTextChanged(A,e,t=!1){console.log(`OnTextChanged value:${A}`)}OnStatusChanged(A){}OnEditAction(A){}}class xn extends En{constructor(A,e=1){super(A),this._ViewType=10,this._FilterType=e,this.Id="FilterView",this._Type=e,e==xn.Type.GRAY_DOWN?this.Element.style.filter="grayscale(100%)":e==xn.Type.WAVE&&console.warn("FilterView: ripple effect has not been implemented on the browser side.")}FilterSwitch(A){this.Element&&this._Type==xn.Type.GRAY_DOWN&&(this.Element.style.filter=A?"grayscale(100%)":"")}SetId(A){this.Id=A+"_FilterView"}AddWaveSourceList(){}AddWaveSourceSingle(){}RemoveSource(){}DispatchCommand(){}}xn.Type={GRAY_DOWN:1,WAVE:2},xn.WAVE={CIRCLE_WAVE:1,RECTANGLE_WAVE:2};let Sn={NONE:0,TEXT:1,PASSWORD:2,TEXT_AREA:3,CONTENT_EDITABLE:4,SEARCH:5,URL:6,EMAIL:7,TELEPHONE:8,NUMBER:9};{let vi=1,xi=2,Si=3;class bi{constructor(A,e){this.IdToken=_.sViewSensorManager.IdTokenGenerator++,this.Type=A,this.Manager=null,this._OnAnyViewLostList=null,this._AnyViewLostMark=null,this._OnWholeViewLostList=null,this._WholeViewLostMark=null,this._HtmlStatusInfo={target:null==e?vi:xi}}OnManaged(A){return this._HtmlStatusInfo.target!=Si&&(this.Manager?(console.error("manage duplicated"),!1):(this._RegisterViewLostCallbacks(),this.Manager=A,!0))}ResetAutoRecycleViewsRef(A,e){A instanceof Array&&e instanceof Array?this._HtmlStatusInfo.target!=Si&&(this._UnregisterViewCallbacks(),this._OnAnyViewLostList=A,this._OnWholdViewLostList=e,this.Manager&&this._RegisterViewLostCallbacks()):console.error("need array ",A,e)}Expired(){return this._HtmlStatusInfo.target==Si}Recycle(){this._HtmlStatusInfo.target!=Si&&this.Manager&&(this._HtmlStatusInfo.target=Si,this.OnSelfRecycle(),this.Manager.RecycleSensor(this),this.Manager=null,this._UnregisterViewCallbacks()),this._OnAnyViewLostList=null,this._OnWholdViewLostList=null}HtmlDoWorkOnFrame(){console.log("Need be override")}HtmlNeedWorkOnFrame(){return!0}OnCallback(A){console.log("Need be override")}OnSelfRecycle(){}_RegisterViewLostCallbacks(){let A=this;if(this._OnAnyViewLostList?.length>0){let e=this._OnAnyViewLostList.length;this._AnyViewLostMark={callbacks:new Array(e).fill(null)};for(let t=0;t<e;t++){let e=this._OnAnyViewLostList[t];if(e.HtmlCanAccessElement()&&e.Expired)this._OnAnyViewLostList[t]=null;else{let n=()=>{A.Recycle()};this._AnyViewLostMark.callbacks[t]=n,e.RegisterDetachCallback(n)}}}else this._AnyViewLostMark=null;if(this._OnWholeViewLostList?.length>0){let e=this._OnWholeViewLostList.length;this._WholeViewLostMark={list:new Array(e).fill({callback:null,lost:!1}),lostCount:0};for(let t=0;t<e;t++){let e=this._OnWholeViewLostList[t];if(e.HtmlCanAccessElement()&&e.Expired)this._OnWholeViewLostList[t]=null,this._WholeViewLostMark.list[t].lost=!0,this._WholeViewLostMark.lostCount++;else{let n=()=>{A._OnViewOfWholeListLost(t)};this._WholeViewLostMark.list[t].callback=n,e.RegisterDetachCallback(n)}}}else this._WholeViewLostMark=null}_UnregisterViewCallbacks(){if(this._AnyViewLostMark){let A=this._OnAnyViewLostList.length;for(let e=0;e<A;e++){this._OnAnyViewLostList[e]&&this._OnAnyViewLostList[e].UnregisterDetachCallback(this._AnyViewLostMark.callbacks[e])}this._AnyViewLostMark=null}if(this._WholeViewLostMark){let A=this._OnWholdViewLostList.length;for(let e=0;e<A;e++){this._OnWholdViewLostList[e]&&this._OnWholdViewLostList[e].UnregisterDetachCallback(this._WholeViewLostMark.list[e].callback)}this._WholeViewLostMark=null}}_OnViewOfWholeListLost(A){this._WholeViewLostMark.list[A].lost||(this._WholeViewLostMark.lostCount++,this._WholeViewLostMark.list[A].lost=!0,this._WholeViewLostMark.list[view_idx].callback=null,this._OnWholdViewLostList[A]=null),this._WholeViewLostMark.lostCount==this._OnWholeViewLostList.length&&this.Recycle()}}bi.TypeDefines={TYPE_IMPACT:1,TYPE_FROZE_SET:2,TYPE_ON_SCREEN:3,TYPE_ENV_BLOCK:3,TYPE_DRAG_IMPACT:101},_.ViewSensor=bi}class bn extends _.ViewSensor{constructor(A,e,t,n){super(_.ViewSensor.TypeDefines.TYPE_IMPACT),this._HtmlConfig={view1:A,view2:e,frozeSetId:n?n.IdToken:0,status:{contacted:!1}},this._Callback=t,this._FrozeViewsSet=n,n&&n.DoRef(),this.ResetAutoRecycleViewsRef([A,e],[]),_.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){if(!this.Expired()&&this._HtmlConfig.view1&&this._HtmlConfig.view2&&this._HtmlConfig.view1.HtmlCanAccessElement()&&this._HtmlConfig.view1.HtmlCanAccessElement()){(A=this._HtmlConfig.view1.HtmlGetElement(),e=this._HtmlConfig.view2.HtmlGetElement(),fn.intersect($t(A),$t(e)))?this._HtmlConfig.status.contacted||(this._HtmlConfig.status.contacted=!0,this.OnCallback(1)):this._HtmlConfig.status.contacted&&(this.OnCallback(2),this._HtmlConfig.status.contacted=!1)}var A,e}OnCallback(A){this._Callback&&(1==A&&this._Callback.OnBeginContact?this._Callback.OnBeginContact():2==A&&this._Callback.OnEndContact&&this._Callback.OnEndContact())}OnSelfRecycle(){this._FrozeViewsSet&&(this._FrozeViewsSet.UnRef(),this._FrozeViewsSet=null),this._HtmlConfig=null}}_.ImpactSensor=bn;class Ln extends _.ViewSensor{constructor(A,e){super(_.ViewSensor.TypeDefines.TYPE_FROZE_SET),this._PreImpactViewList=null,this._OnImpactViewList=null,this._UpdateAutoRecycleRef(A,!0,e,!0),_.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){}HtmlNeedWorkOnFrame(){return!1}UpdatePreImpactList(A){this._UpdateAutoRecycleRef(A,!0,null,!1)}UpdateOnImpactList(A){this._UpdateAutoRecycleRef(null,!1,A,!0)}DoRef(){this.Expired()?console.error("Error: froze set is expired for all bind views lost"):this._RefCount++}UnRef(){this._RefCount>0&&this._RefCount--,0==this._RefCount&&this.Recycle()}OnSelfRecycle(){this._PreImpactViewList=null,this._OnImpactViewList=null}_UpdateAutoRecycleRef(A,e,t,n){e&&(this._PreImpactViewList=A instanceof Array?A:[]),n&&(this._OnImpactViewList=t instanceof Array?t:[]),this.ResetAutoRecycleViewsRef([],[...this._PreImpactViewList,...this._OnImpactViewList])}}class Hn{constructor(A,e){this.Start=A,this.End=e}Merge(A){return this.IsInterAct(A)?(this.Start>A.Start&&(this.Start=A.Start),this.End<A.End&&(this.End=A.End),!0):this.End+1==A.Start?(this.End=A.End,!0):this.Start==A.End+1&&(this.Start=A.Start,!0)}IsInterAct(A){return A.Start<this.Start?!(A.End<this.Start):A.Start<=this.End}IsInclude(A){return this.Start<=A.Start&&this.End>=A.End}Exclude(A){var e={success:!1,newSplitedRange:null};return this.IsInterAct(A)?(A.Start<=this.Start?A.End<this.End?this.Start=A.End+1:this.Clear():(A.End<this.End&&(e.newSplitedRange=new Hn(A.End+1,this.End),e.newSplitedRange=e.newSplitedRange),this.End=A.Start-1),e.success=!0,e.success=e.success,e):e}IsEmpty(){return this.Start>this.End}Clear(){this.End=this.Start-1}Clone(){return new Hn(this.Start,this.End)}}const _n="OV",kn="NV",Pn="OH",Dn="NH";class Rn extends _.ViewSensor{constructor(A,e){super(_.ViewSensor.TypeDefines.TYPE_ON_SCREEN),this._HtmlConfig={view:A,container:null,enable:!1,testRange:null,status:{horizonVisible:!1,verticalVisible:!1}},this._Callback=e,this.ResetAutoRecycleViewsRef([A],[]),_.sViewSensorManager.AddSensor(this)}HtmlDoWorkOnFrame(){if(!this.Expired()&&this._HtmlConfig.enable&&this._HtmlConfig.testRange&&this._HtmlConfig.view&&this._HtmlConfig.view.HtmlCanAccessElement()){let A=_.sRenderBridge.GetScreenInfo().designedWidth,e=Math.floor(9*A/16);if(!this._HtmlConfig.view.IsVisibleInTree()){if(this._HtmlConfig.status.horizonVisible||this._HtmlConfig.status.verticalVisible){let A={};A[Pn]=this._HtmlConfig.status.horizonVisible,A[Dn]=!1,A[_n]=this._HtmlConfig.status.verticalVisible,A[kn]=!1,this._HtmlConfig.status.horizonVisible=!1,this._HtmlConfig.status.verticalVisible=!1,this.OnCallback(A)}return}let t={top:0,bottom:0,left:0,right:0},n=qt(this._HtmlConfig.view.HtmlGetElement());[t.top,t.bottom,t.left,t.right]=n;let i,s,r={top:0,bottom:e,left:0,right:A},o=!0;if(this._HtmlConfig.container&&this._HtmlConfig.container.HtmlCanAccessElement()){let t=qt(this._HtmlConfig.container.HtmlGetElement());[r.top,r.bottom,r.left,r.right]=t,i=new Hn(r.left,r.right),s=new Hn(r.top,r.bottom);let n=new Hn(0,A),a=new Hn(0,e);o=n.IsInterAct(i)&&a.IsInterAct(s)}else i=new Hn(r.left,r.right),s=new Hn(r.top,r.bottom);let a,l,c,h,u=new Hn(t.left,t.right),g=new Hn(t.top,t.bottom),d=this._HtmlConfig.testRange;{let A=Math.floor((t.right-t.left)*d.horizon);a=new Hn(t.left,t.left+A),l=new Hn(t.right-A,t.right)}{let A=Math.floor((t.bottom-t.top)*d.vertical);c=new Hn(t.top,t.top+A),h=new Hn(t.bottom-A,t.bottom)}let B=(i.IsInclude(a)||i.IsInclude(l))&&s.IsInterAct(g)&&o,f=(s.IsInclude(c)||s.IsInclude(h))&&i.IsInterAct(u)&&o;if(B!=this._HtmlConfig.status.horizonVisible||f!=this._HtmlConfig.status.verticalVisible){let A={};A[Pn]=this._HtmlConfig.status.horizonVisible,A[Dn]=B,A[_n]=this._HtmlConfig.status.verticalVisible,A[kn]=f,this._HtmlConfig.status.horizonVisible=B,this._HtmlConfig.status.verticalVisible=f,this.OnCallback(A)}}}HtmlNeedWorkOnFrame(){return this._HtmlConfig.enable}HtmlRequestSync(){_.sRenderBridge.BeginHtmlFrameLoop()}ResetArea(A){"number"!=typeof A.horizon&&(A.horizon=1),"number"!=typeof A.vertical&&(A.vertical=1),this._HtmlConfig.testRange=A,this.HtmlRequestSync()}Enable(A){this._HtmlConfig.enable=A,this._HtmlConfig.status.horizonVisible=!1,this._HtmlConfig.status.verticalVisible=!1,this.HtmlRequestSync()}ResetContainer(A){this._HtmlConfig.container=A,this.HtmlRequestSync()}OnCallback(A){this._Callback&&this._Callback(A[Pn],A[Dn],A[_n],A[kn])}OnSelfRecycle(){this._HtmlConfig=null}}_.VisibleSensor=Rn;class On extends _.ViewSensor{constructor(A){super(_.ViewSensor.TypeDefines.TYPE_ENV_BLOCK),this._HtmlConfig={view:A,enable:!0},this.topGID=0,this.bottomGID=0,this.leftGID=0,this.rightGID=0}HtmlNeedWorkOnFrame(){return this._HtmlConfig.enable}ResetTopGID(A){if(null==A||0==A)return!1;this.topGID=A}ResetBottomGID(A){if(null==A||0==A)return!1;this.bottomGID=A}ResetLeftGID(A){if(null==A||0==A)return!1;this.leftGID=A}ResetRightGID(A){if(null==A||0==A)return!1;this.rightGID=A}Enable(A){this._HtmlConfig.enable=A,A?Ke.addSensor(this):Ke.deleteSensor(this)}OnSelfRecycle(){this._HtmlConfig=null}}function Mn(A){if(!A)throw Error("assert :P")}function Vn(A,e,t){for(var n=0;4>n;n++)if(A[e+n]!=t.charCodeAt(n))return!0;return!1}function Gn(A,e,t,n,i){for(var s=0;s<i;s++)A[e+s]=t[n+s]}function Kn(A,e,t,n){for(var i=0;i<n;i++)A[e+i]=t}function Nn(A){return new Int32Array(A)}function Wn(A,e){for(var t=[],n=0;n<A;n++)t.push(new e);return t}function Yn(A,e){var t=[];return function A(t,n,i){for(var s=i[n],r=0;r<s&&(t.push(i.length>n+1?[]:new e),!(i.length<n+1));r++)A(t[r],n+1,i)}(t,0,A),t}function Xn(A,e){for(var t="",n=0;n<4;n++)t+=String.fromCharCode(A[e++]);return t}function Jn(A,e){return(A[e+0]<<0|A[e+1]<<8|A[e+2]<<16)>>>0}function jn(A,e){return(A[e+0]<<0|A[e+1]<<8|A[e+2]<<16|A[e+3]<<24)>>>0}_.EnvBlockerSensor=On,window.WebPDecoder=function(){function A(A,e){for(var t=1<<e-1>>>0;A&t;)t>>>=1;return t?(A&t-1)+t:A}function e(A,e,t,n,i){Mn(!(n%t));do{A[e+(n-=t)]=i}while(0<n)}function t(t,i,s,r,o){if(Mn(2328>=o),512>=o)var a=Nn(512);else if(null==(a=Nn(o)))return 0;return function(t,i,s,r,o,a){var l,c,h=i,u=1<<s,g=Nn(16),d=Nn(16);for(Mn(0!=o),Mn(null!=r),Mn(null!=t),Mn(0<s),c=0;c<o;++c){if(15<r[c])return 0;++g[r[c]]}if(g[0]==o)return 0;for(d[1]=0,l=1;15>l;++l){if(g[l]>1<<l)return 0;d[l+1]=d[l]+g[l]}for(c=0;c<o;++c)l=r[c],0<r[c]&&(a[d[l]++]=c);if(1==d[15])return(r=new n).g=0,r.value=a[0],e(t,h,1,u,r),u;var B,f=-1,w=u-1,p=0,C=1,m=1,F=1<<s;for(c=0,l=1,o=2;l<=s;++l,o<<=1){if(C+=m<<=1,0>(m-=g[l]))return 0;for(;0<g[l];--g[l])(r=new n).g=l,r.value=a[c++],e(t,h+p,o,F,r),p=A(p,l)}for(l=s+1,o=2;15>=l;++l,o<<=1){if(C+=m<<=1,0>(m-=g[l]))return 0;for(;0<g[l];--g[l]){if(r=new n,(p&w)!=f){for(h+=F,B=1<<(f=l)-s;15>f&&!(0>=(B-=g[f]));)++f,B<<=1;u+=F=1<<(B=f-s),t[i+(f=p&w)].g=B+s,t[i+f].value=h-i-f}r.g=l-s,r.value=a[c++],e(t,h+(p>>s),o,F,r),p=A(p,l)}}return C!=2*d[15]-1?0:u}(t,i,s,r,o,a)}function n(){this.value=this.g=0}function i(){this.value=this.g=0}function s(){this.G=Wn(5,n),this.H=Nn(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=Wn(St,i)}function r(A,e,t,n){Mn(null!=A),Mn(null!=e),Mn(2147483648>n),A.Ca=254,A.I=0,A.b=-8,A.Ka=0,A.oa=e,A.pa=t,A.Jd=e,A.Yc=t+n,A.Zc=4<=n?t+n-4+1:t,p(A)}function o(A,e){for(var t=0;0<e--;)t|=m(A,128)<<e;return t}function a(A,e){var t=o(A,e);return C(A)?-t:t}function l(A,e,t,n){var i,s=0;for(Mn(null!=A),Mn(null!=e),Mn(4294967288>n),A.Sb=n,A.Ra=0,A.u=0,A.h=0,4<n&&(n=4),i=0;i<n;++i)s+=e[t+i]<<8*i;A.Ra=s,A.bb=n,A.oa=e,A.pa=t}function c(A){for(;8<=A.u&&A.bb<A.Sb;)A.Ra>>>=8,A.Ra+=A.oa[A.pa+A.bb]<<Ht-8>>>0,++A.bb,A.u-=8;B(A)&&(A.h=1,A.u=0)}function h(A,e){if(Mn(0<=e),!A.h&&e<=Lt){var t=d(A)&bt[e];return A.u+=e,c(A),t}return A.h=1,A.u=0}function u(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function g(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function d(A){return A.Ra>>>(A.u&Ht-1)>>>0}function B(A){return Mn(A.bb<=A.Sb),A.h||A.bb==A.Sb&&A.u>Ht}function f(A,e){A.u=e,A.h=B(A)}function w(A){A.u>=_t&&(Mn(A.u>=_t),c(A))}function p(A){Mn(null!=A&&null!=A.oa),A.pa<A.Zc?(A.I=(A.oa[A.pa++]|A.I<<8)>>>0,A.b+=8):(Mn(null!=A&&null!=A.oa),A.pa<A.Yc?(A.b+=8,A.I=A.oa[A.pa++]|A.I<<8):A.Ka?A.b=0:(A.I<<=8,A.b+=8,A.Ka=1))}function C(A){return o(A,1)}function m(A,e){var t=A.Ca;0>A.b&&p(A);var n=A.b,i=t*e>>>8,s=(A.I>>>n>i)+0;for(s?(t-=i,A.I-=i+1<<n>>>0):t=i+1,n=t,i=0;256<=n;)i+=8,n>>=8;return n=7^i+kt[n],A.b-=n,A.Ca=(t<<n)-1,s}function F(A,e,t){A[e+0]=t>>24&255,A[e+1]=t>>16&255,A[e+2]=t>>8&255,A[e+3]=t>>0&255}function y(A,e){return A[e+0]<<0|A[e+1]<<8}function Q(A,e){return y(A,e)|A[e+2]<<16}function E(A,e){return y(A,e)|y(A,e+2)<<16}function U(A,e){var t=1<<e;return Mn(null!=A),Mn(0<e),A.X=Nn(t),null==A.X?0:(A.Mb=32-e,A.Xa=e,1)}function I(A,e){Mn(null!=A),Mn(null!=e),Mn(A.Xa==e.Xa),Gn(e.X,0,A.X,0,1<<e.Xa)}function T(){this.X=[],this.Xa=this.Mb=0}function v(A,e,t,n){Mn(null!=t),Mn(null!=n);var i=t[0],s=n[0];return 0==i&&(i=(A*s+e/2)/e),0==s&&(s=(e*i+A/2)/A),0>=i||0>=s?0:(t[0]=i,n[0]=s,1)}function x(A,e){return A+(1<<e)-1>>>e}function S(A,e){return((4278255360&A)+(4278255360&e)>>>0&4278255360)+((16711935&A)+(16711935&e)>>>0&16711935)>>>0}function b(A,e){self[e]=function(e,t,n,i,s,r,o){var a;for(a=0;a<s;++a){var l=self[A](r[o+a-1],n,i+a);r[o+a]=S(e[t+a],l)}}}function L(){this.ud=this.hd=this.jd=0}function H(A,e){return((4278124286&(A^e))>>>1)+(A&e)>>>0}function _(A){return 0<=A&&256>A?A:0>A?0:255<A?255:void 0}function k(A,e){return _(A+(A-e+.5>>1))}function P(A,e,t){return Math.abs(e-t)-Math.abs(A-t)}function D(A,e,t,n,i,s,r){for(n=s[r-1],t=0;t<i;++t)s[r+t]=n=S(A[e+t],n)}function R(A,e,t,n,i){var s;for(s=0;s<t;++s){var r=A[e+s],o=r>>8&255,a=16711935&(a=(a=16711935&r)+((o<<16)+o));n[i+s]=(4278255360&r)+a>>>0}}function O(A,e){e.jd=A>>0&255,e.hd=A>>8&255,e.ud=A>>16&255}function M(A,e,t,n,i,s){var r;for(r=0;r<n;++r){var o=e[t+r],a=o>>>8,l=o,c=255&(c=(c=o>>>16)+((A.jd<<24>>24)*(a<<24>>24)>>>5));l=255&(l=(l=l+((A.hd<<24>>24)*(a<<24>>24)>>>5))+((A.ud<<24>>24)*(c<<24>>24)>>>5));i[s+r]=(4278255360&o)+(c<<16)+l}}function V(A,e,t,n,i){self[e]=function(A,e,t,s,r,o,a,l,c){for(s=a;s<l;++s)for(a=0;a<c;++a)r[o++]=i(t[n(A[e++])])},self[A]=function(A,e,s,r,o,a,l){var c=8>>A.b,h=A.Ea,u=A.K[0],g=A.w;if(8>c)for(A=(1<<A.b)-1,g=(1<<c)-1;e<s;++e){var d,B=0;for(d=0;d<h;++d)d&A||(B=n(r[o++])),a[l++]=i(u[B&g]),B>>=c}else self["VP8LMapColor"+t](r,o,u,g,a,l,e,s,h)}}function G(A,e,t,n,i){for(t=e+t;e<t;){var s=A[e++];n[i++]=s>>16&255,n[i++]=s>>8&255,n[i++]=s>>0&255}}function K(A,e,t,n,i){for(t=e+t;e<t;){var s=A[e++];n[i++]=s>>16&255,n[i++]=s>>8&255,n[i++]=s>>0&255,n[i++]=s>>24&255}}function N(A,e,t,n,i){for(t=e+t;e<t;){var s=(r=A[e++])>>16&240|r>>12&15,r=r>>0&240|r>>28&15;n[i++]=s,n[i++]=r}}function W(A,e,t,n,i){for(t=e+t;e<t;){var s=(r=A[e++])>>16&248|r>>13&7,r=r>>5&224|r>>3&31;n[i++]=s,n[i++]=r}}function Y(A,e,t,n,i){for(t=e+t;e<t;){var s=A[e++];n[i++]=s>>0&255,n[i++]=s>>8&255,n[i++]=s>>16&255}}function X(A,e,t,n,i,s){if(0==s)for(t=e+t;e<t;)F(n,((s=A[e++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),i+=32;else Gn(n,i,A,e,t)}function J(A,e){self[e][0]=self[A+"0"],self[e][1]=self[A+"1"],self[e][2]=self[A+"2"],self[e][3]=self[A+"3"],self[e][4]=self[A+"4"],self[e][5]=self[A+"5"],self[e][6]=self[A+"6"],self[e][7]=self[A+"7"],self[e][8]=self[A+"8"],self[e][9]=self[A+"9"],self[e][10]=self[A+"10"],self[e][11]=self[A+"11"],self[e][12]=self[A+"12"],self[e][13]=self[A+"13"],self[e][14]=self[A+"0"],self[e][15]=self[A+"0"]}function j(A){return A==kn||A==Pn||A==Dn||A==Rn}function z(){this.eb=[],this.size=this.A=this.fb=0}function Z(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function $(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new z,this.f.kb=new Z,this.sd=null}function q(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function AA(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function eA(A){return alert("todo:WebPSamplerProcessPlane"),A.T}function tA(A,e){var t=A.T,n=e.ba.f.RGBA,i=n.eb,s=n.fb+A.ka*n.A,r=fi[e.ba.S],o=A.y,a=A.O,l=A.f,c=A.N,h=A.ea,u=A.W,g=e.cc,d=e.dc,B=e.Mc,f=e.Nc,w=A.ka,p=A.ka+A.T,C=A.U,m=C+1>>1;for(0==w?r(o,a,null,null,l,c,h,u,l,c,h,u,i,s,null,null,C):(r(e.ec,e.fc,o,a,g,d,B,f,l,c,h,u,i,s-n.A,i,s,C),++t);w+2<p;w+=2)g=l,d=c,B=h,f=u,c+=A.Rc,u+=A.Rc,s+=2*n.A,r(o,(a+=2*A.fa)-A.fa,o,a,g,d,B,f,l,c,h,u,i,s-n.A,i,s,C);return a+=A.fa,A.j+p<A.o?(Gn(e.ec,e.fc,o,a,C),Gn(e.cc,e.dc,l,c,m),Gn(e.Mc,e.Nc,h,u,m),t--):1&p||r(o,a,null,null,l,c,h,u,l,c,h,u,i,s+n.A,null,null,C),t}function nA(A,e,t){var n=A.F,i=[A.J];if(null!=n){var s=A.U,r=e.ba.S,o=r==Ln||r==Dn;e=e.ba.f.RGBA;var a=[0],l=A.ka;a[0]=A.T,A.Kb&&(0==l?--a[0]:(--l,i[0]-=A.width),A.j+A.ka+A.T==A.o&&(a[0]=A.o-A.j-l));var c=e.eb;l=e.fb+l*e.A;A=wn(n,i[0],A.width,s,a,c,l+(o?0:3),e.A),Mn(t==a),A&&j(r)&&Bn(c,l,o,s,a,e.A)}return 0}function iA(A){var e=A.ma,t=e.ba.S,n=11>t,i=t==xn||t==bn||t==Ln||t==Hn||12==t||j(t);if(e.memory=null,e.Ib=null,e.Jb=null,e.Nd=null,!Tt(e.Oa,A,i?11:12))return 0;if(i&&j(t)&&ct(),A.da)alert("todo:use_scaling");else{if(n){if(e.Ib=eA,A.Kb){if(t=A.U+1>>1,e.memory=Nn(A.U+2*t),null==e.memory)return 0;e.ec=e.memory,e.fc=0,e.cc=e.ec,e.dc=e.fc+A.U,e.Mc=e.cc,e.Nc=e.dc+t,e.Ib=tA,ct()}}else alert("todo:EmitYUV");i&&(e.Jb=nA,n&&at())}if(n&&!Si){for(A=0;256>A;++A)bi[A]=89858*(A-128)+Ui>>Ei,_i[A]=-22014*(A-128)+Ui,Hi[A]=-45773*(A-128),Li[A]=113618*(A-128)+Ui>>Ei;for(A=Ii;A<Ti;++A)e=76283*(A-16)+Ui>>Ei,ki[A-Ii]=DA(e,255),Pi[A-Ii]=DA(e+8>>4,15);Si=1}return 1}function sA(A){var e=A.ma,t=A.U,n=A.T;return Mn(!(1&A.ka)),0>=t||0>=n?0:(t=e.Ib(A,e),null!=e.Jb&&e.Jb(A,e,t),e.Dc+=t,1)}function rA(A){A.ma.memory=null}function oA(A,e,t,n){return 47!=h(A,8)?0:(e[0]=h(A,14)+1,t[0]=h(A,14)+1,n[0]=h(A,1),0!=h(A,3)?0:!A.h)}function aA(A,e){if(4>A)return A+1;var t=A-2>>1;return(2+(1&A)<<t)+h(e,t)+1}function lA(A,e){return 120<e?e-120:1<=(t=((t=Zn[e-1])>>4)*A+(8-(15&t)))?t:1;var t}function cA(A,e,t){var n=d(t),i=A[e+=255&n].g-8;return 0<i&&(f(t,t.u+8),n=d(t),e+=A[e].value,e+=n&(1<<i)-1),f(t,t.u+A[e].g),A[e].value}function hA(A,e,t){return t.g+=A.g,t.value+=A.value<<e>>>0,Mn(8>=t.g),A.g}function uA(A,e,t){var n=A.xc;return Mn((e=0==n?0:A.vc[A.md*(t>>n)+(e>>n)])<A.Wb),A.Ya[e]}function gA(A,e,t,n){var i=A.ab,s=A.c*e,r=A.C;e=r+e;var o=t,a=n;for(n=A.Ta,t=A.Ua;0<i--;){var l=A.gc[i],c=r,h=e,u=o,g=a,d=(a=n,o=t,l.Ea);switch(Mn(c<h),Mn(h<=l.nc),l.hc){case 2:Rt(u,g,(h-c)*d,a,o);break;case 0:var B=c,f=h,w=a,p=o,C=(E=l).Ea;0==B&&(Pt(u,g,null,null,1,w,p),D(u,g+1,0,0,C-1,w,p+1),g+=C,p+=C,++B);for(var m=1<<E.b,F=m-1,y=x(C,E.b),Q=E.K,E=E.w+(B>>E.b)*y;B<f;){var U=Q,I=E,T=1;for(Dt(u,g,w,p-C,1,w,p);T<C;){var v=(T&~F)+m;v>C&&(v=C),(0,Kt[U[I++]>>8&15])(u,g+ +T,w,p+T-C,v-T,w,p+T),T=v}g+=C,p+=C,++B&F||(E+=y)}h!=l.nc&&Gn(a,o-d,a,o+(h-c-1)*d,d);break;case 1:for(d=u,f=g,C=(u=l.Ea)-(p=u&~(w=(g=1<<l.b)-1)),B=x(u,l.b),m=l.K,l=l.w+(c>>l.b)*B;c<h;){for(F=m,y=l,Q=new L,E=f+p,U=f+u;f<E;)O(F[y++],Q),Nt(Q,d,f,g,a,o),f+=g,o+=g;f<U&&(O(F[y++],Q),Nt(Q,d,f,C,a,o),f+=C,o+=C),++c&w||(l+=B)}break;case 3:if(u==a&&g==o&&0<l.b){for(f=a,u=d=o+(h-c)*d-(p=(h-c)*x(l.Ea,l.b)),g=a,w=o,B=[],p=(C=p)-1;0<=p;--p)B[p]=g[w+p];for(p=C-1;0<=p;--p)f[u+p]=B[p];Ot(l,c,h,a,d,a,o)}else Ot(l,c,h,u,g,a,o)}o=n,a=t}a!=t&&Gn(n,t,o,a,s)}function dA(A,e){var t=A.V,n=A.Ba+A.c*A.C,i=e-A.C;if(Mn(e<=A.l.o),Mn(16>=i),0<i){var s=A.l,r=A.Ta,o=A.Ua,a=s.width;if(gA(A,i,t,n),i=o=[o],Mn((t=A.C)<(n=e)),Mn(s.v<s.va),n>s.o&&(n=s.o),t<s.j){var l=s.j-t;t=s.j;i[0]+=l*a}if(t>=n?t=0:(i[0]+=4*s.v,s.ka=t-s.j,s.U=s.va-s.v,s.T=n-t,t=1),t){if(o=o[0],11>(t=A.ca).S){var c=t.f.RGBA,h=(n=t.S,i=s.U,s=s.T,l=c.eb,c.A),u=s;for(c=c.fb+A.Ma*c.A;0<u--;){var g=r,d=o,B=i,f=l,w=c;switch(n){case vn:Wt(g,d,B,f,w);break;case xn:Yt(g,d,B,f,w);break;case kn:Yt(g,d,B,f,w),Bn(f,w,0,B,1,0);break;case Sn:jt(g,d,B,f,w);break;case bn:X(g,d,B,f,w,1);break;case Pn:X(g,d,B,f,w,1),Bn(f,w,0,B,1,0);break;case Ln:X(g,d,B,f,w,0);break;case Dn:X(g,d,B,f,w,0),Bn(f,w,1,B,1,0);break;case Hn:Xt(g,d,B,f,w);break;case Rn:Xt(g,d,B,f,w),fn(f,w,B,1,0);break;case _n:Jt(g,d,B,f,w);break;default:Mn(0)}o+=a,c+=h}A.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");Mn(A.Ma<=t.height)}}A.C=e,Mn(A.C<=A.i)}function BA(A){var e;if(0<A.ua)return 0;for(e=0;e<A.Wb;++e){var t=A.Ya[e].G,n=A.Ya[e].H;if(0<t[1][n[1]+0].g||0<t[2][n[2]+0].g||0<t[3][n[3]+0].g)return 0}return 1}function fA(A,e,t,n,i,s){if(0!=A.Z){var r=A.qd,o=A.rd;for(Mn(null!=Bi[A.Z]);e<t;++e)Bi[A.Z](r,o,n,i,n,i,s),r=n,o=i,i+=s;A.qd=r,A.rd=o}}function wA(A,e){var t=A.l.ma,n=0==t.Z||1==t.Z?A.l.j:A.C;n=A.C<n?n:A.C;if(Mn(e<=A.l.o),e>n){var i=A.l.width,s=t.ca,r=t.tb+i*n,o=A.V,a=A.Ba+A.c*n,l=A.gc;Mn(1==A.ab),Mn(3==l[0].hc),Vt(l[0],n,e,o,a,s,r),fA(t,n,e,s,r,i)}A.C=A.Ma=e}function pA(A,e,t,n,i,s,r){var o=A.$/n,a=A.$%n,l=A.m,c=A.s,h=t+A.$,u=h;i=t+n*i;var g=t+n*s,p=280+c.ua,C=A.Pb?o:16777216,m=0<c.ua?c.Wa:null,F=c.wc,y=h<g?uA(c,a,o):null;Mn(A.C<s),Mn(g<=i);var Q=!1;A:for(;;){for(;Q||h<g;){var E=0;if(o>=C){var U=h-t;Mn((C=A).Pb),C.wd=C.m,C.xd=U,0<C.s.ua&&I(C.s.Wa,C.s.vb),C=o+qn}if(a&F||(y=uA(c,a,o)),Mn(null!=y),y.Qb&&(e[h]=y.qb,Q=!0),!Q)if(w(l),y.jc){E=l,U=e;var T=h,v=y.pd[d(E)&St-1];Mn(y.jc),256>v.g?(f(E,E.u+v.g),U[T]=v.value,E=0):(f(E,E.u+v.g-256),Mn(256<=v.value),E=v.value),0==E&&(Q=!0)}else E=cA(y.G[0],y.H[0],l);if(l.h)break;if(Q||256>E){if(!Q)if(y.nd)e[h]=(y.qb|E<<8)>>>0;else{if(w(l),Q=cA(y.G[1],y.H[1],l),w(l),U=cA(y.G[2],y.H[2],l),T=cA(y.G[3],y.H[3],l),l.h)break;e[h]=(T<<24|Q<<16|E<<8|U)>>>0}if(Q=!1,++h,++a>=n&&(a=0,++o,null!=r&&o<=s&&!(o%16)&&r(A,o),null!=m))for(;u<h;)E=e[u++],m.X[(506832829*E&4294967295)>>>m.Mb]=E}else if(280>E){if(E=aA(E-256,l),U=cA(y.G[4],y.H[4],l),w(l),U=lA(n,U=aA(U,l)),l.h)break;if(h-t<U||i-h<E)break A;for(T=0;T<E;++T)e[h+T]=e[h+T-U];for(h+=E,a+=E;a>=n;)a-=n,++o,null!=r&&o<=s&&!(o%16)&&r(A,o);if(Mn(h<=i),a&F&&(y=uA(c,a,o)),null!=m)for(;u<h;)E=e[u++],m.X[(506832829*E&4294967295)>>>m.Mb]=E}else{if(!(E<p))break A;for(Q=E-280,Mn(null!=m);u<h;)E=e[u++],m.X[(506832829*E&4294967295)>>>m.Mb]=E;E=h,Mn(!(Q>>>(U=m).Xa)),e[E]=U.X[Q],Q=!0}Q||Mn(l.h==B(l))}if(A.Pb&&l.h&&h<i)Mn(A.m.h),A.a=5,A.m=A.wd,A.$=A.xd,0<A.s.ua&&I(A.s.vb,A.s.Wa);else{if(l.h)break A;null!=r&&r(A,o>s?s:o),A.a=0,A.$=h-t}return 1}return A.a=3,0}function CA(A){Mn(null!=A),A.vc=null,A.yc=null,A.Ya=null;var e=A.Wa;null!=e&&(e.X=null),A.vb=null,Mn(null!=A)}function mA(){var A=new $e;return null==A?null:(A.a=0,A.xb=di,J("Predictor","VP8LPredictors"),J("Predictor","VP8LPredictors_C"),J("PredictorAdd","VP8LPredictorsAdd"),J("PredictorAdd","VP8LPredictorsAdd_C"),Rt=R,Nt=M,Wt=G,Yt=K,Xt=N,Jt=W,jt=Y,self.VP8LMapColor32b=Mt,self.VP8LMapColor8b=Gt,A)}function FA(A,e,i,r,o){var a=1,l=[A],c=[e],u=r.m,g=r.s,B=null,p=0;A:for(;;){if(i)for(;a&&h(u,1);){var C=l,m=c,F=r,y=1,Q=F.m,E=F.gc[F.ab],I=h(Q,2);if(F.Oc&1<<I)a=0;else{switch(F.Oc|=1<<I,E.hc=I,E.Ea=C[0],E.nc=m[0],E.K=[null],++F.ab,Mn(4>=F.ab),I){case 0:case 1:E.b=h(Q,3)+2,y=FA(x(E.Ea,E.b),x(E.nc,E.b),0,F,E.K),E.K=E.K[0];break;case 3:var T,v=h(Q,8)+1,b=16<v?0:4<v?1:2<v?2:3;if(C[0]=x(E.Ea,b),E.b=b,T=y=FA(v,1,0,F,E.K)){var L,H=v,_=E,k=1<<(8>>_.b),P=Nn(k);if(null==P)T=0;else{var D=_.K[0],R=_.w;for(P[0]=_.K[0][0],L=1;L<1*H;++L)P[L]=S(D[R+L],P[L-1]);for(;L<4*k;++L)P[L]=0;_.K[0]=null,_.K[0]=P,T=1}}y=T;break;case 2:break;default:Mn(0)}a=y}}if(l=l[0],c=c[0],a&&h(u,1)&&!(a=1<=(p=h(u,4))&&11>=p)){r.a=3;break A}var O;if(O=a)e:{var M,V,G,K=r,N=l,W=c,Y=p,X=i,J=K.m,j=K.s,z=[null],Z=1,$=0,q=$n[Y];t:for(;;){if(X&&h(J,1)){var AA=h(J,3)+2,eA=x(N,AA),tA=x(W,AA),nA=eA*tA;if(!FA(eA,tA,0,K,z))break t;for(z=z[0],j.xc=AA,M=0;M<nA;++M){var iA=z[M]>>8&65535;z[M]=iA,iA>=Z&&(Z=iA+1)}}if(J.h)break t;for(V=0;5>V;++V){var sA=Jn[V];!V&&0<Y&&(sA+=1<<Y),$<sA&&($=sA)}var rA=Wn(Z*q,n),oA=Z,aA=Wn(oA,s);if(null==aA)var lA=null;else Mn(65536>=oA),lA=aA;var cA=Nn($);if(null==lA||null==cA||null==rA){K.a=1;break t}var uA=rA;for(M=G=0;M<Z;++M){var gA=lA[M],dA=gA.G,BA=gA.H,fA=0,wA=1,mA=0;for(V=0;5>V;++V){sA=Jn[V],dA[V]=uA,BA[V]=G,!V&&0<Y&&(sA+=1<<Y);n:{var yA,QA=sA,EA=K,UA=cA,IA=uA,TA=G,vA=0,xA=EA.m,SA=h(xA,1);if(Kn(UA,0,0,QA),SA){var bA=h(xA,1)+1,LA=h(xA,1),HA=h(xA,0==LA?1:8);UA[HA]=1,2==bA&&(UA[HA=h(xA,8)]=1);var _A=1}else{var kA=Nn(19),PA=h(xA,4)+4;if(19<PA){EA.a=3;var DA=0;break n}for(yA=0;yA<PA;++yA)kA[zn[yA]]=h(xA,3);var RA=void 0,OA=void 0,MA=EA,VA=kA,GA=QA,KA=UA,NA=0,WA=MA.m,YA=8,XA=Wn(128,n);i:for(;t(XA,0,7,VA,19);){if(h(WA,1)){var JA=2+2*h(WA,3);if((RA=2+h(WA,JA))>GA)break i}else RA=GA;for(OA=0;OA<GA&&RA--;){w(WA);var jA=XA[0+(127&d(WA))];f(WA,WA.u+jA.g);var zA=jA.value;if(16>zA)KA[OA++]=zA,0!=zA&&(YA=zA);else{var ZA=16==zA,$A=zA-16,qA=Xn[$A],Ae=h(WA,On[$A])+qA;if(OA+Ae>GA)break i;for(var ee=ZA?YA:0;0<Ae--;)KA[OA++]=ee}}NA=1;break i}NA||(MA.a=3),_A=NA}(_A=_A&&!xA.h)&&(vA=t(IA,TA,8,UA,QA)),_A&&0!=vA?DA=vA:(EA.a=3,DA=0)}if(0==DA)break t;if(wA&&1==jn[V]&&(wA=0==uA[G].g),fA+=uA[G].g,G+=DA,3>=V){var te,ne=cA[0];for(te=1;te<sA;++te)cA[te]>ne&&(ne=cA[te]);mA+=ne}}if(gA.nd=wA,gA.Qb=0,wA&&(gA.qb=(dA[3][BA[3]+0].value<<24|dA[1][BA[1]+0].value<<16|dA[2][BA[2]+0].value)>>>0,0==fA&&256>dA[0][BA[0]+0].value&&(gA.Qb=1,gA.qb+=dA[0][BA[0]+0].value<<8)),gA.jc=!gA.Qb&&6>mA,gA.jc){var ie,se=gA;for(ie=0;ie<St;++ie){var re=ie,oe=se.pd[re],ae=se.G[0][se.H[0]+re];256<=ae.value?(oe.g=ae.g+256,oe.value=ae.value):(oe.g=0,oe.value=0,re>>=hA(ae,8,oe),re>>=hA(se.G[1][se.H[1]+re],16,oe),re>>=hA(se.G[2][se.H[2]+re],0,oe),hA(se.G[3][se.H[3]+re],24,oe))}}}j.vc=z,j.Wb=Z,j.Ya=lA,j.yc=rA,O=1;break e}O=0}if(!(a=O)){r.a=3;break A}if(0<p){if(g.ua=1<<p,!U(g.Wa,p)){r.a=1,a=0;break A}}else g.ua=0;var le=r,ce=l,he=c,ue=le.s,ge=ue.xc;if(le.c=ce,le.i=he,ue.md=x(ce,ge),ue.wc=0==ge?-1:(1<<ge)-1,i){r.xb=gi;break A}if(null==(B=Nn(l*c))){r.a=1,a=0;break A}a=(a=pA(r,B,0,l,c,c,null))&&!u.h;break A}return a?(null!=o?o[0]=B:(Mn(null==B),Mn(i)),r.$=0,i||CA(g)):CA(g),a}function yA(A,e){var t=A.c*A.i,n=t+e+16*e;return Mn(A.c<=e),A.V=Nn(n),null==A.V?(A.Ta=null,A.Ua=0,A.a=1,0):(A.Ta=A.V,A.Ua=A.Ba+t+e,1)}function QA(A,e){var t=A.C,n=e-t,i=A.V,s=A.Ba+A.c*t;for(Mn(e<=A.l.o);0<n;){var r=16<n?16:n,o=A.l.ma,a=A.l.width,l=a*r,c=o.ca,h=o.tb+a*t,u=A.Ta,g=A.Ua;gA(A,r,i,s),pn(u,g,c,h,l),fA(o,t,t+r,c,h,a),n-=r,i+=r*A.c,t+=r}Mn(t==e),A.C=A.Ma=e}function EA(){this.ub=this.yd=this.td=this.Rb=0}function UA(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function IA(){this.Fb=this.Bb=this.Cb=0,this.Zb=Nn(4),this.Lb=Nn(4)}function TA(){this.Yb=function(){var A=[];return function A(e,t,n){for(var i=n[t],s=0;s<i&&(e.push(n.length>t+1?[]:0),!(n.length<t+1));s++)A(e[s],t+1,n)}(A,0,[3,11]),A}()}function vA(){this.jb=Nn(3),this.Wc=Yn([4,8],TA),this.Xc=Yn([4,17],TA)}function xA(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new Nn(4),this.od=new Nn(4)}function SA(){this.ld=this.La=this.dd=this.tc=0}function bA(){this.Na=this.la=0}function LA(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function HA(){this.ad=Nn(384),this.Za=0,this.Ob=Nn(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function _A(){this.uc=this.M=this.Nb=0,this.wa=Array(new SA),this.Y=0,this.ya=Array(new HA),this.aa=0,this.l=new RA}function kA(){this.y=Nn(16),this.f=Nn(8),this.ea=Nn(8)}function PA(){this.cb=this.a=0,this.sc="",this.m=new u,this.Od=new EA,this.Kc=new UA,this.ed=new xA,this.Qa=new IA,this.Ic=this.$c=this.Aa=0,this.D=new _A,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=Wn(8,u),this.ia=0,this.pb=Wn(4,LA),this.Pa=new vA,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new kA),this.Hd=0,this.rb=Array(new bA),this.sb=0,this.wa=Array(new SA),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new HA),this.L=this.aa=0,this.gd=Yn([4,2],SA),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function DA(A,e){return 0>A?0:A>e?e:A}function RA(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function OA(){var A=new PA;return null!=A&&(A.a=0,A.sc="OK",A.cb=0,A.Xb=0,ti||(ti=KA)),A}function MA(A,e,t){return 0==A.a&&(A.a=e,A.sc=t,A.cb=0),0}function VA(A,e,t){return 3<=t&&157==A[e+0]&&1==A[e+1]&&42==A[e+2]}function GA(A,e){if(null==A)return 0;if(A.a=0,A.sc="OK",null==e)return MA(A,2,"null VP8Io passed to VP8GetHeaders()");var t=e.data,n=e.w,i=e.ha;if(4>i)return MA(A,7,"Truncated header.");var s=t[n+0]|t[n+1]<<8|t[n+2]<<16,l=A.Od;if(l.Rb=!(1&s),l.td=s>>1&7,l.yd=s>>4&1,l.ub=s>>5,3<l.td)return MA(A,3,"Incorrect keyframe parameters.");if(!l.yd)return MA(A,4,"Frame not displayable.");n+=3,i-=3;var c=A.Kc;if(l.Rb){if(7>i)return MA(A,7,"cannot parse picture header");if(!VA(t,n,i))return MA(A,3,"Bad code word");c.c=16383&(t[n+4]<<8|t[n+3]),c.Td=t[n+4]>>6,c.i=16383&(t[n+6]<<8|t[n+5]),c.Ud=t[n+6]>>6,n+=7,i-=7,A.za=c.c+15>>4,A.Ub=c.i+15>>4,e.width=c.c,e.height=c.i,e.Da=0,e.j=0,e.v=0,e.va=e.width,e.o=e.height,e.da=0,e.ib=e.width,e.hb=e.height,e.U=e.width,e.T=e.height,Kn((s=A.Pa).jb,0,255,s.jb.length),Mn(null!=(s=A.Qa)),s.Cb=0,s.Bb=0,s.Fb=1,Kn(s.Zb,0,0,s.Zb.length),Kn(s.Lb,0,0,s.Lb)}if(l.ub>i)return MA(A,7,"bad partition length");r(s=A.m,t,n,l.ub),n+=l.ub,i-=l.ub,l.Rb&&(c.Ld=C(s),c.Kd=C(s)),c=A.Qa;var h,u=A.Pa;if(Mn(null!=s),Mn(null!=c),c.Cb=C(s),c.Cb){if(c.Bb=C(s),C(s)){for(c.Fb=C(s),h=0;4>h;++h)c.Zb[h]=C(s)?a(s,7):0;for(h=0;4>h;++h)c.Lb[h]=C(s)?a(s,6):0}if(c.Bb)for(h=0;3>h;++h)u.jb[h]=C(s)?o(s,8):255}else c.Bb=0;if(s.Ka)return MA(A,3,"cannot parse segment header");if((c=A.ed).zd=C(s),c.Tb=o(s,6),c.wb=o(s,3),c.Pc=C(s),c.Pc&&C(s)){for(u=0;4>u;++u)C(s)&&(c.vd[u]=a(s,6));for(u=0;4>u;++u)C(s)&&(c.od[u]=a(s,6))}if(A.L=0==c.Tb?0:c.zd?1:2,s.Ka)return MA(A,3,"cannot parse filter header");var g=i;if(i=h=n,n=h+g,c=g,A.Xb=(1<<o(A.m,2))-1,g<3*(u=A.Xb))t=7;else{for(h+=3*u,c-=3*u,g=0;g<u;++g){var d=t[i+0]|t[i+1]<<8|t[i+2]<<16;d>c&&(d=c),r(A.Jc[+g],t,h,d),h+=d,c-=d,i+=3}r(A.Jc[+u],t,h,c),t=h<n?0:5}if(0!=t)return MA(A,t,"cannot parse partitions");for(t=o(h=A.m,7),i=C(h)?a(h,4):0,n=C(h)?a(h,4):0,c=C(h)?a(h,4):0,u=C(h)?a(h,4):0,h=C(h)?a(h,4):0,g=A.Qa,d=0;4>d;++d){if(g.Cb){var B=g.Zb[d];g.Fb||(B+=t)}else{if(0<d){A.pb[d]=A.pb[0];continue}B=t}var f=A.pb[d];f.Sc[0]=Ai[DA(B+i,127)],f.Sc[1]=ei[DA(B+0,127)],f.Eb[0]=2*Ai[DA(B+n,127)],f.Eb[1]=101581*ei[DA(B+c,127)]>>16,8>f.Eb[1]&&(f.Eb[1]=8),f.Qc[0]=Ai[DA(B+u,117)],f.Qc[1]=ei[DA(B+h,127)],f.lc=B+h}if(!l.Rb)return MA(A,4,"Not a key frame.");for(C(s),l=A.Pa,t=0;4>t;++t){for(i=0;8>i;++i)for(n=0;3>n;++n)for(c=0;11>c;++c)u=m(s,ai[t][i][n][c])?o(s,8):ri[t][i][n][c],l.Wc[t][i].Yb[n][c]=u;for(i=0;17>i;++i)l.Xc[t][i]=l.Wc[t][li[i]]}return A.kc=C(s),A.kc&&(A.Bd=o(s,8)),A.cb=1}function KA(A,e,t,n,i,s,r){var o=e[i].Yb[t];for(t=0;16>i;++i){if(!m(A,o[t+0]))return i;for(;!m(A,o[t+1]);)if(o=e[++i].Yb[0],t=0,16==i)return 16;var a=e[i+1].Yb;if(m(A,o[t+2])){var l=A,c=0;if(m(l,(u=o)[(h=t)+3]))if(m(l,u[h+6])){for(o=0,h=2*(c=m(l,u[h+8]))+(u=m(l,u[h+9+c])),c=0,u=ni[h];u[o];++o)c+=c+m(l,u[o]);c+=3+(8<<h)}else m(l,u[h+7])?(c=7+2*m(l,165),c+=m(l,145)):c=5+m(l,159);else c=m(l,u[h+4])?3+m(l,u[h+5]):2;o=a[2]}else c=1,o=a[1];a=r+ii[i],0>(l=A).b&&p(l);var h,u=l.b,g=(h=l.Ca>>1)-(l.I>>u)>>31;--l.b,l.Ca+=g,l.Ca|=1,l.I-=(h+1&g)<<u,s[a]=((c^g)-g)*n[(0<i)+0]}return 16}function NA(A){var e=A.rb[A.sb-1];e.la=0,e.Na=0,Kn(A.zc,0,0,A.zc.length),A.ja=0}function WA(A,e){if(null==A)return 0;if(null==e)return MA(A,2,"NULL VP8Io parameter in VP8Decode().");if(!A.cb&&!GA(A,e))return 0;if(Mn(A.cb),null==e.ac||e.ac(e)){e.ob&&(A.L=0);var t=Ri[A.L];if(2==A.L?(A.yb=0,A.zb=0):(A.yb=e.v-t>>4,A.zb=e.j-t>>4,0>A.yb&&(A.yb=0),0>A.zb&&(A.zb=0)),A.Va=e.o+15+t>>4,A.Hb=e.va+15+t>>4,A.Hb>A.za&&(A.Hb=A.za),A.Va>A.Ub&&(A.Va=A.Ub),0<A.L){var n=A.ed;for(t=0;4>t;++t){var i;if(A.Qa.Cb){var s=A.Qa.Lb[t];A.Qa.Fb||(s+=n.Tb)}else s=n.Tb;for(i=0;1>=i;++i){var r=A.gd[t][i],o=s;if(n.Pc&&(o+=n.vd[0],i&&(o+=n.od[0])),0<(o=0>o?0:63<o?63:o)){var a=o;0<n.wb&&((a=4<n.wb?a>>2:a>>1)>9-n.wb&&(a=9-n.wb)),1>a&&(a=1),r.dd=a,r.tc=2*o+a,r.ld=40<=o?2:15<=o?1:0}else r.tc=0;r.La=i}}}t=0}else MA(A,6,"Frame setup failed"),t=A.a;if(t=0==t){if(t){A.$c=0,0<A.Aa||(A.Ic=Mi);A:{t=A.Ic;n=4*(a=A.za);var l=32*a,c=a+1,h=0<A.L?a*(0<A.Aa?2:1):0,u=(2==A.Aa?2:1)*a;if((r=n+832+(i=3*(16*t+Ri[A.L])/2*l)+(s=null!=A.Fa&&0<A.Fa.length?A.Kc.c*A.Kc.i:0))!=r)t=0;else{if(r>A.Vb){if(A.Vb=0,A.Ec=Nn(r),A.Fc=0,null==A.Ec){t=MA(A,1,"no memory during frame initialization.");break A}A.Vb=r}r=A.Ec,o=A.Fc,A.Ac=r,A.Bc=o,o+=n,A.Gd=Wn(l,kA),A.Hd=0,A.rb=Wn(c+1,bA),A.sb=1,A.wa=h?Wn(h,SA):null,A.Y=0,A.D.Nb=0,A.D.wa=A.wa,A.D.Y=A.Y,0<A.Aa&&(A.D.Y+=a),Mn(!0),A.oc=r,A.pc=o,o+=832,A.ya=Wn(u,HA),A.aa=0,A.D.ya=A.ya,A.D.aa=A.aa,2==A.Aa&&(A.D.aa+=a),A.R=16*a,A.B=8*a,a=(l=Ri[A.L])*A.R,l=l/2*A.B,A.sa=r,A.ta=o+a,A.qa=A.sa,A.ra=A.ta+16*t*A.R+l,A.Ha=A.qa,A.Ia=A.ra+8*t*A.B+l,A.$c=0,o+=i,A.mb=s?r:null,A.nb=s?o:null,Mn(o+s<=A.Fc+A.Vb),NA(A),Kn(A.Ac,A.Bc,0,n),t=1}}if(t){if(e.ka=0,e.y=A.sa,e.O=A.ta,e.f=A.qa,e.N=A.ra,e.ea=A.Ha,e.Vd=A.Ia,e.fa=A.R,e.Rc=A.B,e.F=null,e.J=0,!Qn){for(t=-255;255>=t;++t)Cn[255+t]=0>t?-t:t;for(t=-1020;1020>=t;++t)mn[1020+t]=-128>t?-128:127<t?127:t;for(t=-112;112>=t;++t)Fn[112+t]=-16>t?-16:15<t?15:t;for(t=-255;510>=t;++t)yn[255+t]=0>t?0:255<t?255:t;Qn=1}zt=ee,Zt=ZA,qt=$A,An=qA,en=Ae,$t=zA,tn=Me,nn=Ve,sn=Ne,rn=We,on=Ge,an=Ke,ln=Ye,cn=Xe,hn=_e,un=ke,gn=Pe,dn=De,hi[0]=fe,hi[1]=ne,hi[2]=de,hi[3]=Be,hi[4]=we,hi[5]=Ce,hi[6]=pe,hi[7]=me,hi[8]=ye,hi[9]=Fe,ci[0]=le,ci[1]=se,ci[2]=re,ci[3]=oe,ci[4]=ce,ci[5]=he,ci[6]=ue,ui[0]=Ie,ui[1]=ie,ui[2]=Qe,ui[3]=Ee,ui[4]=ve,ui[5]=Te,ui[6]=xe,t=1}else t=0}t&&(t=function(A,e){for(A.M=0;A.M<A.Va;++A.M){var t,n=A.Jc[A.M&A.Xb],i=A.m,s=A;for(t=0;t<s.za;++t){var r=i,o=s,a=o.Ac,l=o.Bc+4*t,c=o.zc,h=o.ya[o.aa+t];if(o.Qa.Bb?h.$b=m(r,o.Pa.jb[0])?2+m(r,o.Pa.jb[2]):m(r,o.Pa.jb[1]):h.$b=0,o.kc&&(h.Ad=m(r,o.Bd)),h.Za=!m(r,145)+0,h.Za){var u=h.Ob,g=0;for(o=0;4>o;++o){var d,B=c[0+o];for(d=0;4>d;++d){B=oi[a[l+d]][B];for(var f=si[m(r,B[0])];0<f;)f=si[2*f+m(r,B[f])];B=-f,a[l+d]=B}Gn(u,g,a,l,4),g+=4,c[0+o]=B}}else B=m(r,156)?m(r,128)?1:3:m(r,163)?2:0,h.Ob[0]=B,Kn(a,l,B,4),Kn(c,0,B,4);h.Dd=m(r,142)?m(r,114)?m(r,183)?1:3:2:0}if(s.m.Ka)return MA(A,7,"Premature end-of-partition0 encountered.");for(;A.ja<A.za;++A.ja){if(s=n,r=(i=A).rb[i.sb-1],a=i.rb[i.sb+i.ja],t=i.ya[i.aa+i.ja],l=i.kc?t.Ad:0)r.la=a.la=0,t.Za||(r.Na=a.Na=0),t.Hc=0,t.Gc=0,t.ia=0;else{var w,p;if(r=a,a=s,l=i.Pa.Xc,c=i.ya[i.aa+i.ja],h=i.pb[c.$b],o=c.ad,u=0,g=i.rb[i.sb-1],B=d=0,Kn(o,u,0,384),c.Za)var C=0,F=l[3];else{f=Nn(16);var y=r.Na+g.Na;if(y=ti(a,l[1],y,h.Eb,0,f,0),r.Na=g.Na=(0<y)+0,1<y)zt(f,0,o,u);else{var Q=f[0]+3>>3;for(f=0;256>f;f+=16)o[u+f]=Q}C=1,F=l[0]}var E=15&r.la,U=15&g.la;for(f=0;4>f;++f){var I=1&U;for(Q=p=0;4>Q;++Q)E=E>>1|(I=(y=ti(a,F,y=I+(1&E),h.Sc,C,o,u))>C)<<7,p=p<<2|(3<y?3:1<y?2:0!=o[u+0]),u+=16;E>>=4,U=U>>1|I<<7,d=(d<<8|p)>>>0}for(F=E,C=U>>4,w=0;4>w;w+=2){for(p=0,E=r.la>>4+w,U=g.la>>4+w,f=0;2>f;++f){for(I=1&U,Q=0;2>Q;++Q)y=I+(1&E),E=E>>1|(I=0<(y=ti(a,l[2],y,h.Qc,0,o,u)))<<3,p=p<<2|(3<y?3:1<y?2:0!=o[u+0]),u+=16;E>>=2,U=U>>1|I<<5}B|=p<<4*w,F|=E<<4<<w,C|=(240&U)<<w}r.la=F,g.la=C,c.Hc=d,c.Gc=B,c.ia=43690&B?0:h.ia,l=!(d|B)}if(0<i.L&&(i.wa[i.Y+i.ja]=i.gd[t.$b][t.Za],i.wa[i.Y+i.ja].La|=!l),s.Ka)return MA(A,7,"Premature end-of-file encountered.")}if(NA(A),i=e,s=1,t=(n=A).D,r=0<n.L&&n.M>=n.zb&&n.M<=n.Va,0==n.Aa)A:{if(t.M=n.M,t.uc=r,Ut(n,t),s=1,t=(p=n.D).Nb,r=(B=Ri[n.L])*n.R,a=B/2*n.B,f=16*t*n.R,Q=8*t*n.B,l=n.sa,c=n.ta-r+f,h=n.qa,o=n.ra-a+Q,u=n.Ha,g=n.Ia-a+Q,U=0==(E=p.M),d=E>=n.Va-1,2==n.Aa&&Ut(n,p),p.uc)for(I=(y=n).D.M,Mn(y.D.uc),p=y.yb;p<y.Hb;++p){C=p,F=I;var T=(v=(D=y).D).Nb;w=D.R;var v=v.wa[v.Y+C],x=D.sa,S=D.ta+16*T*w+16*C,b=v.dd,L=v.tc;if(0!=L)if(Mn(3<=L),1==D.L)0<C&&un(x,S,w,L+4),v.La&&dn(x,S,w,L),0<F&&hn(x,S,w,L+4),v.La&&gn(x,S,w,L);else{var H=D.B,_=D.qa,k=D.ra+8*T*H+8*C,P=D.Ha,D=D.Ia+8*T*H+8*C;T=v.ld,0<C&&(nn(x,S,w,L+4,b,T),rn(_,k,P,D,H,L+4,b,T)),v.La&&(an(x,S,w,L,b,T),cn(_,k,P,D,H,L,b,T)),0<F&&(tn(x,S,w,L+4,b,T),sn(_,k,P,D,H,L+4,b,T)),v.La&&(on(x,S,w,L,b,T),ln(_,k,P,D,H,L,b,T))}}if(n.ia&&alert("todo:DitherRow"),null!=i.put){if(p=16*E,E=16*(E+1),U?(i.y=n.sa,i.O=n.ta+f,i.f=n.qa,i.N=n.ra+Q,i.ea=n.Ha,i.W=n.Ia+Q):(p-=B,i.y=l,i.O=c,i.f=h,i.N=o,i.ea=u,i.W=g),d||(E-=B),E>i.o&&(E=i.o),i.F=null,i.J=null,null!=n.Fa&&0<n.Fa.length&&p<E&&(i.J=nt(n,i,p,E-p),i.F=n.mb,null==i.F&&0==i.F.length)){s=MA(n,3,"Could not decode alpha data.");break A}p<i.j&&(B=i.j-p,p=i.j,Mn(!(1&B)),i.O+=n.R*B,i.N+=n.B*(B>>1),i.W+=n.B*(B>>1),null!=i.F&&(i.J+=i.width*B)),p<E&&(i.O+=i.v,i.N+=i.v>>1,i.W+=i.v>>1,null!=i.F&&(i.J+=i.v),i.ka=p-i.j,i.U=i.va-i.v,i.T=E-p,s=i.put(i))}t+1!=n.Ic||d||(Gn(n.sa,n.ta-r,l,c+16*n.R,r),Gn(n.qa,n.ra-a,h,o+8*n.B,a),Gn(n.Ha,n.Ia-a,u,g+8*n.B,a))}if(!s)return MA(A,6,"Output aborted.")}return 1}(A,e)),null!=e.bc&&e.bc(e),t&=1}return t?(A.cb=0,t):0}function YA(A,e,t,n,i){i=A[e+t+32*n]+(i>>3),A[e+t+32*n]=-256&i?0>i?0:255:i}function XA(A,e,t,n,i,s){YA(A,e,0,t,n+i),YA(A,e,1,t,n+s),YA(A,e,2,t,n-s),YA(A,e,3,t,n-i)}function JA(A){return(20091*A>>16)+A}function jA(A,e,t,n){var i,s=0,r=Nn(16);for(i=0;4>i;++i){var o=A[e+0]+A[e+8],a=A[e+0]-A[e+8],l=(35468*A[e+4]>>16)-JA(A[e+12]),c=JA(A[e+4])+(35468*A[e+12]>>16);r[s+0]=o+c,r[s+1]=a+l,r[s+2]=a-l,r[s+3]=o-c,s+=4,e++}for(i=s=0;4>i;++i)o=(A=r[s+0]+4)+r[s+8],a=A-r[s+8],l=(35468*r[s+4]>>16)-JA(r[s+12]),YA(t,n,0,0,o+(c=JA(r[s+4])+(35468*r[s+12]>>16))),YA(t,n,1,0,a+l),YA(t,n,2,0,a-l),YA(t,n,3,0,o-c),s++,n+=32}function zA(A,e,t,n){var i=A[e+0]+4,s=35468*A[e+4]>>16,r=JA(A[e+4]),o=35468*A[e+1]>>16;XA(t,n,0,i+r,A=JA(A[e+1]),o),XA(t,n,1,i+s,A,o),XA(t,n,2,i-s,A,o),XA(t,n,3,i-r,A,o)}function ZA(A,e,t,n,i){jA(A,e,t,n),i&&jA(A,e+16,t,n+4)}function $A(A,e,t,n){Zt(A,e+0,t,n,1),Zt(A,e+32,t,n+128,1)}function qA(A,e,t,n){var i;for(A=A[e+0]+4,i=0;4>i;++i)for(e=0;4>e;++e)YA(t,n,e,i,A)}function Ae(A,e,t,n){A[e+0]&&An(A,e+0,t,n),A[e+16]&&An(A,e+16,t,n+4),A[e+32]&&An(A,e+32,t,n+128),A[e+48]&&An(A,e+48,t,n+128+4)}function ee(A,e,t,n){var i,s=Nn(16);for(i=0;4>i;++i){var r=A[e+0+i]+A[e+12+i],o=A[e+4+i]+A[e+8+i],a=A[e+4+i]-A[e+8+i],l=A[e+0+i]-A[e+12+i];s[0+i]=r+o,s[8+i]=r-o,s[4+i]=l+a,s[12+i]=l-a}for(i=0;4>i;++i)r=(A=s[0+4*i]+3)+s[3+4*i],o=s[1+4*i]+s[2+4*i],a=s[1+4*i]-s[2+4*i],l=A-s[3+4*i],t[n+0]=r+o>>3,t[n+16]=l+a>>3,t[n+32]=r-o>>3,t[n+48]=l-a>>3,n+=64}function te(A,e,t){var n,i=e-32,s=In,r=255-A[i-1];for(n=0;n<t;++n){var o,a=s,l=r+A[e-1];for(o=0;o<t;++o)A[e+o]=a[l+A[i+o]];e+=32}}function ne(A,e){te(A,e,4)}function ie(A,e){te(A,e,8)}function se(A,e){te(A,e,16)}function re(A,e){var t;for(t=0;16>t;++t)Gn(A,e+32*t,A,e-32,16)}function oe(A,e){var t;for(t=16;0<t;--t)Kn(A,e,A[e-1],16),e+=32}function ae(A,e,t){var n;for(n=0;16>n;++n)Kn(e,t+32*n,A,16)}function le(A,e){var t,n=16;for(t=0;16>t;++t)n+=A[e-1+32*t]+A[e+t-32];ae(n>>5,A,e)}function ce(A,e){var t,n=8;for(t=0;16>t;++t)n+=A[e-1+32*t];ae(n>>4,A,e)}function he(A,e){var t,n=8;for(t=0;16>t;++t)n+=A[e+t-32];ae(n>>4,A,e)}function ue(A,e){ae(128,A,e)}function ge(A,e,t){return A+2*e+t+2>>2}function de(A,e){var t,n=e-32;n=new Uint8Array([ge(A[n-1],A[n+0],A[n+1]),ge(A[n+0],A[n+1],A[n+2]),ge(A[n+1],A[n+2],A[n+3]),ge(A[n+2],A[n+3],A[n+4])]);for(t=0;4>t;++t)Gn(A,e+32*t,n,0,n.length)}function Be(A,e){var t=A[e-1],n=A[e-1+32],i=A[e-1+64],s=A[e-1+96];F(A,e+0,16843009*ge(A[e-1-32],t,n)),F(A,e+32,16843009*ge(t,n,i)),F(A,e+64,16843009*ge(n,i,s)),F(A,e+96,16843009*ge(i,s,s))}function fe(A,e){var t,n=4;for(t=0;4>t;++t)n+=A[e+t-32]+A[e-1+32*t];for(n>>=3,t=0;4>t;++t)Kn(A,e+32*t,n,4)}function we(A,e){var t=A[e-1+0],n=A[e-1+32],i=A[e-1+64],s=A[e-1-32],r=A[e+0-32],o=A[e+1-32],a=A[e+2-32],l=A[e+3-32];A[e+0+96]=ge(n,i,A[e-1+96]),A[e+1+96]=A[e+0+64]=ge(t,n,i),A[e+2+96]=A[e+1+64]=A[e+0+32]=ge(s,t,n),A[e+3+96]=A[e+2+64]=A[e+1+32]=A[e+0+0]=ge(r,s,t),A[e+3+64]=A[e+2+32]=A[e+1+0]=ge(o,r,s),A[e+3+32]=A[e+2+0]=ge(a,o,r),A[e+3+0]=ge(l,a,o)}function pe(A,e){var t=A[e+1-32],n=A[e+2-32],i=A[e+3-32],s=A[e+4-32],r=A[e+5-32],o=A[e+6-32],a=A[e+7-32];A[e+0+0]=ge(A[e+0-32],t,n),A[e+1+0]=A[e+0+32]=ge(t,n,i),A[e+2+0]=A[e+1+32]=A[e+0+64]=ge(n,i,s),A[e+3+0]=A[e+2+32]=A[e+1+64]=A[e+0+96]=ge(i,s,r),A[e+3+32]=A[e+2+64]=A[e+1+96]=ge(s,r,o),A[e+3+64]=A[e+2+96]=ge(r,o,a),A[e+3+96]=ge(o,a,a)}function Ce(A,e){var t=A[e-1+0],n=A[e-1+32],i=A[e-1+64],s=A[e-1-32],r=A[e+0-32],o=A[e+1-32],a=A[e+2-32],l=A[e+3-32];A[e+0+0]=A[e+1+64]=s+r+1>>1,A[e+1+0]=A[e+2+64]=r+o+1>>1,A[e+2+0]=A[e+3+64]=o+a+1>>1,A[e+3+0]=a+l+1>>1,A[e+0+96]=ge(i,n,t),A[e+0+64]=ge(n,t,s),A[e+0+32]=A[e+1+96]=ge(t,s,r),A[e+1+32]=A[e+2+96]=ge(s,r,o),A[e+2+32]=A[e+3+96]=ge(r,o,a),A[e+3+32]=ge(o,a,l)}function me(A,e){var t=A[e+0-32],n=A[e+1-32],i=A[e+2-32],s=A[e+3-32],r=A[e+4-32],o=A[e+5-32],a=A[e+6-32],l=A[e+7-32];A[e+0+0]=t+n+1>>1,A[e+1+0]=A[e+0+64]=n+i+1>>1,A[e+2+0]=A[e+1+64]=i+s+1>>1,A[e+3+0]=A[e+2+64]=s+r+1>>1,A[e+0+32]=ge(t,n,i),A[e+1+32]=A[e+0+96]=ge(n,i,s),A[e+2+32]=A[e+1+96]=ge(i,s,r),A[e+3+32]=A[e+2+96]=ge(s,r,o),A[e+3+64]=ge(r,o,a),A[e+3+96]=ge(o,a,l)}function Fe(A,e){var t=A[e-1+0],n=A[e-1+32],i=A[e-1+64],s=A[e-1+96];A[e+0+0]=t+n+1>>1,A[e+2+0]=A[e+0+32]=n+i+1>>1,A[e+2+32]=A[e+0+64]=i+s+1>>1,A[e+1+0]=ge(t,n,i),A[e+3+0]=A[e+1+32]=ge(n,i,s),A[e+3+32]=A[e+1+64]=ge(i,s,s),A[e+3+64]=A[e+2+64]=A[e+0+96]=A[e+1+96]=A[e+2+96]=A[e+3+96]=s}function ye(A,e){var t=A[e-1+0],n=A[e-1+32],i=A[e-1+64],s=A[e-1+96],r=A[e-1-32],o=A[e+0-32],a=A[e+1-32],l=A[e+2-32];A[e+0+0]=A[e+2+32]=t+r+1>>1,A[e+0+32]=A[e+2+64]=n+t+1>>1,A[e+0+64]=A[e+2+96]=i+n+1>>1,A[e+0+96]=s+i+1>>1,A[e+3+0]=ge(o,a,l),A[e+2+0]=ge(r,o,a),A[e+1+0]=A[e+3+32]=ge(t,r,o),A[e+1+32]=A[e+3+64]=ge(n,t,r),A[e+1+64]=A[e+3+96]=ge(i,n,t),A[e+1+96]=ge(s,i,n)}function Qe(A,e){var t;for(t=0;8>t;++t)Gn(A,e+32*t,A,e-32,8)}function Ee(A,e){var t;for(t=0;8>t;++t)Kn(A,e,A[e-1],8),e+=32}function Ue(A,e,t){var n;for(n=0;8>n;++n)Kn(e,t+32*n,A,8)}function Ie(A,e){var t,n=8;for(t=0;8>t;++t)n+=A[e+t-32]+A[e-1+32*t];Ue(n>>4,A,e)}function Te(A,e){var t,n=4;for(t=0;8>t;++t)n+=A[e+t-32];Ue(n>>3,A,e)}function ve(A,e){var t,n=4;for(t=0;8>t;++t)n+=A[e-1+32*t];Ue(n>>3,A,e)}function xe(A,e){Ue(128,A,e)}function Se(A,e,t){var n=A[e-t],i=A[e+0],s=3*(i-n)+En[1020+A[e-2*t]-A[e+t]],r=Un[112+(s+4>>3)];A[e-t]=In[255+n+Un[112+(s+3>>3)]],A[e+0]=In[255+i-r]}function be(A,e,t,n){var i=A[e+0],s=A[e+t];return Tn[255+A[e-2*t]-A[e-t]]>n||Tn[255+s-i]>n}function Le(A,e,t,n){return 4*Tn[255+A[e-t]-A[e+0]]+Tn[255+A[e-2*t]-A[e+t]]<=n}function He(A,e,t,n,i){var s=A[e-3*t],r=A[e-2*t],o=A[e-t],a=A[e+0],l=A[e+t],c=A[e+2*t],h=A[e+3*t];return 4*Tn[255+o-a]+Tn[255+r-l]>n?0:Tn[255+A[e-4*t]-s]<=i&&Tn[255+s-r]<=i&&Tn[255+r-o]<=i&&Tn[255+h-c]<=i&&Tn[255+c-l]<=i&&Tn[255+l-a]<=i}function _e(A,e,t,n){var i=2*n+1;for(n=0;16>n;++n)Le(A,e+n,t,i)&&Se(A,e+n,t)}function ke(A,e,t,n){var i=2*n+1;for(n=0;16>n;++n)Le(A,e+n*t,1,i)&&Se(A,e+n*t,1)}function Pe(A,e,t,n){var i;for(i=3;0<i;--i)_e(A,e+=4*t,t,n)}function De(A,e,t,n){var i;for(i=3;0<i;--i)ke(A,e+=4,t,n)}function Re(A,e,t,n,i,s,r,o){for(s=2*s+1;0<i--;){if(He(A,e,t,s,r))if(be(A,e,t,o))Se(A,e,t);else{var a=A,l=e,c=t,h=a[l-2*c],u=a[l-c],g=a[l+0],d=a[l+c],B=a[l+2*c],f=27*(p=En[1020+3*(g-u)+En[1020+h-d]])+63>>7,w=18*p+63>>7,p=9*p+63>>7;a[l-3*c]=In[255+a[l-3*c]+p],a[l-2*c]=In[255+h+w],a[l-c]=In[255+u+f],a[l+0]=In[255+g-f],a[l+c]=In[255+d-w],a[l+2*c]=In[255+B-p]}e+=n}}function Oe(A,e,t,n,i,s,r,o){for(s=2*s+1;0<i--;){if(He(A,e,t,s,r))if(be(A,e,t,o))Se(A,e,t);else{var a=A,l=e,c=t,h=a[l-c],u=a[l+0],g=a[l+c],d=Un[112+((B=3*(u-h))+4>>3)],B=Un[112+(B+3>>3)],f=d+1>>1;a[l-2*c]=In[255+a[l-2*c]+f],a[l-c]=In[255+h+B],a[l+0]=In[255+u-d],a[l+c]=In[255+g-f]}e+=n}}function Me(A,e,t,n,i,s){Re(A,e,t,1,16,n,i,s)}function Ve(A,e,t,n,i,s){Re(A,e,1,t,16,n,i,s)}function Ge(A,e,t,n,i,s){var r;for(r=3;0<r;--r)Oe(A,e+=4*t,t,1,16,n,i,s)}function Ke(A,e,t,n,i,s){var r;for(r=3;0<r;--r)Oe(A,e+=4,1,t,16,n,i,s)}function Ne(A,e,t,n,i,s,r,o){Re(A,e,i,1,8,s,r,o),Re(t,n,i,1,8,s,r,o)}function We(A,e,t,n,i,s,r,o){Re(A,e,1,i,8,s,r,o),Re(t,n,1,i,8,s,r,o)}function Ye(A,e,t,n,i,s,r,o){Oe(A,e+4*i,i,1,8,s,r,o),Oe(t,n+4*i,i,1,8,s,r,o)}function Xe(A,e,t,n,i,s,r,o){Oe(A,e+4,1,i,8,s,r,o),Oe(t,n+4,1,i,8,s,r,o)}function Je(){this.ba=new $,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new AA,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function je(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ze(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Ze(){this.ua=0,this.Wa=new T,this.vb=new T,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new s,this.yc=new n}function $e(){this.xb=this.a=0,this.l=new RA,this.ca=new $,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new g,this.Pb=0,this.wd=new g,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Ze,this.ab=0,this.gc=Wn(4,ze),this.Oc=0}function qe(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new RA,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function At(A,e,t,n,i,s,r){for(A=null==A?0:A[e+0],e=0;e<r;++e)i[s+e]=A+t[n+e]&255,A=i[s+e]}function et(A,e,t,n,i,s,r){var o;if(null==A)At(null,null,t,n,i,s,r);else for(o=0;o<r;++o)i[s+o]=A[e+o]+t[n+o]&255}function tt(A,e,t,n,i,s,r){if(null==A)At(null,null,t,n,i,s,r);else{var o,a=A[e+0],l=a,c=a;for(o=0;o<r;++o)l=c+(a=A[e+o])-l,c=t[n+o]+(-256&l?0>l?0:255:l)&255,l=a,i[s+o]=c}}function nt(A,e,t,n){var i=e.width,s=e.o;if(Mn(null!=A&&null!=e),0>t||0>=n||t+n>s)return null;if(!A.Cc){if(null==A.ga){var r;if(A.ga=new qe,(r=null==A.ga)||(r=e.width*e.o,Mn(0==A.Gb.length),A.Gb=Nn(r),A.Uc=0,null==A.Gb?r=0:(A.mb=A.Gb,A.nb=A.Uc,A.rc=null,r=1),r=!r),!r){r=A.ga;var o=A.Fa,a=A.P,c=A.qc,h=A.mb,u=A.nb,g=a+1,d=c-1,f=r.l;if(Mn(null!=o&&null!=h&&null!=e),Bi[0]=null,Bi[1]=At,Bi[2]=et,Bi[3]=tt,r.ca=h,r.tb=u,r.c=e.width,r.i=e.height,Mn(0<r.c&&0<r.i),1>=c)e=0;else if(r.$a=o[a+0]>>0&3,r.Z=o[a+0]>>2&3,r.Lc=o[a+0]>>4&3,a=o[a+0]>>6&3,0>r.$a||1<r.$a||4<=r.Z||1<r.Lc||a)e=0;else if(f.put=sA,f.ac=iA,f.bc=rA,f.ma=r,f.width=e.width,f.height=e.height,f.Da=e.Da,f.v=e.v,f.va=e.va,f.j=e.j,f.o=e.o,r.$a)A:{Mn(1==r.$a),e=mA();e:for(;;){if(null==e){e=0;break A}if(Mn(null!=r),r.mc=e,e.c=r.c,e.i=r.i,e.l=r.l,e.l.ma=r,e.l.width=r.c,e.l.height=r.i,e.a=0,l(e.m,o,g,d),!FA(r.c,r.i,1,e,null))break e;if(1==e.ab&&3==e.gc[0].hc&&BA(e.s)?(r.ic=1,o=e.c*e.i,e.Ta=null,e.Ua=0,e.V=Nn(o),e.Ba=0,null==e.V?(e.a=1,e=0):e=1):(r.ic=0,e=yA(e,r.c)),!e)break e;e=1;break A}r.mc=null,e=0}else e=d>=r.c*r.i;r=!e}if(r)return null;1!=A.ga.Lc?A.Ga=0:n=s-t}Mn(null!=A.ga),Mn(t+n<=s);A:{if(e=(o=A.ga).c,s=o.l.o,0==o.$a){if(g=A.rc,d=A.Vc,f=A.Fa,a=A.P+1+t*e,c=A.mb,h=A.nb+t*e,Mn(a<=A.P+A.qc),0!=o.Z)for(Mn(null!=Bi[o.Z]),r=0;r<n;++r)Bi[o.Z](g,d,f,a,c,h,e),g=c,d=h,h+=e,a+=e;else for(r=0;r<n;++r)Gn(c,h,f,a,e),g=c,d=h,h+=e,a+=e;A.rc=g,A.Vc=d}else{if(Mn(null!=o.mc),e=t+n,Mn(null!=(r=o.mc)),Mn(e<=r.i),r.C>=e)e=1;else if(o.ic||at(),o.ic){o=r.V,g=r.Ba,d=r.c;var p=r.i,C=(f=1,a=r.$/d,c=r.$%d,h=r.m,u=r.s,r.$),m=d*p,F=d*e,y=u.wc,Q=C<F?uA(u,c,a):null;Mn(C<=m),Mn(e<=p),Mn(BA(u));e:for(;;){for(;!h.h&&C<F;){if(c&y||(Q=uA(u,c,a)),Mn(null!=Q),w(h),256>(p=cA(Q.G[0],Q.H[0],h)))o[g+C]=p,++C,++c>=d&&(c=0,++a<=e&&!(a%16)&&wA(r,a));else{if(!(280>p)){f=0;break e}p=aA(p-256,h);var E,U=cA(Q.G[4],Q.H[4],h);if(w(h),!(C>=(U=lA(d,U=aA(U,h)))&&m-C>=p)){f=0;break e}for(E=0;E<p;++E)o[g+C+E]=o[g+C+E-U];for(C+=p,c+=p;c>=d;)c-=d,++a<=e&&!(a%16)&&wA(r,a);C<F&&c&y&&(Q=uA(u,c,a))}Mn(h.h==B(h))}wA(r,a>e?e:a);break e}!f||h.h&&C<m?(f=0,r.a=h.h?5:3):r.$=C,e=f}else e=pA(r,r.V,r.Ba,r.c,r.i,e,QA);if(!e){n=0;break A}}t+n>=s&&(A.Cc=1),n=1}if(!n)return null;if(A.Cc&&(null!=(n=A.ga)&&(n.mc=null),A.ga=null,0<A.Ga))return alert("todo:WebPDequantizeLevels"),null}return A.nb+t*i}function it(A,e,t,n,i,s){for(;0<i--;){var r,o=A,a=e+(t?1:0),l=A,c=e+(t?0:3);for(r=0;r<n;++r){var h=l[c+4*r];255!=h&&(h*=32897,o[a+4*r+0]=o[a+4*r+0]*h>>23,o[a+4*r+1]=o[a+4*r+1]*h>>23,o[a+4*r+2]=o[a+4*r+2]*h>>23)}e+=s}}function st(A,e,t,n,i){for(;0<n--;){var s;for(s=0;s<t;++s){var r=A[e+2*s+0],o=15&(l=A[e+2*s+1]),a=4369*o,l=(240&l|l>>4)*a>>16;A[e+2*s+0]=(240&r|r>>4)*a>>16&240|(15&r|r<<4)*a>>16>>4&15,A[e+2*s+1]=240&l|o}e+=i}}function rt(A,e,t,n,i,s,r,o){var a,l,c=255;for(l=0;l<i;++l){for(a=0;a<n;++a){var h=A[e+a];s[r+4*a]=h,c&=h}e+=t,r+=o}return 255!=c}function ot(A,e,t,n,i){var s;for(s=0;s<i;++s)t[n+s]=A[e+s]>>8}function at(){Bn=it,fn=st,wn=rt,pn=ot}function lt(A,e,t){self[A]=function(A,n,i,s,r,o,a,l,c,h,u,g,d,B,f,w,p){var C,m=p-1>>1,F=r[o+0]|a[l+0]<<16,y=c[h+0]|u[g+0]<<16;Mn(null!=A);var Q=3*F+y+131074>>2;for(e(A[n+0],255&Q,Q>>16,d,B),null!=i&&(Q=3*y+F+131074>>2,e(i[s+0],255&Q,Q>>16,f,w)),C=1;C<=m;++C){var E=r[o+C]|a[l+C]<<16,U=c[h+C]|u[g+C]<<16,I=F+E+y+U+524296,T=I+2*(E+y)>>3;Q=T+F>>1,F=(I=I+2*(F+U)>>3)+E>>1,e(A[n+2*C-1],255&Q,Q>>16,d,B+(2*C-1)*t),e(A[n+2*C-0],255&F,F>>16,d,B+(2*C-0)*t),null!=i&&(Q=I+y>>1,F=T+U>>1,e(i[s+2*C-1],255&Q,Q>>16,f,w+(2*C-1)*t),e(i[s+2*C+0],255&F,F>>16,f,w+(2*C+0)*t)),F=E,y=U}1&p||(Q=3*F+y+131074>>2,e(A[n+p-1],255&Q,Q>>16,d,B+(p-1)*t),null!=i&&(Q=3*y+F+131074>>2,e(i[s+p-1],255&Q,Q>>16,f,w+(p-1)*t)))}}function ct(){fi[vn]=wi,fi[xn]=Ci,fi[Sn]=pi,fi[bn]=mi,fi[Ln]=Fi,fi[Hn]=yi,fi[_n]=Qi,fi[kn]=Ci,fi[Pn]=mi,fi[Dn]=Fi,fi[Rn]=yi}function ht(A){return A&~xi?0>A?0:255:A>>vi}function ut(A,e){return ht((19077*A>>8)+(26149*e>>8)-14234)}function gt(A,e,t){return ht((19077*A>>8)-(6419*e>>8)-(13320*t>>8)+8708)}function dt(A,e){return ht((19077*A>>8)+(33050*e>>8)-17685)}function Bt(A,e,t,n,i){n[i+0]=ut(A,t),n[i+1]=gt(A,e,t),n[i+2]=dt(A,e)}function ft(A,e,t,n,i){n[i+0]=dt(A,e),n[i+1]=gt(A,e,t),n[i+2]=ut(A,t)}function wt(A,e,t,n,i){var s=gt(A,e,t);e=s<<3&224|dt(A,e)>>3,n[i+0]=248&ut(A,t)|s>>5,n[i+1]=e}function pt(A,e,t,n,i){var s=240&dt(A,e)|15;n[i+0]=240&ut(A,t)|gt(A,e,t)>>4,n[i+1]=s}function Ct(A,e,t,n,i){n[i+0]=255,Bt(A,e,t,n,i+1)}function mt(A,e,t,n,i){ft(A,e,t,n,i),n[i+3]=255}function Ft(A,e,t,n,i){Bt(A,e,t,n,i),n[i+3]=255}function DA(A,e){return 0>A?0:A>e?e:A}function yt(A,e,t){self[A]=function(A,n,i,s,r,o,a,l,c){for(var h=l+(-2&c)*t;l!=h;)e(A[n+0],i[s+0],r[o+0],a,l),e(A[n+1],i[s+0],r[o+0],a,l+t),n+=2,++s,++o,l+=2*t;1&c&&e(A[n+0],i[s+0],r[o+0],a,l)}}function Qt(A,e,t){return 0==t?0==A?0==e?6:5:0==e?4:0:t}function Et(A,e,t,n,i){switch(A>>>30){case 3:Zt(e,t,n,i,0);break;case 2:$t(e,t,n,i);break;case 1:An(e,t,n,i)}}function Ut(A,e){var t,n,i=e.M,s=e.Nb,r=A.oc,o=A.pc+40,a=A.oc,l=A.pc+584,c=A.oc,h=A.pc+600;for(t=0;16>t;++t)r[o+32*t-1]=129;for(t=0;8>t;++t)a[l+32*t-1]=129,c[h+32*t-1]=129;for(0<i?r[o-1-32]=a[l-1-32]=c[h-1-32]=129:(Kn(r,o-32-1,127,21),Kn(a,l-32-1,127,9),Kn(c,h-32-1,127,9)),n=0;n<A.za;++n){var u=e.ya[e.aa+n];if(0<n){for(t=-1;16>t;++t)Gn(r,o+32*t-4,r,o+32*t+12,4);for(t=-1;8>t;++t)Gn(a,l+32*t-4,a,l+32*t+4,4),Gn(c,h+32*t-4,c,h+32*t+4,4)}var g=A.Gd,d=A.Hd+n,B=u.ad,f=u.Hc;if(0<i&&(Gn(r,o-32,g[d].y,0,16),Gn(a,l-32,g[d].f,0,8),Gn(c,h-32,g[d].ea,0,8)),u.Za){var w=r,p=o-32+16;for(0<i&&(n>=A.za-1?Kn(w,p,g[d].y[15],4):Gn(w,p,g[d+1].y,0,4)),t=0;4>t;t++)w[p+128+t]=w[p+256+t]=w[p+384+t]=w[p+0+t];for(t=0;16>t;++t,f<<=2)w=r,p=o+Di[t],hi[u.Ob[t]](w,p),Et(f,B,16*+t,w,p)}else if(w=Qt(n,i,u.Ob[0]),ci[w](r,o),0!=f)for(t=0;16>t;++t,f<<=2)Et(f,B,16*+t,r,o+Di[t]);for(t=u.Gc,w=Qt(n,i,u.Dd),ui[w](a,l),ui[w](c,h),f=B,w=a,p=l,255&(u=t>>0)&&(170&u?qt(f,256,w,p):en(f,256,w,p)),u=c,f=h,255&(t>>=8)&&(170&t?qt(B,320,u,f):en(B,320,u,f)),i<A.Ub-1&&(Gn(g[d].y,0,r,o+480,16),Gn(g[d].f,0,a,l+224,8),Gn(g[d].ea,0,c,h+224,8)),t=8*s*A.B,g=A.sa,d=A.ta+16*n+16*s*A.R,B=A.qa,u=A.ra+8*n+t,f=A.Ha,w=A.Ia+8*n+t,t=0;16>t;++t)Gn(g,d+t*A.R,r,o+32*t,16);for(t=0;8>t;++t)Gn(B,u+t*A.B,a,l+32*t,8),Gn(f,w+t*A.B,c,h+32*t,8)}}function It(A,e,t,n,i,s,r,o,a){var c=[0],h=[0],u=0,d=null!=a?a.kd:0,B=null!=a?a:new je;if(null==A||12>t)return 7;B.data=A,B.w=e,B.ha=t,e=[e],t=[t],B.gb=[B.gb];A:{var f=e,w=t,p=B.gb;if(Mn(null!=A),Mn(null!=w),Mn(null!=p),p[0]=0,12<=w[0]&&!Vn(A,f[0],"RIFF")){if(Vn(A,f[0]+8,"WEBP")){p=3;break A}var C=E(A,f[0]+4);if(12>C||4294967286<C){p=3;break A}if(d&&C>w[0]-8){p=7;break A}p[0]=C,f[0]+=12,w[0]-=12}p=0}if(0!=p)return p;for(C=0<B.gb[0],t=t[0];;){A:{var m=A;w=e,p=t;var F=c,y=h,U=f=[0];if((v=u=[u])[0]=0,8>p[0])p=7;else{if(!Vn(m,w[0],"VP8X")){if(10!=E(m,w[0]+4)){p=3;break A}if(18>p[0]){p=7;break A}var I=E(m,w[0]+8),T=1+Q(m,w[0]+12);if(2147483648<=T*(m=1+Q(m,w[0]+15))){p=3;break A}null!=U&&(U[0]=I),null!=F&&(F[0]=T),null!=y&&(y[0]=m),w[0]+=18,p[0]-=18,v[0]=1}p=0}}if(u=u[0],f=f[0],0!=p)return p;if(w=!!(2&f),!C&&u)return 3;if(null!=s&&(s[0]=!!(16&f)),null!=r&&(r[0]=w),null!=o&&(o[0]=0),r=c[0],f=h[0],u&&w&&null==a){p=0;break}if(4>t){p=7;break}if(C&&u||!C&&!u&&!Vn(A,e[0],"ALPH")){t=[t],B.na=[B.na],B.P=[B.P],B.Sa=[B.Sa];A:{I=A,p=e,C=t;var v=B.gb;F=B.na,y=B.P,U=B.Sa;T=22,Mn(null!=I),Mn(null!=C),m=p[0];var x=C[0];for(Mn(null!=F),Mn(null!=U),F[0]=null,y[0]=null,U[0]=0;;){if(p[0]=m,C[0]=x,8>x){p=7;break A}var S=E(I,m+4);if(4294967286<S){p=3;break A}var b=8+S+1&-2;if(T+=b,0<v&&T>v){p=3;break A}if(!Vn(I,m,"VP8 ")||!Vn(I,m,"VP8L")){p=0;break A}if(x[0]<b){p=7;break A}Vn(I,m,"ALPH")||(F[0]=I,y[0]=m+8,U[0]=S),m+=b,x-=b}}if(t=t[0],B.na=B.na[0],B.P=B.P[0],B.Sa=B.Sa[0],0!=p)break}t=[t],B.Ja=[B.Ja],B.xa=[B.xa];A:if(v=A,p=e,C=t,F=B.gb[0],y=B.Ja,U=B.xa,I=p[0],m=!Vn(v,I,"VP8 "),T=!Vn(v,I,"VP8L"),Mn(null!=v),Mn(null!=C),Mn(null!=y),Mn(null!=U),8>C[0])p=7;else{if(m||T){if(v=E(v,I+4),12<=F&&v>F-12){p=3;break A}if(d&&v>C[0]-8){p=7;break A}y[0]=v,p[0]+=8,C[0]-=8,U[0]=T}else U[0]=5<=C[0]&&47==v[I+0]&&!(v[I+4]>>5),y[0]=C[0];p=0}if(t=t[0],B.Ja=B.Ja[0],B.xa=B.xa[0],e=e[0],0!=p)break;if(4294967286<B.Ja)return 3;if(null==o||w||(o[0]=B.xa?2:1),r=[r],f=[f],B.xa){if(5>t){p=7;break}o=r,d=f,w=s,null==A||5>t?A=0:5<=t&&47==A[e+0]&&!(A[e+4]>>5)?(C=[0],v=[0],F=[0],l(y=new g,A,e,t),oA(y,C,v,F)?(null!=o&&(o[0]=C[0]),null!=d&&(d[0]=v[0]),null!=w&&(w[0]=F[0]),A=1):A=0):A=0}else{if(10>t){p=7;break}o=f,null==A||10>t||!VA(A,e+3,t-3)?A=0:(d=A[e+0]|A[e+1]<<8|A[e+2]<<16,w=16383&(A[e+7]<<8|A[e+6]),A=16383&(A[e+9]<<8|A[e+8]),1&d||3<(d>>1&7)||!(d>>4&1)||d>>5>=B.Ja||!w||!A?A=0:(r&&(r[0]=w),o&&(o[0]=A),A=1))}if(!A)return 3;if(r=r[0],f=f[0],u&&(c[0]!=r||h[0]!=f))return 3;null!=a&&(a[0]=B,a.offset=e-a.w,Mn(4294967286>e-a.w),Mn(a.offset==a.ha-t));break}return 0==p||7==p&&u&&null==a?(null!=s&&(s[0]|=null!=B.na&&0<B.na.length),null!=n&&(n[0]=r),null!=i&&(i[0]=f),0):p}function Tt(A,e,t){var n=e.width,i=e.height,s=0,r=0,o=n,a=i;if(e.Da=null!=A&&0<A.Da,e.Da&&(o=A.cd,a=A.bd,s=A.v,r=A.j,11>t||(s&=-2,r&=-2),0>s||0>r||0>=o||0>=a||s+o>n||r+a>i))return 0;if(e.v=s,e.j=r,e.va=s+o,e.o=r+a,e.U=o,e.T=a,e.da=null!=A&&0<A.da,e.da){if(!v(o,a,t=[A.ib],s=[A.hb]))return 0;e.ib=t[0],e.hb=s[0]}return e.ob=null!=A&&A.ob,e.Kb=null==A||!A.Sd,e.da&&(e.ob=e.ib<3*n/4&&e.hb<3*i/4,e.Kb=0),1}function vt(A){if(null==A)return 2;if(11>A.S){var e=A.f.RGBA;e.fb+=(A.height-1)*e.A,e.A=-e.A}else e=A.f.kb,A=A.height,e.O+=(A-1)*e.fa,e.fa=-e.fa,e.N+=(A-1>>1)*e.Ab,e.Ab=-e.Ab,e.W+=(A-1>>1)*e.Db,e.Db=-e.Db,null!=e.F&&(e.J+=(A-1)*e.lb,e.lb=-e.lb);return 0}function xt(A,e,t,n){if(null==n||0>=A||0>=e)return 2;if(null!=t){if(t.Da){var i=t.cd,s=t.bd,r=-2&t.v,o=-2&t.j;if(0>r||0>o||0>=i||0>=s||r+i>A||o+s>e)return 2;A=i,e=s}if(t.da){if(!v(A,e,i=[t.ib],s=[t.hb]))return 2;A=i[0],e=s[0]}}n.width=A,n.height=e;A:{var a=n.width,l=n.height;if(A=n.S,0>=a||0>=l||!(A>=vn&&13>A))A=2;else{if(0>=n.Rd&&null==n.sd){r=s=i=e=0;var c=(o=a*Vi[A])*l;if(11>A||(s=(l+1)/2*(e=(a+1)/2),12==A&&(r=(i=a)*l)),null==(l=Nn(c+2*s+r))){A=1;break A}n.sd=l,11>A?((a=n.f.RGBA).eb=l,a.fb=0,a.A=o,a.size=c):((a=n.f.kb).y=l,a.O=0,a.fa=o,a.Fd=c,a.f=l,a.N=0+c,a.Ab=e,a.Cd=s,a.ea=l,a.W=0+c+s,a.Db=e,a.Ed=s,12==A&&(a.F=l,a.J=0+c+2*s),a.Tc=r,a.lb=i)}if(e=1,i=n.S,s=n.width,r=n.height,i>=vn&&13>i)if(11>i)A=n.f.RGBA,e&=(o=Math.abs(A.A))*(r-1)+s<=A.size,e&=o>=s*Vi[i],e&=null!=A.eb;else{A=n.f.kb,o=(s+1)/2,c=(r+1)/2,a=Math.abs(A.fa);l=Math.abs(A.Ab);var h=Math.abs(A.Db),u=Math.abs(A.lb),g=u*(r-1)+s;e&=a*(r-1)+s<=A.Fd,e&=l*(c-1)+o<=A.Cd,e=(e&=h*(c-1)+o<=A.Ed)&a>=s&l>=o&h>=o,e&=null!=A.y,e&=null!=A.f,e&=null!=A.ea,12==i&&(e&=u>=s,e&=g<=A.Tc,e&=null!=A.F)}else e=0;A=e?0:2}}return 0!=A||null!=t&&t.fd&&(A=vt(n)),A}var St=64,bt=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Lt=24,Ht=32,_t=8,kt=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];b("Predictor0","PredictorAdd0"),self.Predictor0=function(){return 4278190080},self.Predictor1=function(A){return A},self.Predictor2=function(A,e,t){return e[t+0]},self.Predictor3=function(A,e,t){return e[t+1]},self.Predictor4=function(A,e,t){return e[t-1]},self.Predictor5=function(A,e,t){return H(H(A,e[t+1]),e[t+0])},self.Predictor6=function(A,e,t){return H(A,e[t-1])},self.Predictor7=function(A,e,t){return H(A,e[t+0])},self.Predictor8=function(A,e,t){return H(e[t-1],e[t+0])},self.Predictor9=function(A,e,t){return H(e[t+0],e[t+1])},self.Predictor10=function(A,e,t){return H(H(A,e[t-1]),H(e[t+0],e[t+1]))},self.Predictor11=function(A,e,t){var n=e[t+0];return 0>=P(n>>24&255,A>>24&255,(e=e[t-1])>>24&255)+P(n>>16&255,A>>16&255,e>>16&255)+P(n>>8&255,A>>8&255,e>>8&255)+P(255&n,255&A,255&e)?n:A},self.Predictor12=function(A,e,t){var n=e[t+0];return(_((A>>24&255)+(n>>24&255)-((e=e[t-1])>>24&255))<<24|_((A>>16&255)+(n>>16&255)-(e>>16&255))<<16|_((A>>8&255)+(n>>8&255)-(e>>8&255))<<8|_((255&A)+(255&n)-(255&e)))>>>0},self.Predictor13=function(A,e,t){var n=e[t-1];return(k((A=H(A,e[t+0]))>>24&255,n>>24&255)<<24|k(A>>16&255,n>>16&255)<<16|k(A>>8&255,n>>8&255)<<8|k(A>>0&255,n>>0&255))>>>0};var Pt=self.PredictorAdd0;self.PredictorAdd1=D,b("Predictor2","PredictorAdd2"),b("Predictor3","PredictorAdd3"),b("Predictor4","PredictorAdd4"),b("Predictor5","PredictorAdd5"),b("Predictor6","PredictorAdd6"),b("Predictor7","PredictorAdd7"),b("Predictor8","PredictorAdd8"),b("Predictor9","PredictorAdd9"),b("Predictor10","PredictorAdd10"),b("Predictor11","PredictorAdd11"),b("Predictor12","PredictorAdd12"),b("Predictor13","PredictorAdd13");var Dt=self.PredictorAdd2;V("ColorIndexInverseTransform","MapARGB","32b",(function(A){return A>>8&255}),(function(A){return A})),V("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(A){return A}),(function(A){return A>>8&255}));var Rt,Ot=self.ColorIndexInverseTransform,Mt=self.MapARGB,Vt=self.VP8LColorIndexInverseTransformAlpha,Gt=self.MapAlpha,Kt=self.VP8LPredictorsAdd=[];Kt.length=16,(self.VP8LPredictors=[]).length=16,(self.VP8LPredictorsAdd_C=[]).length=16,(self.VP8LPredictors_C=[]).length=16;var Nt,Wt,Yt,Xt,Jt,jt,zt,Zt,$t,qt,An,en,tn,nn,sn,rn,on,an,ln,cn,hn,un,gn,dn,Bn,fn,wn,pn,Cn=Nn(511),mn=Nn(2041),Fn=Nn(225),yn=Nn(767),Qn=0,En=mn,Un=Fn,In=yn,Tn=Cn,vn=0,xn=1,Sn=2,bn=3,Ln=4,Hn=5,_n=6,kn=7,Pn=8,Dn=9,Rn=10,On=[2,3,7],Xn=[3,3,11],Jn=[280,256,256,256,40],jn=[0,1,1,1,0],zn=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Zn=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],$n=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],qn=8,Ai=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ei=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ti=null,ni=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],ii=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],si=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ri=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],oi=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ai=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],li=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ci=[],hi=[],ui=[],gi=1,di=2,Bi=[],fi=[];lt("UpsampleRgbLinePair",Bt,3),lt("UpsampleBgrLinePair",ft,3),lt("UpsampleRgbaLinePair",Ft,4),lt("UpsampleBgraLinePair",mt,4),lt("UpsampleArgbLinePair",Ct,4),lt("UpsampleRgba4444LinePair",pt,2),lt("UpsampleRgb565LinePair",wt,2);var wi=window.UpsampleRgbLinePair,pi=window.UpsampleBgrLinePair,Ci=window.UpsampleRgbaLinePair,mi=window.UpsampleBgraLinePair,Fi=window.UpsampleArgbLinePair,yi=window.UpsampleRgba4444LinePair,Qi=window.UpsampleRgb565LinePair,Ei=16,Ui=1<<Ei-1,Ii=-227,Ti=482,vi=6,xi=(256<<vi)-1,Si=0,bi=Nn(256),Li=Nn(256),Hi=Nn(256),_i=Nn(256),ki=Nn(Ti-Ii),Pi=Nn(Ti-Ii);yt("YuvToRgbRow",Bt,3),yt("YuvToBgrRow",ft,3),yt("YuvToRgbaRow",Ft,4),yt("YuvToBgraRow",mt,4),yt("YuvToArgbRow",Ct,4),yt("YuvToRgba4444Row",pt,2),yt("YuvToRgb565Row",wt,2);var Di=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Ri=[0,2,8],Oi=[8,7,6,4,4,2,2,2,1,1,1,1],Mi=1;this.WebPDecodeRGBA=function(A,e,t,n,i){var s=xn,r=new Je,o=new $;r.ba=o,o.S=s,o.width=[o.width],o.height=[o.height];var a=o.width,c=o.height,h=new q;if(null==h||null==A)var u=2;else Mn(null!=h),u=It(A,e,t,h.width,h.height,h.Pd,h.Qd,h.format,null);if(0!=u?a=0:(null!=a&&(a[0]=h.width[0]),null!=c&&(c[0]=h.height[0]),a=1),a){o.width=o.width[0],o.height=o.height[0],null!=n&&(n[0]=o.width),null!=i&&(i[0]=o.height);A:{if(n=new RA,(i=new je).data=A,i.w=e,i.ha=t,i.kd=1,e=[0],Mn(null!=i),(0==(A=It(i.data,i.w,i.ha,null,null,null,e,null,i))||7==A)&&e[0]&&(A=4),0==(e=A)){if(Mn(null!=r),n.data=i.data,n.w=i.w+i.offset,n.ha=i.ha-i.offset,n.put=sA,n.ac=iA,n.bc=rA,n.ma=r,i.xa){if(null==(A=mA())){r=1;break A}if(function(A,e){var t=[0],n=[0],i=[0];e:for(;;){if(null==A)return 0;if(null==e)return A.a=2,0;if(A.l=e,A.a=0,l(A.m,e.data,e.w,e.ha),!oA(A.m,t,n,i)){A.a=3;break e}if(A.xb=di,e.width=t[0],e.height=n[0],!FA(t[0],n[0],1,A,null))break e;return 1}return Mn(0!=A.a),0}(A,n)){if(n=0==(e=xt(n.width,n.height,r.Oa,r.ba))){e:{n=A;t:for(;;){if(null==n){n=0;break e}if(Mn(null!=n.s.yc),Mn(null!=n.s.Ya),Mn(0<n.s.Wb),Mn(null!=(t=n.l)),Mn(null!=(i=t.ma)),0!=n.xb){if(n.ca=i.ba,n.tb=i.tb,Mn(null!=n.ca),!Tt(i.Oa,t,bn)){n.a=2;break t}if(!yA(n,t.width))break t;if(t.da)break t;if((t.da||j(n.ca.S))&&at(),11>n.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=n.ca.f.kb.F&&at()),n.Pb&&0<n.s.ua&&null==n.s.vb.X&&!U(n.s.vb,n.s.Wa.Xa)){n.a=1;break t}n.xb=0}if(!pA(n,n.V,n.Ba,n.c,n.i,t.o,dA))break t;i.Dc=n.Ma,n=1;break e}Mn(0!=n.a),n=0}n=!n}n&&(e=A.a)}else e=A.a}else{if(null==(A=new OA)){r=1;break A}if(A.Fa=i.na,A.P=i.P,A.qc=i.Sa,GA(A,n)){if(0==(e=xt(n.width,n.height,r.Oa,r.ba))){if(A.Aa=0,t=r.Oa,Mn(null!=(i=A)),null!=t){if(0<(a=0>(a=t.Md)?0:100<a?255:255*a/100)){for(c=h=0;4>c;++c)12>(u=i.pb[c]).lc&&(u.ia=a*Oi[0>u.lc?0:u.lc]>>3),h|=u.ia;h&&(alert("todo:VP8InitRandom"),i.ia=1)}i.Ga=t.Id,100<i.Ga?i.Ga=100:0>i.Ga&&(i.Ga=0)}WA(A,n)||(e=A.a)}}else e=A.a}0==e&&null!=r.Oa&&r.Oa.fd&&(e=vt(r.ba))}r=e}s=0!=r?null:11>s?o.f.RGBA.eb:o.f.kb.y}else s=null;return s};var Vi=[3,4,3,4,4,2,2,4,4,4,2,1,1]},new window.WebPDecoder,window.WebPRiffParser=function(A,e){var t={},n=0,i=!1,s=0,r=0;if(t.frames=[],!function(A,e,t,n){for(var i=0;i<n;i++)if(A[e+i]!=t.charCodeAt(i))return!0;return!1}(A,e,"RIFF",4)){for(jn(A,e+=4),e+=8;e<A.length;){var o=Xn(A,e),a=jn(A,e+=4);e+=4;var l=a+(1&a);switch(o){case"VP8 ":case"VP8L":void 0===t.frames[n]&&(t.frames[n]={}),(u=t.frames[n]).src_off=i?r:e-8,u.src_size=s+a+8,n++,i&&(i=!1,s=0,r=0);break;case"VP8X":(u=t.header={}).feature_flags=A[e];var c=e+4;u.canvas_width=1+Jn(A,c),c+=3,u.canvas_height=1+Jn(A,c),c+=3;break;case"ALPH":i=!0,s=l+8,r=e-8;break;case"ANIM":(u=t.header).bgcolor=jn(A,e),c=e+4,u.loop_count=(g=A)[(d=c)+0]<<0|g[d+1]<<8,c+=2;break;case"ANMF":var h,u;(u=t.frames[n]={}).offset_x=2*Jn(A,e),e+=3,u.offset_y=2*Jn(A,e),e+=3,u.width=1+Jn(A,e),e+=3,u.height=1+Jn(A,e),e+=3,u.duration=Jn(A,e),e+=3,h=A[e++],u.dispose=1&h,u.blend=h>>1&1}"ANMF"!=o&&(e+=l)}var g,d;return t}},window.ApicTools={parseGIF:A,decompressFrames:e},Tt.DoInit(),_.sRenderBridge=Tt.sRenderBridge,_.sTextureManager=Tt.sTextureManager,_.sViewStore=Tt.sViewStore,_.sCustomCanvasResProvider=Tt.sCustomCanvasResProvider,_.sTextStyleCache=Tt.sTextStyleCache,_.sTextUtils=Tt.sTextUtils,_.sFrameCount=Tt.sFrameCount,_.sViewSensorManager=Tt.sViewSensorManager,_.LayoutView=En,_.ClipView=Tn,_.NinePatchView=class extends En{constructor(A){super(A,"div"),this._HorizontalRepeats=[0,0,0,0],this._VerticalRepeats=[0,0,0,0],this._HorizontalPadding=[0,0],this._VerticalPadding=[0,0],this._ImageDspWidth=0,this._ImageDspHeight=0}ResetTexture(A,e){let t=null;A&&(t=new pn(A,e,null)),this.TextureSetting=t,this._ApplyChanges()}SetRepeat(A,e){rA.Assert(A.length<=2),rA.Assert(e.length<=2);for(let t=0;t<2;t++)t<A.length?(this._HorizontalRepeats[2*t]=A[t].start,this._HorizontalRepeats[2*t+1]=A[t].width):(this._HorizontalRepeats[2*t]=0,this._HorizontalRepeats[2*t+1]=0),t<e.length?(this._VerticalRepeats[2*t]=e[t].start,this._VerticalRepeats[2*t+1]=e[t].width):(this._VerticalRepeats[2*t]=0,this._VerticalRepeats[2*t+1]=0);return this._ApplyChanges(),this}SetPadding(A,e){return rA.Assert(null!==A),rA.Assert(null!==e),this._VerticalPadding[0]=e.start,this._VerticalPadding[1]=e.width,this._HorizontalPadding[0]=A.start,this._HorizontalPadding[1]=A.width,this._ApplyChanges(),this}SetImageDspSize(A,e){this._ImageDspWidth=A,this._ImageDspHeight=e}_ApplyChanges(){let A=this.TextureSetting;if(A){if(A.MaskSetting&&"CORNER"===A.MaskSetting._MaskType&&this._SetBorderRadius(A.MaskSetting),A.Texture.Source){const e=A.Texture.RenderTexture.Width,t=A.Texture.RenderTexture.Height,n=e/this._ImageDspWidth,i=t/this._ImageDspHeight,s=this._HorizontalRepeats[0],r=this._ImageDspWidth-this._HorizontalRepeats[1]-s,o=this._VerticalRepeats[0],a=this._ImageDspHeight-this._VerticalRepeats[1]-o;let l=Math.floor(this._HorizontalRepeats[0]*n),c=e-Math.floor(this._HorizontalRepeats[1]*n)-l,h=Math.floor(this._VerticalRepeats[0]*i),u=t-Math.floor(this._VerticalRepeats[1]*i)-h;l+c>=e&&(l-=1,c-=1),h+u>=t&&(h-=1,u-=1);const g=`${h} ${c} ${u} ${l}`;this.Element.style.borderImage=`url(${A.Texture.Source}) ${g} fill`;const d=this._HorizontalPadding[0],B=this._ImageDspWidth-this._HorizontalPadding[1]-d,f=this._VerticalPadding[0],w=this._ImageDspHeight-this._VerticalPadding[1]-f;this.Element.style.borderImageWidth=`${o}px ${r}px ${a}px ${s}px`,this.Element.style.borderImageOutset=`${f}px ${B}px ${w}px ${d}px`}}else this.Element.style.borderRadius="",this.Element.style.borderImage=""}},_.EditControlView=vn,_.FilterView=xn,_.RootView=Un,_.IFrameView=class extends En{constructor(){super(null,"div"),this._Iframe=O().createElement("iframe"),this._Iframe.style.border="none",this._Iframe.style.margin="0px",this._Iframe.style.padding="0px",this._Iframe.scrolling="no",this._IframeWidth=0,this._IframeHeight=0,this.Element.appendChild(this._Iframe)}SetIframeSize(A,e){isNaN(A)||(this._IframeWidth=A,this._Iframe.width=A),isNaN(e)||(this._IframeHeight=e,this._Iframe.height=e)}SetInnerHtml(A){this._Iframe.srcdoc=A,this._Iframe.onload=()=>{0==this._IframeHeight&&(this._Iframe.height=this._Iframe.contentDocument.body.clientHeight)}}},_.VideoView=class extends En{constructor(A,e){super(e),this._ViewType=8,this.Element=A,this.Id="VideoView"}SetId(A){this.Id=`${A}_VideoView`}ResetLayoutParams(A){null!==A?(this.LayoutParams=A instanceof Vt?A.Clone():new Vt(A),this.Element.style.left=`${this.LayoutParams.MarginLeft}px`,this.Element.style.top=`${this.LayoutParams.MarginTop}px`,this.LayoutParams.Width&&(this.Element.style.width=`${this.LayoutParams.Width}px`),this.LayoutParams.Height&&(this.Element.style.height=`${this.LayoutParams.Height}px`)):rA.ThrowError("ResetLayoutParams(): new params is null")}_OnAttachToSystem(){console.log("Video attach"),super._OnAttachToSystem()}_OnDetachFromSystem(){console.log("Video detach"),super._OnDetachFromSystem()}},_.TextureSetting=wn,_.ExternalTextureSetting=pn,_.ViewTextureMask=mn,_.ViewRoundCornerMask=Fn,_.CssKeyframeAnimation=class extends ot{constructor(A,e,t,n,i){super("CK",e,t),this._keyFramesSet=A}_BuildKeyFrame(){let A=this._keyFramesSet.replaceAll("\n","");if(A.indexOf("@keyframes")<0&&A.indexOf("@-webkit-keyframes")<0)return console.warn("Warning:keyframes array empty"),null;let e=A.split(" ")[1];e.indexOf("{")>=0&&(e=e.substr(0,e.indexOf("{"))),A=A.replaceAll(/([left|top|width|height]:\s+\d+)/g,"$1px");const t=A.split("translate3d");for(let A=1;A<t.length;A++){let e=!1,n=t[A].replace(/\).*/,"");n=n.replace(/.*\(/,"");const i=n.split(",");for(let A=0;A<i.length;A++){const t=i[A].trim();t.match(/[0-9]$/)&&(i[A]=t+"px",e=!0)}e&&(n=i.join(","),t[A]=t[A].replace(/\(.*?\)/,"("+n+")"))}return{name:e,keyFrameString:t.join("translate3d"),tmp:!1}}_GetLastKeyframeTransform(A){let e=A.indexOf("to");if(e<0&&(e=A.indexOf("100%")),e<0)return"";{let t=A.indexOf("transform:",e);return t<0?"":A.substring(t+10,A.indexOf(";",t))}}_GetFrozenTransform(A){let e={transform:"",transformOrigin:null};return 1===A?e={transform:this._GetLastKeyframeTransform(this._keyFramesSet),transformOrigin:null}:console.warn("CssKeyframeAnimation can not get transform whill progress is not 1"),e}},_.CssTransitionAnimation=class extends rt{constructor(A){super("CT",0,null),this._transArray=A}Start(A){super.Start(A);const e=this,t=this._transArray,n={};if(0===t.length)return void console.warn("Warning:transition empty");let i="";for(let A=0;A<t.length;A++){let e="linear";const s=t[A];s.tf&&(e=je(s.tf)),i=`${s.name} ${s.dur/1e3}s ${e} ${s.dly/1e3}s`,n[s.name]=i}A.ApplyStyleTransition(n),i&&(A.Element.addEventListener("transitionend",(A=>{A.stopPropagation(),e.OnEnd(!0)})),A.Element.addEventListener("webkitTransitionEnd",(A=>{A.stopPropagation(),e.OnEnd(!0)})))}},_.AnimationDelegate=rt,_.AnimationListener=it,_.StepsEasing=class extends z{constructor(A,e){super(),this._Steps=A,this._Type=e}Package(){const A=this._GetBasePackage(j.EasingTypeSteps);return A.St={S:this._Steps,T:this._Type},A}},_.BezierEasing=class extends z{constructor(A,e,t,n,i){super(),this._Inited=!1,this._X1=A,this._X2=t,this._Y1=e,this._Y2=n,this._Duration=i}Package(){const A=this._GetBasePackage(j.EasingTypeBezier);return A.St={X1:this._X1,X2:this._X2,Y1:this._Y1,Y2:this._Y2,Dur:this._Duration},A}},_.FreeMoveAnimation=Bt,_.FreeMoveCmdPackBuilder=Pe,_.FreeMoveActionBuilder=Re,_.FreeMoveConditionSet=ct,_.FreeMoveExternType={GroupType_FromAction:10,GroupType_ActionAssoc:10},_.FreeMoveActEvtType=ve,_.FreeMoveStateBuilder=be,Tt.sRenderBridge.RegisterPerFrameCallback((()=>{for(let A=0;A<Oe.length;A++)Oe[A].animationRef.Invoking()})),Tt.sRenderBridge.RegisterPerFrameCallback((()=>{Tt.sTouchRecvManager.ProcessTouchEvent(Date.now())})),_.LinearGradientTexture=Dt,_.TextInputType=Sn,_.TextureInstantLoad=St,_.QRCodeLevel=xt,_.ColorSpace=vt,_.TextUtils=he,_.Easing=Z,_.AnimFireCommand={AltSpeed:(A,e,t)=>{},RunFreeMoveCmdPacks:(A,e)=>{A.TransformAnimationObj.doCommand(e)}},_.FreeMoveActEvtType={ActEvent_ActFinish:1,ActEvent_Speed_X_Revert:2,ActEvent_Speed_Y_Revert:3,ActEvent_ActReject:4},_.AnimationEnable=lt,_.FlexSetNames=Gt,_.FlexContainerProps=class{constructor(){this.flexDirection=Gt.Row,this.flexWrap=Gt.NoWrap,this.justifyContent=Gt.FlexStart,this.alignItems=Gt.Center,this.alignContent=Gt.FlexStart}},_.FlexItemProps=class{constructor(){this.alignSelf=Gt.NoSet,this.flexGrow=0}},_.ViewInfo=FA,_.DomElementGetter=null,_.ReactUtils={StyleClassMap:{}},_.InitRenderDocument=function(A){!function(A){if(null==k){let t=A.getElementById("app");var e=A.createElement("iframe");e.scrolling="no",t?.appendChild(e),D=e,k=e.contentDocument,P=k.createElement("div"),e.contentDocument.body.appendChild(P);let n=A=>{var e=k.activeElement?.tagName;e&&"input"===e.toLowerCase()||(R?.DispatchKeyDown(A),A.preventDefault&&A.preventDefault())},i=A=>{var e=k.activeElement?.tagName;e&&"input"===e.toLowerCase()||(R?.DispatchKeyUp(A),A.preventDefault&&A.preventDefault())};e.contentWindow.addEventListener("keydown",n),e.contentWindow.addEventListener("keyup",i),window.addEventListener("keydown",n),window.addEventListener("keyup",i),window.jsvRenderDocument=k}}(A);let e=k.createElement("style");return e.type="text/css",e.innerHTML="\n * {\n margin: 0px;\n }\n div {\n position: absolute;\n background-size: 100% 100%;\n white-space: pre-wrap;\n pointer-events: none;\n z-index: 0; /* 所有元素都设置zindex以触发DOM为每个view创建单独的zIndex stack context,使和Forge native动作一致 */\n }\n video {\n position: absolute;\n background-size: 100% 100%;\n }\n img {\n position: absolute;\n pointer-events: none;\n }\n ",k.head.appendChild(e),k},_.SetRootPageBase=function(A){R=A},Kt=A=>{window.gRootView=A,Forge.sRootView=A},window.PlatformUtils=V,console.log("Using JsView HTML Forge");let zn=_;class Zn{static StringToInt32(A){let e=S.InvalidInt32,t=parseInt(A);return 0==isNaN(t)&&(e=t),e}static StringTrim(A){return A.trim()}static StringStartsWith(A,e){return A.startsWith(e)}static StringEndsWith(A,e){return A.endsWith(e)}static StringSplit(A,e=" ",t=0,n=0,i=!1){A||(A=""),0==n&&(n=A.length-1);let s=(A=A.substring(t,n+1)).trim().split(e),r=[];for(let A of s)A&&(i&&(A=A.trim(),0==A.length)||r.push(A));return r}static MergeBrackets(A,e=null){let t=[],n="",i=null,s=null,r=0,o=!1;for(let a of A){let A=0;for(;A<a.length;)if(r>0){let e=a.indexOf(")",A),t=a.indexOf("(",A);if(-1!=t&&(-1==e||t<e))r++,A=t+1;else{if(!(e>=0))break;r--,A=e+1}}else{let e=a.indexOf("(",A);if(-1==e)break;r++,A=e+1}o?(e&&(n+=e),n+=a):null!=i?(n+=i,e&&(n+=e),n+=a,i=null,o=!0):i=a,0==r&&(o?(s=n,n=""):s=a,t.push(s),i=null,o=!1)}return t}static ConvertToInt32(A,e){if(e.is(S.DataType.Null))return 0;if(e.is(S.DataType.String)){const A=e.get();if(""===A)return 0;if(Zn.StringTrim(A),Zn.StringEndsWith(A,"px")){const e='JsView Warning: Using px will make style performance lower, you can directly use numbers instead of "'+A+'".';console.warn(e)}return Zn.StringToInt32(A)}return e.is(S.DataType.Int32)||e.is(S.DataType.Float)?e.get():(E(C.InvalidArgument,S.InvalidInt32,["Failed to convert style ",A,"=",e.toString(),", value type is supported."]),S.InvalidInt32)}static ConvertToFloat(A,e){return e.is(S.DataType.Null)?S.InvalidFloat:e.is(S.DataType.String)&&""===e.get()?0:e.is(S.DataType.Int32)||e.is(S.DataType.Float)?e.get():(E(C.InvalidArgument,S.InvalidFloat,["Failed to convert style ",A,"=",e.toString(),", value type is supported."]),S.InvalidFloat)}static ConvertToString(A,e,t=!1){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);let n=e.get();return null==n||n.length<=0?S.InvalidPointer:(t&&(n=n.toUpperCase()),n)}static ConvertToCorner(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;let t=null;if(e.is(S.DataType.Int32)){const A=e.get();t=new S.CornerImpl(String(A)),t.topLeft=A,t.topRight=A,t.bottomRight=A,t.bottomLeft=A}else if(e.is(S.DataType.String)){const A=e.get();if(null==A||A.length<=0)return S.InvalidPointer;const n=Zn.StringSplit(A),i=n.length;t=new S.CornerImpl(A),t.topLeft=i>0?parseInt(n[0]):0,t.topRight=i>1?parseInt(n[1]):t.topLeft,t.bottomRight=i>2?parseInt(n[2]):t.topLeft,t.bottomLeft=i>3?parseInt(n[3]):t.bottomRight}else E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not number or string."]);return t}static ConvertToBlendType(A,e){if(e.is(S.DataType.Null))return 0;if(e.is(S.DataType.String)){const A=e.get();if(null==A||A.length<=0)return 0;const t="alphaOverride";return 0==A.indexOf(t)?2:0}return E(C.InvalidArgument,0,["Failed to convert style ",A,"=",e.toString(),", type is not number or string."]),0}static ConvertToRect(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style "+A+"="+e+", value type is not string."]);const t=e.get();if(null==t||t.length<=0)return S.InvalidPointer;const n=new S.RectImpl(t),i=Zn.StringSplit(t),s=i.length;return n.top=s>0?parseInt(i[0]):0,n.right=s>1?parseInt(i[1]):n.top,n.bottom=s>2?parseInt(i[2]):n.top,n.left=s>3?parseInt(i[3]):n.right,n}static ConvertToAnimation(A,e,t=null){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);const n=e.get();if(null==n||n.length<=0)return S.InvalidPointer;if(null!=t&&null!=t.rawValue&&t.rawValue==n)return t;return Zn.ParseToAnimation(n)}static ConvertToTransition(A,e,t=null){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);const n=e.get();if(null==n||n.length<=0)return S.InvalidPointer;if(null!=t&&null!=t.rawValue&&t.rawValue==n)return t;let i=[];const s=Zn.StringSplit(n,",");for(let A=0;A<s.length;A++)if(s[A].indexOf("(")>=0){let e=A;for(;e<s.length&&s[e].indexOf(")")<0;)e++;let t="";for(let n=A;n<=e;n++)n!=A&&(t+=","),t+=s[n];A=e,i.push(t)}else i.push(s[A]);const r=new S.TransitionImpl(n);for(const e of i){const t=Zn.ConvertToAnimation(A,new S(e));if(null!=t&&(r.animationMap.set(t.name,t),"all"==t?.name)){const A=["opacity","left","top","width","height","transform"];for(const e of A)r.animationMap.set(e,t)}}return r}static ConvertToTextShadow(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);const t=e.get();if(null==t||t.length<=0)return S.InvalidPointer;const n=new S.TextShadowImpl(t),i=Zn.StringSplit(t);i.length>0&&(n.hShadow=parseInt(i[0])),i.length>1&&(n.vShadow=parseInt(i[1])),i.length>2&&(n.blur=parseInt(i[2]));let s=-1;return 3==i.length?s=2:i.length>3&&(s=3),s>0&&(n.color=i[s]),n}static ConvertToWebkitTextStroke(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);const t=e.get();if(null==t||t.length<=0)return S.InvalidPointer;const n=new S.WebkitTextStrokeImpl(t),i=Zn.StringSplit(t);return i.length>0&&(n.length=parseInt(i[0])),i.length>1&&(n.color=i[1]),n}static ConvertToBorderImage(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);const t=e.get();if(null==t||t.length<=0)return S.InvalidPointer;const n=new S.BorderImageImpl(t),i=Zn.StringSplit(t),s=i.length;return s>0&&(n.source=i[0]),s>1&&(n.slice=Zn.ConvertToRect(A,new S(i[1]))),n}static ConvertToBackgroundImage(A,e){if(e.is(S.DataType.Null))return S.InvalidPointer;0==e.is(S.DataType.String)&&E(C.InvalidArgument,S.InvalidPointer,["Failed to convert style ",A,"=",e.toString(),", type is not string."]);let t=e.get();if(null==t||t.length<=0)return S.InvalidPointer;const n=new S.BackgroundImageImpl(t),i="linear-gradient(";if(0==t.indexOf(i)){t=Zn.StringTrim(t),n.type=S.BackgroundImageImpl.eType.LINEAR_GRADIENT,n.linearGradient=new S.BackgroundImageImpl.LinearGradient,n.urlPath=t;let A=Zn.StringSplit(t,",",16,t.length-2);A=Zn.MergeBrackets(A,",");let i=A.length;if(i>0){let e=A[0];if(-1!=e.indexOf("to ")){A.splice(0,1);let t=A.length;-1!=e.indexOf("left")?(n.linearGradient.fromX=t+1,n.linearGradient.toX=0):-1!=e.indexOf("right")?(n.linearGradient.fromX=0,n.linearGradient.toX=t+1):(n.linearGradient.fromX=0,n.linearGradient.toX=0),-1!=e.indexOf("top")?(n.linearGradient.fromY=t+1,n.linearGradient.toY=0):-1!=e.indexOf("bottom")?(n.linearGradient.fromY=0,n.linearGradient.toY=t+1):(n.linearGradient.fromY=0,n.linearGradient.toY=0)}else n.linearGradient.fromX=0,n.linearGradient.toX=0,n.linearGradient.fromY=0,n.linearGradient.toY=2}if(i<2)return console.error(`linear gradient format error: str=${e}`),null;let s=1/A.length,r=A.length;for(let e=0;e<r;e++){let t=A[e];t=Zn.StringTrim(t);let i=new zn.LinearGradientTexture.StopPoint;i.color=t,i.stopPosition=e!=r-1?e*s:1,n.linearGradient.stops.push(i)}}else n.type=S.BackgroundImageImpl.eType.URL_PATH,n.urlPath=t;return n}static ConvertToFlexEnum(A,e){let t=e.toString();return"flexDirection"==A?"row"==t?zn.FlexSetNames.Row:"row-reverse"==t?zn.FlexSetNames.RowReverse:"column"==t?zn.FlexSetNames.Column:"column-reverse"==t?zn.FlexSetNames.ColumnReverse:(console.warn("Unknown flexDirection value="+t),S.InvalidInt32):"flexWrap"==A?"nowrap"==t?zn.FlexSetNames.NoWrap:"wrap"==t?zn.FlexSetNames.Wrap:"wrap-reverse"==t?zn.FlexSetNames.WrapReverse:(console.warn("Unknown flexWrap value="+t),S.InvalidInt32):"justifyContent"==A?"flex-start"==t?zn.FlexSetNames.FlexStart:"flex-end"==t?zn.FlexSetNames.FlexEnd:"center"==t?zn.FlexSetNames.Center:(console.warn("Unknown justifyContent value="+t),S.InvalidInt32):"alignItems"==A?"stretch"==t?zn.FlexSetNames.Stretch:"flex-start"==t?zn.FlexSetNames.FlexStart:"flex-end"==t?zn.FlexSetNames.FlexEnd:"center"==t?zn.FlexSetNames.Center:(console.warn("Unknown alignItems value="+t),S.InvalidInt32):"alignContent"==A?"flex-start"==t?zn.FlexSetNames.FlexStart:"flex-end"==t?zn.FlexSetNames.FlexEnd:"center"==t?zn.FlexSetNames.Center:(console.warn("Unknown alignContent value="+t),S.InvalidInt32):"alignSelf"==A?"stretch"==t?zn.FlexSetNames.Stretch:"flex-start"==t?zn.FlexSetNames.FlexStart:"flex-end"==t?zn.FlexSetNames.FlexEnd:"center"==t?zn.FlexSetNames.Center:(console.warn("Unknown alignSelf value="+t),S.InvalidInt32):S.InvalidInt32}static ParseToAnimation(A){const e=Zn.StringTrim(A);let t=[];const n=e.indexOf("cubic-bezier");if(n>=0){const A=e.indexOf(")"),i=e.substring(n,A-1),s=Zn.StringSplit(e,i);for(const A of s){const e=Zn.StringSplit(A);t=[...t,...e]}t.push(i)}else t=Zn.StringSplit(e);let i="",s=0,r=1,o=e.indexOf("alternate")>=0;for(var a=2;a<t.length;a++){if("infinite"==t[a]){r=-1;continue}let A=Zn.ParseToTimeMs(t[a]);0==isNaN(A)?s=A:(A=Zn.ParseToFloat(t[a]),0==isNaN(A)?r=A:i=t[a])}const l=t.length>1?Zn.ParseToTimeMs(t[1]):0,c=new S.AnimationImpl(e);return c.name=t.length>0?t[0]:"",c.duration=l,c.timingFunction=Zn.ParseToEasing(i,l),c.delay=s,c.iterationCount=r,c.direction=o,c}static ParseToTimeMs(A){if(0==Zn.StringEndsWith(A,"s"))return NaN;let e=Zn.ParseToFloat(A);return Zn.StringEndsWith(A,"ms")?e*=1:Zn.StringEndsWith(A,"s")&&(e*=1e3),e}static ParseToFloat(A){const e=Zn.StringTrim(A);return parseFloat(e)}static ParseToEasing(A,e){let t=null;return A.indexOf("ease")>=0?t=A.indexOf("-in-out")>=0?_.Easing.Circular.InOut:A.indexOf("-out")>=0?_.Easing.Circular.Out:A.indexOf("-in")>=0?_.Easing.Circular.In:_.Easing.Circular.InOut:A.indexOf("linear")>=0?t=null:A.indexOf("cubic-bezier")>=0?t=Zn.ParseToEasingBezier(A,e):A.indexOf("steps")>=0&&(t=Zn.ParseToEasingSteps(A)),t}static ParseToEasingBezier(A,e){let t=A.indexOf("(");t>=0&&(A=A.substring(t+1));let n=Zn.StringSplit(A,","),i={x1:n.length>0?parseFloat(n[0]):0,y1:n.length>1?parseFloat(n[1]):0,x2:n.length>2?parseFloat(n[2]):0,y2:n.length>3?parseFloat(n[3]):0};return new _.BezierEasing(i.x1,i.y1,i.x2,i.y2,e)}static ParseToEasingSteps(A){let e=A.indexOf("(");e>=0&&(A=A.substring(e+1));let t=Zn.StringSplit(A,","),n={steps:t.length>0?parseInt(t[0]):1,type:t.length>1?t[1].includes("start")?0:1:0};return new _.StepsEasing(n.steps,n.type)}constructor(){throw new Error("new StyleGroup() is forbidden.")}}class $n{static IsInheritedProp(A){return A==x.Text.Color||A==x.Text.FontFamily||A==x.Text.FontSize||A==x.Text.FontStyle||A==x.Text.FontWeight||A==x.Text.LineHeight||A==x.Text.TextAlign||A==x.Text.TextOverflow||A==x.Text.TextShadow||A==x.Text.WebkitTextStroke||A==x.Text.WhiteSpace||A==x.Text.WordWrap||A==x.Text.Direction||A==x.Text.JsvTextEmoji||A==x.Text.JsvTextLatex||A==x.Text.JsvTextAlignMinWidth||A==x.Text.JsvTextVerticalAlign||A==x.Text.JsvTextLineAlign||A==x.Text.JsvTextInnerDirection}constructor(){this.changedStyleGroups=new Set,this.lockedPropNames=new Set,this.layout=void 0,this.background=void 0,this.flex=void 0,this.effect=void 0,this.text=void 0,this.motion=void 0}setPropValue(A,e,t){if(0==t&&1==this.isPropNameLocked(A))return C.CssStyleNotChanged;const n=this.setValue(A,e);return null==n?C.CssStyleNotChanged:(this.changedStyleGroups.add(n),this.needUpdateTransition(A)&&this.changedStyleGroups.add(H.Motion.Name),t&&this.lockedPropNames.add(A),0)}getPropValue(A){return this.getValue(A)}hasPropValue(A){return this.hasValue(A)}hasPropGroup(A){return A==H.Layout.Name?null!=this.layout:A==H.Background.Name?null!=this.background:A==H.Effect.Name?null!=this.effect:A==H.Text.Name?null!=this.text:A==H.Motion.Name&&null!=this.motion}isPropNameLocked(A){return 1==this.lockedPropNames.has(A)}addChangedStyleGroup(A){return A!=H.Layout.Name&&A!=H.Background.Name&&A!=H.Effect.Name&&A!=H.Text.Name&&A!=H.Motion.Name&&Q(C.InvalidArgument),this.changedStyleGroups.add(A),0}getChangedStyleGroups(){return this.changedStyleGroups}clearChangedStyleGroups(){this.changedStyleGroups.clear()}setValue(A,e){let t=null;return A==x.Layout.Left||A==x.Layout.Top||A==x.Layout.Width||A==x.Layout.Height?t=this.setLayoutValue(A,e):A==x.Flex.FlexDirection||A==x.Flex.FlexWrap||A==x.Flex.JustifyContent||A==x.Flex.AlignItems||A==x.Flex.AlignContent||A==x.Flex.AlignSelf||A==x.Flex.FlexGrow?t=this.setFlexValue(A,e):A==x.Background.BackgroundColor||A==x.Background.BackgroundImage||A==x.Background.BorderRadius||A==x.Background.JsvImageBlendType?t=this.setBackgroundValue(A,e):A==x.Effect.BackfaceVisibility||A==x.Effect.BorderImage||A==x.Effect.BorderImageWidth||A==x.Effect.BorderImageOutset||A==x.Effect.Display||A==x.Effect.ObjectFit||A==x.Effect.Opacity||A==x.Effect.Overflow||A==x.Effect.Perspective||A==x.Effect.PerspectiveOrigin||A==x.Effect.Transform||A==x.Effect.TransformOrigin||A==x.Effect.TransformStyle||A==x.Effect.Visibility||A==x.Effect.ZIndex?t=this.setEffectValue(A,e):A==x.Text.Color||A==x.Text.FontFamily||A==x.Text.FontSize||A==x.Text.FontStyle||A==x.Text.FontWeight||A==x.Text.TextAlign||A==x.Text.TextOverflow||A==x.Text.TextShadow||A==x.Text.LineHeight||A==x.Text.WebkitTextStroke||A==x.Text.WhiteSpace||A==x.Text.WordWrap||A==x.Text.Direction||A==x.Text.JsvTextEmoji||A==x.Text.JsvTextLatex||A==x.Text.JsvTextAlignMinWidth||A==x.Text.JsvTextVerticalAlign||A==x.Text.JsvTextLineAlign||A==x.Text.JsvTextInnerDirection?t=this.setTextValue(A,e):A==x.Motion.Animation||A==x.Motion.Transition||A==x.Motion.AnimationFillMode?t=this.setMotionValue(A,e):E(C.UnimplementedError,null),null!=t&&this.changedStyleGroups.add(t),t}getValue(A){let e;return A==x.Layout.Left||A==x.Layout.Top||A==x.Layout.Width||A==x.Layout.Height?e=this.getLayoutValue(A):A==x.Flex.FlexDirection||A==x.Flex.FlexWrap||A==x.Flex.JustifyContent||A==x.Flex.AlignItems||A==x.Flex.AlignContent||A==x.Flex.AlignSelf||A==x.Flex.FlexGrow?e=this.getFlexValue(A):A==x.Background.BackgroundColor||A==x.Background.BackgroundImage||A==x.Background.BorderRadius||A==x.Background.JsvImageBlendType?e=this.getBackgroundValue(A):A==x.Effect.BackfaceVisibility||A==x.Effect.BorderImage||A==x.Effect.BorderImageWidth||A==x.Effect.BorderImageOutset||A==x.Effect.Display||A==x.Effect.ObjectFit||A==x.Effect.Opacity||A==x.Effect.Overflow||A==x.Effect.Perspective||A==x.Effect.PerspectiveOrigin||A==x.Effect.Transform||A==x.Effect.TransformOrigin||A==x.Effect.TransformStyle||A==x.Effect.Visibility||A==x.Effect.ZIndex?e=this.getEffectValue(A):A==x.Text.Color||A==x.Text.FontFamily||A==x.Text.FontSize||A==x.Text.FontStyle||A==x.Text.FontWeight||A==x.Text.TextAlign||A==x.Text.TextOverflow||A==x.Text.TextShadow||A==x.Text.LineHeight||A==x.Text.WebkitTextStroke||A==x.Text.WhiteSpace||A==x.Text.WordWrap||A==x.Text.Direction||A==x.Text.JsvTextEmoji||A==x.Text.JsvTextLatex||A==x.Text.JsvTextAlignMinWidth||A==x.Text.JsvTextVerticalAlign||A==x.Text.JsvTextLineAlign||A==x.Text.JsvTextInnerDirection?e=this.getTextValue(A):A==x.Motion.Animation||A==x.Motion.Transition||A==x.Motion.AnimationFillMode?e=this.getMotionValue(A):(E(C.UnimplementedError,null),e=new S),e}hasValue(A){let e=!1;return A==x.Layout.Left||A==x.Layout.Top||A==x.Layout.Width||A==x.Layout.Height?e=this.hasLayoutValue(A):A==x.Flex.FlexDirection||A==x.Flex.FlexWrap||A==x.Flex.JustifyContent||A==x.Flex.AlignItems||A==x.Flex.AlignContent||A==x.Flex.AlignSelf||A==x.Flex.FlexGrow?e=this.hasFlexValue(A):A==x.Background.BackgroundColor||A==x.Background.BackgroundImage||A==x.Background.BorderRadius||A==x.Background.JsvImageBlendType?e=this.hasBackgroundValue(A):A==x.Effect.BackfaceVisibility||A==x.Effect.BorderImage||A==x.Effect.BorderImageWidth||A==x.Effect.BorderImageOutset||A==x.Effect.Display||A==x.Effect.ObjectFit||A==x.Effect.Overflow||A==x.Effect.Perspective||A==x.Effect.PerspectiveOrigin||A==x.Effect.Transform||A==x.Effect.TransformOrigin||A==x.Effect.TransformStyle||A==x.Effect.Visibility||A==x.Effect.ZIndex?e=this.hasEffectValue(A):A==x.Text.Color||A==x.Text.FontFamily||A==x.Text.FontSize||A==x.Text.FontStyle||A==x.Text.FontWeight||A==x.Text.TextAlign||A==x.Text.TextOverflow||A==x.Text.TextShadow||A==x.Text.LineHeight||A==x.Text.WebkitTextStroke||A==x.Text.WhiteSpace||A==x.Text.WordWrap||A==x.Text.Direction||A==x.Text.JsvTextEmoji||A==x.Text.JsvTextLatex||A==x.Text.JsvTextAlignMinWidth||A==x.Text.JsvTextVerticalAlign||A==x.Text.JsvTextLineAlign||A==x.Text.JsvTextInnerDirection?e=this.hasTextValue(A):A!=x.Motion.Animation&&A!=x.Motion.Transition&&A!=x.Motion.AnimationFillMode||(e=this.hasMotionValue(A)),e}setLayoutValue(A,e){const t=(A,e)=>{const t=e;return this.layout[A]==t==0&&(this.layout[A]=t,!0)};this.ensureGroupExist(H.Layout.Name);let n=!1;if(A==x.Layout.Height)n=t("height",Zn.ConvertToInt32(A,e));else if(A==x.Layout.Left)n=t("left",Zn.ConvertToInt32(A,e));else if(A==x.Layout.Top)n=t("top",Zn.ConvertToInt32(A,e));else{if(A!=x.Layout.Width)throw new Error;n=t("width",Zn.ConvertToInt32(A,e))}return n?H.Layout.Name:null}getLayoutValue(A){const e=A=>this.layout?new S(this.layout[A]):new S;if(A==x.Layout.Height)return e("height");if(A==x.Layout.Left)return e("left");if(A==x.Layout.Top)return e("top");if(A==x.Layout.Width)return e("width");throw new Error}hasLayoutValue(A){const e=A=>!(!this.layout||this.layout[A]==S.InvalidInt32);if(A==x.Layout.Height)return e("height");if(A==x.Layout.Left)return e("left");if(A==x.Layout.Top)return e("top");if(A==x.Layout.Width)return e("width");throw new Error}setFlexValue(A,e){const t=(A,e)=>{const t=e;return this.flex[A]==t==0&&(this.flex[A]=t,!0)};this.ensureGroupExist(H.Flex.Name);let n=!1;if(A==x.Flex.FlexDirection)n=t("flexDirection",Zn.ConvertToFlexEnum(A,e));else if(A==x.Flex.FlexWrap)n=t("flexWrap",Zn.ConvertToFlexEnum(A,e));else if(A==x.Flex.JustifyContent)n=t("justifyContent",Zn.ConvertToFlexEnum(A,e));else if(A==x.Flex.AlignItems)n=t("alignItems",Zn.ConvertToFlexEnum(A,e));else if(A==x.Flex.AlignContent)n=t("alignContent",Zn.ConvertToFlexEnum(A,e));else if(A==x.Flex.AlignSelf)n=t("alignSelf",Zn.ConvertToFlexEnum(A,e));else{if(A!=x.Flex.FlexGrow)throw new Error;n=t("flexGrow",Zn.ConvertToFloat(A,e))}return n?H.Flex.Name:null}getFlexValue(A){const e=A=>this.flex?new S(this.flex[A]):new S;if(A==x.Flex.FlexDirection)return e("flexDirection");if(A==x.Flex.FlexWrap)return e("flexWrap");if(A==x.Flex.JustifyContent)return e("justifyContent");if(A==x.Flex.AlignItems)return e("alignItems");if(A==x.Flex.AlignContent)return e("alignContent");if(A==x.Flex.AlignSelf)return e("alignSelf");if(A==x.Flex.FlexGrow)return e("flexGrow");throw new Error}hasFlexValue(A){const e=A=>!(!this.flex||this.flex[A]==S.InvalidInt32);if(A==x.Flex.FlexDirection)return e("flexDirection");if(A==x.Flex.FlexWrap)return e("flexWrap");if(A==x.Flex.JustifyContent)return e("justifyContent");if(A==x.Flex.AlignItems)return e("alignItems");if(A==x.Flex.AlignContent)return e("alignContent");if(A==x.Flex.AlignSelf)return e("alignSelf");if(A==x.Flex.FlexGrow)return!(!this.flex||this.flex[A]==S.InvalidFloat);throw new Error}setBackgroundValue(A,e){const t=(A,e)=>{const t=e;return this.background[A]==t==0&&(this.background[A]=t,!0)};this.ensureGroupExist(H.Background.Name);let n=!1;if(A==x.Background.BackgroundColor)n=t("backgroundColor",Zn.ConvertToString(A,e));else if(A==x.Background.BackgroundImage)n=t("backgroundImage",Zn.ConvertToBackgroundImage(A,e));else if(A==x.Background.BorderRadius)n=t("borderRadius",Zn.ConvertToCorner(A,e));else{if(A!=x.Background.JsvImageBlendType)throw new Error;n=t("jsvImageBlendType",Zn.ConvertToBlendType(A,e))}return n?H.Background.Name:null}getBackgroundValue(A){const e=A=>this.background?new S(this.background[A]):new S;if(A==x.Background.BackgroundColor)return e("backgroundColor");if(A==x.Background.BackgroundImage)return e("backgroundImage");if(A==x.Background.BorderRadius)return e("borderRadius");if(A==x.Background.JsvImageBlendType)return e("jsvImageBlendType");throw new Error}hasBackgroundValue(A){const e=A=>!(!this.background||this.background[A]==S.InvalidPointer);if(A==x.Background.BackgroundColor)return e("backgroundColor");if(A==x.Background.BackgroundImage)return e("backgroundImage");if(A==x.Background.BorderRadius)return e("borderRadius");if(A==x.Background.JsvImageBlendType)return e("jsvImageBlendType");throw new Error}setEffectValue(A,e){const t=(A,e)=>{const t=e;return this.effect[A]==t==0&&(this.effect[A]=t,!0)};this.ensureGroupExist(H.Effect.Name);let n=!1;if(A==x.Effect.BackfaceVisibility)n=t("backfaceVisibility",Zn.ConvertToString(A,e));else if(A==x.Effect.BorderImage)n=t("borderImage",Zn.ConvertToBorderImage(A,e));else if(A==x.Effect.BorderImageWidth)n=t("borderImageWidth",Zn.ConvertToRect(A,e));else if(A==x.Effect.BorderImageOutset)n=t("borderImageOutset",Zn.ConvertToRect(A,e));else if(A==x.Effect.Display)n=t("display",Zn.ConvertToString(A,e));else if(A==x.Effect.ObjectFit)n=t("objectFit",Zn.ConvertToString(A,e));else if(A==x.Effect.Opacity)n=t("opacity",Zn.ConvertToFloat(A,e));else if(A==x.Effect.Overflow)n=t("overflow",Zn.ConvertToString(A,e));else if(A==x.Effect.Perspective)n=t("perspective",Zn.ConvertToInt32(A,e));else if(A==x.Effect.PerspectiveOrigin)n=t("perspectiveOrigin",Zn.ConvertToInt32(A,e));else if(A==x.Effect.Transform)n=t("transform",Zn.ConvertToString(A,e));else if(A==x.Effect.TransformOrigin)n=t("transformOrigin",Zn.ConvertToString(A,e));else if(A==x.Effect.TransformStyle)n=t("transformStyle",Zn.ConvertToString(A,e));else if(A==x.Effect.Visibility)n=t("visibility",Zn.ConvertToString(A,e));else{if(A!=x.Effect.ZIndex)throw new Error;n=t("zIndex",Zn.ConvertToInt32(A,e))}return n?H.Effect.Name:null}getEffectValue(A){const e=A=>this.effect?new S(this.effect[A]):new S;if(A==x.Effect.BackfaceVisibility)return e("backfaceVisibility");if(A==x.Effect.BorderImage)return e("borderImage");if(A==x.Effect.BorderImageWidth)return e("borderImageWidth");if(A==x.Effect.BorderImageOutset)return e("borderImageOutset");if(A==x.Effect.Display)return e("display");if(A==x.Effect.ObjectFit)return e("objectFit");if(A==x.Effect.Opacity)return e("opacity");if(A==x.Effect.Overflow)return e("overflow");if(A==x.Effect.Perspective)return e("perspective");if(A==x.Effect.PerspectiveOrigin)return e("perspectiveOrigin");if(A==x.Effect.Transform)return e("transform");if(A==x.Effect.TransformOrigin)return e("transformOrigin");if(A==x.Effect.TransformStyle)return e("transformStyle");if(A==x.Effect.Visibility)return e("visibility");if(A==x.Effect.ZIndex)return e("zIndex");throw new Error}hasEffectValue(A){const e=(A,e)=>!(!this.effect||this.effect[A]==e);if(A==x.Effect.BackfaceVisibility)return e("backfaceVisibility",S.InvalidInt32);if(A==x.Effect.BorderImage)return e("borderImage",S.InvalidPointer);if(A==x.Effect.BorderImageWidth)return e("borderImageWidth",S.InvalidPointer);if(A==x.Effect.BorderImageOutset)return e("borderImageOutset",S.InvalidPointer);if(A==x.Effect.Display)return e("display",S.InvalidPointer);if(A==x.Effect.ObjectFit)return e("objectFit",S.InvalidPointer);if(A==x.Effect.Overflow)return e("overflow",S.InvalidPointer);if(A==x.Effect.Perspective)return e("perspective",S.InvalidInt32);if(A==x.Effect.PerspectiveOrigin)return e("perspectiveOrigin",S.InvalidInt32);if(A==x.Effect.Transform)return e("transform",S.InvalidPointer);if(A==x.Effect.TransformOrigin)return e("transformOrigin",S.InvalidPointer);if(A==x.Effect.TransformStyle)return e("transformStyle",S.InvalidPointer);if(A==x.Effect.Visibility)return e("visibility",S.InvalidPointer);if(A==x.Effect.ZIndex)return e("zIndex",S.InvalidInt32);throw new Error}setTextValue(A,e){const t=(A,e)=>{const t=e;return this.text[A]==t==0&&(this.text[A]=t,!0)};this.ensureGroupExist(H.Text.Name);let n=!1;if(A==x.Text.Color)n=t("color",Zn.ConvertToString(A,e));else if(A==x.Text.FontFamily)n=t("fontFamily",Zn.ConvertToString(A,e));else if(A==x.Text.FontSize)n=t("fontSize",Zn.ConvertToInt32(A,e));else if(A==x.Text.FontStyle)n=t("fontStyle",Zn.ConvertToString(A,e));else if(A==x.Text.FontWeight)n=t("fontWeight",Zn.ConvertToString(A,e));else if(A==x.Text.LineHeight)n=t("lineHeight",Zn.ConvertToInt32(A,e));else if(A==x.Text.TextAlign)n=t("textAlign",Zn.ConvertToString(A,e));else if(A==x.Text.TextOverflow)n=t("textOverflow",Zn.ConvertToString(A,e));else if(A==x.Text.TextShadow)n=t("textShadow",Zn.ConvertToTextShadow(A,e));else if(A==x.Text.WebkitTextStroke)n=t("webkitTextStroke",Zn.ConvertToWebkitTextStroke(A,e));else if(A==x.Text.WhiteSpace)n=t("whiteSpace",Zn.ConvertToString(A,e));else if(A==x.Text.WordWrap)n=t("wordWrap",Zn.ConvertToString(A,e));else if(A==x.Text.Direction)n=t("direction",Zn.ConvertToString(A,e));else if(A==x.Text.JsvTextEmoji)n=t("jsvTextEmoji",Zn.ConvertToInt32(A,e));else if(A==x.Text.JsvTextLatex)n=t("jsvTextLatex",Zn.ConvertToInt32(A,e));else if(A==x.Text.JsvTextAlignMinWidth)n=t("jsvTextAlignMinWidth",Zn.ConvertToInt32(A,e));else if(A==x.Text.JsvTextVerticalAlign)n=t("jsvTextVerticalAlign",Zn.ConvertToString(A,e));else if(A==x.Text.JsvTextLineAlign)n=t("jsvTextLineAlign",Zn.ConvertToString(A,e));else{if(A!=x.Text.JsvTextInnerDirection)throw new Error;n=t("jsvTextInnerDirection",Zn.ConvertToString(A,e))}return n?H.Text.Name:null}getTextValue(A){const e=A=>this.text?new S(this.text[A]):new S;if(A==x.Text.Color)return e("color");if(A==x.Text.FontFamily)return e("fontFamily");if(A==x.Text.FontSize)return e("fontSize");if(A==x.Text.FontStyle)return e("fontStyle");if(A==x.Text.FontWeight)return e("fontWeight");if(A==x.Text.LineHeight)return e("lineHeight");if(A==x.Text.TextAlign)return e("textAlign");if(A==x.Text.TextOverflow)return e("textOverflow");if(A==x.Text.TextShadow)return e("textShadow");if(A==x.Text.WebkitTextStroke)return e("webkitTextStroke");if(A==x.Text.WhiteSpace)return e("whiteSpace");if(A==x.Text.WordWrap)return e("wordWrap");if(A==x.Text.Direction)return e("direction");if(A==x.Text.JsvTextEmoji)return e("jsvTextEmoji");if(A==x.Text.JsvTextLatex)return e("jsvTextLatex");if(A==x.Text.JsvTextAlignMinWidth)return e("jsvTextAlignMinWidth");if(A==x.Text.JsvTextVerticalAlign)return e("jsvTextVerticalAlign");if(A==x.Text.JsvTextLineAlign)return e("jsvTextLineAlign");if(A==x.Text.JsvTextInnerDirection)return e("jsvTextInnerDirection");throw new Error}hasTextValue(A){const e=(A,e)=>!(!this.text||this.text[A]==e);if(A==x.Text.Color)return e("color",S.InvalidPointer);if(A==x.Text.FontFamily)return e("fontFamily",S.InvalidPointer);if(A==x.Text.FontSize)return e("fontSize",S.InvalidInt32);if(A==x.Text.FontStyle)return e("fontStyle",S.InvalidPointer);if(A==x.Text.FontWeight)return e("fontWeight",S.InvalidPointer);if(A==x.Text.LineHeight)return e("lineHeight",S.InvalidInt32);if(A==x.Text.TextAlign)return e("textAlign",S.InvalidPointer);if(A==x.Text.TextOverflow)return e("textOverflow",S.InvalidPointer);if(A==x.Text.TextShadow)return e("textShadow",S.InvalidPointer);if(A==x.Text.WebkitTextStroke)return e("webkitTextStroke",S.InvalidPointer);if(A==x.Text.WhiteSpace)return e("whiteSpace",S.InvalidPointer);if(A==x.Text.WordWrap)return e("wordWrap",S.InvalidPointer);if(A==x.Text.Direction)return e("direction",S.InvalidPointer);if(A==x.Text.JsvTextEmoji)return e("jsvTextEmoji",S.InvalidInt32);if(A==x.Text.JsvTextLatex)return e("jsvTextLatex",S.InvalidInt32);if(A==x.Text.JsvTextAlignMinWidth)return e("jsvTextAlignMinWidth",S.InvalidInt32);if(A==x.Text.JsvTextVerticalAlign)return e("jsvTextVerticalAlign",S.InvalidPointer);if(A==x.Text.JsvTextLineAlign)return e("jsvTextLineAlign",S.InvalidPointer);if(A==x.Text.JsvTextInnerDirection)return e("jsvTextInnerDirection",S.InvalidPointer);throw new Error}setMotionValue(A,e){const t=(A,e)=>{const t=e;return this.motion[A]==t==0&&(this.motion[A]=t,!0)};this.ensureGroupExist(H.Motion.Name);let n=!1;if(A==x.Motion.Animation)n=t("animation",Zn.ConvertToAnimation(A,e,this.motion.animation));else if(A==x.Motion.Transition)n=t("transition",Zn.ConvertToTransition(A,e,this.motion.transition));else{if(A!=x.Motion.AnimationFillMode)throw new Error;n=t("animationFillMode",Zn.ConvertToString(A,e))}return n?H.Motion.Name:null}getMotionValue(A){const e=A=>this.motion?new S(this.motion[A]):new S;if(A==x.Motion.Animation)return e("animation");if(A==x.Motion.Transition)return e("transition");if(A==x.Motion.AnimationFillMode)return e("animationFillMode");throw new Error}hasMotionValue(A){const e=A=>!(!this.motion||this.motion[A]==S.InvalidPointer);if(A==x.Motion.Animation)return e("animation");if(A==x.Motion.Transition)return e("transition");if(A==x.Motion.AnimationFillMode)return e("animationFillMode");throw new Error}needUpdateTransition(A){return null!=this.motion&&null==this.motion.animation&&null!=this.motion.transition&&(A==x.Layout.Height||A==x.Layout.Left||A==x.Layout.Top||A==x.Layout.Width||A==x.Effect.Transform)}ensureGroupExist(A){A==H.Layout.Name&&null==this.layout?this.layout=new H.Layout:A==H.Flex.Name&&null==this.flex?this.flex=new H.Flex:A==H.Background.Name&&null==this.background?this.background=new H.Background:A==H.Effect.Name&&null==this.effect?this.effect=new H.Effect:A==H.Text.Name&&null==this.text?this.text=new H.Text:A==H.Motion.Name&&null==this.motion&&(this.motion=new H.Motion)}}var qn,Ai,ei;class ti{constructor(A){this.classNames="",this.classAttributes=new Set,this.classStyleManager=A}getManager(){return this.classStyleManager}setClassNames(A){return null==A&&(A=""),this.classNames==A?C.CssClassNotChanged:(this.classNames=A,0)}getClassNames(){return this.classNames}appendClassAttribute(A){return this.classAttributes.has(A)?C.CssClassNotChanged:(this.classAttributes.add(A),0)}mergeClassAttributes(A){for(let e of A.classAttributes)this.classAttributes.add(e);return 0}hasClassAttribute(A){return this.classAttributes.has(A)}getClassAttributes(){return this.classAttributes}getClassDeclarations(A){if(0==this.classNames.length)return null;let e="";e+=this.classNames,e+=" @ ";for(const A of this.classAttributes)e+=A+" ";const t=e;let n=this.classStyleManager.findStyleClassCache(t);return null==n&&(n=this.makeClassDeclarations(A),this.classStyleManager.appendStyleClassCache(t,n)),n}getKeyframes(A){if(0==A.length)return"";const e=this.classStyleManager.getKeyframes(this.classAttributes,A);return 0==e.length?"":e}static CastToStyleValue(A){let e;return null==A||Number(A)===A||"string"==typeof A?e=new S(A):"boolean"==typeof A?e=new S(Number(A)):(E(C.UnimplementedError,null),e=new S),e}static ParseDeclarations(A,e,t){let n=new Map;for(let i of e){if(0==A.has(t))continue;const e=A.get(t);if(0==e.has(i))continue;const s=e.get(i);let r;r=s instanceof String==0?s:ti.ParseDeclarationsFromString(s),n=new Map([...n,...r])}return n}static ParseDeclarationsFromString(A){let e=new Map;const t=JSON.parse(A);for(const[A,n]of Object.entries(t)){const t=x.ToConst(A);if(null==t){console.error("Unsupported style name: "+A);continue}if(t==x.Effect.ObjectFit||t==x.Effect.Overflow){console.warn("Unimplemented style name: "+t+", please set the "+t+" attribute directly in the element's style.");continue}const i=ti.CastToStyleValue(n);e.set(t,i)}return e}makeClassDeclarations(A){let e=new Map;const t=this.classStyleManager.getStyleSheets(),n=this.getNestedClassCombine(A),i=ti.ParseDeclarations(t,n,ti.Manager.StyleSheetKeyGlobal);for(const[A,t]of i)e.set(A,t);for(const A of this.classAttributes){const i=ti.ParseDeclarations(t,n,A);for(const[A,t]of i)e.set(A,t)}return e}getNestedClassCombine(A){const e=Zn.StringSplit(this.classNames),t=[];for(const A of e)t.push("."+A);for(let e=A.length-1;e>=0;e--){const n=A[e],i=t.length,s=Zn.StringSplit(n);for(const A of s)for(let e=0;e<i;e++){const n=t[e];t.push("."+A+" "+n)}}return t}}ti.Manager=(p(qn=class{constructor(){this.styleSheetMap=new Map,this.parsedStyleClassCache=new Map,this.propVariableMap=new Map}declareStyleSheets(A){for(const[e,t]of Object.entries(A)){let A=0;A=parseInt(e,16),0==this.styleSheetMap.has(A)&&this.styleSheetMap.set(A,new Map);const n=this.styleSheetMap.get(A);for(const[A,e]of Object.entries(t))if(n.has(A)&&console.warn('StyleSheets class "'+A+'" already exists, overwrite it with the new value.'),e.includes("@keyframes"))n.set(A,e);else{const t=ti.ParseDeclarationsFromString(e);n.set(A,t)}}return 0}undeclareStyleSheets(A){for(const[e,t]of Object.entries(A)){let A=0;if(A=parseInt(e,16),0==this.styleSheetMap.has(A))continue;const n=this.styleSheetMap.get(A);for(const[A,e]of Object.entries(t))n.delete(A)}return 0}getStyleSheets(){return this.styleSheetMap}appendStyleClassCache(A,e){this.parsedStyleClassCache.set(A,e)}findStyleClassCache(A){const e=this.parsedStyleClassCache.get(A);return null==e?null:e}clearStyleClassCache(){this.parsedStyleClassCache.clear()}watchVariable(A,e,t,n,i){let s=x.ToConst(e);m(null!=s,C.InvalidArgument);let r=this.getVariableInfo(n);if(m(null!=r,C.InvalidArgument),0==r.watchListenerMap.has(A)){const e=new Set;r.watchListenerMap.set(A,e)}const o=r.watchListenerMap.get(A),a=new ti.Manager.VariableInfo.WatchListener;if(a.propName=s,a.listener=t,o.add(a),0==r.value.is(S.DataType.Null)){const A=t(s,r.value,i);if(A==C.CssStyleNotChanged)return A;Q(A)}return 0}watchKeyframeVariables(A,e,t,n,i){const s=this.getRawKeyframes(A.classAttributes,n);if(0==s.length)return 0;const r=new Set;let o=this.getKeyframesVarNames(s,r);Q(o);for(const n of r)o=this.watchVariable(A,e,t,n,i),Q(o);return 0}unwatchVariable(A,e){for(const[t,n]of this.propVariableMap){if(0==n.watchListenerMap.has(A))continue;let t=n.watchListenerMap.get(A);for(const A of t)if(A.propName!=e){t.delete(A);break}}return 0}unwatchAllVariables(A){for(const[e,t]of this.propVariableMap)t.watchListenerMap.delete(A)}setVariable(A,e,t){let n=this.getVariableInfo(A);m(null!=n,C.InvalidArgument),n.value=e;for(const[A,i]of n.watchListenerMap)for(const A of i){let n=new Set;const i=A.listener(A.propName,e,n);if(i==C.CssStyleNotChanged)return i;Q(i);for(const A of n)t.add(A)}return 0}insertKeyFrame(A,e){const t=this.styleSheetMap.get(ti.Manager.StyleSheetKeyGlobal);F(t,null),t?.set(A,e)}removeKeyFrame(A){const e=this.styleSheetMap.get(ti.Manager.StyleSheetKeyGlobal);F(e,null),e?.has(A)&&e.delete(A)}getKeyframes(A,e){if(0==e.length)return"";const t=this.getRawKeyframes(A,e);if(0==t.length)return"";const n=new Set;if(E(this.getKeyframesVarNames(t,n),""),0==n.size)return t;let i=t;for(const A of n){const e=this.getVariableInfo(A);F(null!=e,""),s=A,r=e.value.toString(),i=i.replaceAll(s,r)}var s,r;return i}getRawKeyframes(A,e){if(0==e.length)return ti.Manager.ConstEmptyString;if(0==this.styleSheetMap.has(ti.Manager.StyleSheetKeyGlobal))return ti.Manager.ConstEmptyString;const t=this.styleSheetMap.get(ti.Manager.StyleSheetKeyGlobal);for(const n of A){const A=e+"-"+n.toString(16).padStart(8,"0");if(0==t.has(A))continue;return t.get(A)}if(t.has(e)){return t.get(e)}return ti.Manager.ConstEmptyString}getKeyframesVarNames(A,e){e.clear();let t=A;const n=/var\([\s\S]+?\)/;let i;for(;null!==(i=n.exec(t));)e.add(i[0]),t=t.substring(i.index+i[0].length);return 0}getVariableInfo(A){let e=L.FormatVariableName(A);if(m(null!=e,null),0==this.propVariableMap.has(e)){const A=new ti.Manager.VariableInfo;this.propVariableMap.set(e,A)}let t=this.propVariableMap.get(e);return t}},"Manager"),qn.StyleSheetKeyGlobal=0,qn.VariableInfo=(p(Ai=class{constructor(){this.value=new S,this.watchListenerMap=new Map}},"VariableInfo"),Ai.WatchListener=class{},Ai),qn.ConstEmptyString="",qn);class ni{static STYLE_PROPERTY_GETTER(A,e,t){let n=new S;return A.getProperty(e,n)>=0?n.get():t}constructor(A,e){this.lastCssClassKeySet=new Set,this.elementDelegate=A,this.style=new $n,this.styleClass=new ti(e)}finalize(){this.styleClass.getManager().unwatchAllVariables(this.styleClass)}hasPropGroup(A){return this.style.hasPropGroup(A)}setProperty(A,e,t){let n=A;0==L.IsVariable(A)&&(n=x.ToConst(A)),m(n,C.UnsupportedError),t.clear();return this.setStyleInheritedProperty(n,e,!0,t)}getProperty(A,e){const t=x.ToConst(A);m(t,C.UnsupportedError);return this.getStyleInheritedProperty(t,e)}setClassNames(A){const e=this.styleClass.setClassNames(A);return m(e>=0||e==C.CssClassNotChanged,e),0}getClassNames(){return this.styleClass.getClassNames()}appendClassAttribute(A){const e=this.styleClass.appendClassAttribute(A);return e==C.CssClassNotChanged||Q(e),0}mergeClassAttributes(A){return Q(this.styleClass.mergeClassAttributes(A.styleClass)),0}getKeyframes(A){const e=this.styleClass.getKeyframes(A);return F(null!=e,null,["Failed to get keyframes:"+A]),e}getNestedClassNames(A){const e=this.elementDelegate;m(null!=e,C.InvalidElement);const t=e.parentNode;m(null!=t,C.InvalidElement);const n=t.styleDelegate,i=this.styleClass.getClassAttributes();let s=[];for(const A of i){const e=[];Q(n.getNestedClassNamesRecursive(A,e)),(s.length<=0||s.length>e.length)&&(s=e)}for(const e of s)A.push(e);if(A.length>5){let A="JsView: Low performance warning: ";A+="It is recommended that the nesting of style classes in a single vue file should less than 6.",A+="You can avoid this risk by splitting the vue file.",console.warn(A)}return 0}updateClassDeclarations(A,e){e.clear();const t=this.lastCssClassKeySet,n=new Set,i=this.styleClass.getClassDeclarations(A);if(null!=i)for(const[A,s]of i){let i=this.setStyleInheritedProperty(A,s,!1,e);i==C.CssStyleNotChanged&&(i=0),I(i),n.add(A),t.delete(A)}let s=new S;for(const A of t){let t=this.setStyleInheritedProperty(A,s,!1,e);t==C.CssStyleNotChanged&&(t=0),I(t)}this.lastCssClassKeySet=n}addChangedStyleGroup(A){return this.style.addChangedStyleGroup(A)}getChangedStyleGroups(){return this.style.getChangedStyleGroups()}clearChangedStyleGroups(){this.style.clearChangedStyleGroups()}jsvValidHeight(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Height,0)}height(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Height,S.InvalidInt32)}left(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Left,0)}top(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Top,0)}jsvValidWidth(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Width,0)}width(){return ni.STYLE_PROPERTY_GETTER(this,x.Layout.Width,S.InvalidInt32)}flexDirection(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.FlexDirection,S.InvalidInt32)}flexWrap(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.FlexWrap,S.InvalidInt32)}justifyContent(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.JustifyContent,S.InvalidInt32)}alignItems(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.AlignItems,S.InvalidInt32)}alignContent(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.AlignContent,S.InvalidInt32)}alignSelf(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.AlignSelf,S.InvalidInt32)}flexGrow(){return ni.STYLE_PROPERTY_GETTER(this,x.Flex.FlexGrow,S.InvalidFloat)}backgroundColor(){return ni.STYLE_PROPERTY_GETTER(this,x.Background.BackgroundColor,null)}backgroundImage(){return ni.STYLE_PROPERTY_GETTER(this,x.Background.BackgroundImage,null)}borderRadius(){return ni.STYLE_PROPERTY_GETTER(this,x.Background.BorderRadius,null)}jsvImageBlendType(){return ni.STYLE_PROPERTY_GETTER(this,x.Background.JsvImageBlendType,0)}backfaceVisibility(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.BackfaceVisibility,null)}borderImage(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.BorderImage,null)}borderImageWidth(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.BorderImageWidth,null)}borderImageOutset(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.BorderImageOutset,null)}display(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Display,null)}objectFit(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.ObjectFit,null)}opacity(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Opacity,1)}overflow(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Overflow,null)}perspective(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Perspective,0)}perspectiveOrigin(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.PerspectiveOrigin,null)}transform(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Transform,null)}transformOrigin(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.TransformOrigin,null)}transformStyle(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.TransformStyle,null)}visibility(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.Visibility,null)}zIndex(){return ni.STYLE_PROPERTY_GETTER(this,x.Effect.ZIndex,0)}color(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.Color,b.Text.Color)}fontFamily(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.FontFamily,b.Text.FontFamily)}fontSize(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.FontSize,b.Text.FontSize)}fontStyle(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.FontStyle,b.Text.FontStyle)}fontWeight(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.FontWeight,b.Text.FontWeight)}lineHeight(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.LineHeight,b.Text.LineHeight)}textAlign(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.TextAlign,b.Text.TextAlign)}textOverflow(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.TextOverflow,b.Text.TextOverflow)}textShadow(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.TextShadow,b.Text.TextShadow)}webkitTextStroke(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.WebkitTextStroke,b.Text.WebkitTextStroke)}whiteSpace(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.WhiteSpace,b.Text.WhiteSpace)}wordWrap(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.WordWrap,b.Text.WordWrap)}direction(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.Direction,b.Text.Direction)}jsvTextEmoji(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextEmoji,b.Text.JsvTextEmoji)}jsvTextLatex(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextLatex,b.Text.JsvTextLatex)}jsvTextAlignMinWidth(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextAlignMinWidth,b.Text.JsvTextAlignMinWidth)}jsvTextVerticalAlign(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextVerticalAlign,b.Text.JsvTextVerticalAlign)}jsvTextLineAlign(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextLineAlign,b.Text.JsvTextLineAlign)}jsvTextInnerDirection(){return ni.STYLE_PROPERTY_GETTER(this,x.Text.JsvTextInnerDirection,b.Text.JsvTextInnerDirection)}animation(){return ni.STYLE_PROPERTY_GETTER(this,x.Motion.Animation,null)}transition(){return ni.STYLE_PROPERTY_GETTER(this,x.Motion.Transition,null)}animationFillMode(){return ni.STYLE_PROPERTY_GETTER(this,x.Motion.AnimationFillMode,null)}static OnVariableChanged(A,e,t,n){const i=A;if(e==x.Motion.Animation){const A=i.elementDelegate;m(null!=A,C.InvalidElement),i.addChangedStyleGroup(H.Motion.Name),n.add(A.nativeId)}else{const A=i.setStyleInheritedProperty(e,t,!1,n);if(A==C.CssStyleNotChanged)return A;Q(A)}return 0}setStyleInheritedProperty(A,e,t,n){const i=this.styleClass.getManager();let s=C.UnknownError;if(L.IsVariable(A))s=i.setVariable(A,e,n);else if(L.IsVariable(e))s=i.watchVariable(this.styleClass,A,ni.OnVariableChanged.bind(null,this),e.get(),n);else{if(s=this.style.setPropValue(A,e,t),s==C.CssStyleNotChanged)return s;if(Q(s),A==x.Motion.Animation){t&&(s=i.unwatchVariable(this.styleClass,A),Q(s));const e=this.style.getPropValue(A);e.is(S.DataType.Animation)&&(s=i.watchKeyframeVariables(this.styleClass,A,ni.OnVariableChanged.bind(null,this),e.get().name,n),Q(s))}}if(s==C.CssStyleNotChanged)return s;Q(s);const r=this.elementDelegate;m(null!=r,C.InvalidElement),n.add(r.nativeId);const o=(A,e,t)=>{for(const n of e.childNodes)n.styleDelegate.style.hasPropValue(A)||o(A,n,t);const n=e instanceof gi?e:null;null!=n&&0!=n.getTextContent().length&&(e.styleDelegate.addChangedStyleGroup(H.Text.Name),t.add(e.nativeId))};return $n.IsInheritedProp(A)&&o(A,r,n),0}getStyleInheritedProperty(A,e){if(e.reset(this.style.getPropValue(A)),0==e.is(S.DataType.Null))return 0;if(0==$n.IsInheritedProp(A))return C.CssStyleNotExists;const t=this.elementDelegate;m(null!=t,C.InvalidElement);const n=t.parentNode;if(null==n)return C.CssStyleNotExists;const i=n.styleDelegate.getStyleInheritedProperty(A,e);return i<0?i:0}getNestedClassNamesRecursive(A,e){const t=this.elementDelegate;if(m(null!=t,C.InvalidElement),0==this.styleClass.hasClassAttribute(A))return 0;const n=t.parentNode;m(null!=n,C.InvalidElement);Q(n.styleDelegate.getNestedClassNamesRecursive(A,e));const i=this.styleClass.getClassNames();return i.length<=0||e.push(i),0}}class ii{constructor(A){let e=-1;null==A?e=ii.DataType.Null:Number(A)===A&&A%1==0?e=ii.DataType.Int32:Number(A)===A&&A%1!=0?e=ii.DataType.Float:"string"==typeof A&&(e=ii.DataType.String),this.data=new ii.DataInfo,A!=ii.InvalidInt32&&A!=ii.InvalidFloat&&A!=ii.InvalidPointer?this.data.value=A:this.data.value=null,this.data.index=e}is(A){return this.data.index==A}get(){return this.data.value}reset(A){this.data.value=A.data.value,this.data.index=A.data.index}equals(A){return this.data.value===A.data.value&&this.data.index===A.data.index}}ii.DataType=(p(ei=class{},"DataType"),ei.Null=0,ei.Int32=1,ei.Float=2,ei.String=3,ei),ii.InvalidInt32=Number.MIN_VALUE,ii.InvalidFloat=Number.NaN,ii.InvalidPointer=null,ii.DataInfo=class{constructor(){this.value=null,this.index=-1}};class si{constructor(){this._PersistMap=new Map,this._PersistMax=300,this._PersistIdx=0,this._PersistTrackList=new Array(this._PersistMax),this._TempMap=new Map,this._TempMax=50,this._TempIdx=0,this._TempTrackList=new Array(this._TempMax)}getPersistPack(A){return this._PersistMap.get(A)}putPersistPack(A,e){si._putPack(this._PersistMap,this._PersistTrackList,this._PersistIdx,A,e),this._PersistIdx=(this._PersistIdx+1)%this._PersistMax}getTempPack(A){return this._TempMap.get(A)}putTempPack(A,e){si._putPack(this._TempMap,this._TempTrackList,this._TempIdx,A,e),this._TempIdx=(this._TempIdx+1)%this._TempMax}static _putPack(A,e,t,n,i){let s=e[t];s&&(A.delete(s),e[t]=n),A.set(n,i)}}let ri=new si;var oi,ai;class li{GetAnimationManager(){}GetRootView(){return new _.RootView}GetTextureManager(){return window.JsvCode.ForgeHandles.TextureManager}GetTextureSetting(A,e){return new _.ExternalTextureSetting(A,e)}GetRenderBridge(){return li.sRenderBridge}}li.ClipView=_.ClipView,li.LayoutView=_.LayoutView,li.NinePatchView=_.NinePatchView,li.ViewRoundCornerMask=_.ViewRoundCornerMask,li.AnimationListener=_.AnimationListener,li.sRenderBridge=_.sRenderBridge,li.InitRenderDocument=_.InitRenderDocument,li.TextureInstantLoad={AUTO:_.TextureInstantLoad.AUTO,SYNC:_.TextureInstantLoad.SYNC,ASYNC:_.TextureInstantLoad.ASYNC},li.FlexContainerProps=_.FlexContainerProps,li.FlexSetNames=_.FlexSetNames,li.FlexItemProps=_.FlexItemProps,li.Animation=class{constructor(){}Cancel(){this.animation.Cancel()}Enable(A){this.animation.Enable(A)}EnableDelay(A){this.animation.EnableDelay(A)}SetAnimationListener(A){this.animation.SetAnimationListener(A)}SetRepeat(A){this.animation.SetRepeat(A)}Start(A){this.animation.Start(A)}},li.AnimationCssKeyframes=class extends _.CssKeyframeAnimation{constructor(A,e){super(e.keyframes,e.duration,e.easing,e.width,e.height)}},li.AnimationCssTransition=(p(oi=class extends _.CssTransitionAnimation{constructor(A,e){let t=[];for(const A of e){let e={name:A.name,dur:A.duration,tf:A.easing?.Package(),dly:A.delay,from:A.from.data,to:A.to.data};t.push(e)}super(t)}},"AnimationCssTransition"),oi.Value=class{constructor(A){this.data=A}},oi),li.AnimationManager=(p(ai=class{},"AnimationManager"),ai.AnimationEnable={ReleaseAfterEndCallback:1,KeepTransform:2,AckFinalProgress:4,AckRepeat:8},ai),li.AnimationEnable=_.AnimationEnable,li.TextUtils=class{static GetTextWidth(A,e,t,n,i,s){return _.sTextUtils.GetTextWidth(e,t,n,i,s)}static GetOneLineTextDrawWidth(A,e,t,n,i,s,r){_.sTextUtils.GetOneLineTextDrawWidth(e,t,n,i,s,r)}static BuildTextView(A,e,t,n,i,s,r,o,a,l,c){return _.sTextUtils.BuildTextView(A,e,t.GetStylePack(),n,{width:i,height:s},0!=r?r:null,o,a,0!=l,0!=c)}},li.TextStyleCache=class{constructor(){this.stylePackData={}}UpdateShadow(A,e,t,n){this.stylePackData.shadow={shadowOffsetX:A,shadowOffsetY:e,shadowBlur:t,shadowColor:n}}UpdateStroke(A,e){this.stylePackData.stroke={strokeWidth:A,strokeColor:e}}CommitChanges(){this.stylePackData.textColor=this.textColor,this.stylePackData.font=this.font,this.stylePackData.italic=this.italic,this.stylePackData.bold=this.bold,this.stylePackData.hAlign=this.hAlign,this.stylePackData.vAlign=this.vAlign,this.stylePackData.vAreaAlign=this.vAreaAlign,this.stylePackData.textOverflow=this.textOverflow,this.stylePackData.wordWrap=this.wordWrap,this.stylePackData.direction=this.direction,this.stylePackData.textInnerDirection=this.textInnerDirection,this.stylePackData.whiteSpace=this.whiteSpace;let A=JSON.stringify(this.stylePackData);this.stylePackData.textColor=null==this.stylePackData.textColor?void 0:this.stylePackData.textColor,this.stylePackData.font=null==this.stylePackData.font?void 0:this.stylePackData.font,this.stylePackData.italic=null==this.stylePackData.italic?void 0:this.stylePackData.italic,this.stylePackData.bold=null==this.stylePackData.bold?void 0:this.stylePackData.bold,this.stylePackData.hAlign=null==this.stylePackData.hAlign?void 0:this.stylePackData.hAlign,this.stylePackData.vAlign=null==this.stylePackData.vAlign?void 0:this.stylePackData.vAlign,this.stylePackData.vAreaAlign=null==this.stylePackData.vAreaAlign?void 0:this.stylePackData.vAreaAlign,this.stylePackData.textOverflow=null==this.stylePackData.textOverflow?void 0:this.stylePackData.textOverflow,this.stylePackData.wordWrap=null==this.stylePackData.wordWrap?void 0:this.stylePackData.wordWrap,this.stylePackData.direction=null==this.stylePackData.direction?void 0:this.stylePackData.direction,this.stylePackData.textInnerDirection=null==this.stylePackData.textInnerDirection?void 0:this.stylePackData.textInnerDirection,this.stylePackData.whiteSpace=null==this.stylePackData.whiteSpace?void 0:this.stylePackData.whiteSpace,"nowrap"===this.stylePackData.whiteSpace&&(this.stylePackData.wordWrap="none");let e=ri.getTempPack(A);e||(e=_.sTextStyleCache.StyleToPack(this.stylePackData),ri.putTempPack(A,e)),this.textStylePack=e}GetStylePack(){return this.textStylePack}},li.LayoutView.eVisibility={VIEW_HIDDEN:"hidden",VIEW_VISIBLE:"visible"};class ci{constructor(A,e,t){this.name=A,this.value=e,this.viewType=t}}class hi{static MakeShared(A,e,t,n){const i=new n(A,e);return i.styleDelegate=new ni(i,t),i}bindToForgeRootView(A){this.forgeMainView=A.GetRootView(),this.forgeMaskView=this.forgeMainView}insertForgeView(A,e,t){e.ensureForgeMaskView(A);const n=this.forgeMainView.InsertView(e.forgeMaskView,t?t.forgeMaskView:null);y(n||void 0===n),this.linkChild(A,e,t)}removeForgeView(A,e){this.forgeMainView.RemoveView(e.forgeMaskView),this.unlinkChild(A,e)}linkChild(A,e,t){this.childNodes.push(e),e.parentNode=this,(e.attrStore.extendClassAttributeDepth>0||e.hasExtendClassAttributeChildren)&&(this.hasExtendClassAttributeChildren=!0)}unlinkChild(A,e){const t=this.childNodes.indexOf(e);this.childNodes.splice(t,1),e.parentNode=void 0}moveForgeView(A,e,t,n){e.unlinkChild(A,t),this.linkChild(A,t,n),(e.forgeMaskView?e.forgeMaskView:e.forgeMainView).MoveChildView(t.forgeMaskView,this.forgeMainView,n?n.forgeMaskView:null),console.log("moving child")}reOrderForgeView(A,e,t){this.forgeMainView.ReOrderChildView(e.forgeMaskView,t?t.forgeMaskView:null)}addEventListener(A,e,t){if(null==this.eventInfoMap&&(this.eventInfoMap=new Map),0==this.eventInfoMap.has(A)){const t=new hi.EventInfo;t.listener=e,this.eventInfoMap.set(A,t)}this.eventInfoMap.get(A).count++;const n=this.tryDealWithCustomEvent(A,t);return Q(n),n}removeEventListener(A,e){if(null==this.eventInfoMap)return;if(0==this.eventInfoMap.has(A))return;const t=this.eventInfoMap.get(A);t.count--,t.count<=0&&this.eventInfoMap.delete(A)}setAttribute(A,e,t){let n=C.UnsupportedError;if(Zn.StringStartsWith(e,"data-v-"))n=this.appendStyleClassAttribute(e),Q(n),n=hi.State.NeedRefreshCssClassAttribute;else if(Zn.StringStartsWith(e,"class"))n=this.styleDelegate.setClassNames(t),Q(n),n=hi.State.NeedRefreshCssClass;else if(Zn.StringStartsWith(e,"data-jsv-extend-class-attr")){const A=Zn.StringToInt32(t);m(A!=S.InvalidInt32,C.InvalidArgument),n=this.setExtendClassAttributeDepth(A),Q(n),n=hi.State.NeedRefreshCssClass}else Zn.StringStartsWith(e,"data-jsv-flex-container")&&(this.enableAsFlexContainer(),n=hi.State.NeedRefreshCssClassAttribute);return Q(n),n}getExtendClassAttributeChildren(A,e=0){if(this.attrStore.extendClassAttributeDepth==e)return A.add(this),0;if(0==this.hasExtendClassAttributeChildren)return 0;for(let t of this.childNodes){if(t.attrStore.extendClassAttributeDepth<=0&&0==t.hasExtendClassAttributeChildren)continue;Q(t.getExtendClassAttributeChildren(A,e+1))}return 0}onCssStyleChanged(A){const e=this.styleDelegate.getChangedStyleGroups();return e.has(H.Layout.Name)&&this.onFlushViewLayout(A),e.has(H.Flex.Name)&&this.onFlushViewFlex(A),e.has(H.Background.Name)&&this.onFlushViewBackground(A),e.has(H.Effect.Name)&&this.onFlushViewEffect(A),e.has(H.Motion.Name)&&this.onFlushViewMotion(A),this.styleDelegate.clearChangedStyleGroups(),0}onAllChangeFinished(A){if(null==this.onAllChangeFinishTasks)return 0;for(const A of this.onAllChangeFinishTasks)A();return this.onAllChangeFinishTasks=void 0,0}handleAfterAllChangeFinish(A){null==this.onAllChangeFinishTasks&&(this.onAllChangeFinishTasks=[]),this.onAllChangeFinishTasks.push(A)}setForgeViewInnerProps(A,e,t,n){return 1==t?this.forgeMaskView?this.forgeMaskView.SetElementProp(A,e,n):this.forgeInnerPropsCacheList.push(new ci(e,n,t)):this.forgeMainView.SetElementProp(A,e,n),0}getElementView(A){return A?this.forgeMaskView:this.forgeMainView}setClientWidth(A,e){this.clientWidth=e}getClientWidth(A){return this.clientWidth<0?this.styleDelegate.width():this.clientWidth}setClientHeight(A,e){this.clientHeight=e}getClientHeight(A){return this.clientHeight>0?this.clientHeight:this.styleDelegate.jsvValidHeight()}constructor(A,e){this.childNodes=[],this.parentNode=void 0,this.forgeAnimation=null,this.eventInfoMap=void 0,this.onAllChangeFinishTasks=void 0,this.attrStore=new hi.AttrStore,this.hasExtendClassAttributeChildren=!1,this.transitionSetInfo=new hi.TransitionSetInfo,this.flexEnabled=!1,this.clientWidth=-1,this.clientHeight=-1,this.forgeInnerPropsCacheList=[],this.nativeId=e,this.forgeMainView=new li.LayoutView,this.forgeMaskView=this.forgeMainView}sendEvent(A,e){if(null==this.eventInfoMap||0==this.eventInfoMap.has(A))return;console.log("ElementDelegate.sendEvent(). event="+A);const t=this.eventInfoMap.get(A);let n=[];n.push(new ii(this.nativeId)),n.push(new ii(A));for(const A of e)n.push(A);t.listener(n)}getObjectFitClipStatus(A){return!1}flushMaskViewClip(A){if(null==this.forgeMaskView)return;const e=this.forgeMaskView instanceof li.ClipView?this.forgeMaskView:null;if(null==e)return;let t={left:0,top:0,width:0,height:0,autoSizeClip:!1,useScissors:!1};if(!this.getObjectFitClipStatus(t)){const A=this.styleDelegate.overflow();null!=A&&"hidden"==A&&(t.autoSizeClip=!0,t.useScissors=!0)}t.autoSizeClip?e.SetWholeSizeScissor(t.useScissors,!0):e.SetClipRect(t.left,t.top,t.width,t.height,t.useScissors)}onFlushViewLayout(A){if(0==this.styleDelegate.hasPropGroup(H.Layout.Name))return;const e=this.styleDelegate.left(),t=this.styleDelegate.top(),n=this.styleDelegate.jsvValidWidth(),i=this.styleDelegate.jsvValidHeight();this.forgeMaskView.ResetLayoutParams({x:e,y:t,width:n,height:i}),this.forgeMaskView!=this.forgeMainView&&this.forgeMainView.ResetLayoutParams({x:0,y:0,width:n,height:i})}onFlushViewFlex(A){if(!this.flexEnabled)return;const e=this.styleDelegate.flexDirection(),t=this.styleDelegate.flexWrap(),n=this.styleDelegate.justifyContent(),i=this.styleDelegate.alignItems(),s=this.styleDelegate.alignContent();let r=new li.FlexContainerProps;r.flexDirection=e!=S.InvalidInt32?e:r.flexDirection,r.flexWrap=t!=S.InvalidInt32?t:r.flexWrap,r.justifyContent=n!=S.InvalidInt32?n:r.justifyContent,r.alignItems=i!=S.InvalidInt32?i:r.alignItems,r.alignContent=s!=S.InvalidInt32?s:r.alignContent,this.forgeMainView.ResetFlexContainerCell(r);const o=this.styleDelegate.alignSelf(),a=this.styleDelegate.flexGrow();if(o==S.InvalidInt32&&isNaN(a))this.forgeMainView.ResetFlexItemCell(null);else{let A=new li.FlexItemProps;A.alignSelf=o!=S.InvalidInt32?o:A.alignSelf,A.flexGrow=isNaN(a)?A.flexGrow:a,this.forgeMainView.ResetFlexItemCell(A)}}onFlushViewBackground(A){if(0==this.styleDelegate.hasPropGroup(H.Background.Name))return;const e=A.GetTextureManager(),t=this.styleDelegate.backgroundColor(),n=this.styleDelegate.backgroundImage(),i=this.styleDelegate.borderRadius(),s=this.styleDelegate.jsvImageBlendType();let r,o=null;n&&n.urlPath&&0!=n.urlPath.length&&(n.type==S.BackgroundImageImpl.eType.LINEAR_GRADIENT?(o=e.GetNamedCachedTexture(n.urlPath),null==o&&(o=e.CreateCssGradientColorTexture(n.urlPath,n.linearGradient.fromX,n.linearGradient.fromY,n.linearGradient.toX,n.linearGradient.toY,n.linearGradient.stops))):o=e.GetImage(n.urlPath,null)),t&&0!=t.length&&(null==o?o=e.GetColorTextureCached(t):console.warn(`Ignore color(${t}) when image(${n?.urlPath}) set(id=${this.nativeId})`)),i&&(r=new li.ViewRoundCornerMask(i.topLeft,i.topRight,i.bottomLeft,i.bottomRight)),this.forgeMainView.ResetTexture(o,r,0==s)}onFlushViewEffect(A){if(0==this.styleDelegate.hasPropGroup(H.Effect.Name))return;const e=this.styleDelegate.visibility();let t=e&&"hidden"==e?li.LayoutView.eVisibility.VIEW_HIDDEN:li.LayoutView.eVisibility.VIEW_VISIBLE;"none"==this.styleDelegate.display()&&(t=li.LayoutView.eVisibility.VIEW_HIDDEN),this.forgeMaskView.SetVisibility(t),this.flushMaskViewClip(A);const n=this.styleDelegate.perspective();if(n>0){const A=this.styleDelegate.perspectiveOrigin();this.forgeMainView.SetPerspective(n,A)}const i=this.styleDelegate.backfaceVisibility();i&&this.forgeMainView.SetBackfaceVisibility("visible"==i);const s=this.styleDelegate.opacity();isNaN(s)||1==s||this.setOpacity(s),this.styleDelegate.transformStyle()&&this.forgeMainView.SetTransformStyle(this.styleDelegate.transformStyle()),this.forgeMaskView.ResetCssTransform(this.styleDelegate.transform(),this.styleDelegate.transformOrigin()),this.forgeMaskView.SetZIndex(this.styleDelegate.zIndex())}onFlushViewMotion(A){if(null!=this.forgeAnimation&&(this.forgeAnimation.Cancel(),this.forgeAnimation=null),0==this.styleDelegate.hasPropGroup(H.Motion.Name))return;let e="",t="";const n=this.styleDelegate.animation(),i=this.styleDelegate.transition(),s=this.styleDelegate.animationFillMode();if(null!=n&&null!=i&&console.warn("ElementDelegate","Cannot set both animation and transition on a single element at the same time."),null!=n){e="animation",t=n.name;const i=this.styleDelegate.getKeyframes(n.name);this.forgeAnimation=this.makeAnimation(A,n,i),"forwards"===s&&this.forgeAnimation.Enable(li.AnimationManager.AnimationEnable.KeepTransform)}if(null!=i&&null==this.forgeAnimation){const t=A.GetRenderBridge().GetSwapCount();if(this.transitionSetInfo.alreadySet&&this.transitionSetInfo.swapCount!=t)e="transition",this.forgeAnimation=this.makeTransition(A,i);else{for(const[A,e]of i.animationMap){let e=new S;const t=x.ToConst(A);null!=t&&(this.styleDelegate.getProperty(t,e),this.attrStore.transitionStyleMap.set(A,e))}this.transitionSetInfo.alreadySet||(this.transitionSetInfo.alreadySet=!0,this.transitionSetInfo.swapCount=t)}}else this.attrStore.transitionStyleMap.clear(),this.transitionSetInfo.swapCount=0,this.transitionSetInfo.alreadySet=!1;if(null!=this.forgeAnimation){const A=this.makeForgeAnimationListener(e,t);null!=A&&this.forgeAnimation.SetAnimationListener(A),this.forgeMaskView.StartAnimation(this.forgeAnimation)}}tryDealWithCustomEvent(A,e){if("jsv-getbound"===A){m(e.has("jsvtoken"),C.InvalidArgument);const t=e.get("jsvtoken"),n=()=>{const e=this;null!=e?e.getBoundingClientRect(A,t,e.forgeMainView):console.error("ElementDelegate.tryDealWithCustomEvent(), Element has been released.")};return this.handleAfterAllChangeFinish(n),hi.State.NeedCallPostProcess}if("click"===A){let A=1;const e=()=>{if(!this.forgeMaskView.HasTapCallback()){this.forgeMaskView.TouchRecvEnableAdd(A);let e=this,t=A=>{1==A&&e.sendEvent("click",[])};this.forgeMaskView.RegisterTapCallback(t)}};return this.handleAfterAllChangeFinish(e),hi.State.NeedCallPostProcess}return 0}setOpacity(A){1!=A&&console.error("Error: not support opacity for performance issue(only <img>) value="+A)}static parsePerformAttr(A,e,t){return!(!Zn.StringStartsWith(A,"data-jsv-perf-")||"data-jsv-perf-loadtex"!=A)&&(t.outTexInstantLoad="sync"==e?li.TextureInstantLoad.SYNC:"async"==e?li.TextureInstantLoad.ASYNC:li.TextureInstantLoad.AUTO,t.outParseResult=hi.State.NeedRefreshCssClassAttribute,!0)}makeAnimation(A,e,t){if(null==e||null==t)return null;const n=this.styleDelegate.jsvValidWidth(),i=this.styleDelegate.jsvValidHeight();let s={keyframes:t,duration:e.duration,easing:e.timingFunction,width:n,height:i,left:this.styleDelegate.left(),top:this.styleDelegate.top()};const r=new li.AnimationCssKeyframes(A.GetAnimationManager(),s);return r.EnableDelay(e.delay),r.SetRepeat(e.iterationCount),r.Enable(li.AnimationEnable.ReleaseAfterEndCallback),r}makeTransition(A,e){if(null==e)return this.attrStore.transitionStyleMap.clear(),null;let t=[];for(const[A,n]of e.animationMap){if(null==n)continue;const e=this.attrStore.transitionStyleMap.get(A)??new S;let i=new S;const s=x.ToConst(A);if(m(s,null,["Failed makeTransition no support:"+A]),this.styleDelegate.getProperty(s,i),i.equals(e))continue;const r={name:A,duration:n.duration,easing:n.timingFunction,delay:n.delay,from:new li.AnimationCssTransition.Value,to:new li.AnimationCssTransition.Value,origin:""};if(e.is(S.DataType.Int32)){const A=e.get();r.from=new li.AnimationCssTransition.Value(A)}else if(e.is(S.DataType.Float)){const A=e.get();r.from=new li.AnimationCssTransition.Value(A)}else if(e.is(S.DataType.String)){const A=e.get();r.from=new li.AnimationCssTransition.Value(A)}if(i.is(S.DataType.Int32)){const A=i.get();r.to=new li.AnimationCssTransition.Value(A)}else if(i.is(S.DataType.Float)){const A=i.get();r.to=new li.AnimationCssTransition.Value(A)}else if(i.is(S.DataType.String)){const A=i.get();r.to=new li.AnimationCssTransition.Value(A)}A==x.Effect.Transform&&(r.origin=null!=this.styleDelegate.transformOrigin()?this.styleDelegate.transformOrigin():"center center"),t.push(r),this.attrStore.transitionStyleMap.set(A,i)}if(t.length>0){return new li.AnimationCssTransition(A.GetAnimationManager(),t)}return null}makeForgeAnimationListener(A,e){const t=new li.AnimationListener(null,null,null);return t.OnStart((()=>{const t=A+"start";this.sendEvent(t,[new ii(e)])})),t.OnRepeat((t=>{const n=A+"iteration";this.sendEvent(n,[new ii(e)])})),t.OnEnd((t=>{let n;this.forgeAnimation=null,n=t?A+"end":A+"cancel",this.sendEvent(n,[new ii(e)])})),t}ensureForgeMaskView(A){if(this.forgeMainView.mParentView)return void console.log("ElementDelegate.ensureForgeMaskView(), Failed to ensure forge mask view, main view's parent is not null.");const e=this.styleDelegate.objectFit(),t=this.styleDelegate.overflow();if(null!=e||null!=t?(null!=this.forgeMaskView&&this.forgeMaskView!=this.forgeMainView&&console.error(hi.TAG,"Jsview: jsvMaskView is conflicting."),this.forgeMaskView=new li.ClipView):null==this.forgeMaskView&&(this.forgeMaskView=this.forgeMainView),this.forgeMaskView!==this.forgeMainView&&(this.forgeMaskView.AddView(this.forgeMainView,0,0),this.flexEnabled&&this.forgeMaskView.TransChildFlexInfoPack(this.forgeMainView),this.forgeMaskView.MarkFlexChildrenFromChild0()),this.forgeInnerPropsCacheList.length>0){for(let e of this.forgeInnerPropsCacheList)this.forgeMaskView.SetElementProp(A,e.name,e.value);this.forgeInnerPropsCacheList=[]}}appendStyleClassAttribute(A){const e=A.replace("data-v-","");let t=0;t=parseInt(e,16);let n=this.styleDelegate.appendClassAttribute(t);Q(n);const i=new Set;n=this.getExtendClassAttributeChildren(i),Q(n);for(let A of i)n=A.styleDelegate.appendClassAttribute(t),Q(n);return 0}setExtendClassAttributeDepth(A){if(A<=0)return 0;this.attrStore.extendClassAttributeDepth=A;let e=this;for(let t=0;t<A&&(e=e.parentNode,null!=e);t++);if(e){Q(this.styleDelegate.mergeClassAttributes(e.styleDelegate))}return 0}convertObjectFit(A){return A?"fill"==A?"fill":"none"==A?"none":"cover"==A?"cover":"contain"==A?"contain":"scale-down"==A?"scale-down":"fill":"fill"}getBoundingClientRect(A,e,t){if(t){const n=t=>{this.sendEvent(A,[new ii(t),new ii(e)])};t.GetBoundingClientRect(n)}else{const t='{"status": -100, "error": target LayoutView is null})';this.sendEvent(A,[new ii(t),new ii(e)])}}enableAsFlexContainer(){this.flexEnabled=!0}}hi.TAG="ElementDelegate",hi.State={NeedRefreshCssClass:1,NeedRefreshCssClassAttribute:2,NeedCallPostProcess:3},hi.EventInfo=class{constructor(){this.listener=void 0,this.count=0}},hi.AttrStore=class{constructor(){this.transitionStyleMap=new Map,this.extendClassAttributeDepth=-1}},hi.TransitionSetInfo=class{constructor(){this.swapCount=0,this.alreadySet=!1}};class ui{static isRtl(A){for(let e=0;e<A.length;++e){let t=A.charCodeAt(e);if(32!==t)return t>=1536&&t<=1791}return!1}}class gi extends hi{setTextContent(A){this.textContent=A}getTextContent(){return this.textContent}onCssStyleChanged(A){const e=this.styleDelegate.getChangedStyleGroups();return(e.has(H.Text.Name)||e.has(H.Layout.Name)&&this.clientWidth!=this.styleDelegate.jsvValidHeight())&&this.onFlushViewText(A),e.has(H.Effect.Name)&&null!=this.styleDelegate.borderImage()&&this.onFlushViewBorder(A),super.onCssStyleChanged(A)}constructor(A,e){super(A,e),this.textContent="",this.instantLoadSet=li.TextureInstantLoad.AUTO}setAttribute(A,e,t){let n,i={};return hi.parsePerformAttr(e,t,i)?(this.instantLoadSet=i.outTexInstantLoad,n=i.outParseResult,n):(n=super.setAttribute(A,e,t),n)}onFlushViewText(A){if(!this.textContent)return void(this.forgeContentView&&(this.forgeMainView.RemoveView(this.forgeContentView),this.forgeContentView=null));null==this.forgeContentView&&(this.forgeContentView=new li.LayoutView,this.forgeMainView.InsertView(this.forgeContentView),this.forgeMainView.MarkFlexSizeFromChild(this.forgeContentView)),this.forgeContentView.ClearViews(),this.clientWidth=0,this.clientHeight=0;let e=A.GetTextureManager(),t=new li.TextStyleCache;const n=this.styleDelegate.fontSize();let i=this.styleDelegate.lineHeight();i<=0&&(i=n>0?Math.ceil(1.3*n):14);const s=this.styleDelegate.jsvTextEmoji(),r=this.styleDelegate.jsvTextLatex(),o=this.styleDelegate.fontStyle(),a=this.styleDelegate.fontWeight(),l=this.styleDelegate.textShadow(),c=this.styleDelegate.webkitTextStroke();i>=0&&(t.vAlign="middle"),t.textColor=this.styleDelegate.color(),t.font=this.styleDelegate.fontFamily(),t.italic=o&&"italic"==o,t.bold=a&&"bold"==a,t.hAlign=this.styleDelegate.textAlign(),t.vAlign=this.styleDelegate.jsvTextLineAlign(),t.vAreaAlign=this.styleDelegate.jsvTextVerticalAlign(),t.textOverflow=this.styleDelegate.textOverflow(),l&&t.UpdateShadow(l.hShadow,l.vShadow,l.blur,l.color),c&&t.UpdateStroke(c.length,c.color),t.whiteSpace=this.styleDelegate.whiteSpace(),t.wordWrap=this.styleDelegate.wordWrap(),t.direction=this.styleDelegate.direction(),t.textInnerDirection=this.styleDelegate.jsvTextInnerDirection(),t.CommitChanges(e);const h=this.styleDelegate.height();let u=this.styleDelegate.width(),g=h!=S.InvalidInt32?h:0,d=u==S.InvalidInt32;if(d&&(u=li.TextUtils.GetTextWidth(e,this.textContent,t.font,n,t.bold,t.italic)),u<=0)return void console.error(gi.TAG,"Failed to render text: %s, text width is invalid.");let B=u,f=this.styleDelegate.jsvTextAlignMinWidth();f>0&&B<f&&(B=f);const w=h==S.InvalidInt32||0==h,p=w?(A,e,t)=>{this.clientWidth=A,this.clientHeight=e}:null;let C=Math.floor(u*li.sRenderBridge.GetScreenInfo().scaleRatio);if(C>3e3){if(!d)return void console.error(`long text only support style.width=undefine. str=${this.textContent}`);console.log(`text too long, start to break down. width(${C})`),this.forgeTextView=new li.LayoutView;const A=[];li.TextUtils.GetOneLineTextDrawWidth(e,this.textContent,t.font,n,t.bold,t.italic,A);const o=A[0];let a=0;const l="unset"===t.textInnerDirection?ui.isRtl(this.textContent):"rtl"===t.textInnerDirection;for(let c=1;c<A.length;c+=3){const h=A[c],u=A[c+1],d=A[c+2],B=this.textContent.slice(h,u);let f=li.TextUtils.BuildTextView(e,B,t,0==h?p:null,d,g,n,i,this.instantLoadSet,r,s);const w=l?o-a-d:a;this.forgeTextView.AddView(f,w,0,d,g),a+=d}this.clientWidth=o,this.forgeTextView.ResetLayoutParams({x:0,y:0,width:o,height:g})}else this.forgeTextView=li.TextUtils.BuildTextView(e,this.textContent,t,p,B,g,n,i,this.instantLoadSet,r,s),this.clientWidth=u;w&&this.forgeTextView.EnableAutoHeight(),this.forgeContentView.InsertView(this.forgeTextView),this.forgeContentView.MarkFlexSizeFromChild(this.forgeTextView)}ensureForgeMaskView(A){null!=this.styleDelegate.borderImage()&&(this.forgeMaskView=new li.NinePatchView),super.ensureForgeMaskView(A)}onFlushViewBorder(A){if(null==this.forgeMaskView)return;const e=this.styleDelegate.borderImage();if(null!=e)if(0==e.source.length)this.forgeMaskView.ResetTexture(null,null);else{const t=A.GetTextureManager(),n=e.source,i=t.GetImage(n,null),s=this.styleDelegate.jsvImageBlendType();this.forgeMaskView.ResetTexture(i,null,0==s),this.forgeMaskView.WaitTextureToResize(!0);const r=(A,t,n)=>{const i=this.styleDelegate.borderImageWidth(),s=this.styleDelegate.borderImageOutset();if(null==this.forgeMaskView||null==e.slice||null==i||null==s)return void console.log(gi.TAG,"Nine patch settings are not complete.");const r=this.forgeMaskView,o=Math.floor(A*i.top/e.slice.top),a=Math.floor(t*i.left/e.slice.left);r.SetImageDspSize(o,a);const l={start:s.left,width:Math.max(0,o-s.left-s.right)},c={start:s.top,width:Math.max(0,a-s.top-s.bottom)};r.SetPadding(l,c);const h=[{start:i?.left,width:Math.max(0,o-2*i.left)}],u=[{start:i.top,width:Math.max(0,a-2*i.top)}];r.SetRepeat(h,u),r.WaitTextureToResize(!1)};i.RegisterLoadImageCallback(r)}}getBoundingClientRect(A,e,t){this.styleDelegate.height()!=S.InvalidInt32&&this.styleDelegate.width()!=S.InvalidInt32||null==this.forgeTextView||(t=this.forgeTextView),super.getBoundingClientRect(A,e,t)}}gi.TAG="DivDelegate";class di extends hi{constructor(A,e){super(A,e)}}class Bi extends di{constructor(A,e){super(A,e)}}class fi extends hi{setAttribute(A,e,t){const n=()=>{const e=this;null!=e?e.loadImage(A,e.imgAttrStore.src):console.error("ElementDelegate.tryDealWithCustomEvent(), Element has been released.")};if("src"==e)return this.imgAttrStore.src!==t&&(this.imgAttrStore.sizeApplied=!1,this.imgAttrStore.imageWidth=0,this.imgAttrStore.imageHeight=0),this.imgAttrStore.src=t,this.handleAfterAllChangeFinish(n),fi.State.NeedCallPostProcess;return 0==this.setTextureAttribute(A,e,t)?(this.handleAfterAllChangeFinish(n),fi.State.NeedCallPostProcess):super.setAttribute(A,e,t)}onCssStyleChanged(A){const e=this.styleDelegate.getChangedStyleGroups();return(e.has(H.Layout.Name)||e.has(H.Effect.Name))&&this.onFlushViewImage(A),super.onCssStyleChanged(A)}constructor(A,e){super(A,e),this.imageInLoading=!1,this.forgeImageTexture=null,this.imageOperatorKey=null,this.loadCallbackSeq=0,this.imgAttrStore=new fi.ImgAttrStore,this.forgeImageView=new li.LayoutView(null,"img"),this.forgeMainView.InsertView(this.forgeImageView),this.forgeMainView.MarkFlexSizeFromChild(this.forgeImageView)}setForgeViewInnerProps(A,e,t,n){return 1==t?super.setForgeViewInnerProps(A,e,t,n):(this.forgeImageView.SetElementProp(A,e,n),0)}getObjectFitClipStatus(A){if(0!=this.imgAttrStore.imageWidth&&0!=this.imgAttrStore.imageHeight){let e=this.convertObjectFit(this.styleDelegate.objectFit());if("fill"!=e){let t=this.forgeImageView.ApplyObjectFit(this.styleDelegate.jsvValidWidth(),this.styleDelegate.jsvValidHeight(),this.imgAttrStore.imageWidth,this.imgAttrStore.imageHeight,e);if(t)return A.left=t.x,A.top=t.y,A.width=t.width,A.height=t.height,A.autoSizeClip=!1,A.useScissors=!0,!0}}return!1}onFlushViewImage(A){if(0!=this.imgAttrStore.imageWidth&&0!=this.imgAttrStore.imageHeight&&!this.imgAttrStore.sizeApplied){this.flushMaskViewClip(A);let e=this.styleDelegate.jsvValidWidth(),t=this.styleDelegate.jsvValidHeight();0==e&&0!=t?e=this.imgAttrStore.imageWidth*t/this.imgAttrStore.imageHeight:0!=e&&0==t&&(t=this.imgAttrStore.imageHeight*e/this.imgAttrStore.imageWidth),this.clientWidth=e,this.clientHeight=t,this.imgAttrStore.sizeApplied=!0}const e=this.styleDelegate.jsvValidWidth(),t=this.styleDelegate.jsvValidHeight(),n={x:0,y:0,width:e>0?e:this.getClientWidth(A),height:t>0?t:this.getClientHeight(A)};this.forgeImageView.ResetLayoutParams({x:n.x,y:n.y,width:n.width,height:n.height})}setTextureAttribute(A,e,t){let n=C.UnsupportedError;return"dataJsvImgColorSpace"==e||"data-jsv-img-color-space"==e?(this.imageInLoading&&console.log("Failed to set attribute "+e+", this attribute must be set before src"),this.imgAttrStore.dataJsvColorSpace=t,n=0):"dataJsvImgScaledownTex"==e||"data-jsv-img-scaledown-tex"==e?(this.imageInLoading&&console.log("Failed to set attribute "+e+", this attribute must be set before src"),this.imgAttrStore.dataJsvScaleDownTex=""==t||"true"==t,n=0):"data-jsv-img-poster-image"==e&&(this.imageInLoading&&console.log("Failed to set attribute "+e+", this attribute must be set before src"),this.imgAttrStore.dataJsvPosterImage="true"==t,n=0),n}loadImage(A,e){if(null==e)return;this.imgAttrStore.imageWidth=0,this.imgAttrStore.imageHeight=0;let t=0,n=0;1==this.imgAttrStore.dataJsvScaleDownTex&&(t=this.styleDelegate.width(),0==t&&console.error("set dataJsvScaleDownTex while style.width is not set"),n=this.styleDelegate.height(),0==n&&console.error("set dataJsvScaleDownTex while style.height is not set"));let i=A.GetTextureManager();this.forgeImageTexture=i.GetImage2(this.imgAttrStore.src,t,n,this.imgAttrStore.dataJsvColorSpace,null,!1,this.imgAttrStore.dataJsvPosterImage),this.imageInLoading=!0;let s,r=++this.loadCallbackSeq;this.imageOperatorKey=this.forgeImageTexture.RegisterLoadImageCallback(((e,t,n)=>{r==this.loadCallbackSeq&&(this.imgAttrStore.imageWidth=e,this.imgAttrStore.imageHeight=t,this.imageInLoading=!1,this.onFlushViewImage(A),this.sendEvent("load",[new ii(e),new ii(t)]))}));let o=this.styleDelegate.borderRadius(),a=this.styleDelegate.jsvImageBlendType();o&&(s=new li.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight)),this.forgeImageView.ResetTexture(this.forgeImageTexture,s,0==a)}getClientWidth(A){const e=super.getClientWidth(A);return e<=0&&this.imgAttrStore.imageWidth>0?this.imgAttrStore.imageWidth:e}getClientHeight(A){const e=super.getClientHeight(A);return e<=0&&this.imgAttrStore.imageHeight>0?this.imgAttrStore.imageHeight:e}setOpacity(A){this.forgeImageView.SetViewOpacity(A)}}fi.ImgAttrStore=class{constructor(){this.src=void 0,this.imageWidth=0,this.imageHeight=0,this.sizeApplied=!1,this.dataJsvColorSpace="RGBA_8888",this.dataJsvScaleDownTex=!1,this.dataJsvPosterImage=!1}};class wi extends di{onCssStyleChanged(A){return this.styleDelegate.getChangedStyleGroups().has(H.Layout.Name)&&this.onFlushViewHole(A),super.onCssStyleChanged(A)}constructor(A,e){super(A,e)}onFlushViewHole(A){this.forgeMainView.Element.style.backgroundColor="#222222"}}class pi{static SetForgeFrontToContext(A,e){A.forgeFront=e}static GetForgeFrontFromContext(A){return A.forgeFront}}class Ci{constructor(){this.elementDelegateMap=new Map,this.onEventListener=void 0,this.styleClassMgr=new ti.Manager}static GetInstance(A){const e=Ci.PlatformBridgeInstanceMap.get(A);if(e)return e;const t=new class extends Ci{};return t.jsviewId=A,Ci.PlatformBridgeInstanceMap.set(A,t),pi.SetForgeFrontToContext(t,new li),window.JsvCode.Debug||(window.JsvCode.Debug={}),window.JsvCode.Debug.PlatformBridge=[],window.JsvCode.Debug.PlatformBridge.push(t),t}static SetOnEventListener(...A){F(A.length>=2,null);const e=A[0],t=A[1],n=Ci.GetInstance(e);return n.onEventListener=new Ci.EventListener,n.onEventListener.jseFunction=t,null}static RunSyncTask(...A){m(A.length>=3,C.BadArgumentSize);const e=A[0],t=A[1],n=A[2],i=A,s=Ci.GetInstance(e),r=pi.GetForgeFrontFromContext(s);let o=new ii;U(s.runGetterTaskByType(r,t,n,i,o),null,["Failed to run sync task"]);return Ci.CastFromUnionValue(o)}static RunLazyTaskList(...A){F(A.length>=2,null);const e=A[0],t=A[1],n=JSON.parse(t),i=Ci.GetInstance(e),s=pi.GetForgeFrontFromContext(i),r=n,o=new Ci.TaskStash;for(const A of r){const e=A[0],t=A[1],n=A;if(o.removedIdSet.has(t))continue;let r=i.runSetterTaskByType(s,e,t,n,o);r==C.CssStyleNotChanged&&(r=0),U(r,null,["Failed to run lazy task"])}for(const A of o.removedIdSet)o.cssClassChangedIdSet.delete(A),o.cssStyleChangedIdSet.delete(A),o.postprocessingIdSet.delete(A);const a=i.syncCssClasses(o.cssClassChangedIdSet,o.cssStyleChangedIdSet);o.cssClassChangedIdSet.clear(),U(a,null);for(const A of o.cssStyleChangedIdSet){i.getElementById(A).onCssStyleChanged(s)}o.cssStyleChangedIdSet.clear();for(const A of o.postprocessingIdSet){i.getElementById(A).onAllChangeFinished(s)}return o.postprocessingIdSet.clear(),null}static CastFromUnionValue(A){let e;return A.is(ii.DataType.String)||A.is(ii.DataType.Int32)||A.is(ii.DataType.Float)?e=A.get():A.is(ii.DataType.Null)?e=null:F(!1,null),e}static AppendToJsonObject(A,e,t){let n,i;if(n=e,t.is(S.DataType.String)){const A=t.get();A&&(i=A)}else if(t.is(S.DataType.Int32)){i=t.get()}else if(t.is(S.DataType.Float)){i=t.get()}else t.is(S.DataType.Null)||Q(C.CssStyleBadType);return A[n]=i,0}getElementById(A){let e=null;const t=this.elementDelegateMap.get(A);return null!=t&&(e=t),F(e,null),e}forgeElementGetter(A){let e=null;const t=this.elementDelegateMap.get(A);return null!=t&&(e=t),e}syncCssClasses(A,e){for(const t of A){const n=this.getElementById(t),i=[];this.syncCssClassesRecursive(n,i,A,e)}return this.styleClassMgr.clearStyleClassCache(),0}syncCssClassesRecursive(A,e,t,n){let i=new Set;A.styleDelegate.updateClassDeclarations(e,i);for(const A of i)n.add(A)}runSetterTaskByType(A,e,t,n,i){let s=C.BadTaskType;switch(e){case Ci.TaskType.CreateElement:s=this.createElement(A,t,n);break;case Ci.TaskType.BindElementToRootView:s=this.bindElementToRootView(A,t,n);break;case Ci.TaskType.InsertElementChild:s=this.insertElementChild(A,t,n);break;case Ci.TaskType.RemoveElementChild:s=this.removeElementChild(A,t,n,i);break;case Ci.TaskType.MoveElementChild:s=this.moveElementChild(A,t,n);break;case Ci.TaskType.ReOrderElementChild:s=this.reOrderElementChild(A,t,n);break;case Ci.TaskType.AddElementEventListener:s=this.addElementEventListener(A,t,n,i);break;case Ci.TaskType.RemoveElementEventListener:s=this.removeElementEventListener(A,t,n);break;case Ci.TaskType.SetElementText:s=this.setElementText(A,t,n,i);break;case Ci.TaskType.SetElementAttribute:s=this.setElementAttribute(A,t,n,i);break;case Ci.TaskType.SetForgeViewInnerProps:s=this.setForgeViewInnerProps(A,t,n);break;case Ci.TaskType.InsertKeyFrameDefine:s=this.insertKeyFrame(A,t,n);break;case Ci.TaskType.RemoveKeyFrameDefine:s=this.removeKeyFrame(A,t,n);break;case Ci.TaskType.DeclareStyleSheets:s=this.declareStyleSheets(A,t,n);break;case Ci.TaskType.UndeclareStyleSheets:s=this.undeclareStyleSheets(A,t,n);break;case Ci.TaskType.SetStyleProperty:s=this.setStyleProperty(A,t,n,i)}return Q(s),0}runGetterTaskByType(A,e,t,n,i){let s=C.BadTaskType;switch(e){case Ci.TaskType.GetElementBoundingClientStyles:s=this.getElementBoundingClientStyles(A,t,n,i);case Ci.TaskType.GetStyleProperties:s=this.getStyleProperties(A,t,n,i);break;case Ci.TaskType.GetElementAttribute:s=this.getElementAttributes(A,t,n,i);break;case Ci.TaskType.GetRelativePosition:s=this.getRelativePosition(A,t,n,i)}return Q(s),0}createElement(A,e,t){const n=t;m(n.length>=3,C.BadArgumentSize);const i=n[2];let s;return s="AUDIO"==i?hi.MakeShared(A,e,this.styleClassMgr,Bi):"DIV"==i?hi.MakeShared(A,e,this.styleClassMgr,gi):"IMG"==i?hi.MakeShared(A,e,this.styleClassMgr,fi):"VIDEO"==i?hi.MakeShared(A,e,this.styleClassMgr,wi):hi.MakeShared(A,e,this.styleClassMgr,hi),this.elementDelegateMap.set(e,s),0}bindElementToRootView(A,e,t){m(t.length>=2,C.BadArgumentSize);return this.getElementById(e).bindToForgeRootView(A),0}insertElementChild(A,e,t){const n=t;m(n.length>=3,C.BadArgumentSize);const i=n[2],s=n.length>=4&&n[3]?n[3]:-1,r=this.getElementById(e),o=this.getElementById(i),a=s>0?this.getElementById(s):void 0;return r.insertForgeView(A,o,a),0}removeElementChild(A,e,t,n){const i=t;m(i.length>=3,C.BadArgumentSize);const s=i[2],r=this.getElementById(e),o=this.getElementById(s),a=(A,e,t)=>{for(const n of A.childNodes)a(n,e,t);A.styleDelegate.finalize(),e.add(A.nativeId),t.delete(A.nativeId)};return a(o,n.removedIdSet,this.elementDelegateMap),r.removeForgeView(A,o),0}moveElementChild(A,e,t){const n=t;m(n.length>=4,C.BadArgumentSize);const i=n[2],s=n[3],r=n.length>=5&&n[4]?n[4]:-1,o=this.getElementById(e),a=this.getElementById(i),l=this.getElementById(s),c=r>0?this.getElementById(r):void 0;return o.moveForgeView(A,a,l,c),0}reOrderElementChild(A,e,t){const n=t;m(n.length>=3,C.BadArgumentSize);const i=n[2],s=n.length>=4&&n[3]?n[3]:-1,r=this.getElementById(e),o=this.getElementById(i),a=s>0?this.getElementById(s):void 0;return r.reOrderForgeView(A,o,a),0}addElementEventListener(A,e,t,n){const i=t;m(i.length>=4,C.BadArgumentSize);const s=i[2],r=new Map;if("object"==typeof i[3]&&null!==i[3]){const A=i[3];for(const[e,t]of Object.entries(A))m("number"==typeof t,C.InvalidArgument),r.set(e,t)}const o=this.getElementById(e).addEventListener(s,((A,e,t)=>{y(Ci.GetInstance(A).onEventListener),setTimeout(e.bind(this,A,t),0)}).bind(this,this.jsviewId,((A,e)=>{const t=Ci.GetInstance(A);if(null==t.onEventListener)return;const n=t.onEventListener.jseFunction;let i=[];for(const A of e){const e=Ci.CastFromUnionValue(A);i.push(e)}n(...i)})),r);return Q(o),o==hi.State.NeedCallPostProcess&&n.postprocessingIdSet.add(e),0}removeElementEventListener(A,e,t){const n=t;m(n.length>=4,C.BadArgumentSize);const i=n[2],s=new Map;if("object"==typeof n[3]&&null!==n[3]){const A=n[3];for(const[e,t]of Object.entries(A))m("number"==typeof t,C.InvalidArgument),s.set(e,t)}return this.getElementById(e).removeEventListener(i,s),0}setElementText(A,e,t,n){const i=t;m(i.length>=3,C.BadArgumentSize);const s=i[2],r=this.getElementById(e),o=r instanceof gi?r:null;return m(o,C.BadElementType),o.setTextContent(s),o.styleDelegate.addChangedStyleGroup(H.Text.Name),n.cssStyleChangedIdSet.add(o.nativeId),0}setElementAttribute(A,e,t,n){const i=t;m(i.length>=4,C.BadArgumentSize);const s=i[2],r=i[3],o=this.getElementById(e);let a=o.setAttribute(A,s,r);if(Q(a),a==hi.State.NeedRefreshCssClass)n.cssClassChangedIdSet.add(e);else if(a==hi.State.NeedRefreshCssClassAttribute){n.cssClassChangedIdSet.add(e);const A=new Set;a=o.getExtendClassAttributeChildren(A),Q(a);for(const e of A)n.cssClassChangedIdSet.add(e.nativeId)}else a==hi.State.NeedCallPostProcess&&n.postprocessingIdSet.add(e);return 0}getElementBoundingClientStyles(A,e,t,n){const i=t;m(i.length>=4,C.BadArgumentSize);const s=i[3];m(s,C.InvalidElement);const r=JSON.parse(s),o=this.getElementById(e),a=o.styleDelegate,l={},c=r;for(const A of c){const e=A,t=x.ToConst(e);m(t,C.CssStyleBadName);let n=new S;if(t==x.Layout.Left){let A=a.left(),e=o.parentNode;for(;null!=e;){A+=e.styleDelegate.left(),e=e.parentNode}n=new S(A)}else if(t==x.Layout.Top){let A=a.top(),e=o.parentNode;for(;null!=e;){A+=e.styleDelegate.top(),e=e.parentNode}n=new S(A)}else{let A=a.getProperty(t,n);m(A>=0||C.CssStyleNotExists,A,["Failed to get style ",t])}Q(Ci.AppendToJsonObject(l,t,n))}const h=JSON.stringify(l),u=new ii(h);return n.reset(u),0}declareStyleSheets(A,e,t){const n=t;m(n.length>=2,C.BadArgumentSize);const i=n[2];return Q(this.styleClassMgr.declareStyleSheets(i)),0}undeclareStyleSheets(A,e,t){const n=t;m(n.length>=2,C.BadArgumentSize);const i=n[2];return Q(this.styleClassMgr.undeclareStyleSheets(i)),0}setStyleProperty(A,e,t,n){const i=t;m(i.length>=3,C.BadArgumentSize);const s=i[2],r=i.length>=4?i[3]:null,o=this.getElementById(e).styleDelegate,a=ti.CastToStyleValue(r);let l=new Set;const c=o.setProperty(s,a,l);if(c==C.CssStyleNotChanged)return 0;Q(c,["Failed to set style ",s]);for(const A of l)n.cssStyleChangedIdSet.add(A);return 0}getStyleProperties(A,e,t,n){const i=t;m(i.length>=4,C.BadArgumentSize);const s=i[3];m(s,C.InvalidElement);const r=JSON.parse(s),o=this.getElementById(e).styleDelegate,a={},l=r;for(const A of l){const e=A,t=x.ToConst(e);m(t,C.CssStyleBadName);const n=new S;let i=o.getProperty(t,n);m(i>=0||C.CssStyleNotExists,i,["Failed to get style ",t]),i=Ci.AppendToJsonObject(a,t,n),Q(i)}const c=JSON.stringify(a),h=new ii(c);return n.reset(h),0}getElementAttributes(A,e,t,n){const i=t;m(i.length>=3,C.BadArgumentSize);const s=i[3],r=this.getElementById(e);if("clientWidth"==s){const e=new ii(r.getClientWidth(A));n.reset(e)}else if("clientHeight"==s){const e=new ii(r.getClientHeight(A));n.reset(e)}return 0}getRelativePosition(A,e,t,n){const i=t;m(i.length>=3,C.BadArgumentSize);const s=i[3],r=this.getElementById(e),o=this.getElementById(s);let a=0,l=0,c=r.getClientWidth(A),h=r.getClientHeight(A),u=r;for(;null!=u&&u!=o;)a+=u.styleDelegate.left(),l+=u.styleDelegate.top(),u=u.parentNode;const g=new ii(JSON.stringify({left:a,top:l,width:c,height:h}));return n.reset(g),0}setForgeViewInnerProps(A,e,t){const n=t;m(n.length>=5,C.BadArgumentSize);const i=n[2],s=n[3],r=n[4];return this.getElementById(e).setForgeViewInnerProps(A,i,s,r)}insertKeyFrame(A,e,t){const n=t;m(n.length>=4,C.BadArgumentSize);const i=n[2],s=n[3];return this.styleClassMgr.insertKeyFrame(i,s),0}removeKeyFrame(A,e,t){const n=t;m(n.length>=3,C.BadArgumentSize);const i=n[2];return this.styleClassMgr.removeKeyFrame(i),0}}Ci.TaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42},Ci.TaskStash=class{constructor(){this.removedIdSet=new Set,this.cssClassChangedIdSet=new Set,this.cssStyleChangedIdSet=new Set,this.postprocessingIdSet=new Set}},Ci.EventListener=class{constructor(){this.jseContext=null}},Ci.JsViewId=1,Ci.PlatformBridgeInstanceMap=new Map,Ci.RegisterOriginDocument=function(A){console.log("RegisterOriginDocument in"),li.InitRenderDocument(A),window.originDocument=A},window.JsvCode.BrowserPlatformDomBridge=Ci,w.LogF=function(A){},w.LogE=function(A){},w.LogW=function(A){},w.LogI=function(A){},w.LogD=function(A){},w.LogM=function(A){},w.ThrowError=function(A){throw new Error(A)},w.Assert=function(A){if(!A)throw new Error("ASSERT!!!!!")},w.EnableLog=function(A){w.LogM=console.log.bind(console),A>0&&(w.LogF=console.error.bind(console)),A>1&&(w.LogE=console.error.bind(console)),A>2&&(w.LogW=console.warn.bind(console)),A>3&&(w.LogI=console.log.bind(console)),A>4&&(w.LogD=console.debug.bind(console))},w.EnableLog(4),w.BaseActivity=class{constructor(){this._RootPageBase=new w.PageBase("rootPageBase"),w.SetRootPageBase(this._RootPageBase)}GetRootPageBase(){return this._RootPageBase}},console.log("Log debug replace Forge.BaseActivity");{class Li{constructor(A,e,t){this.PageName=A,this._FocusChild=null,this._LatestFocusChild=null,this.SubPages=[],this._ParentPage=null,this._ConsumeKeycodeUntilUp=-1,this.TouchDispatcher=null,this._Acc=.001,this._KeyLock=!1,this._CVSet=null,this._AutoShow=!1,this._IsShowing=!1,this._HostActivity=t,e&&this.SetContentView(e)}OnRenderFrame(){w.LogE("OnRenderFrame() MUST override")}OnKeyDown(A){return!1}OnKeyUp(A){return!1}DispatchKeyDown(A){if(this._KeyLock)return!0;var e=!1;return Li.sLastFocusPage=this,this._FocusChild&&(e=this._FocusChild.DispatchKeyDown(A)),e||(e=this.OnKeyDown(A)),e}OnCustomEvent(A){return!1}BubbleCustomEvent(A){this.OnCustomEvent(A)||this._ParentPage&&this._ParentPage.BubbleCustomEvent(A)}DispatchKeyUp(A){if(this._KeyLock)return!0;var e=!1;return this._FocusChild&&(e=this._FocusChild.DispatchKeyUp(A)),e||(e=this.OnKeyUp(A)),e}PrintLastFocusPage(){var A="------"+this.PageName+"\n",e=this._ParentPage;return e&&(A+=e.PrintLastFocusPage()),A}OnMouseDown(A){return!1}EnableTouchDispatcher(){this.TouchDispatcher=new w.TouchDispatcher(this)}DisableTouchDispatcher(){this.TouchDispatcher=null}GetTouchView(){return null}GetSwipeParams(A,e,t){var n=void 0===t||0==t?this._Acc:t,i=A*A/2/n;A<0&&(i=-i);var s=e*e/2/n;return e<0&&(s=-s),{durationX:Math.floor(Math.abs(A/n)),durationY:Math.floor(Math.abs(e/n)),distanceX:i,distanceY:s}}OnTouch(A){return!1}DispatchTouch(A){var e=!1;return this.TouchDispatcher&&(e=this.TouchDispatcher.OnTouch(A)),e}LostTouchFocus(A){}OnJavaKey(A,e){return!0}OnPlatformKey(A,e){return!0}PassPlatformKey(A,e){if(this._KeyLock)return!1;var t=this.OnPlatformKey(A,e);return t&&(t=this.OnJavaKey(A,e)),t}DispatchJavaKey(A,e){if(A==this._ConsumeKeycodeUntilUp)return 1==e&&(this._ConsumeKeycodeUntilUp=-1),w.LogM("Consume Javakey until up keycode="+A+" keyaction="+e),!1;if(this._KeyLock)return!1;-1!=this._ConsumeKeycodeUntilUp&&(w.LogE("ERROR: Other key pressed before locked key release"),this._ConsumeKeycodeUntilUp=-1);var t=this._FocusChild,n=!0;return t&&(n=t.DispatchJavaKey(A,e)),n&&(n=this.PassPlatformKey(A,e)),t!=this._FocusChild&&0==e&&this.CosumeAllKeyUnitlUpForFocusChange(A),n}CosumeAllKeyUnitlUpForFocusChange(A){this._ParentPage?this._ParentPage.CosumeAllKeyUnitlUpForFocusChange(A):this._ConsumeKeycodeUntilUp=A}OnHostActivityGetFocus(){this._ConsumeKeycodeUntilUp=-1}IsFocus(){return!this._ParentPage||this._ParentPage._FocusChild==this}_IsLeafInChain(){return this.IsFocus()&&!this._FocusChild}SetParent(A,e){null!=A?(null!=e&&this.SetContentView(e),A instanceof w.BaseActivity&&(A=A.GetRootPageBase()),this._ParentPage=A,A.SubPages.push(this),this._HostActivity=A._HostActivity,A._IsShowing&&this._AutoShow&&this._OnShowInternal()):w.ThrowError("ERROR: parent is null")}SetParentPage(A){this.SetParent(A)}OnRemoveFromTree(){if(this._ParentPage=null,this.SubPages&&this.SubPages.length>0){for(let A of this.SubPages)A.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(A){A==this._FocusChild&&(this._FocusChild=null),A==this._LatestFocusChild&&(this._LatestFocusChild=null);for(var e=0;e<this.SubPages.length;e++)if(A==this.SubPages[e]){A._OnHideInternal(),this.SubPages.splice(e,1);break}}ClearSubPages(){this.SubPages=[],this._FocusChild=null,this._LatestFocusChild=null}GetParentPage(){return this._ParentPage}Focus(A){if(this.IsFocus()){if(!A)return void w.LogI("requestFocus(): Already focused name="+this.PageName);if(this._IsLeafInChain())return void w.LogI("requestFocus(): Already focused name="+this.PageName)}if(Li.sChangingFocusLock)return void Li.sDelayedFocusChanges.push(this);if(Li.sChangingFocusLock=!0,this._ParentPage){for(var e,t=[],n=this;n._ParentPage&&!n.IsFocus();)t.push(n),n=n._ParentPage;e=A&&0==t.length?this._FocusChild:t[t.length-1]._ParentPage._FocusChild;for(var i=[];e;)i.push(e),e=e._FocusChild;for(var s=i.length-1;s>=0;s--)i[s]._BlurInternal();for(s=t.length-1;s>=0;s--)t[s]._FocusInternal();if(A)this._LatestFocusChild=null;else for(var r=t[0];r._LatestFocusChild&&null==r._FocusChild;)r._LatestFocusChild._FocusInternal(),(r=r._FocusChild)||w.ThrowError("ERROR: focus chain is broken")}Li.sChangingFocusLock=!1;let o=Li.sDelayedFocusChanges.length;if(o>0){let A=Li.sDelayedFocusChanges;Li.sDelayedFocusChanges=[];for(let e=0;e<o;e++)A[e].Focus()}}ReturnFocusToParent(){this._ParentPage&&(this.IsFocus()&&this._ParentPage.Focus(!0),this._ParentPage._FocusChild==this&&(this._ParentPage._FocusChild=null),this._ParentPage._LatestFocusChild==this&&(this._ParentPage._LatestFocusChild=null))}_FocusInternal(){this._ParentPage?(this._ParentPage._FocusChild=this,this._ParentPage._LatestFocusChild=this,this.OnFocus()):w.LogE("No dispatcher")}_BlurInternal(){this._ParentPage||w.LogE("No dispacher"),this._ParentPage._FocusChild==this?(this._ParentPage._FocusChild=null,this.OnBlur()):w.LogW("Not focus yet, page name="+this.PageName)}GetFocusChild(){return this._FocusChild}Hide(){this._AutoShow=!1,this._OnHideInternal()}Show(A){this._OnShowInternal(),A&&this.Focus()}OnFocus(){w.LogW("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){w.LogW("No overrided Page OnBlur event, page name="+this.PageName)}OnShow(){w.LogW("No overrided Page OnShow event, page name="+this.PageName)}OnHide(){w.LogW("No overrided Page OnHide event, page name="+this.PageName)}_OnShowInternal(){for(var A,e=0;e<this.SubPages.length;e++)(A=this.SubPages[e])._AutoShow&&A._OnShowInternal();this._IsShowing||(this._IsShowing=!0,this.OnShow())}_OnHideInternal(){for(var A,e=0;e<this.SubPages.length;e++)(A=this.SubPages[e])._IsShowing&&A._OnHideInternal();this._IsShowing&&(this._IsShowing=!1,this.OnHide())}GetMainView(){return null==this._CVSet&&(this._CVSet=new w.MainViewSetting(null,null)),this._CVSet}GetContentView(){return null==this._CVSet?null:this._CVSet.View}SetContentView(A){null!=A&&(null!=this._CVSet&&this._CVSet.View.BindedPageBase(null),this._CVSet=new w.MainViewSetting(A,null),A.BindedPageBase(this))}OnContentViewLostInternal(){this.OnContentViewLost()}OnContentViewLost(){}GetHostActivity(){return this._HostActivity}SetHostActivity(A){this._HostActivity=A}GetTextureManager(){return null!=this._HostActivity?this._HostActivity.GetTextureManager():null}SetAutoShow(A){this._AutoShow=A}KeyLock(){this._KeyLock=!0}UnKeyLock(){this._KeyLock=!1}}Li.sLastFocusPage=null,Li.sChangingFocusLock=!1,Li.sDelayedFocusChanges=[],w.PageBase=Li}w.RectArea=oA,w.sParticleManager=ce(),w.AnimationListener=it,w.TranslateAnimation=at,w.TranslateFrameAnimation=class extends at{constructor(A,e,t,n,i,s){let r=i,o=s,a=i,l=s;n?(r=A,a=e):(o=A,l=e);super(r,a,o,l,Math.abs(Math.floor((e-A)/t*1e3)),null)}},w.TextureSetting=wn,w.ExternalTextureSetting=pn,w.DragInfo=void 0,w.DragSetting=void 0;let mi=pA();w.sRenderBridge=mi;{let Hi=[];function _i(){if(Hi.length>0){for(let A of Hi)A.DoAttachToElement();Hi=[]}}mi.AddAfterSwapListener("NewDomView",(()=>{_i()}));class ki extends En{constructor(A,e){super(null,"jsv-element-proxy"),this.ProxiedView=null,this._DomNativeId=A,this._UseMaskView=e,this.DelayedCalls=[],this._OnReadyCallbacks=[],Hi.push(this)}DoAttachToElement(){let A=w.DomElementGetter?.(this._DomNativeId);if(A){this.ProxiedView=A?.getElementView(this._UseMaskView),this.InvokeDelayCalls();for(const A of this._OnReadyCallbacks)A();this._OnReadyCallbacks=null}else console.log("domProxyView: attached element removed id="+this._DomNativeId)}RegisterOnProxyReady(A){this.ProxiedView?A():"function"==typeof A&&this._OnReadyCallbacks.push(A)}PushDelayCalls(A,e){this.DelayedCalls.push({name:A,args:e})}InvokeDelayCalls(){if(this.DelayedCalls.length>0)for(let A of this.DelayedCalls)this.ProxiedView[A.name].apply(this.ProxiedView,A.args)}HtmlCanAccessElement(){return null!=this.ProxiedView}}function Pi(A,e){let t=new ki(A,e);return new Proxy(t,{get(A,e){if("string"!=typeof e||e.startsWith("_"))return A[e];if(null!=A.ProxiedView)return void 0!==A.ProxiedView[e]?"function"==typeof A.ProxiedView[e]?A.ProxiedView[e].bind(A.ProxiedView):A.ProxiedView[e]:Reflect.get(A,e);if("function"==typeof A[e]){if("RegisterOnProxyReady"===e)return A[e].bind(A);{let t=A;return(...A)=>{t.PushDelayCalls(e,A),w.sRenderBridge.RequestSwap()}}}console.warn(`proxy not ready to get prop(${e})`)},set(A,e){console.warn("no support set prop")}})}w.NewDomProxyView=Pi}w.LayoutView=class extends En{ResetTexture(A){A?super.ResetTexture(A.Texture,A.MaskSetting?.ImageTexture):super.ResetTexture(null)}AddView(A,e){let t=0,n=0,i=0,s=0;e&&(e instanceof w.LayoutParams?(t=e.MarginLeft,n=e.MarginTop,i=e.Width,s=e.Height):(t=isNaN(e.x)?0:e.x,n=isNaN(e.y)?0:e.y,i=isNaN(e.width)?0:e.width,s=isNaN(e.height)?0:e.height)),super.AddView(A,t,n,i,s)}},w.FilterView=xn,w.EditControlView=vn,w.DragSetting=void 0,w.DragInfo=void 0;w.TextureManager=class extends Ot{RegisterLoadImageCallback(A,e,t){return super.RegisterLoadImageCallback(((A,n)=>{e({width:A,height:n},t)}))}},w.sViewStore=yA(),w.ViewInfo=FA,w.ViewMask=Cn,w.ViewTextureMask=mn,w.ViewRoundCornerMask=Fn;{class Di{constructor(A,e){this.OnBeginContact=A,this.OnEndContact=e}UpdateImpactCallback(A){this.OnBeginContact=A}UpdateLeaveCallback(A){this.OnEndContact=A}}w.sImpactSensorManager={StartTrace:(A,e,t,n)=>new bn(A,e,t,n),Callback:Di,AutoFroze:Ln}}w.ImpactAutoFroze=Ln,w.ImpactSensor=bn,w.VisibleSensor=Rn,w.TextInputType=Sn;const Fi=window.ForgeFront,yi=Object.keys(Fi);for(let Ri of yi)Ri in w||(w[Ri]=Fi[Ri]);export{w as default};
2
23