@shijiu/jsview 2.3.151-test.0 → 2.3.728-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/bin/jsview-dom-browser-engine-core.min.js +1 -1
- package/dom/bin/jsview-dom-browser-engine-modules.min.js +1 -1
- package/dom/bin/{jsview-dom-browser-forge.1493.9a36.wasm → jsview-dom-browser-forge.1798.9ed7.wasm} +0 -0
- package/dom/bin/jsview-dom-browser-forge.min.js +1 -1
- package/dom/bin/jsview-dom-browser-forge.worker.min.js +1 -1
- package/dom/bin/jsview-dom-browser.min.js +1 -1
- package/dom/bin/jsview-dom-native.min.js +1 -1
- package/dom/bin/jsview-engine-js-browser.min.js +1 -1
- package/dom/bin/jsview-engine-js-native.min.js +1 -1
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/target_core_revision.mjs +2 -2
- package/loader/jsv-core-api/jsview-core-api-glue.js +12 -1
- package/loader/jsv-core-api/wasm/core-api.js +95 -2
- package/loader/jsv-core-api/wasm/wasm-extension.js +5 -0
- package/loader/jsview-loader.js +10 -3
- package/loader/jsview-main.mjs +1 -0
- package/loader/jsview.config.default.js +4 -0
- package/package.json +1 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +6 -2
- package/tools/jsview-build-zip.mjs +7 -2
- package/tools/jsview-common.mjs +9 -1
- package/tools/jsview-post-build.mjs +55 -0
- package/tools/jsview-post-install.mjs +5 -4
- package/tools/jsview-run-tool.mjs +3 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ class e{static CreateAudioPlayer(e){return new Audio(e)}static CreateVideoPlayer(){const t=new Video;return t.jsvOnCssStyleChanged=e.OnCssStyleChanged.bind(t),t.jsvFinalize=e.JsvFinalize.bind(t),t}static OnCssStyleChanged(e,t){this.jsvSetStyles(t.left,t.top,t.width,t.height,t.objectFit,t.visibility)}static JsvFinalize(){console.log("NativePlatformMediaBridge.JsvFinalize()");const e=this;e.pause(),e.unload?.(),e.releaseResource&&(e.releaseResource(),e.onPlatformDestroy())}}window.JsvCode.NativePlatformMediaBridge||(window.JsvCode.NativePlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var n,o,r,a,l,c,h,u,d,v,g,f,m,p,y,w=window.Forge;window.JsvCoreApi.setForgeJsHandle(w);class T{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){T.PushLazyTask(T.TaskType.CreateElement,e,t)}static BindElementToRootView(e){T.PushLazyTask(T.TaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){T.PushLazyTask(T.TaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){T.PushLazyTask(T.TaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){T.PushLazyTask(T.TaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){T.PushLazyTask(T.TaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){T.PushLazyTask(T.TaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){T.PushLazyTask(T.TaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){T.PushLazyTask(T.TaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){T.PushLazyTask(T.TaskType.SetElementAttribute,e,t,s),T.LazyTaskSyncedListenerMap.has(e)&&T.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return T.RunSyncTask(T.TaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")?(i=1,t=t.substr(5)):t.startsWith("mmask")&&(i=2,t=t.substr(6)),T.PushLazyTask(T.TaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){T.PushLazyTask(T.TaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){T.PushLazyTask(T.TaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){T.PushLazyTask(T.TaskType.SetStyleProperty,e,t,s),T.LazyTaskSyncedListenerMap.has(e)&&T.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return T.RunSyncTask(T.TaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){T.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){T.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==T.CachedLazyTaskList.length)return;const e=JSON.stringify(T.CachedLazyTaskList);T.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e),T.CachedLazyTaskAmount=0;for(const e of T.CachedSyncListenIdSet){const t=T.LazyTaskSyncedListenerMap.get(e);t?.()}T.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return T.RunSyncTask(T.TaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){T.PushLazyTask(T.TaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){T.PushLazyTask(T.TaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=T.RunSyncTask(T.TaskType.GetRelativePosition,e,t);return JSON.parse(s)}static SearchNextFocus(e,t){return T.RunSyncTask(T.TaskType.SearchNextFocus,e,t)}static GetLazyTaskAmount(){return 0}static RunSyncTask(e,t,...s){T.RequestSwapAllCachedTasks();const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){let i=1;e==T.TaskType.SetStyleProperty?i=2:e==T.TaskType.DeclareStyleSheets&&(i=3),T.CachedLazyTaskAmount+=i,T.CachedLazyTaskList.push([e,t,...s]),w.sRenderBridge?.RequestSwap()}}T.CachedLazyTaskAmount=0,T.CachedLazyTaskList=new Array,T.CachedSyncListenIdSet=new Set,T.LazyTaskSyncedListenerMap=new Map,T.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,SearchNextFocus:23,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class N{}N.Dom=T,N.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class D{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}D.UniqueId=0,D.MaxUniqueId=Math.pow(2,31)-1;class C{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function S(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}C.ELEMENT_NODE=1,C.TEXT_NODE=3,C.COMMENT_NODE=8,C.DOCUMENT_NODE=9,C.NOLAYOUT_NODE=10;class F{static HasGetterMethod(e){switch(e){case F.Layout.Height:case F.Layout.Left:case F.Layout.Top:case F.Layout.Width:case F.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==F.Layout.Height?F.Layout.Height:e==F.Layout.Left?F.Layout.Left:e==F.Layout.Top?F.Layout.Top:e==F.Layout.Width?F.Layout.Width:e==F.Flex.FlexDirection?F.Flex.FlexDirection:e==F.Flex.FlexWrap?F.Flex.FlexWrap:e==F.Flex.JustifyContent?F.Flex.JustifyContent:e==F.Flex.AlignItems?F.Flex.AlignItems:e==F.Flex.AlignContent?F.Flex.AlignContent:e==F.Flex.AlignSelf?F.Flex.AlignSelf:e==F.Flex.FlexGrow?F.Flex.FlexGrow:e==F.Background.BackgroundColor?F.Background.BackgroundColor:e==F.Background.BackgroundImage?F.Background.BackgroundImage:e==F.Background.BorderRadius?F.Background.BorderRadius:e==F.Background.JsvImageBlendType?F.Background.JsvImageBlendType:e==F.Effect.BackfaceVisibility?F.Effect.BackfaceVisibility:e==F.Effect.BorderImage?F.Effect.BorderImage:e==F.Effect.BorderImageWidth?F.Effect.BorderImageWidth:e==F.Effect.BorderImageOutset?F.Effect.BorderImageOutset:e==F.Effect.Display?F.Effect.Display:e==F.Effect.ObjectFit?F.Effect.ObjectFit:e==F.Effect.Opacity?F.Effect.Opacity:e==F.Effect.Overflow?F.Effect.Overflow:e==F.Effect.Perspective?F.Effect.Perspective:e==F.Effect.PerspectiveOrigin?F.Effect.PerspectiveOrigin:e==F.Effect.Transform?F.Effect.Transform:e==F.Effect.TransformOrigin?F.Effect.TransformOrigin:e==F.Effect.TransformStyle?F.Effect.TransformStyle:e==F.Effect.Visibility?F.Effect.Visibility:e==F.Effect.ZIndex?F.Effect.ZIndex:e==F.Text.Color?F.Text.Color:e==F.Text.FontFamily?F.Text.FontFamily:e==F.Text.FontSize?F.Text.FontSize:e==F.Text.FontStyle?F.Text.FontStyle:e==F.Text.FontWeight?F.Text.FontWeight:e==F.Text.LineHeight?F.Text.LineHeight:e==F.Text.TextAlign?F.Text.TextAlign:e==F.Text.TextOverflow?F.Text.TextOverflow:e==F.Text.TextShadow?F.Text.TextShadow:e==F.Text.WebkitTextStroke?F.Text.WebkitTextStroke:e==F.Text.WhiteSpace?F.Text.WhiteSpace:e==F.Text.WordWrap?F.Text.WordWrap:e==F.Text.Direction?F.Text.Direction:e==F.Text.JsvTextEmoji?F.Text.JsvTextEmoji:e==F.Text.JsvTextLatex?F.Text.JsvTextLatex:e==F.Text.JsvTextAlignMinWidth?F.Text.JsvTextAlignMinWidth:e==F.Text.JsvTextVerticalAlign?F.Text.JsvTextVerticalAlign:e==F.Text.JsvTextLineAlign?F.Text.JsvTextLineAlign:e==F.Text.JsvTextInnerDirection?F.Text.JsvTextInnerDirection:e==F.Motion.Animation?F.Motion.Animation:e==F.Motion.Transition?F.Motion.Transition:e==F.Motion.AnimationFillMode?F.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}F.Layout=(S(n=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),n.Height="height",n.Left="left",n.Top="top",n.Width="width",n),F.Flex=(S(o=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),o.FlexDirection="flexDirection",o.FlexWrap="flexWrap",o.JustifyContent="justifyContent",o.AlignItems="alignItems",o.AlignContent="alignContent",o.AlignSelf="alignSelf",o.FlexGrow="flexGrow",o),F.Background=(S(r=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),r.BackgroundColor="backgroundColor",r.BackgroundImage="backgroundImage",r.BorderRadius="borderRadius",r.JsvImageBlendType="JsvImageBlendType",r),F.Effect=(S(a=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),a.BackfaceVisibility="backfaceVisibility",a.BorderImage="borderImage",a.BorderImageWidth="borderImageWidth",a.BorderImageOutset="borderImageOutset",a.Display="display",a.ObjectFit="objectFit",a.Opacity="opacity",a.Overflow="overflow",a.Perspective="perspective",a.PerspectiveOrigin="perspectiveOrigin",a.Transform="transform",a.TransformOrigin="transformOrigin",a.TransformStyle="transformStyle",a.Visibility="visibility",a.ZIndex="zIndex",a),F.Text=(S(l=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),l.Color="color",l.FontFamily="fontFamily",l.FontSize="fontSize",l.FontStyle="fontStyle",l.FontWeight="fontWeight",l.LineHeight="lineHeight",l.TextAlign="textAlign",l.TextOverflow="textOverflow",l.TextShadow="textShadow",l.WebkitTextStroke="WebkitTextStroke",l.WhiteSpace="whiteSpace",l.WordWrap="wordWrap",l.Direction="direction",l.JsvTextEmoji="JsvTextEmoji",l.JsvTextLatex="JsvTextLatex",l.JsvTextAlignMinWidth="JsvTextAlignMinWidth",l.JsvTextVerticalAlign="JsvTextVerticalAlign",l.JsvTextLineAlign="JsvTextLineAlign",l.JsvTextInnerDirection="JsvTextInnerDirection",l),F.Motion=(S(c=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),c.Animation="animation",c.Transition="transition",c.AnimationFillMode="animationFillMode",c);class E{constructor(e){let t=-1,s=null;null==e?t=E.DataType.Null:Number(e)===e&&e%1==0?t=E.DataType.Int32:Number(e)===e&&e%1!=0?t=E.DataType.Float:"string"==typeof e||e instanceof String?t=E.DataType.String:e instanceof E.AnimationImpl?t=E.DataType.Animation:e instanceof E.CornerImpl?t=E.DataType.Corner:e instanceof E.RectImpl?t=E.DataType.Rect:e instanceof E.TextShadowImpl?t=E.DataType.TextShadow:e instanceof E.WebkitTextStrokeImpl?t=E.DataType.WebkitTextStroke:e instanceof E.TransitionImpl?t=E.DataType.Transition:e instanceof E.BorderImageImpl&&(t=E.DataType.BorderImage),e!=E.InvalidInt32&&e!=E.InvalidFloat&&e!=E.InvalidPointer?s=e:(t=E.DataType.Null,s=null),this.data=new E.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case E.DataType.Null:return"";case E.DataType.Int32:case E.DataType.Float:return String(this.get());case E.DataType.String:e=this.get();break;case E.DataType.Animation:case E.DataType.Corner:case E.DataType.Rect:case E.DataType.TextShadow:case E.DataType.WebkitTextStroke:case E.DataType.Transition:case E.DataType.BorderImage:case E.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}}let x,I;E.Base=class{constructor(e){this.rawValue=e}},E.AnimationImpl=class extends E.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},E.CornerImpl=class extends E.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},E.RectImpl=class extends E.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},E.TextShadowImpl=class extends E.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},E.WebkitTextStrokeImpl=class extends E.Base{constructor(e){super(e),this.length=0,this.color=void 0}},E.TransitionImpl=class extends E.Base{constructor(e){super(e),this.animationMap=new Map}},E.BorderImageImpl=class extends E.Base{constructor(e){super(e),this.source="",this.slice=null}},E.BackgroundImageImpl=(S(h=class extends E.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),h.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},h.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},h),E.DataType=(S(u=class{},"DataType"),u.Null=0,u.Int32=1,u.Float=2,u.String=3,u.Animation=4,u.Corner=5,u.Rect=6,u.TextShadow=7,u.WebkitTextStroke=8,u.Transition=9,u.BorderImage=10,u.BackgroundImage=11,u),E.InvalidInt32=Number.MIN_VALUE,E.InvalidFloat=Number.NaN,E.InvalidPointer=null,E.DataInfo=class{constructor(){this.value=null,this.index=-1}},S(d=class{},"Text"),d.Color="#000000",d.FontFamily="黑体",d.FontSize=10,d.FontStyle="normal",d.FontWeight="normal",d.LineHeight=0,d.TextAlign="start",d.TextOverflow="clip",d.TextShadow=null,d.WebkitTextStroke=null,d.WhiteSpace="normal",d.WordWrap="normal",d.Direction="ltr",d.JsvTextEmoji=0,d.JsvTextLatex=0,d.JsvTextAlignMinWidth=0,d.JsvTextVerticalAlign="top",d.JsvTextLineAlign="middle",d.JsvTextInnerDirection="unset",S(v=class{constructor(){this.height=E.InvalidInt32,this.left=E.InvalidInt32,this.top=E.InvalidInt32,this.width=E.InvalidInt32}},"Layout"),v.Name="layout",S(g=class{constructor(){this.flexDirection=E.InvalidInt32,this.flexWrap=E.InvalidInt32,this.justifyContent=E.InvalidInt32,this.alignItems=E.InvalidInt32,this.alignContent=E.InvalidInt32,this.alignSelf=E.InvalidInt32,this.flexGrow=E.InvalidFloat}},"Flex"),g.Name="flex",S(f=class{constructor(){this.backgroundColor=E.InvalidPointer,this.backgroundImage=E.InvalidPointer,this.borderRadius=E.InvalidPointer,this.JsvImageBlendType=E.InvalidInt32}},"Background"),f.Name="background",S(m=class{constructor(){this.backfaceVisibility=E.InvalidPointer,this.borderImage=E.InvalidPointer,this.borderImageWidth=E.InvalidPointer,this.borderImageOutset=E.InvalidPointer,this.display=E.InvalidPointer,this.objectFit=E.InvalidPointer,this.opacity=E.InvalidFloat,this.overflow=E.InvalidPointer,this.perspective=E.InvalidInt32,this.perspectiveOrigin=E.InvalidPointer,this.transform=E.InvalidPointer,this.transformOrigin=E.InvalidPointer,this.transformStyle=E.InvalidPointer,this.visibility=E.InvalidPointer,this.zIndex=E.InvalidInt32}},"Effect"),m.Name="effect",S(p=class{constructor(){this.color=E.InvalidPointer,this.fontFamily=E.InvalidPointer,this.fontSize=E.InvalidInt32,this.fontStyle=E.InvalidPointer,this.fontWeight=E.InvalidPointer,this.lineHeight=E.InvalidInt32,this.textAlign=E.InvalidPointer,this.textOverflow=E.InvalidPointer,this.textShadow=E.InvalidPointer,this.webkitTextStroke=E.InvalidPointer,this.whiteSpace=E.InvalidPointer,this.wordWrap=E.InvalidPointer,this.direction=E.InvalidPointer,this.jsvTextEmoji=E.InvalidInt32,this.jsvTextLatex=E.InvalidInt32,this.jsvTextAlignMinWidth=E.InvalidInt32,this.jsvTextVerticalAlign=E.InvalidPointer,this.jsvTextLineAlign=E.InvalidPointer,this.jsvTextInnerDirection=E.InvalidPointer}},"Text"),p.Name="text",S(y=class{constructor(){this.animation=E.InvalidPointer,this.transition=E.InvalidPointer,this.animationFillMode="none"}},"Motion"),y.Name="motion",global.JsvURLClass?(x=global.JsvURLClass,I=()=>window.location.jsvGetLocation()):(x=window.URL,I=()=>window.location.href);class k{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")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let s=e.indexOf("://");if(!(s<0||s>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),(e.startsWith("/")||e.startsWith("./"))&&(e=new x(e,I()).href),this.href=e,!t)return;let i=this.href,n=i.indexOf("#");n>0&&(this.hash=i.substring(n),i=i.substring(0,n));let o=i.indexOf("?");o>1&&(this.search=i.substring(o),i=i.substring(0,o));let r=i,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let l=a>1?r.substring(a+3):"";a=l.indexOf("/"),this.host=a>0?l.substring(0,a):"",this.pathname=a>=1?l.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=l),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class b{static JsvDeclarePrototype(){for(let e in F){let t=F[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(b.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==F.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new k(t).href}else if(e==F.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new k(e[0]).href),t=e.join(" ")}else e==F.Effect.Display&&(this.cachedProps[e]=t);N.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==F.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=N.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class L extends t{constructor(e){super(e)}}var P;!function(e){e[e.Cancel=0]="Cancel",e[e.Click=1]="Click",e[e.LongPress=2]="LongPress",e[e.LongPressRelease=3]="LongPressRelease",e[e.touchFirstStart=4]="touchFirstStart",e[e.touchLastEnd=5]="touchLastEnd"}(P||(P={}));class R extends C{static JsvEnableEventListener(){N.Dom.EnableEventListener((function(e,t,...s){let i=R.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)}))}constructor(e){super(C.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=R.JsvTagName.Audio&&this.tagName!=R.JsvTagName.Div&&this.tagName!=R.JsvTagName.Image&&this.tagName!=R.JsvTagName.Video&&this.tagName!=R.JsvTagName.JsvFDiv||(this.jsvNativeId=D.GenerateId(),this.style=new b(this.jsvNativeId),N.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof R&&e.jsvNativeId>0&&N.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),N.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),N.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=N.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=N.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?N.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?N.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&N.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&N.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){console.warn("warn: focus is invalid, use JsvFocusBlock to manager")}jsvGetBoundingClientRect(){const e="jsv-getbound",t=D.GenerateId();return new Promise(((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})}))}jsvSetTapListener(e,t=0){let s=this.jsvGetProxyView(!0);if(!e)return s.DragEnables(0),void s.SetTapListener(null);e.onClick&&(t|=1),(e.onLongPress||e.onLongPressRelease)&&(t|=2),e.onTouchStart&&(t|=8),e.onTouchEnd&&(t|=16),s.DragEnables(t),s.SetTapListener(((t,s)=>{switch(t){case P.Cancel:e.onCancel?.(s);break;case P.LongPress:e.onLongPress?.(s);break;case P.LongPressRelease:e.onLongPressRelease?.(s);break;case P.Click:e.onClick?.(s);break;case P.touchFirstStart:e.onTouchStart?.(s);break;case P.touchLastEnd:e.onTouchEnd?.(s);break;default:console.error("Error:onTap unknown type:"+t)}}))}jsvSetOnLazyTaskSyncedListener(e){N.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new L(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"==e&&(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=w.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=w.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return N.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=R.JsvEventListenerMap.get(e);s||(s=new Map,R.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=R.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=R.JsvFindBackwardForgeView(s),N.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=R.JsvFindBackwardForgeView(t),N.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===C.TEXT_NODE?this.textContent=e.nodeValue:e instanceof R&&e.jsvNativeId>0&&(t=R.JsvFindBackwardForgeView(t),N.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof R!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),N.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),R.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof R);)t=t.nextSibling;return t}}R.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},R.JsvEventListenerMap=new Map;class M extends R{constructor(){super(R.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return R.JsvTagName.Anchor}}class _ extends C{constructor(e){super(C.COMMENT_NODE),this.textContent=e}}class j extends R{constructor(){super(R.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},N.Dom.SetElementText(this.jsvNativeId,e)}}const O="FocusDebug",B="__AppRoot__",A={PrintToken:1,DebugSwitch:!1,DebugNeedCallStack:!1,ChangingFocusLock:!1,DelayedFocusChanges:[]};function J(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==B?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==B?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}function W(e,t){let s=J(e);if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let e=t?.stack;t.stack=null,console.log(O,`focusChange(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusStack:${s}\n:trace:${e}:`,t)}else console.log(O,`focusChange:${s} but empty debugSaveInfo`)}class V{constructor(){this.listeners=[]}addListener(e){-1===this.listeners.indexOf(e)&&this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>-1&&this.listeners.splice(t,1)}notifyListeners(e){this.listeners.forEach((t=>t(e)))}}class G{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._FocusListenerManagerOnRequest=null,this._FocusListenerManagerOnFocus=null,this.IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(e=!1){if(null==this._FocusNodeName)return null;let t=this._ChildMap[this._FocusNodeName];if(!t)return e||console.error("Erorr: node not mounted name="+this._FocusNodeName),null;if(t.RouterDelegate.ref!=this){let e=t.RouterDelegate.ref.getCurrentFocusNode();return null==e?t:e}return t}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==B?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===B?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}addFocusChangeListener(e,t=!1){t?(this._FocusListenerManagerOnRequest||(this._FocusListenerManagerOnRequest=new V),this._FocusListenerManagerOnRequest.addListener(e)):(this._FocusListenerManagerOnFocus||(this._FocusListenerManagerOnFocus=new V),this._FocusListenerManagerOnFocus.addListener(e))}delFocusChangeListener(e,t=!1){t?this._FocusListenerManagerOnRequest&&this._FocusListenerManagerOnRequest.removeListener(e):this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.removeListener(e)}_FindRouterSearchBase(e,t){if(0==e[0].length){let t=null;for(let e in this._ChildMap){t=this._ChildMap[e];break}if(null!=t){let s;do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return null}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(null!=o&&o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found fname=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: FDiv name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: FDiv router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){if(A.DebugSwitch)if(null==s)console.error(O,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);else if(!s.originFStack){let e=this.getCurrentFocusNode(!0);s.originFStack="Mark1:",s.originFStack+=e?J(e):`NoFocus[focusSet:${this._FocusNodeName} notMountFocus:${this._FocusNameBeforeMount}]`}if(this._FocusListenerManagerOnRequest&&"string"==typeof e&&!e.includes(".")&&this._FocusListenerManagerOnRequest.notifyListeners(e),A.ChangingFocusLock){let i=this;return A.DelayedFocusChanges.push((()=>{i.focusBeforeMount(e,t,s)})),!0}A.ChangingFocusLock=!0;try{let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.notifyListeners(e),n.Focus(!t);let i=n.GetFocusChild();for(;i;){let e=i.GetFocusChild();if(!e){this._FocusNodeName=i.BranchName;break}i=e}return A.DebugSwitch&&W(i??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,A.DebugSwitch&&function(e,t){if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let s=t?.stack;t.stack=null,console.log(O,`focusChange(wait-mount)(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusName:${e}\n:trace:${s}:`,t)}else console.log(O,`focusChange(wait-mount):${e} but empty debugSaveInfo`)}(e,s),!1}console.error("error: name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}i||console.error("illegal name param",e)}finally{A.ChangingFocusLock=!1;let e=A.DelayedFocusChanges.length;if(e>0){let t=A.PrintToken++;A.DebugSwitch&&console.log(O,`stash onFocus pop start(token=${t}) len=${e}`);let s=A.DelayedFocusChanges;A.DelayedFocusChanges=[];for(let t=0;t<e;t++)s[t]();A.DebugSwitch&&console.log(O,`stash onFocus pop done(token=${t})`)}}return!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found branch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class K{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new G(!1,t))}enableFocusTrace(e){A.DebugSwitch=!0,A.DebugNeedCallStack=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==B?"":e}wrapWithNameSpace(e){let t=new K(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e,t){return this.RouterDelegate.ref.getNodeByName(e,t)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`);let s=null;A.DebugSwitch&&(s={askName:e,deepToChild:t,from:"setFocus",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null});return this.focusByNameBeforeMount(e,t,s)}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==B||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){if(w.PageBase.sLastFocus){let e=w.PageBase.sLastFocus;for(;e._LatestFocusChild;)e=e._LatestFocusChild;return e.BranchName}return null}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getCurrentFocusNode(){return this.RouterDelegate.ref?.getCurrentFocusNode()}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}addFocusChangeListener(e,t=!1){this.RouterDelegate.ref.addFocusChangeListener(e,t)}delFocusChangeListener(e,t=!1){this.RouterDelegate.ref.delFocusChangeListener(e,t)}}class U extends w.PageBase{constructor(e,t){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.NativeId=-1,this.BranchName=e,this.NativeId=t,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1,U.sFocusNodeMap.set(this.NativeId,this)}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise(((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)}))}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new K(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new G(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e;let s=this.GetParentPage();s&&s.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=U.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=U.safeCallback(e)}setOnFocus(e){this._OnFocus=U.safeCallback(e)}setOnBlur(e){this._OnBlur=U.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=U.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=U.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=U.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=U.safeCallback(e),this._DKeyUpProxy=U.safeCallback(t)}requestFocus(e){let t=null;A.DebugSwitch&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;A.DebugSwitch&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this.GetParentPage()._Mounted&&(this.updateMountState(),z()),e instanceof U)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref.IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach(((t,s)=>{e.routerAdd(s,t)}))}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return U.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(){this._OnFocus&&this._OnFocus()}OnBlur(){U.sLastFocus=this,this._OnBlur&&this._OnBlur()}onUnMount(e){U.sFocusNodeMap.delete(this.NativeId),U.sLastFocus==this&&(U.sLastFocus=null);let t=this.IsFocus();if(A.DebugSwitch&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:"Mark2:"+J(this)},W(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==B)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==B?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}U.sFocusMemos=[],U.sLastFocus=null,U.sRootPageNode=null,U.sFocusNodeMap=new Map;let z=()=>{let e=U.sFocusMemos.length;if(e>0){let t=U.sFocusMemos;U.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}};class H extends t{constructor(e){super(e),this.keyCode=-1,this.key=-1,this.repeat=0,this.keyCode=-1,this.key=-1,this.repeat=0}}H.KeyCode={Enter:13,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};let $={};class q{constructor(e,t,s){this._AutoSearchFocus=!1,this._Element=s,$.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),$[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),t.setOnKeyDown((e=>{if(!this._AutoSearchFocus)return!1;switch(e.keyCode){case H.KeyCode.ArrowLeft:case H.KeyCode.ArrowUp:case H.KeyCode.ArrowRight:case H.KeyCode.ArrowDown:const t=this.getHub().getCurrentFocusNode();if(t){const s=N.Dom.SearchNextFocus(t.NativeId,e.keyCode),i=U.sFocusNodeMap.get(s);if(i)return this.getHub().setFocus(i.getFullName()),!0}}return!1})),t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView)}enableAutoSearchFocus(e){this._AutoSearchFocus=e}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),z()}}class X extends R{constructor(){super(R.JsvTagName.Image)}setAttribute(e,t){if("src"===e){t=new k(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&N.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class Y extends R{constructor(){super(R.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new k(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class Z extends R{constructor(){super(R.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new k(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,((e,s)=>{t.jsvOnLoadResult(e,s)}))}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class Q extends R{constructor(){super(R.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class ee extends R{constructor(){super(R.JsvTagName.Svg)}}class te extends C{constructor(e){super(C.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let se=1;class ie extends R{constructor(){super(R.JsvTagName.JsvFDiv),this.FocusNodeRef=new U("unnamed-"+se++,this.jsvNativeId),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e){if(""!==t&&!this.hubRef){let e=new K(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}else super.setAttribute(e,t)}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class ne extends C{constructor(){super(C.DOCUMENT_NODE),this.location=window.location,this.rootElement=new j,this.rootElement.ownerDocument=this,this.rootElement.id="root",N.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new _(e)}createElement(e){switch(e=e.toUpperCase()){case R.JsvTagName.Anchor:return new M;case R.JsvTagName.Div:return new j;case R.JsvTagName.Image:return new X;case R.JsvTagName.Link:return new Y;case R.JsvTagName.Script:return new Z;case R.JsvTagName.Style:return new Q;case R.JsvTagName.Svg:return new ee;case R.JsvTagName.JsvFDiv:return new ie;case R.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new te(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===R.JsvTagName.Head)return[this.head];if(e===R.JsvTagName.Link||e===R.JsvTagName.Script||e===R.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=this.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new q(e,t,s)}}class oe extends R{constructor(){super(R.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof Y||e instanceof Z)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class re{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class ae extends re{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null,this.sRenderBridge=null}setHandles(e,t,s,i){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.sRenderBridge=i,this.dataReady()}}let le="@keyframes";class ce{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),N.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),N.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(le)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let he=null;function ue(e){return he||(he={global:new ce("global")}),he.global}class de{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,de.EnsureGlobalJsvCode(e,t),R.JsvEnableEventListener(),b.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=N.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=N.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ue),window.JsvCode.Dom.GetLazyTaskAmount||(window.JsvCode.Dom.GetLazyTaskAmount=N.Dom.GetLazyTaskAmount),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new ae)}}class ve{static SetLevel(e){switch(ve.E=ve.W=ve.I=ve.D=function(){},e){case ve.Level.Verbose:ve.V=console.debug.bind(console);case ve.Level.Debug:ve.D=console.debug.bind(console);case ve.Level.Info:ve.I=console.info.bind(console)}}}ve.E=console.error.bind(console),ve.W=console.warn.bind(console),ve.I=console.info.bind(console),ve.D=function(){},ve.V=function(){},ve.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class ge{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof C))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged((()=>{this.callback?.()}))}disconnect(){this.callback=void 0}}class fe extends ne{constructor(){super(),this.head=new oe}set cookie(e){window.__JsvCookies.setCookie(e)}get cookie(){return window.__JsvCookies.getCookie()}}class me{static DeclareGlobal(){me.DeclareDocument(),me.DeclareOthers(),me.DeclareAddition()}static DeclareDocument(){window.document=new fe}static DeclareOthers(){window.MutationObserver=ge,window.Element=R,window.SVGElement=ee;let e=new k(window.JsView.getAppUrl(),!0);window.location.applyUrlInfo?window.location.applyUrlInfo(e):window.location=e,window.history={},window.navigator={userAgent:"jsview-runtime",platform:"jsview"}}static DeclareAddition(){window.JsView.Dom={Render:null,Extension:null,UrlRef:k}}}class pe{constructor(e){this.activity=new w.ReactActivity("NativeForgeActivity",e,null,null),this.init()}init(){console.log("create NativeForgeActivity.");let e=new w.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity,w.sRenderBridge);let t=null;w.DesignMap&&(t=w.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),w.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{N.Dom.RequestSwapAllCachedTasks()}))}}class ye{constructor(e){this.activityManager=e;let t=new pe(e);e.StartActivity(t.activity)}}window.jsvIsBrowserDebug=!1;const we=window.JsvCode.NativePlatformDomBridge,Te=window.JsvCode.NativePlatformMediaBridge;function Ne(){de.EnsureGlobalEnv(we,Te),me.DeclareGlobal(),ve.I("Using JsView Native Environment.")}export{ye as ForgeAppClass,Ne as InitEnv};
|
|
1
|
+
/* eslint-disable */ class e{static CreateAudioPlayer(e){return new Audio(e)}static CreateVideoPlayer(){const t=new Video;return t.jsvOnCssStyleChanged=e.OnCssStyleChanged.bind(t),t.jsvFinalize=e.JsvFinalize.bind(t),t}static OnCssStyleChanged(e,t){this.jsvSetStyles(t.left,t.top,t.width,t.height,t.objectFit,t.visibility)}static JsvFinalize(){console.log("NativePlatformMediaBridge.JsvFinalize()");const e=this;e.pause(),e.unload?.(),e.releaseResource&&(e.releaseResource(),e.onPlatformDestroy())}}window.JsvCode.NativePlatformMediaBridge||(window.JsvCode.NativePlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var n=window.Forge;window.JsvCoreApi.setForgeJsHandle(n);class o{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){o.PushLazyTask(o.TaskType.CreateElement,e,t)}static BindElementToRootView(e){o.PushLazyTask(o.TaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){o.PushLazyTask(o.TaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){o.PushLazyTask(o.TaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){o.PushLazyTask(o.TaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){o.PushLazyTask(o.TaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){o.PushLazyTask(o.TaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){o.PushLazyTask(o.TaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){o.PushLazyTask(o.TaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){o.PushLazyTask(o.TaskType.SetElementAttribute,e,t,s),o.LazyTaskSyncedListenerMap.has(e)&&o.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return o.RunSyncTask(o.TaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")?(i=1,t=t.substr(5)):t.startsWith("mmask")&&(i=2,t=t.substr(6)),o.PushLazyTask(o.TaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){o.PushLazyTask(o.TaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){o.PushLazyTask(o.TaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){o.PushLazyTask(o.TaskType.SetStyleProperty,e,t,s),o.LazyTaskSyncedListenerMap.has(e)&&o.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return o.RunSyncTask(o.TaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){o.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){o.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==o.CachedLazyTaskList.length)return;const e=JSON.stringify(o.CachedLazyTaskList);o.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e),o.CachedLazyTaskAmount=0,o.CachedLazyNewElementTaskAmount=0;for(const e of o.CachedSyncListenIdSet){const t=o.LazyTaskSyncedListenerMap.get(e);t?.()}o.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return o.RunSyncTask(o.TaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){o.PushLazyTask(o.TaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){o.PushLazyTask(o.TaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=o.RunSyncTask(o.TaskType.GetRelativePosition,e,t);return JSON.parse(s)}static SearchNextFocus(e,t){return o.RunSyncTask(o.TaskType.SearchNextFocus,e,t)}static IsLazyTaskQueueOverLoad(){return"wasm"!=window.JsvCoreApi.Platform&&o.CachedLazyNewElementTaskAmount>o.LazyNewElementTaskOverLoadMaxLevel}static SetLazyTaskOverLoadLevel(e){console.log("SetLazyTaskOverLoadLevel() max_level="+e),e<=0&&(console.error("SetLazyTaskOverLoadLevel() max_level <= 0, reset to 100"),e=100),o.LazyNewElementTaskOverLoadMaxLevel=e}static RunSyncTask(e,t,...s){o.RequestSwapAllCachedTasks();const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){let i=!1,r=1;e==o.TaskType.SetStyleProperty?r=2:e==o.TaskType.DeclareStyleSheets&&(i=!0,r=3),o.CachedLazyTaskAmount+=r,e==o.TaskType.CreateElement&&o.CachedLazyNewElementTaskAmount++,o.CachedLazyTaskList.push([e,t,...s]),i||n.sRenderBridge?.RequestSwap()}}o.CachedLazyTaskAmount=0,o.CachedLazyNewElementTaskAmount=0,o.CachedLazyTaskList=new Array,o.CachedSyncListenIdSet=new Set,o.LazyTaskSyncedListenerMap=new Map,o.LazyNewElementTaskOverLoadMaxLevel=100,o.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,SearchNextFocus:23,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class r{}r.Dom=o,r.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class a{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}a.UniqueId=0,a.MaxUniqueId=Math.pow(2,31)-1;class l{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function c(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}var h,d,u,v,m,g,f,p,y,w,T,N,C,D,S;l.ELEMENT_NODE=1,l.TEXT_NODE=3,l.COMMENT_NODE=8,l.DOCUMENT_NODE=9,l.NOLAYOUT_NODE=10;class F{static HasGetterMethod(e){switch(e){case F.Layout.Height:case F.Layout.Left:case F.Layout.Top:case F.Layout.Width:case F.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==F.Layout.Height?F.Layout.Height:e==F.Layout.Left?F.Layout.Left:e==F.Layout.Top?F.Layout.Top:e==F.Layout.Width?F.Layout.Width:e==F.Layout.JsvMinWidth?F.Layout.JsvMinWidth:e==F.Layout.JsvMaxWidth?F.Layout.JsvMaxWidth:e==F.Layout.JsvMinHeight?F.Layout.JsvMinHeight:e==F.Layout.JsvMaxHeight?F.Layout.JsvMaxHeight:e==F.Flex.FlexDirection?F.Flex.FlexDirection:e==F.Flex.FlexWrap?F.Flex.FlexWrap:e==F.Flex.JustifyContent?F.Flex.JustifyContent:e==F.Flex.AlignItems?F.Flex.AlignItems:e==F.Flex.AlignContent?F.Flex.AlignContent:e==F.Flex.AlignSelf?F.Flex.AlignSelf:e==F.Flex.FlexGrow?F.Flex.FlexGrow:e==F.Background.BackgroundColor?F.Background.BackgroundColor:e==F.Background.BackgroundImage?F.Background.BackgroundImage:e==F.Background.BorderRadius?F.Background.BorderRadius:e==F.Background.JsvImageBlendType?F.Background.JsvImageBlendType:e==F.Effect.BackfaceVisibility?F.Effect.BackfaceVisibility:e==F.Effect.BorderImage?F.Effect.BorderImage:e==F.Effect.BorderImageWidth?F.Effect.BorderImageWidth:e==F.Effect.BorderImageOutset?F.Effect.BorderImageOutset:e==F.Effect.Display?F.Effect.Display:e==F.Effect.ObjectFit?F.Effect.ObjectFit:e==F.Effect.Opacity?F.Effect.Opacity:e==F.Effect.Overflow?F.Effect.Overflow:e==F.Effect.Perspective?F.Effect.Perspective:e==F.Effect.PerspectiveOrigin?F.Effect.PerspectiveOrigin:e==F.Effect.Transform?F.Effect.Transform:e==F.Effect.TransformOrigin?F.Effect.TransformOrigin:e==F.Effect.TransformStyle?F.Effect.TransformStyle:e==F.Effect.Visibility?F.Effect.Visibility:e==F.Effect.ZIndex?F.Effect.ZIndex:e==F.Text.Color?F.Text.Color:e==F.Text.FontFamily?F.Text.FontFamily:e==F.Text.FontSize?F.Text.FontSize:e==F.Text.FontStyle?F.Text.FontStyle:e==F.Text.FontWeight?F.Text.FontWeight:e==F.Text.LineHeight?F.Text.LineHeight:e==F.Text.TextAlign?F.Text.TextAlign:e==F.Text.TextOverflow?F.Text.TextOverflow:e==F.Text.TextShadow?F.Text.TextShadow:e==F.Text.WebkitTextStroke?F.Text.WebkitTextStroke:e==F.Text.WhiteSpace?F.Text.WhiteSpace:e==F.Text.WordWrap?F.Text.WordWrap:e==F.Text.Direction?F.Text.Direction:e==F.Text.JsvTextEmoji?F.Text.JsvTextEmoji:e==F.Text.JsvTextLatex?F.Text.JsvTextLatex:e==F.Text.JsvTextAlignMinWidth?F.Text.JsvTextAlignMinWidth:e==F.Text.JsvTextVerticalAlign?F.Text.JsvTextVerticalAlign:e==F.Text.JsvTextLineAlign?F.Text.JsvTextLineAlign:e==F.Text.JsvTextInnerDirection?F.Text.JsvTextInnerDirection:e==F.Motion.Animation?F.Motion.Animation:e==F.Motion.Transition?F.Motion.Transition:e==F.Motion.AnimationFillMode?F.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}F.Layout=(c(h=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),h.Height="height",h.Left="left",h.Top="top",h.Width="width",h.JsvMinWidth="JsvMinWidth",h.JsvMaxWidth="JsvMaxWidth",h.JsvMinHeight="JsvMinHeight",h.JsvMaxHeight="JsvMaxHeight",h),F.Flex=(c(d=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),d.FlexDirection="flexDirection",d.FlexWrap="flexWrap",d.JustifyContent="justifyContent",d.AlignItems="alignItems",d.AlignContent="alignContent",d.AlignSelf="alignSelf",d.FlexGrow="flexGrow",d),F.Background=(c(u=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),u.BackgroundColor="backgroundColor",u.BackgroundImage="backgroundImage",u.BorderRadius="borderRadius",u.JsvImageBlendType="JsvImageBlendType",u),F.Effect=(c(v=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),v.BackfaceVisibility="backfaceVisibility",v.BorderImage="borderImage",v.BorderImageWidth="borderImageWidth",v.BorderImageOutset="borderImageOutset",v.Display="display",v.ObjectFit="objectFit",v.Opacity="opacity",v.Overflow="overflow",v.Perspective="perspective",v.PerspectiveOrigin="perspectiveOrigin",v.Transform="transform",v.TransformOrigin="transformOrigin",v.TransformStyle="transformStyle",v.Visibility="visibility",v.ZIndex="zIndex",v),F.Text=(c(m=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),m.Color="color",m.FontFamily="fontFamily",m.FontSize="fontSize",m.FontStyle="fontStyle",m.FontWeight="fontWeight",m.LineHeight="lineHeight",m.TextAlign="textAlign",m.TextOverflow="textOverflow",m.TextShadow="textShadow",m.WebkitTextStroke="WebkitTextStroke",m.WhiteSpace="whiteSpace",m.WordWrap="wordWrap",m.Direction="direction",m.JsvTextEmoji="JsvTextEmoji",m.JsvTextLatex="JsvTextLatex",m.JsvTextAlignMinWidth="JsvTextAlignMinWidth",m.JsvTextVerticalAlign="JsvTextVerticalAlign",m.JsvTextLineAlign="JsvTextLineAlign",m.JsvTextInnerDirection="JsvTextInnerDirection",m),F.Motion=(c(g=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),g.Animation="animation",g.Transition="transition",g.AnimationFillMode="animationFillMode",g);class E{constructor(e){let t=-1,s=null;null==e?t=E.DataType.Null:Number(e)===e&&e%1==0?t=E.DataType.Int32:Number(e)===e&&e%1!=0?t=E.DataType.Float:"string"==typeof e||e instanceof String?t=E.DataType.String:e instanceof E.AnimationImpl?t=E.DataType.Animation:e instanceof E.CornerImpl?t=E.DataType.Corner:e instanceof E.RectImpl?t=E.DataType.Rect:e instanceof E.TextShadowImpl?t=E.DataType.TextShadow:e instanceof E.WebkitTextStrokeImpl?t=E.DataType.WebkitTextStroke:e instanceof E.TransitionImpl?t=E.DataType.Transition:e instanceof E.BorderImageImpl&&(t=E.DataType.BorderImage),e!=E.InvalidInt32&&e!=E.InvalidFloat&&e!=E.InvalidPointer?s=e:(t=E.DataType.Null,s=null),this.data=new E.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case E.DataType.Null:return"";case E.DataType.Int32:case E.DataType.Float:return String(this.get());case E.DataType.String:e=this.get();break;case E.DataType.Animation:case E.DataType.Corner:case E.DataType.Rect:case E.DataType.TextShadow:case E.DataType.WebkitTextStroke:case E.DataType.Transition:case E.DataType.BorderImage:case E.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}}let x,I;E.Base=class{constructor(e){this.rawValue=e}},E.AnimationImpl=class extends E.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},E.CornerImpl=class extends E.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},E.RectImpl=class extends E.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},E.TextShadowImpl=class extends E.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},E.WebkitTextStrokeImpl=class extends E.Base{constructor(e){super(e),this.length=0,this.color=void 0}},E.TransitionImpl=class extends E.Base{constructor(e){super(e),this.animationMap=new Map}},E.BorderImageImpl=class extends E.Base{constructor(e){super(e),this.source="",this.slice=null}},E.BackgroundImageImpl=(c(f=class extends E.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),f.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},f.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},f),E.DataType=(c(p=class{},"DataType"),p.Null=0,p.Int32=1,p.Float=2,p.String=3,p.Animation=4,p.Corner=5,p.Rect=6,p.TextShadow=7,p.WebkitTextStroke=8,p.Transition=9,p.BorderImage=10,p.BackgroundImage=11,p),E.InvalidInt32=Number.MIN_VALUE,E.InvalidFloat=Number.NaN,E.InvalidPointer=null,E.DataInfo=class{constructor(){this.value=null,this.index=-1}},c(y=class{},"Text"),y.Color="#000000",y.FontFamily="黑体",y.FontSize=10,y.FontStyle="normal",y.FontWeight="normal",y.LineHeight=0,y.TextAlign="start",y.TextOverflow="clip",y.TextShadow=null,y.WebkitTextStroke=null,y.WhiteSpace="normal",y.WordWrap="normal",y.Direction="ltr",y.JsvTextEmoji=0,y.JsvTextLatex=0,y.JsvTextAlignMinWidth=0,y.JsvTextVerticalAlign="top",y.JsvTextLineAlign="middle",y.JsvTextInnerDirection="unset",c(w=class{constructor(){this.height=E.InvalidInt32,this.left=E.InvalidInt32,this.top=E.InvalidInt32,this.width=E.InvalidInt32,this.minWidth=E.InvalidInt32,this.maxWidth=E.InvalidInt32,this.minHeight=E.InvalidInt32,this.maxHeight=E.InvalidInt32}},"Layout"),w.Name="layout",c(T=class{constructor(){this.flexDirection=E.InvalidInt32,this.flexWrap=E.InvalidInt32,this.justifyContent=E.InvalidInt32,this.alignItems=E.InvalidInt32,this.alignContent=E.InvalidInt32,this.alignSelf=E.InvalidInt32,this.flexGrow=E.InvalidFloat}},"Flex"),T.Name="flex",c(N=class{constructor(){this.backgroundColor=E.InvalidPointer,this.backgroundImage=E.InvalidPointer,this.borderRadius=E.InvalidPointer,this.JsvImageBlendType=E.InvalidInt32}},"Background"),N.Name="background",c(C=class{constructor(){this.backfaceVisibility=E.InvalidPointer,this.borderImage=E.InvalidPointer,this.borderImageWidth=E.InvalidPointer,this.borderImageOutset=E.InvalidPointer,this.display=E.InvalidPointer,this.objectFit=E.InvalidPointer,this.opacity=E.InvalidFloat,this.overflow=E.InvalidPointer,this.perspective=E.InvalidInt32,this.perspectiveOrigin=E.InvalidPointer,this.transform=E.InvalidPointer,this.transformOrigin=E.InvalidPointer,this.transformStyle=E.InvalidPointer,this.visibility=E.InvalidPointer,this.zIndex=E.InvalidInt32}},"Effect"),C.Name="effect",c(D=class{constructor(){this.color=E.InvalidPointer,this.fontFamily=E.InvalidPointer,this.fontSize=E.InvalidInt32,this.fontStyle=E.InvalidPointer,this.fontWeight=E.InvalidPointer,this.lineHeight=E.InvalidInt32,this.textAlign=E.InvalidPointer,this.textOverflow=E.InvalidPointer,this.textShadow=E.InvalidPointer,this.webkitTextStroke=E.InvalidPointer,this.whiteSpace=E.InvalidPointer,this.wordWrap=E.InvalidPointer,this.direction=E.InvalidPointer,this.jsvTextEmoji=E.InvalidInt32,this.jsvTextLatex=E.InvalidInt32,this.jsvTextAlignMinWidth=E.InvalidInt32,this.jsvTextVerticalAlign=E.InvalidPointer,this.jsvTextLineAlign=E.InvalidPointer,this.jsvTextInnerDirection=E.InvalidPointer}},"Text"),D.Name="text",c(S=class{constructor(){this.animation=E.InvalidPointer,this.transition=E.InvalidPointer,this.animationFillMode="none"}},"Motion"),S.Name="motion",global.JsvURLClass?(x=global.JsvURLClass,I=()=>window.location.jsvGetLocation()):(x=window.URL,I=()=>window.location.href);class k{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")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}let s=e.substring(0,30).trimStart();if(s.startsWith("data:")||s.startsWith("jsvtexturestore:")||s.startsWith("blob:"))return void(this.href=e);let i=(e=e.trimStart()).indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),(e.startsWith("/")||e.startsWith("./"))&&(e=new x(e,I()).href),this.href=e,!t)return;let n=this.href,o=n.indexOf("#");o>0&&(this.hash=n.substring(o),n=n.substring(0,o));let r=n.indexOf("?");r>1&&(this.search=n.substring(r),n=n.substring(0,r));let a=n,l=a.indexOf("://");this.protocol=l>0?a.substring(0,l+1):"";let c=l>1?a.substring(l+3):"";l=c.indexOf("/"),this.host=l>0?c.substring(0,l):"",this.pathname=l>=1?c.substring(l):"","file:"==this.protocol&&(this.host="",this.pathname=c),this.origin=this.protocol+"//"+this.host,l=this.host.indexOf(":"),this.hostname=l>0?this.host.substring(0,l):this.host,this.port=l>1?this.host.substring(l+1):""}replace(e){this.href=e}}class L{static JsvDeclarePrototype(){for(let e in F){let t=F[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(L.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==F.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new k(t).href}else if(e==F.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new k(e[0]).href),t=e.join(" ")}else e==F.Effect.Display&&(this.cachedProps[e]=t);r.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==F.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=r.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class b extends t{constructor(e){super(e)}}var M;!function(e){e[e.Cancel=0]="Cancel",e[e.Click=1]="Click",e[e.LongPress=2]="LongPress",e[e.LongPressRelease=3]="LongPressRelease",e[e.touchFirstStart=4]="touchFirstStart",e[e.touchLastEnd=5]="touchLastEnd"}(M||(M={}));class P extends l{static JsvEnableEventListener(){r.Dom.EnableEventListener(function(e,t,...s){let i=P.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)})}constructor(e){super(l.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=P.JsvTagName.Audio&&this.tagName!=P.JsvTagName.Div&&this.tagName!=P.JsvTagName.Image&&this.tagName!=P.JsvTagName.Video&&this.tagName!=P.JsvTagName.JsvFDiv||(this.jsvNativeId=a.GenerateId(),this.style=new L(this.jsvNativeId),r.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof P&&e.jsvNativeId>0&&r.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),r.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),r.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=r.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=r.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?r.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?r.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&r.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&r.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){console.warn("warn: focus is invalid, use JsvFocusBlock to manager")}jsvGetBoundingClientRect(){const e="jsv-getbound",t=a.GenerateId();return new Promise((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})})}jsvSetTapListener(e,t=0){let s=this.jsvGetProxyView(!0);if(!e)return s.DragEnables(0),void s.SetTapListener(null);e.onClick&&(t|=1),(e.onLongPress||e.onLongPressRelease)&&(t|=2),e.onTouchStart&&(t|=8),e.onTouchEnd&&(t|=16),s.DragEnables(t),s.SetTapListener((t,s)=>{switch(t){case M.Cancel:e.onCancel?.(s);break;case M.LongPress:e.onLongPress?.(s);break;case M.LongPressRelease:e.onLongPressRelease?.(s);break;case M.Click:e.onClick?.(s);break;case M.touchFirstStart:e.onTouchStart?.(s);break;case M.touchLastEnd:e.onTouchEnd?.(s);break;default:console.error("Error:onTap unknown type:"+t)}})}jsvConsumeMouseEvent(e){let t=this.jsvGetProxyView(!0),s=0;e.hover&&(s|=1),e.scroll&&(s|=2),t.MouseEnables(s)}jsvSetOnLazyTaskSyncedListener(e){r.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new b(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"!=e&&"mouseenter"!=e&&"mouseleave"!=e||(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=n.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=n.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return r.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=P.JsvEventListenerMap.get(e);s||(s=new Map,P.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=P.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=P.JsvFindBackwardForgeView(s),r.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=P.JsvFindBackwardForgeView(t),r.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===l.TEXT_NODE?this.textContent=e.nodeValue:e instanceof P&&e.jsvNativeId>0&&(t=P.JsvFindBackwardForgeView(t),r.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof P!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),r.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),P.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof P);)t=t.nextSibling;return t}}P.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},P.JsvEventListenerMap=new Map;class R extends P{constructor(){super(P.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return P.JsvTagName.Anchor}}class O extends l{constructor(e){super(l.COMMENT_NODE),this.textContent=e}}class _ extends P{constructor(){super(P.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},r.Dom.SetElementText(this.jsvNativeId,e)}}const j="FocusDebug",J="__AppRoot__",B={PrintToken:1,DebugSwitch:!1,DebugNeedCallStack:!1,ChangingFocusLock:!1,DelayedFocusChanges:[]};function A(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==J?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==J?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}function W(e,t){let s=A(e);if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let e=t?.stack;t.stack=null,console.log(j,`focusChange(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusStack:${s}\n:trace:${e}:`,t)}else console.log(j,`focusChange:${s} but empty debugSaveInfo`)}class V{constructor(){this.listeners=[]}addListener(e){-1===this.listeners.indexOf(e)&&this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>-1&&this.listeners.splice(t,1)}notifyListeners(e){this.listeners.forEach(t=>t(e))}}class z{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._FocusListenerManagerOnRequest=null,this._FocusListenerManagerOnFocus=null,this.LastFocusNodeName=null,this.LastFocusNode=null,this.IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(e=!1){if(null==this._FocusNodeName)return null;let t=this._ChildMap[this._FocusNodeName];if(!t)return e||console.error("Erorr: JsvFocus node not mounted name="+this._FocusNodeName),null;if(t.RouterDelegate.ref!=this){let e=t.RouterDelegate.ref.getCurrentFocusNode();return null==e?t:e}return t}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==J?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===J?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}addFocusChangeListener(e,t=!1){t?(this._FocusListenerManagerOnRequest||(this._FocusListenerManagerOnRequest=new V),this._FocusListenerManagerOnRequest.addListener(e)):(this._FocusListenerManagerOnFocus||(this._FocusListenerManagerOnFocus=new V),this._FocusListenerManagerOnFocus.addListener(e))}delFocusChangeListener(e,t=!1){t?this._FocusListenerManagerOnRequest&&this._FocusListenerManagerOnRequest.removeListener(e):this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.removeListener(e)}_FindRouterSearchBase(e,t){if(0==e[0].length){let t=null;for(let e in this._ChildMap){t=this._ChildMap[e];break}if(null!=t){let s;do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return null}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(null!=o&&o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found JsvFocus name=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: JsvFocus name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: JsvFocus router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter JsvFocus name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){if(B.DebugSwitch)if(null==s)console.error(j,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);else if(!s.originFStack){let e=this.getCurrentFocusNode(!0);s.originFStack="Mark1:",s.originFStack+=e?A(e):`NoFocus[focusSet:${this._FocusNodeName} notMountFocus:${this._FocusNameBeforeMount}]`}if(this._FocusListenerManagerOnRequest&&"string"==typeof e&&!e.includes(".")&&this._FocusListenerManagerOnRequest.notifyListeners(e),B.ChangingFocusLock){let i=this;return B.DelayedFocusChanges.push(()=>{i.focusBeforeMount(e,t,s)}),!0}B.ChangingFocusLock=!0;try{let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.notifyListeners(e),n.Focus(!t);let i=n.GetFocusChild();for(;i;){let e=i.GetFocusChild();if(!e){this._FocusNodeName=i.BranchName;break}i=e}return B.DebugSwitch&&W(i??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,B.DebugSwitch&&function(e,t){if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let s=t?.stack;t.stack=null,console.log(j,`focusChange(wait-mount)(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusName:${e}\n:trace:${s}:`,t)}else console.log(j,`focusChange(wait-mount):${e} but empty debugSaveInfo`)}(e,s),!1}console.error("error: JsvFocus name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}i||console.error("illegal JsvFocus name param",e)}finally{B.ChangingFocusLock=!1;let e=B.DelayedFocusChanges.length;if(e>0){let t=B.PrintToken++;B.DebugSwitch&&console.log(j,`stash onFocus pop start(token=${t}) len=${e}`);let s=B.DelayedFocusChanges;B.DelayedFocusChanges=[];for(let t=0;t<e;t++)s[t]();B.DebugSwitch&&console.log(j,`stash onFocus pop done(token=${t})`)}}return!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found JsvFocusbranch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class G{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new z(!1,t))}enableFocusTrace(e){B.DebugSwitch=!0,B.DebugNeedCallStack=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==J?"":e}wrapWithNameSpace(e){let t=new G(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e,t){return this.RouterDelegate.ref.getNodeByName(e,t)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`),K.SetFocusCallSeqToken++;let s=null;B.DebugSwitch&&(s={askName:e,deepToChild:t,from:"setFocus",stack:B.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null});return this.focusByNameBeforeMount(e,t,s)}getFocusCallToken(){return K.SetFocusCallSeqToken}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==J||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){return K.FirstName}getLastFocusNear(){return K.LatestName}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getCurrentFocusNode(){return this.RouterDelegate.ref?.getCurrentFocusNode()}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){K.SetFocusCallSeqToken++;const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}addFocusChangeListener(e,t=!1){this.RouterDelegate.ref.addFocusChangeListener(e,t)}delFocusChangeListener(e,t=!1){this.RouterDelegate.ref.delFocusChangeListener(e,t)}}const K={LatestName:null,FirstName:null,FocusChangeSeqToken:0,SetFocusCallSeqToken:0};class U extends n.PageBase{constructor(e,t){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this._FlagNamed=!1,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.NativeId=-1,this.BranchName=e,this.NativeId=t,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1,U.sFocusNodeMap.set(this.NativeId,this)}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)})}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new G(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new z(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e,this._FlagNamed=!0;let s=this.GetParentPage();s&&s.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=U.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=U.safeCallback(e)}setOnFocus(e){this._OnFocus=U.safeCallback(e)}setOnBlur(e){this._OnBlur=U.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=U.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=U.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=U.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=U.safeCallback(e),this._DKeyUpProxy=U.safeCallback(t)}requestFocus(e){let t=null;B.DebugSwitch&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:B.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;B.DebugSwitch&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:B.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this.GetParentPage()._Mounted&&(this.updateMountState(),H()),e instanceof U)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref.IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach((t,s)=>{e.routerAdd(s,t)})}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return U.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(e){this._OnFocus&&this._OnFocus()}OnBlur(e){this._FlagNamed&&(K.LatestName=this.BranchName,K.FocusChangeSeqToken!=e&&(K.FocusChangeSeqToken=e,K.FirstName=this.BranchName)),this._OnBlur&&this._OnBlur()}onUnMount(e){U.sFocusNodeMap.delete(this.NativeId);let t=this.IsFocus();if(t&&this._FlagNamed&&(K.LatestName=this.BranchName,K.FirstName=this.BranchName,K.FocusChangeSeqToken=0),B.DebugSwitch&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:B.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:"Mark2:"+A(this)},W(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==J)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==J?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}U.sFocusMemos=[],U.sRootPageNode=null,U.sFocusNodeMap=new Map;let H=()=>{let e=U.sFocusMemos.length;if(e>0){let t=U.sFocusMemos;U.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}};class q extends t{constructor(e){super(e),this.keyCode=-1,this.key=-1,this.repeat=0,this.keyCode=-1,this.key=-1,this.repeat=0}}q.KeyCode={Enter:13,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};let $={};class X{constructor(e,t,s){this._AutoSearchFocus=!1,this._Element=s,$.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),$[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),t.setOnKeyDown(e=>{if(!this._AutoSearchFocus)return!1;switch(e.keyCode){case q.KeyCode.ArrowLeft:case q.KeyCode.ArrowUp:case q.KeyCode.ArrowRight:case q.KeyCode.ArrowDown:const t=this.getHub().getCurrentFocusNode();if(t){const s=r.Dom.SearchNextFocus(t.NativeId,e.keyCode),i=U.sFocusNodeMap.get(s);if(i)return this.getHub().setFocus(i.getFullName()),!0}}return!1}),t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView)}enableAutoSearchFocus(e){this._AutoSearchFocus=e}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),H()}}class Y extends P{constructor(){super(P.JsvTagName.Image)}setAttribute(e,t){if("src"===e){if("string"!=typeof t)return void console.error("Error:img.src is not string!",t);t=new k(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&r.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class Q extends P{constructor(){super(P.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new k(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class Z extends P{constructor(){super(P.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new k(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,(e,s)=>{t.jsvOnLoadResult(e,s)})}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class ee extends P{constructor(){super(P.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class te extends P{constructor(){super(P.JsvTagName.Svg)}}class se extends l{constructor(e){super(l.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let ie=1;class ne extends P{constructor(){super(P.JsvTagName.JsvFDiv),this.FocusNodeRef=new U("unnamed-"+ie++,this.jsvNativeId),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e){if(""!==t&&!this.hubRef){let e=new G(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}else super.setAttribute(e,t)}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class oe extends l{constructor(){super(l.DOCUMENT_NODE),this.location=window.location,this.rootElement=new _,this.rootElement.ownerDocument=this,this.rootElement.id="root",r.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new O(e)}createElement(e){switch(e=e.toUpperCase()){case P.JsvTagName.Anchor:return new R;case P.JsvTagName.Div:return new _;case P.JsvTagName.Image:return new Y;case P.JsvTagName.Link:return new Q;case P.JsvTagName.Script:return new Z;case P.JsvTagName.Style:return new ee;case P.JsvTagName.Svg:return new te;case P.JsvTagName.JsvFDiv:return new ne;case P.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new se(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===P.JsvTagName.Head)return[this.head];if(e===P.JsvTagName.Link||e===P.JsvTagName.Script||e===P.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=this.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new X(e,t,s)}}class re extends P{constructor(){super(P.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof Q||e instanceof Z)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class ae{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class le extends ae{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null,this.sRenderBridge=null}setHandles(e,t,s,i){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.sRenderBridge=i,this.dataReady()}}let ce="@keyframes";class he{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),r.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),r.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(ce)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let de=null;function ue(e){return de||(de={global:new he("global")}),de.global}class ve{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,ve.EnsureGlobalJsvCode(e,t),P.JsvEnableEventListener(),L.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=r.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=r.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ue),window.JsvCode.Dom.IsLazyTaskQueueOverLoad||(window.JsvCode.Dom.IsLazyTaskQueueOverLoad=r.Dom.IsLazyTaskQueueOverLoad),window.JsvCode.Dom.SetLazyTaskOverLoadLevel||(window.JsvCode.Dom.SetLazyTaskOverLoadLevel=r.Dom.SetLazyTaskOverLoadLevel),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new le)}}class me{static SetLevel(e){switch(me.E=me.W=me.I=me.D=function(){},e){case me.Level.Verbose:me.V=console.debug.bind(console);case me.Level.Debug:me.D=console.debug.bind(console);case me.Level.Info:me.I=console.info.bind(console)}}}me.E=console.error.bind(console),me.W=console.warn.bind(console),me.I=console.info.bind(console),me.D=function(){},me.V=function(){},me.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class ge{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof l))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged(()=>{this.callback?.()})}disconnect(){this.callback=void 0}}class fe extends oe{constructor(){super(),this.head=new re}set cookie(e){window.__JsvCookies.setCookie(e)}get cookie(){return window.__JsvCookies.getCookie()}}class pe{static DeclareGlobal(){let e=pe.DeclareDocument();pe.DeclareOthers(),pe.DeclareAddition(),window.JsvCode.Dom.JsViewDocument=e}static DeclareDocument(){let e=new fe;return window.document=e,e}static DeclareOthers(){window.MutationObserver=ge,window.Element=P,window.SVGElement=te;let e=new k(window.JsView.getAppUrl(),!0);window.location.applyUrlInfo?window.location.applyUrlInfo(e):window.location=e,window.history={},window.navigator={userAgent:"jsview-runtime",platform:"jsview"}}static DeclareAddition(){window.JsView.Dom={Render:null,Extension:null,UrlRef:k}}}class ye{constructor(e){this.activity=new n.ReactActivity("NativeForgeActivity",e,null,null),this.init()}init(){console.log("create NativeForgeActivity.");let e=window.JsvCode.Dom.JsViewDocument.rootElement.jsvGetProxyView();window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity,n.sRenderBridge);let t=null;n.DesignMap&&(t=n.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),n.sRenderBridge.AddWillSwapListener("forgeSwap",()=>{r.Dom.RequestSwapAllCachedTasks()})}}class we{constructor(e){this.activityManager=e;let t=new ye(e);e.StartActivity(t.activity)}}window.jsvIsBrowserDebug=!1;const Te=window.JsvCode.NativePlatformDomBridge,Ne=window.JsvCode.NativePlatformMediaBridge;function Ce(){ve.EnsureGlobalEnv(Te,Ne),pe.DeclareGlobal(),me.I("Using JsView Native Environment.")}export{we as ForgeAppClass,Ce as InitEnv};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ async function e(){let e=await import("./jsview-dom-browser-engine-core.min.js"),o=e.getJMD();await import("./jsview-dom-browser-engine-modules.min.js"),window.JsvCoreApi.loadInfoFromCore(),window._BootEngineEmb={promiseRef:null,resolveFunc:null},window._BootEngineEmb.promiseRef=new Promise(
|
|
1
|
+
/* eslint-disable */ async function e(){let e=await import("./jsview-dom-browser-engine-core.min.js"),o=e.getJMD();await import("./jsview-dom-browser-engine-modules.min.js"),window.JsvCoreApi.loadInfoFromCore(),window._BootEngineEmb={promiseRef:null,resolveFunc:null},window._BootEngineEmb.promiseRef=new Promise(e=>{window._BootEngineEmb.resolveFunc=e});e.takeCanvas(e=>{(async e=>{window._BootEngineEmb&&(await window._BootEngineEmb.promiseRef,console.log("SYSTEMJS: embedded engineJs ready")),window._BootEngineEmb=null,window.Forge.Run(e),window.Forge.sRenderBridge.SetPlatformMsgDisp(o);let n=e.renderBridge.TakeAndSyncBackStatus.bind(e.renderBridge);o.subscribe("JscRender",function(e){n()});let r=e.keyProc,i=e.keyUpProc;o.subscribe("onForgeKeyDown",function(e){let o,n=!0;try{o=JSON.parse(e),n=r(o)}catch(e){console.error("onForgeKeyDown error:",e)}finally{return console.log("onForgeKeyDown "+e+" consumed="+!n),!n}}),null!=i&&o.subscribe("onForgeKeyUp",function(e){let o=JSON.parse(e),n=i(o);return console.log("onForgeKeyUp "+e+" consumed="+!n),!n})})(e)})}var o={SetupEngineJs:async(o,n)=>{await e(),window.Forge.InitStarter(o,n)}};export{o as default};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ let t={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=t;let s=function(t){},e=function(t){},i=function(t){},n=function(t){throw new Error(t)};class r{constructor(){this.i=[],this.h=[],this.l=[],this.o={}}RequestAlterId(t,s){this.o[t]=s}AddToQueue(t,s){this.i.push(s),this.h.push(t)}HasUpdate(){return this.i.length>0}ReadSyncList(){if(this.l.length>0){for(let t of this.l)t();this.l=[]}let t=this.i;return this.RenewSyncList(),t}AddStartSyncCallback(t){this.l.push(t)}RenewSyncList(){if(this.h)for(let t of this.h)t.RenewSyncInfo(this,null);this.i=[],this.h=[]}ProcAlterIds(t,s){for(let e=0;e<t.length;e++)if(this.o.hasOwnProperty(t[e])){let i=this.o[t[e]];i.OnAlterId(s[e]),i.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${t[e]}`);this.o={}}}class h{constructor(t,s=null,e=null){this.u=t,this.PrefSyncInfo=null,this.p=null,this.v=!1,this.N=s,this.SuffSyncInfo=null,this.I=null,this.R=!1,this.InitPackage(e),this.RenewSyncInfo(this.u,null),this.RenewSyncInfo(this.N,null)}AddStartSyncCallback(t){this.u.AddStartSyncCallback(t)}CallToNative(s,e,i=!1){let n={fn:s,a:e};return i?(this.I.push(n),this.R||(this.N.AddToQueue(this,this.SuffSyncInfo),this.R=!0)):(this.p.push(n),this.v||(this.u.AddToQueue(this,this.PrefSyncInfo),this.v=!0)),t.sRenderBridge.RequestSwap(),n}RequestAlterId(t,s=!1){s?this.N.RequestAlterId(t,this):this.u.RequestAlterId(t,this)}SuffCallToNative(t,s){return{fn:t,a:s}}AlterCallParams(t,s){t&&(t.a=s)}RenewSyncInfo(t,s){s||(s={}),this.v=!1,this.R=!1,t&&t==this.u&&(this.p=[],this.PrefSyncInfo={tl:this.p,...s}),t&&t==this.N&&(this.I=[],this.SuffSyncInfo={tl:this.I,...s})}InitPackage(t){}OnAlterId(t){}}let a=new r,l=new r;class o extends h{constructor(t){super(a,l,{id:t}),this.C=null,this.A=t}InitPackage(t){this.A=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.A})}NeedAlterId(t,s){this.C=t,super.RequestAlterId(this.A,s)}OnAlterId(t){this.A=t,this.C.TexId=t,this.C=null}}let u=new class extends h{constructor(){super(a,l)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};let c=new class{constructor(){this.O=[1]}AddData(t){return this.O.push(t),this.O.length-1}TakeArray(){const t=this.O;return this.O=[1],t}PickArray(){return this.O}GetSize(){return this.O.length}ResetForNextSwap(){this.O=[1]}};let d=1;class p{constructor(t,s,e=!1){this.P=s,this.TexId=t,this.k=!1,this.F=0,this.D=0,this.G=null,this._={},this.B=e}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this.P.NeedAlterId(this,this.B)}RegisterLoadImageCallback(t,s,e){if(null==s)return 0;if(this.k)return s({width:this.F,height:this.D},e),0;{this.V();const t=d++,i=this,n=(n,r,h)=>{s({width:n,height:r,extra:h?JSON.parse(h):null},e),delete i._[t]};this._[t]=n;const r=c.AddData(n);return this.P.CallToNative(1,[t,r],this.B),t}}UnregisterLoadImageCallback(t){t>0&&void 0!==this._[t]&&delete this._[t]}DispatchCommand(s,e){this.P.CallToNative(3,[s,e],this.B),t.sRenderBridge.RequestSwap()}V(){if(null==this.G){const t=this;this.G=(s,e,i)=>{t.k=!0,t.F=s,t.D=e};const s=c.AddData(this.G);this.P.CallToNative(1,[d++,s],this.B)}}EnableBackgroundLoad(){this.k||(this.V(),this.P.CallToNative(4,null,this.B))}DisableBackgroundLoad(){this.P.CallToNative(5,null,this.B)}RequestToUnload(){this.P.CallToNative(6,null,this.B)}DisableAutoRecycle(){this.P.CallToNative(7,null,this.B)}}class f extends p{constructor(t,s,e=!1){super(t,s,e),this.J=null}registerOnStart(t){this.W();let s=this.J,e=++s.IdGen;if(s.StartMapCount++,s.StartMapCount>0&&0==s.GlobalStartCallbackId){s.GlobalStartCallbackId=e;const t=()=>{for(let t in s.OnStartMap)s.OnStartMap[t]?.()},i=c.AddData(t);this.P.CallToNative(10,[s.GlobalStartCallbackId,i],this.B)}return s.OnStartMap[e]=t,e}unregisterOnStart(t){if(!this.J)return;let s=this.J;s.OnStartMap.hasOwnProperty(t)&&s.StartMapCount--,0==s.StartMapCount&&0!=s.GlobalStartCallbackId&&(this.P.CallToNative(11,[s.GlobalStartCallbackId],this.B),s.GlobalStartCallbackId=0)}registerOnEnd(t){this.W();let s=this.J,e=++s.IdGen;if(s.EndMapCount++,s.EndMapCount>0&&0==s.GlobalEndCallbackId){s.GlobalEndCallbackId=e;const t=()=>{for(let t in s.OnEndMap)s.OnEndMap[t]?.()},i=c.AddData(t);this.P.CallToNative(12,[s.GlobalEndCallbackId,i],this.B)}return s.OnEndMap[e]=t,e}unregisterOnEnd(t){if(!this.J)return;let s=this.J;s.OnEndMap.hasOwnProperty(t)&&s.EndMapCount--,0==s.EndMapCount&&0!=s.GlobalEndCallbackId&&(this.P.CallToNative(13,[s.GlobalEndCallbackId],this.B),s.GlobalEndCallbackId=0)}W(){this.J||(this.J={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class S extends f{constructor(t,s){super(t,s,!0)}}let y=window.NativeGetIdGroupIntf();const v=10;class w{constructor(t){this.U=t,this.q=0,this.K=0,this.j=new Array(v),this.Y=0;for(let t=0;t<v;t++)this.j[t]={start:0,end:0,expired:!0}}genId(){this.j[this.q].expired&&this.X();let t=this.j[this.q],s=t.start;return t.start++,t.start>t.end&&(t.expired=!0,this.q=(this.q+1)%v,this.Y--),s}X(){let t=20*(v-this.Y);if(t>0){let s=y.GetIdArray(this.U,t);if(s){let t=JSON.parse(s);this.$(t[0],t[1])}}}$(t,s){let e=s-t+1,i=Math.floor(e/20),n=t;for(let t=0;t<i;t++){let t=this.j[this.K];t.start=n,t.end=n+20-1,t.expired=!1,this.K=(this.K+1)%v,n=t.end+1}this.Y+=i,this.Y>v&&console.error(`team over size to ${this.Y}`)}}let m=new class{constructor(){this.Z=new w(0),this.et=new w(1),this.it=new w(2),this.nt=new w(3)}genViewId(){return this.Z.genId()}genTextureId(){return this.et.genId()}genAnimationId(){return this.it.genId()}genSensorId(){return this.nt.genId()}};var N,g,x;!function(t){t.RGBA_8888="RGBA_8888",t.RGBA_4444="RGBA_4444",t.RGBA_5551="RGBA_5551",t.RGB_565="RGB_565",t.RGB_ETC1="RGB_ETC1",t.RGBA_ETC1="RGBA_ETC1"}(N||(N={})),function(t){t.L=1,t.M=0,t.Q=3,t.H=2}(g||(g={})),function(t){t.AUTO=0,t.SYNC=1,t.ASYNC=2}(x||(x={}));class I{constructor(){this.P=u}GetId(){return 0}GetColorTexture(t){let s=m.genTextureId();this.P.CallToNative(1,[t,s]);let e=new p(s,new o(s));return e.RequestSyncerAlterId(),e}GetImage(t,s,e){return this.GetImage2(t,s,null,null,e)}GetImage2(t,s,e,n=N.RGBA_8888,r="",h=!1){if(!t||0==t.length)return i("GetImage2, url is not setted!"),null;let a=m.genTextureId(),l=0,u=0;e&&(l=e.width,u=e.height),n||(n=N.RGBA_8888),r||(r="");let c=null!=h&&h;this.P.CallToNative(2,[t,l,u,n,r,c,a]);let d=new p(a,new o(a));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(t,s,e,i=x.AUTO,n=g.Q,r="#ffffff",h="#000000",a=-1){let l=m.genTextureId();return this.P.CallToNative(3,[t,s,e,n,r,h,a,i,l]),new p(l,new o(l))}GetDownloadTexture(t,s,e){if(!t)return i("GetDownloadTexture, url is null!"),null;let n=m.genTextureId();return this.P.CallToNative(4,[t,s,e,n]),new p(n,new o(n))}GetDomProxyTexture(t){let s=m.genTextureId();return this.P.CallToNative(5,[t,s],!0),new S(s,new o(s))}GetCanvasTexture(t,s){let e=m.genTextureId();return this.P.CallToNative(6,[t,s,e],!1),new p(e,new o(e))}GetPluginTexture(t,s){let e=m.genTextureId();return this.P.CallToNative(7,[t,s,e],!1),new p(e,new o(e))}GetCapturedTexture(){let t=m.genTextureId();return this.P.CallToNative(8,[t],!1),new p(t,new o(t))}GetImageProcessTexture(t){let s=m.genTextureId();return this.P.CallToNative(9,[t,s],!1),new p(s,new o(s))}}let b=new class{constructor(){this.rt=1}get count(){return this.rt}update(){this.rt<Number.MAX_SAFE_INTEGER?++this.rt:this.rt=1}},R=new r,C=new r;let A=new class extends h{constructor(){super(R,C)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}};class O extends h{constructor(t){super(R,C,{id:t}),this.ht=t}InitPackage(t){this.ht=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.ht})}}let P=new r,k=new r;class T extends h{constructor(t){super(P,k,{id:t}),this.lt=t}InitPackage(t){this.lt=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.lt})}}let E=new class extends h{constructor(){super(P,k)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}},F=new r;class D extends h{constructor(t){super(null,F,{id:t}),this.ot=t}InitPackage(t){this.ot=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.ot})}}let G=new class extends h{constructor(){super(null,F)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};var L=null,_=null;class M{constructor(){this.ct={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this.dt=new Map,this.ft=this.yt.bind(this),this.vt={hdl:null},this.wt=!0,this.Nt=-1,this.xt=!1,this.It=1,this.wt=!1,this.bt(),this.Rt=!1,this.Ct=[],this.At=1,this.Ot.OnScreenHide&&window.JsView?.onVisibilityChange((t=>{'{"status":"hide"}'===t&&this.Ot.OnScreenHide()}))}bt(){void 0!==global.NativeSendImpactSensorSyncData&&global.NativeSendImpactSensorSyncData.bind(this.vt),void 0!==global.NativeSetStepFpsSwitch&&(L=global.NativeSetStepFpsSwitch.bind(this.vt)),void 0!==global.NativeSetGlobalConfig&&(_=global.NativeSetGlobalConfig.bind(this.vt)),this.Ot=global.NativeGetRenderIntf(),this.Ot.RegisterSwapFunc((()=>{this.RequestSwap()})),this.Pt=this.Pt.bind(this),this.Ot.RegisterPreDomSyncFunc((()=>{this.kt()})),this.Ot.RegisterOnScreenInfo(this.Tt.bind(this))}SetStepFpsSwitch(t){this.wt?L&&L(t):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this.Ct.push((()=>{this.SetStepFpsSwitch(t)})))}SetGlobalConfig(t){if(this.wt){if(_){let s=JSON.stringify(t);console.log("SetGlobalConfig set with "+s),_(s),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this.Ct.push((()=>{this.SetGlobalConfig(t)}))}Et(){if(this.Ct.length>0){for(let t=0;t<this.Ct.length;t++)this.Ct[t]();this.Ct=[]}}RequestSwap(){this.xt?this.At++:(this.xt=!0,this.At++,this.It++,this.Ft(this.It))}Ft(t){let s=this,e=this.At;Promise.resolve().then((()=>{e==s.At?s.InstantPerformSwap():t==this.It&&s.Ft(t)}))}NotifyNetTypeStatus(t,s){}EnableRequestSwap(t){this.Rt=t,this.Ot.EnableRequestSwap(t)}InstantPerformSwap(){this.xt&&(this.xt=!1,this.It++,this.Pt(!1))}Dt(t,s,e,i,n){let r=null,h=null,a=null,l=null,o=null;if(t.HasUpdate()&&(a=t.ReadSyncList()),s.HasUpdate()&&(h=s.ReadSyncList()),e.HasUpdate()&&(r=e.ReadSyncList()),i?.HasUpdate()&&(l=i.ReadSyncList()),null==r&&null==h&&null==a&&null==l||(o=this.Ot.SyncForgeJsCall(JSON.stringify({TexSync:a,AnimSync:h,ViewSync:r,SensorSync:l}),n)),o){let s;this.xt=!1,s=JSON.parse(o).TexSyncRet,s&&this.Gt(t,s)}}kt(){this.Dt(a,R,P,null,c.PickArray())}Pt(t){if(!this.Rt)return void(this.xt=!1);b.update();let s=c.GetSize();if(this.Dt(a,R,P,null,c.PickArray()),this.dt.size>0&&this.dt.forEach(this.ft),this.Dt(l,C,k,F,c.PickArray()),s==c.GetSize())c.ResetForNextSwap();else{let t=c.GetSize();t>50&&console.warn("Warning: temp sync store kept with large size = "+t)}t=!!t,this.xt=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this.Ot.DoRequestSwap(t)}GetScreenInfo(){return this.ct}SetForgeRtHandler(t){this.vt.hdl=t,this.wt=!0,this.Ot.SetForgeRtHandler(t),this.Et()}InitScreenBuffer(t,s){isNaN(t)&&(t=1),isNaN(s)&&(s=1280);var e=s*t,i=e/16*9;this.ct.width=Math.floor(e),this.ct.height=Math.floor(i),this.ct.x=2/this.ct.width,this.ct.y=2/this.ct.height,this.ct.perspective=this.ct.x,this.ct.scaleRatio=t,this.ct.designedWidth=s}InitNativeScreenBuffer(){if(this.wt){var t=JSON.stringify({displayScaleRatio:this.ct.scaleRatio,designedMapWidth:this.ct.designedWidth});this.Ot.InitScreenBuffer(t)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(t,s){this.Ot.SyncBackStatus(t,s)}TakeAndSyncBackStatus(){1==this.Ot.TakeAndSyncBackStatus()&&this.RequestSwap()}Tt(t,s,e,i,n){this.ct.width=t,this.ct.height=s,this.ct.x=e,this.ct.y=i,this.ct.perspective=n}HasPendingRenderBreak(){return!!this.wt&&this.Ot.HasPendingRenderBreak()}FinishRenderBreak(t){this.wt?this.Ot.FinishRenderBreak(t):(console.warn("FinishRenderBreak(): API link status no ready, delay"),this.Ct.push((()=>{this.Ot.FinishRenderBreak(t)})))}AddWillSwapListener(t,s){this.dt.set(t,s)}AddSwappedOnceObserver(t){this.wt?this.Ot.AddSwappedOnceObserver(t):(console.warn("AddSwappedOnceObserver(): API link status no ready, delay"),this.Ct.push((()=>{this.Ot.AddSwappedOnceObserver(t)})))}ActiveComponent(t){this.wt?this.Ot.ActiveComponent(t):(console.warn("ActiveComponent(): API link status no ready, delay"),this.Ct.push((()=>{this.Ot.ActiveComponent(t)})))}ShutdownComponents(t){this.wt?this.Ot.ShutdownComponents(t):(console.warn("ShutdownComponents(): API link status no ready, delay"),this.Ct.push((()=>{this.Ot.ShutdownComponents(t)})))}SetPlatformMsgDisp(t){this.Lt=t}GetPlatformMsgDisp(){return this.Lt}GetTextToolsApi(){return this.Ot.TextToolApi}yt(t){t()}Gt(t,s){let e;e=s.idAlter,e&&t.ProcAlterIds(e.proxy,e.real)}}class B{constructor(){this._t=!1,this.Mt=0,this.Bt=!1,this.Vt=0,this.Jt=0,this.Wt=!1,this.Ut=!1,this.qt=0,this.Ht=0,this.Kt=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this.Kt&&(this.Wt=!0,this.zt())}SetTranslateDelay(t){B.sKeyTranslateDelay=t}CheckKey(t){if(!t.timeStamp||this._t)return!1;this.Bt=!0;const s=Date.now(),i=t.timeStamp;!this.Wt&&i-this.Mt>3e3&&(this.Vt=s,this.Jt=i,this.Mt=i);let n=s-this.Vt;(n<0||n>5e3)&&(this.Kt?this.zt():(this.Vt=s,this.Jt=i),n=0);return n+this.Jt-i>B.CONST_MAX_PASSING_GAP&&Math.abs(this.Ht-i)<B.CONST_MIN_VALID_KEY_GAP&&!t.repeat?(!this.Ut&&this.Wt&&(this.qt++,this.qt>50&&e("More than 50 keys are expired...")),!0):(this.Ut||(this.Ut=!0),this.Ht=i,!1)}toggleKeyGuard(){this._t=!this._t}IsActive(){return this.Bt}zt(){this.Vt=Date.now(),this.Jt=window.jRuntimeBridge.getSystemUptimeMillis()-B.sKeyTranslateDelay}}B.CONST_MAX_PASSING_GAP=20,B.CONST_MIN_VALID_KEY_GAP=180,B.sKeyTranslateDelay=5;let V,J=new B;class W{constructor(n,r,h){var a;if(this.jt=null,this.Yt=1280,this.Xt=!1,this.Qt=0,a=4,console.log.bind(console),a>0&&console.error.bind(console),a>1&&(s=console.error.bind(console)),a>2&&(e=console.warn.bind(console)),a>3&&(i=console.log.bind(console)),a>4&&console.debug.bind(console),this.$t=new I,this.Zt=new M,t.sRenderBridge=this.Zt,isNaN(h)&&(h=1280),this.Yt=h,this.Xt=!1,this.ts(n,r,h),this.ss={keyProc:null,keyUpProc:null,activityStateProc:null},this.es(this.ss),this.ns(this.ss),this.rs=this.Zt.InstantPerformSwap.bind(this.Zt),null!=n){this.Qt=n.canvasNativeHandle;for(let t in this.ss)n[t]=this.ss[t]}t.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this.$t}DelayedActivateCanvas(t){if(0==this.Qt){this.Qt=t.canvasNativeHandle,this.hs(t);for(let s in this.ss)t[s]=this.ss[s];this.Zt.InitNativeScreenBuffer(),this.Zt.RequestSwap()}else s("Error: already activated")}GetCanvasHandler(){return this.Qt}StartActivity(t){this.jt=t}ts(t,s,e){this.hs(t),this.Zt.InitScreenBuffer(s,e),this.Zt.InitNativeScreenBuffer()}hs(t){null!=t&&(this.Zt.SetForgeRtHandler(t.frtNativeHandle),t.renderBridge=this.Zt,this.Zt.EnableRequestSwap(!0))}ls(t){if(this.Xt)return!0;var s=!0;if(this.jt){if(J.CheckKey(t))return console.log("keyEventGuard ignore keys"),!1;J.IsActive()&&this.Zt.InstantPerformSwap(),s=!this.jt.DispatchKeyDown(t),this.Zt.TakeAndSyncBackStatus()}return s}us(t){if(this.Xt)return!0;var s=!0;return this.jt&&(s=!this.jt.DispatchKeyUp(t),this.Zt.TakeAndSyncBackStatus()),s}es(t){t.keyProc=this.ls.bind(this),t.keyUpProc=this.us.bind(this)}ns(t){let s=this;var e=function(t){var e=t.State;switch(console.log("ActivityStateListenerChanged, state:"+e),e){case"onActivityResumed":s.Zt.EnableRequestSwap(!0),s.Zt.RequestSwap(),s.Zt.InstantPerformSwap();break;case"onActivityPaused":s.Zt.EnableRequestSwap(!1)}}.bind(this);t.activityStateProc=e}}class U{constructor(){this.cs=null}Init(t){let s=1280,e=1;try{if(H){let t=H();"number"==typeof t.width&&(s=t.width),"number"==typeof t.displayScale&&(e=t.displayScale)}}catch(t){console.log("Note: DesignMap failed")}this.cs=new W(t,e,s),q?q(this.cs):console.error("FATAL: no found entry")}getActivityManager(){return this.cs}}let q=null,H=null;class K{constructor(t){this.PageName=t,this.ds=null,this.ps=null,this.SubPages=[],this.fs=null,this.Xt=!1}OnRenderFrame(){s("OnRenderFrame() MUST override")}OnKeyDown(t){return!1}OnKeyUp(t){return!1}DispatchKeyDown(t){if(this.Xt)return!0;let s=!1;return this.ds&&(s=this.ds.DispatchKeyDown(t)),s||(s=this.OnKeyDown(t)),s}OnCustomEvent(t){return!1}BubbleCustomEvent(t){this.OnCustomEvent(t)||this.fs&&this.fs.BubbleCustomEvent(t)}DispatchKeyUp(t){if(this.Xt)return!0;let s=!1;return this.ds&&(s=this.ds.DispatchKeyUp(t)),s||(s=this.OnKeyUp(t)),s}PrintLastFocusPage(){let t="------"+this.PageName+"\n",s=this.fs;return s&&(t+=s.PrintLastFocusPage()),t}IsFocus(){return!this.fs||this.fs.ds==this}Ss(){return this.IsFocus()&&!this.ds}SetParent(t){null!=t?(this.fs=t,t.SubPages.push(this)):n("ERROR: parent is null")}SetParentPage(t){this.SetParent(t)}OnRemoveFromTree(){if(this.fs=null,this.SubPages&&this.SubPages.length>0){for(let t of this.SubPages)t.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(t){t==this.ds&&(this.ds=null),t==this.ps&&(this.ps=null);for(let s=0;s<this.SubPages.length;s++)if(t==this.SubPages[s]){this.SubPages.splice(s,1);break}}ClearSubPages(){this.SubPages=[],this.ds=null,this.ps=null}GetParentPage(){return this.fs}Focus(t=!1){if(this.IsFocus()){if(!t)return void i("requestFocus(): Already focused name="+this.PageName);if(this.Ss())return void i("requestFocus(): Already focused name="+this.PageName)}if(this.fs){let s,e=[],i=this;for(;i.fs&&!i.IsFocus();)e.push(i),i=i.fs;s=t&&0==e.length?this.ds:e[e.length-1].fs?.ds;let r=[];for(;s;)r.push(s),s=s.ds;for(let t=r.length-1;t>=0;t--)r[t].ys();for(let t=e.length-1;t>=0;t--)e[t].vs();if(t)this.ps=null;else{let t=e[0];for(;t.ps&&null==t.ds;)t.ps.vs(),t=t.ds,t||n("ERROR: focus chain is broken")}}}ReturnFocusToParent(){this.fs&&(this.IsFocus()&&this.fs.Focus(!0),this.fs.ds==this&&(this.fs.ds=null),this.fs.ps==this&&(this.fs.ps=null))}vs(){this.fs?(this.fs.ds=this,this.fs.ps=this,this.OnFocus()):s("No dispatcher")}ys(){this.fs?this.fs.ds==this?(this.fs.ds=null,this.OnBlur()):e("Not focus yet, page name="+this.PageName):s("No dispacher")}GetFocusChild(){return this.ds}OnFocus(){e("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){e("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this.Xt=!0}UnKeyLock(){this.Xt=!1}}var z;!function(t){t.VIEW_COMMAND=0,t.TEXTURE_COMMAND=1,t.ANIM_COMMAND=2,t.SYNC_COMMAND=3,t.APIC_PLAY=0,t.APIC_STOP=1,t.GET_BOUNDING_RECT=0,t.FILTER_VIEW_WAVE=1,t.TRANSLATE_FRAME_ALT_SPEED=0,t.FREE_MOVE_RUN_CMDPACKS=1,t.EXE_DEFAULT=0,t.EXE_AFTER_RENDER=1}(z||(z={}));const j=(t,s)=>{let e=0,i=0,n=0;return isNaN(t)||(e|=1,i=t),isNaN(s)||(e|=2,n=s),{e:e,x:i,y:n}};var Y,X,Q;!function(t){t.ActEvent_ActFinish=1,t.ActEvent_Speed_X_Revert=2,t.ActEvent_Speed_Y_Revert=3,t.ActEvent_ActReject=4,t.ActEvent_ActDragStart=5,t.ActEvent_ActDragEnd=6,t.ActEvent_ActFlingStart=7,t.ActEvent_ActFlingProgress=8,t.ActEvent_ActFlingEnd=9,t.ActEvent_ActTouchDown=10,t.ActEvent_ActTouchRelease=11,t.ActEvent_ActFlingCancel=12,t.ActEvent_ActFlingDrop=13,t.ActEvent_MovementSync=14}(Y||(Y={})),function(t){t.GroupType_ActionAssoc=10,t.GroupType_Fling=11,t.GroupType_Invalid_Ext=65535}(X||(X={})),function(t){t.FLING_ON_PROGRESS_INTERVAL=200}(Q||(Q={}));const $=(t,s)=>{t.gtype=s.g,t.once=s.m?0:1;let e=s.s;e&&(t.name=e),t.brk=s.brk?1:0};const Z=51;function tt(t){return t?JSON.stringify(t.Package()):null}let st=new class{constructor(){this.P=A}CreateTranslate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("translate animation duration invalid="+n),n=0),this.P.CallToNative(1,[t,s,e,i,n,tt(r),h])}CreateRotate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("rotate animation duration invalid="+n),n=0),this.P.CallToNative(2,[t,s,e.x,e.y,e.z,i.x,i.y,i.z,n,tt(r),h])}CreateScale(t,s,e,i,n,r,h,a,l,o,u){l!=1/0&&null!=l||(console.warn("scale animation duration invalid="+l),l=0),this.P.CallToNative(3,[t,s,e,i,n,r,h,a,l,tt(o),u])}CreateTranslateFrame(t,s,e,i,n,r,h,a){this.P.CallToNative(5,[t,s,e,i,!!n,r,h,a])}CreateCssKeyframe(t,s,e,i,n,r){s!=1/0&&null!=s||(console.warn("css animation duration invalid="+s),s=0),this.P.CallToNative(6,[t,s,tt(e),i,n,r])}CreateFreeMoveAnimation(t,s,e,i){this.P.CallToNative(7,[t,s?c.AddData(s):0,e,i?1:0])}CreateShaderAnimation(t,s,e){this.P.CallToNative(8,[t,tt(s),e])}};class et{constructor(){this.AnimNativeId=m.genAnimationId(),this.P=new O(this.AnimNativeId),this.ws=null,this.Ns=null}SetAnimationListener(t){this.gs(t)}AddAnimationListener(t){this.ws&&t.AddInherit(this.ws),this.gs(t)}RemoveAnimationListener(){this.ws=null}Enable(t){this.P.CallToNative(2,[t])}EnableInfinite(){return this.P.CallToNative(3,null),this}SetRepeat(t){return this.P.CallToNative(5,[t]),this}EnableDelay(t){return this.P.CallToNative(4,[t]),this}SetStartPos(t){return t>=0&&t<=1?this.P.CallToNative(6,[t]):console.warn("Warning: SetStartPos() out of range"),this}gs(t){let s=!0;if(this.ws&&(s=this.ws.ListenerEnabledFlags==t.ListenerEnabledFlags),this.ws=t,null!=this.ws&&(null==this.Ns||!s)){let t=this;this.Ns=s=>{t.ws?.InvokeFromNativeForge(s)};let s=c.AddData(this.Ns);this.P.CallToNative(1,[s,this.ws.ListenerEnabledFlags])}}}var it,nt;!function(t){t.ReleaseAfterEndCallback=1,t.KeepTransform=2,t.AckFinalProgress=4,t.AckRepeat=8,t.Reverse=16}(it||(it={})),function(t){t.AltSpeed=(t,s,e)=>{let i={S60:Math.floor(100*s/55)/100,T:e};t?.DispatchAnimCommand(z.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(i))},t.RunFreeMoveCmdPacks=(t,s)=>{t?.DispatchAnimCommand(z.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(s))}}(nt||(nt={}));class rt{constructor(){this.Pacakge=this.Package.bind(this)}Package(){}xs(t){return{T:t,St:null}}}class ht extends rt{constructor(){super()}Package(){return this.xs(0)}}class at extends rt{constructor(){super()}Package(){return this.xs(1)}}class lt extends rt{constructor(){super()}Package(){return this.xs(2)}}class ot extends rt{constructor(){super()}Package(){return this.xs(5)}}class ut extends rt{constructor(t,s,e,i,n){super(),this.Is=!1,this.bs=t,this.Rs=e,this.Cs=s,this.As=i,this.Os=n}Package(){var t=this.xs(3);return t.St={X1:this.bs,X2:this.Rs,Y1:this.Cs,Y2:this.As,Dur:this.Os},t}}class ct extends rt{constructor(t,s,e){super(),this.Ps=t,this.ks=s,this.Ts=e}Package(){var t=this.xs(7);return t.St={In:this.Ps,Out:this.ks,MS:this.Ts},t}}var dt;!function(t){var s;(s=t.Circular||(t.Circular={})).In=new ht,s.Out=new at,s.InOut=new lt,s.Deceleration=new ot,t.str2Easing=function(s){if(!s||"string"!=typeof s)return null;if("ease-in"===s)return t.Circular.In;if("ease-out"===s)return t.Circular.Out;if("ease-in-out"===s)return t.Circular.InOut;if(-1!==s.indexOf("cubic-bezier")){const t=s.split("(")[1].split(")")[0].split(",");if(!(4!==t.length||isNaN(parseFloat(t[0]))||isNaN(parseFloat(t[1]))||isNaN(parseFloat(t[2]))||isNaN(parseFloat(t[3]))))return new ut(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),0)}else if(-1!==s.indexOf("jsv-ease")){const t=s.split("(")[1].split(")")[0].split(",");if(3===t.length&&!isNaN(parseFloat(t[0]))&&!isNaN(parseFloat(t[1]))&&!isNaN(parseFloat(t[2])))return new ct(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))}return null}}(dt||(dt={}));class pt{constructor(){this.Es="COMMON"}Type(){return this.Es}ToSyncJsonObj(t){return t||(t={}),t.typ=this.Es,t}}let ft=new class{constructor(){this.Fs={},this.Ds=0}add(t){let s=t.view.ViewId;return this.Fs.hasOwnProperty(s)&&(this.Fs[s]=t),s}remove(t){this.Fs[t]&&delete this.Fs[t]}get(t){return this.Fs[t]}clear(){this.Fs={},this.Ds=0}};class St{constructor(){this.SensorId=m.genViewId(),this.Gs=new D(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(t){G.CallToNative(1,[this.SensorId,t],!0)}Recycle(){this.Gs.CallToNative(1,null,!0)}}class yt{constructor(t,s,e,i){this.Texture=t,this.MaskSetting=s,void 0===i&&(i=!0),this.HasAlpha=i}ToSyncJsonObj(t=void 0){return t||(t={}),t.texId=this.Texture?this.Texture.TexId:0,t.alpha=this.HasAlpha,this.MaskSetting?t.mask=this.MaskSetting.ToSyncJsonObj():t.mask=null,t}}var vt;!function(t){var s,e,i;(s=t.ControlType||(t.ControlType={})).DoKeepInRender=1,s.RecycleKeptView=2,(e=t.SyncedType||(t.SyncedType={})).Synced=0,e.NotSynced=1,e.RequestKeepInRender=2,e.OnKeepingInRender=3,e.RecycleKeeping=4,(i=t.TextureCoordAnchor||(t.TextureCoordAnchor={})).LeftTop=1,i.CenterTop=2,i.RightTop=3,i.LeftMiddle=4,i.Center=5,i.RightMiddle=6,i.LeftBottom=7,i.CenterBottom=8,i.RightBottom=9}(vt||(vt={}));let wt=new class{constructor(){this.P=E}CreateNativeView(t,s,e){this.P.CallToNative(1,[t,s],e)}CreateJsRootView(t){this.P.CallToNative(2,[t])}CreateDomProxyView(t,s,e){this.P.CallToNative(3,[t,s,e?1:0],!0)}};class mt{constructor(t,s,e=!1){this.Visibility=void 0,this.P=new T(t),this.ViewId=t,this.TextureSetting=null,this.Ls=null,this.B=e,this._s=null,this.CreateView(s)}CreateView(t=void 0){}ResetTexture(t=null){if(!this.Ls){this.Ls=this.P.CallToNative(1,null,this.B);let t=this;this.P.AddStartSyncCallback((()=>{this.TextureSetting?t.P.AlterCallParams(t.Ls,[t.TextureSetting.ToSyncJsonObj()]):t.P.AlterCallParams(t.Ls,[null]),t.Ls=null}))}this.TextureSetting=t}BindedPageBase(t){}SetVisibility(t){if("INHERIT"!==t&&void 0!==t||(t="VISIBLE"),this.Visibility!=t){this.Visibility=t;let s=0;switch(t){case"VISIBLE":s=1;break;case"GONE":s=2;break;case"HIDDEN":s=3;break;default:return void console.error("unknown visible type="+t)}this.P.CallToNative(2,[s],this.B)}}AddView(t,s){let e={x:0,y:0,width:0,height:0};s&&(e=this.Ms(s)),this.P.CallToNative(3,[t.ViewId,s?1:0,e.x,e.y,e.width,e.height],this.B)}ClearViews(){this.P.CallToNative(4,null,this.B)}ResetTextureCssTransform(t,s){t=t||"",s=s||"",this.P.CallToNative(5,[t,s],this.B)}SetTextureCoord(t,s,e,i,n=vt.TextureCoordAnchor.Center){this.P.CallToNative(9,[t,s,e,i,n],this.B)}ResetLayoutParams(t){let s;null!=t?(s=this.Ms(t),this.P.CallToNative(6,[s.x,s.y,s.width,s.height],this.B)):n("ResetLayoutParams(): new params is null")}Ms(t){return{x:isNaN(t.x)?0:t.x,y:isNaN(t.y)?0:t.y,width:isNaN(t.width)?0:t.width,height:isNaN(t.height)?0:t.height}}GetBoundingClientRect(){return new Promise(((t,s)=>{null!=this._s&&(this._s=null),this._s=e=>{null!=this._s&&(this._s=null);const i=JSON.parse(e);0==i.status?t(i.data):s(i.error)};const e=c.AddData(this._s);this.P.CallToNative(12,[e],this.B)}))}StartAnimation(t,s,e){let i=t?t.AnimNativeId:0;this.P.CallToNative(7,[i,isNaN(e)?0:e],this.B)}StopAnimation(){this.P.CallToNative(8,null,this.B)}DispatchAnimCommand(t,s){this.P.CallToNative(13,[t,s],this.B)}StartTextureAnimation(t){let s=t?t.AnimNativeId:0;this.P.CallToNative(10,[s],this.B)}StopTextureAnimation(){this.P.CallToNative(11,null,this.B)}DragEnables(t){this.P.CallToNative(14,[t],this.B)}SetTapListener(t=void 0){if(null!=t){const s=c.AddData(t);this.P.CallToNative(15,[s],this.B)}else this.P.CallToNative(15,[0],this.B)}EnableAutoSize(){this.P.CallToNative(16,[],this.B)}RegisterFlexAssigned(t=void 0){if(null!=t){const s=c.AddData(t);this.P.CallToNative(17,[s],this.B)}else this.P.CallToNative(17,[0],this.B)}EnableVisibleTestRect(){this.P.CallToNative(18,[],this.B)}Capture2Texture(t,s=void 0,e=void 0){if(!t)return void console.error("Error: Capture2Texture need target texture");let i=t.GetTextureId();if(!s)return void console.error("Error: Capture2Texture need callback");const n=c.AddData(s),r=e?JSON.stringify(e):"";this.P.CallToNative(19,[i,n,r],this.B)}}class Nt extends mt{constructor(t=null){!t||t instanceof yt||n("ERROR:LayoutView need TextureSetting as parameter"),super(m.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",t&&this.ResetTexture(t)}CreateView(t){wt.CreateNativeView(this.ViewId,0,t.DomDepends)}}function gt(t){let s=[];if(t instanceof Array)for(let e of t)e instanceof mt&&s.push(e.ViewId);return s}class xt extends St{constructor(t,s,e,i){super(),this.InitSet(t,s,e,i)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(t,s,e,i){let n=0;e&&(n=c.AddData((t=>{1==t?e.OnBeginContact?.():2==t&&e.OnEndContact?.()}))),this.Gs.CallToNative(20,[t.ViewId,s.ViewId,n,i?i.SensorId:0],!0)}}let It={StartTrace:(t,s,e,i)=>new xt(t,s,e,i),Callback:class{constructor(t,s){this.OnBeginContact=t,this.OnEndContact=s}UpdateImpactCallback(t){this.OnBeginContact=t}UpdateLeaveCallback(t){this.OnEndContact=t}},AutoFroze:class extends St{constructor(t,s){super(),this.InitSet(),this.Bs(gt(t)),this.Vs(gt(s)),this.Js()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this.Gs.CallToNative(25,null,!0)}UpdatePreImpactList(t){this.Bs(gt(t)),this.Js()}UpdateOnImpactList(t){this.Vs(gt(t)),this.Js()}Bs(t){this.Gs.CallToNative(26,[...t],!0)}Vs(t){this.Gs.CallToNative(27,[...t],!0)}Js(){this.Gs.CallToNative(28,null,!0)}}};var bt;!function(t){t[t.NONE=0]="NONE",t[t.TEXT=1]="TEXT",t[t.PASSWORD=2]="PASSWORD",t[t.TEXT_AREA=3]="TEXT_AREA",t[t.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",t[t.SEARCH=5]="SEARCH",t[t.URL=6]="URL",t[t.EMAIL=7]="EMAIL",t[t.TELEPHONE=8]="TELEPHONE",t[t.NUMBER=9]="NUMBER"}(bt||(bt={}));var Rt,Ct;!function(t){var s;(s=t.UniformType||(t.UniformType={}))[s.FLOAT=1]="FLOAT"}(Rt||(Rt={})),function(t){var s,e;(s=t.Type||(t.Type={}))[s.GRAY_DOWN=1]="GRAY_DOWN",s[s.WAVE=2]="WAVE",(e=t.Wave||(t.Wave={}))[e.CIRCLE_WAVE=1]="CIRCLE_WAVE",e[e.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(Ct||(Ct={}));let At=0;class Ot{constructor(){this.sourceList=[]}addSource(t,s,e,i,n){i=i??{type:Ct.Wave.CIRCLE_WAVE},n=n??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const r=++At;let h=0,a=0,l=0;return i.type==Ct.Wave.RECTANGLE_WAVE&&(h=i.width,a=i.height,l=i.radius),this.sourceList.push(r,t,s,e,h,a,l,n.timeDecay,n.distanceDecay,n.speed,n.frequency,n.waveNum),r}getSourceList(){const t=this.sourceList;return this.sourceList=[],t}}class Pt extends mt{constructor(t,s){super(m.genViewId(),{DomElementId:t,UseMaskView:s},!0),this.Visibility="VISIBLE"}CreateView(t){wt.CreateDomProxyView(this.ViewId,t.DomElementId,t.UseMaskView)}RegisterOnProxyReady(t){t?.()}}function kt(t){return isNaN(t)?0:parseInt(t)}function Tt(t){return{fontFamily:t.fontFamily?t.fontFamily:_t.sDefaultFont,fontSize:kt(t.fontSize),italic:"italic"===t.fontStyle,bold:"bold"===t.fontWeight,hasEmoji:1==t.JsvTextEmoji}}function Et(){return t.sRenderBridge.GetTextToolsApi()}function Ft(t,s){let e=Tt(s);return Et().GetTextWidth(t,JSON.stringify(e))}function Dt(t,s){let e=Tt(s);const i=Et().GetOneLineTextDrawWidth(t,JSON.stringify(e)),n={totalWidth:i[0],sliceInfo:[]};for(let t=1;t<i.length;t+=3)n.sliceInfo.push({start:i[t],end:i[t+1],width:i[4]});return n}function Gt(t,s,e,i,n,r){let h;if(t>0)h=Et().GetCursorPosition(t,s,null,null,null,1);else{let a=Tt(i),l=function(t){let s=kt(t.height),e=kt(t.lineHeight),i="string"==typeof t.wordWrap?t.wordWrap:"none";return"nowrap"==t.whiteSpace&&(i="none"),{width:kt(t.width),height:s,textAlign:"string"==typeof t.textAlign?t.textAlign:"left",lineHeight:0==e?s:e,wordWrap:i,textOverflow:"string"==typeof t.textOverflow?t.textOverflow:"clip"}}(n);h=Et().GetCursorPosition(t,s,e,JSON.stringify(a),JSON.stringify(l),r?1:0)}return h}function Lt(t){Et().RemoveCursorTextCache(t)}var _t;!function(t){t.sDefaultFont="黑体",t.sDefaultFontSize=30,t.sDefaultFontColor="#FFFFFF",t.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",t.GetTextWidth=Ft,t.GetOneLineTextDrawWidth=Dt,t.GetCursorPosition=Gt,t.RemoveCursorTextCache=Lt}(_t||(_t={}));let Mt=t;Mt.Run=function(t){return V=new U,V.Init(t),V},Mt.InitStarter=function(s,e){t.DesignMap=e,q=s,H=e},Mt.NewDomProxyView=function(t,s){return new Pt(t,s)},Mt.sFrameCount=b,Mt.NativeConstant=z,Mt.PageBase=K,Mt.ReactActivity=class extends K{constructor(t,s){super(t),this.$t=s.GetTextureManager()}GetTextureManager(){return this.$t}SetContentView(t,s){this.Ws=t,this.Us=s}},Mt.ViewTextureMask=class extends pt{constructor(t){super(),this.Es="TEXTURE",this.ImageTexture=t}ToSyncJsonObj(t){return t||(t={}),t.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(t)}},Mt.ViewRoundCornerMask=class extends pt{constructor(t,s,e,i){super(),this.Es="CORNER",this.qs=t,this.Hs=isNaN(s)?t:s,this.Ks=isNaN(e)?t:e,this.zs=isNaN(i)?t:i}ToSyncJsonObj(t){return t||(t={}),t.tl=this.qs,t.tr=this.Hs,t.bl=this.Ks,t.br=this.zs,super.ToSyncJsonObj(t)}},Mt.sViewStore=ft,Mt.ViewInfo=class{constructor(t,s){this.view=t,this.layout_params=s}},Mt.LayoutView=Nt,Mt.AutoStretchView=class extends Nt{constructor(t=null){super(t)}CreateView(t){wt.CreateNativeView(this.ViewId,12,t.DomDepends)}},Mt.EditControlView=class extends Nt{constructor(s=null){super(s),this.js=null,this.Ys=this.Xs.bind(this),this.Qs="_JscIme_"+this.ViewId,t.sRenderBridge.GetPlatformMsgDisp().subscribe(this.Qs,this.Ys)}CreateView(t){wt.CreateNativeView(this.ViewId,5,t.DomDepends)}releaseResource(){t.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this.Qs,this.Ys)}setEditorStyle(t,s,e,i){this.P.CallToNative(5005,[t,s,e,i],this.B)}showIme(t,s,e,i,n){t!=bt.NONE?(void 0!==e&&null!=e||(e=s.length>0?s.length:0),e<0?e=0:e>s.length&&(e=s.length>0?s.length:0),this.P.CallToNative(5001,[t,encodeURIComponent(s),e,i,n],this.B)):console.log("showIme inputType error")}hideIme(){this.P.CallToNative(5002,null,this.B)}updateCursorOffset(t,s,e,i){this.P.CallToNative(5003,[t,s,e,i],this.B)}addImeEventListener(t){this.js=t}$s(t){this.P.CallToNative(5006,[t],this.B)}Xs(t){if(t){var s=JSON.parse(t);if("text"==s.type){var e=s.text;let t=s.selectStart,i=s.scrollLeft,n=s.scrollTop;this.js?.OnTextChanged(decodeURIComponent(e),t,i,n)}else if("vstatus"==s.type){let t=s.isVisible?1:0;this.$s(t),this.js?.OnStatusChanged(t)}else if("action"==s.type){var i=s.action;this.js?.OnEditAction(i)}}else console.log("EditControlView","_ImeEventListener input_data error")}},Mt.FilterView=class extends Nt{constructor(t=null,s){super(t),this.Zs=s??Ct.Type.GRAY_DOWN,this.P.CallToNative(10002,[this.Zs,[]],this.B)}CreateView(t){wt.CreateNativeView(this.ViewId,10,t.DomDepends)}FilterSwitch(t){this.P.CallToNative(10001,[t],this.B)}AddWaveSourceList(t){if(this.Zs==Ct.Type.WAVE){const s={T:1,L:t.getSourceList()};this.DispatchCommand(z.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(t,s,e,i={type:Ct.Wave.CIRCLE_WAVE},n={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this.Zs==Ct.Type.WAVE){const r=new Ot,h=r.addSource(t,s,e,i,n);return this.AddWaveSourceList(r),h}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(t){if(this.Zs==Ct.Type.WAVE){const s={T:2,L:t instanceof Array?t:[t]};this.DispatchCommand(z.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(t,s){s&&this.P.CallToNative(10003,[t,s],this.B)}},Mt.FragShaderView=class extends Nt{constructor(t=null){super(t)}CreateView(t){wt.CreateNativeView(this.ViewId,11,t.DomDepends)}SetShaderInfo(t,s,e,i){const n={shaderStr:t,uniformParams:s,textureParams:e};let r=0;null!=i&&(r=c.AddData(i)),this.P.CallToNative(7001,[JSON.stringify(n),r],this.B)}},Mt.NativeSharedView=class extends Nt{constructor(t){super(t),this.te=window.JsView?window.JsView.getJsContextId():0,this.se=null,this.SetTrackId(this.te+"_"+this.ViewId)}CreateView(t){wt.CreateNativeView(this.ViewId,9,t.DomDepends)}GetTrackId(){return this.se}SetTrackId(t){this.se=t,this.P.CallToNative(10101,[this.se],this.B)}SetOverSize(t){this.P.CallToNative(10102,[isNaN(t)?0:t],this.B)}},Mt.NinePatchView=class extends Nt{CreateView(t){wt.CreateNativeView(this.ViewId,4,t.DomDepends)}SetRepeat(t,s){this.P.CallToNative(4001,[t,s],this.B)}SetPadding(t,s){this.P.CallToNative(4002,[t,s],this.B)}SetImageDspSize(t,s){this.P.CallToNative(4003,[t,s],this.B)}SetDesignMapWidth(t){this.P.CallToNative(4004,[t],this.B)}EnableAlphaMix(t){this.P.CallToNative(4005,[t.TexId],this.B)}},Mt.PreloadView=class extends Nt{constructor(t=null){super(t)}CreateView(t){wt.CreateNativeView(this.ViewId,7,t.DomDepends)}},Mt.SprayView=class extends Nt{constructor(t=null){super(t),this.onStop=null}SetSprayInfo(t,s,e,i,n,r,h,a,l,o,u,c,d,p,f,S,y,v,w,m,N,g,x){this.P.CallToNative(6001,[t,s,e,i,n,r,h,a,l,o,u,c,d,p,!!f,!!S,!!y,v,w,m,N,g,x],this.B)}CreateView(t){wt.CreateNativeView(this.ViewId,6,t.DomDepends)}Start(){this.P.CallToNative(6002,[],this.B)}Stop(t=!1){this.P.CallToNative(6003,[t],this.B)}RegisterOnStop(t){this.onStop=t}ee(t){try{if("onStop"===JSON.parse(t).type)this.onStop?.()}catch(t){console.error("SprayView onEvent error",t)}}RegisterEventListener(){const t=c.AddData(this.ee.bind(this));this.P.CallToNative(6004,[t])}},Mt.TextInputType=bt,Mt.FilterViewType=Ct,Mt.TextureSetting=yt,Mt.ExternalTextureSetting=yt,Mt.TextUtils=_t,Mt.VisibleSensor=class extends St{constructor(t,s=null){super(),this.InitSet(t,s)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(t,s){let e=0;s&&(e=c.AddData(((t,e,i,n)=>{s(1==t,1==e,1==i,1==n)}))),this.Gs.CallToNative(11,[t.ViewId,e],!0)}ResetArea(t){"number"!=typeof t.horizon&&(console.log("horizon not set, default to 1.0"),t.horizon=1),"number"!=typeof t.vertical&&(console.log("vertical not set, default to 1.0"),t.vertical=1),this.Gs.CallToNative(12,[t.horizon,t.vertical],!0)}Enable(t){this.Gs.CallToNative(13,[!!t],!0)}ResetContainer(t){let s;s=t?t.ViewId:0,this.Gs.CallToNative(14,[s],!0)}},Mt.EnvBlockerSensor=class extends St{constructor(t){super(),this.InitSet(t)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(t){this.Gs.CallToNative(30,[t.ViewId],!0)}ResetTopGID(t){this.ie(0,t)}ResetBottomGID(t){this.ie(1,t)}ResetLeftGID(t){this.ie(2,t)}ResetRightGID(t){this.ie(3,t)}ie(t,s){this.Gs.CallToNative(31,[t,isNaN(s)?0:parseInt(s)],!0)}Enable(t){this.Gs.CallToNative(32,[t],!0)}},Mt.sImpactSensorManager=It,Mt.TextureInstantLoad=x,Mt.QRCodeLevel=g,Mt.ColorSpace=N,Mt.TextureManager=I,Mt.FreeMoveExternType=X,Mt.AnimationListener=class{constructor(t,s,e){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=t,this.ne=t,t&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=s,this.re=s,s&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=e,this.he=e,e&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this.ae=null,this.InvokeAnimFinal=null,this.le=null,this.oe=null,this.ue=[]}OnStart(t){return this.InvokeAnimationStart=this.ne=t,t?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(t){return this.InvokeAnimationEnd=this.re=t,t?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(t){return this.InvokeAnimRepeat=this.ae=t,t?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(t){return this.InvokeAnimFinal=this.le=t,t?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(t){if(t){if(0==this.ue.length){var s=this;this.InvokeAnimationStart=function(){s.ne&&s.ne();for(var t=0;t<s.ue.length;t++)s.ue[t].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(t){s.re&&s.re(t);for(var e=0;e<s.ue.length;e++)s.ue[e].InvokeAnimationEnd?.(t)},this.InvokeViewNoVisible=function(){s.he&&s.he();for(var t=0;t<s.ue.length;t++)s.ue[t].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(t){s.le&&s.le(t);for(var e=0;e<s.ue.length;e++)s.ue[e].InvokeAnimFinal?.(t)},this.InvokeAnimRepeat=function(t){s.ae&&s.ae(t);for(var e=0;e<s.ue.length;e++)s.ue[e].InvokeAnimRepeat?.(t)},this.ListenerEnabledFlags=31}this.ue.push(t)}}InvokeFromNativeForge(t){switch(t.type){case"end":this.InvokeAnimationEnd?.(1==t.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(t.progress);break;case"repeat":this.InvokeAnimRepeat?.(t.timesCount)}}},Mt.AnimFireCommand=nt,Mt.AnimationEnable=it,Mt.TranslateAnimation=class extends et{constructor(t,s,e,i,n,r){super(),st.CreateTranslate(t,s,e,i,n,r,this.AnimNativeId)}},Mt.RotateAnimation=class extends et{constructor(t,s,e,i,n,r){super(),st.CreateRotate(t,s,e,i,n,r,this.AnimNativeId)}},Mt.ScaleAnimation=class extends et{constructor(t,s,e,i,n,r,h,a,l=200,o=200){super(),st.CreateScale(t,s,e,i,n,r,l,o,h,a,this.AnimNativeId)}},Mt.TranslateFrameAnimation=class extends et{constructor(t,s,e,i,n,r){super();let h=Math.floor(100*e/55)/100;st.CreateTranslateFrame(t,s,h,h,i,n,r,this.AnimNativeId)}},Mt.CssKeyframeAnimation=class extends et{constructor(t,s,e,i,n){super(),st.CreateCssKeyframe(t,s,e,i,n,this.AnimNativeId)}},Mt.ShaderAnimation=class extends et{constructor(t,s){super(),st.CreateShaderAnimation(t,s,this.AnimNativeId)}},Mt.FreeMoveAnimation=class extends et{constructor(t,s,e){super(),this.ce=t,st.CreateFreeMoveAnimation(this.AnimNativeId,t,s,e)}},Mt.FreeMoveActEvtType=Y,Mt.BezierEasing=ut,Mt.StepsEasing=class extends rt{constructor(t,s){super(),this.pe=t,this.Zs=s}Package(){var t=this.xs(6);return t.St={S:this.pe,T:this.Zs},t}},Mt.Easing=dt,Mt.FreeMoveCmdPackBuilder=class{static InitActCmdPack(t,s,e,i){return{t:1,cmds:i,tkn:isNaN(e)?0:e,spd:isNaN(t)?0:t,acc:isNaN(s)?0:s}}static InitStateCmdPack(t){return{t:2,cmd:t}}},Mt.FreeMoveConditionSet=class{static AppendSubCmd(t,s){const e="cmds";t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(t.hasOwnProperty(e)||(t[e]=[]),t[e]?.push(s))}static SetCmdList(t,s){s instanceof Array&&(t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):t.cmds=s)}static SetCmdPackList(t,s){s instanceof Array&&(t.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):t.cmdPacks=s)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(t,s,e,i,n){t.g=s??0,t.m=e??!1,t.s=i??null,t.brk=n}static ReachPosition(t,s,e){let i=j(t,s),n={subt:1,react:1,e:i.e,xv:i.x,yv:i.y};return $(n,e),n}static AcrossPosition(t,s,e){let i=j(t,s),n={subt:1,react:2,e:i.e,xv:i.x,yv:i.y};return $(n,e),n}static BoxPosition(t,s,e,i,n){let r=0,h=0,a=0,l=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(a=e,o|=4),isNaN(i)||(l=i,o|=8);let u={subt:1,react:7,de:o,lv:r,tv:h,rv:a,bv:l};return $(u,n),u}static StartMove(t,s){return this.OnMovement(s,1,1,t)}static OnMovement(t,s,e,i){let n={subt:1,react:9,xv:s,yv:e,e:i};return $(n,t),n}static OffsetPosition(t,s,e,i,n){let r=0,h=0,a=0,l=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(a=e,o|=4),isNaN(i)||(l=i,o|=8);let u={subt:1,react:8,de:o,lv:r,tv:h,rv:a,bv:l};return $(u,n),u}static WallPosition(t,s,e,i){let n,r=j(s,e);switch(t){case"left":n=4;break;case"top":n=3;break;case"right":n=5;break;case"bottom":n=6;break;default:return console.error("WallPosition undefined direction",t),null}let h={subt:1,react:n,e:r.e,xv:r.x,yv:r.y};return $(h,i),h}static ReachSpeed(t,s,e){let i=j(t,s),n={subt:2,react:1,e:i.e,xv:i.x,yv:i.y};return $(n,e),n}static AcrossSpeed(t,s,e){let i=j(t,s),n={subt:2,react:2,e:i.e,xv:i.x,yv:i.y};return $(n,e),n}static TouchCount(t,s){let e={subt:5,react:2,tct:s};return $(e,t),e}static OnNexusEvent(t,s,e){let i={subt:3,nexus:t,etyp:s};return $(i,e),i}static OnDragStart(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActDragStart};return $(e,t),e}static OnDragEnd(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActDragEnd};return $(e,t),e}static OnTouchDown(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActTouchDown};return $(e,t),e}static OnTouchRelease(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActTouchRelease};return $(e,t),e}static OnFlingStart(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActFlingStart};return $(e,t),e}static OnFlingProgress(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActFlingProgress};return $(e,t),e}static OnFlingEnd(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActFlingEnd};return $(e,t),e}static OnFlingCancel(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActFlingCancel};return $(e,t),e}static OnFlingDrop(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_ActFlingDrop};return $(e,t),e}static OnHitBlock(t,s){let e={subt:4,blkGid:t};return $(e,s),e}static OnNextTick(t,s){let e={subt:5,react:1,tgap:t};return s.m=!1,$(e,s),e}static MovementSyncNexus(t,s){let e={subt:3,nexus:s,etyp:Y.ActEvent_MovementSync};return $(e,t),e}},Mt.FreeMoveActionBuilder=class{static SetSpeed(t,s){let e=j(t,s);return{typ:2,set:{xv:e.x,yv:e.y,xye:e.e}}}static SetAccel(t,s){let e=j(t,s);return{typ:7,set:{xye:e.e,xv:e.x,yv:e.y}}}static AltSpeed(t,s,e){if(!e)return null;let i=j(t,s);return{typ:5,set:{xv:i.x,yv:i.y,xye:i.e,tim:Math.floor(e)}}}static StopMoving(){return{typ:3}}static StopMovingExact(){return{typ:9}}static BrakeToPos(t,s){let e=j(t,s);return{typ:4,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetArrowSpeed(t,s,e,i){let n=j(t,s),r=j(e,i);return{typ:6,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),xye1:r.e,xv1:r.x,yv1:r.y}}}static TeleportTo(t,s,e){let i=j(t,s);return{typ:8,set:{xye:i.e,xv:Math.floor(i.x),yv:Math.floor(i.y),isAbs:!e}}}static AckMovementSync(t,s,e,i,n,r){return{typ:10,set:{hstart:t,hend:s,vstart:e,vend:i,xye:n,st:r}}}},Mt.FreeMoveStateBuilder=class{static FireEcho(t){return{typ:52,set:{tkn:t}}}static FireNexusEvent(t,s){return isNaN(s)||0==s?null:{typ:55,set:{etyp:isNaN(t)?0:t,nexus:s}}}static NewCondition(t){return{typ:Z,set:{sub:1,set:t}}}static DelActionAssocCondition(){return{typ:Z,set:{sub:5}}}static RemoveAllCondtions(){return{typ:Z,set:{sub:6}}}static RemoveByGroup(t){return{typ:Z,set:{sub:4,gt:t}}}static RemoveByName(t){return{typ:Z,set:{sub:7,sn:t}}}static ActiveCondition(t,s){return{typ:Z,set:{sub:2,gt:isNaN(t)||t<=0?X.GroupType_Invalid_Ext:t,sn:s}}}static DeactiveCondition(t,s){return{typ:Z,set:{sub:3,gt:isNaN(t)||t<=0?X.GroupType_Invalid_Ext:t,sn:s}}}static SetOffsetPos(t,s){let e=j(t,s);return{typ:53,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetPos(t,s){let e=j(t,s);return{typ:54,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static TouchLockSwitch(t,s,e=-1){return{typ:59,set:{il:t,dir:s,ut:e}}}static SetTouchAttractChild(t){return{typ:60,set:{cid:t?t.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(t,s,e,i,n,r){return{typ:61,set:{hstart:s,hend:e,vstart:i,vend:n,xye:r,nexus:t}}}static StopMovementSync(){return{typ:62}}};var Bt={SetupEngineJs:async(t,s)=>{Mt.InitStarter(t,s)}};export{Bt as default};
|
|
1
|
+
/* eslint-disable */ let t={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=t;let s=function(t){},e=function(t){},i=function(t){},n=function(t){throw new Error(t)};class r{constructor(){this.i=[],this.h=[],this.l=[],this.o={}}RequestAlterId(t,s){this.o[t]=s}AddToQueue(t,s){this.i.push(s),this.h.push(t)}HasUpdate(){return this.i.length>0}ReadSyncList(){if(this.l.length>0){for(let t of this.l)t();this.l=[]}let t=this.i;return this.RenewSyncList(),t}AddStartSyncCallback(t){this.l.push(t)}RenewSyncList(){if(this.h)for(let t of this.h)t.RenewSyncInfo(this,null);this.i=[],this.h=[]}ProcAlterIds(t,s){for(let e=0;e<t.length;e++)if(this.o.hasOwnProperty(t[e])){let i=this.o[t[e]];i.OnAlterId(s[e]),i.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${t[e]}`);this.o={}}}class h{constructor(t,s=null,e=null){this.u=t,this.PrefSyncInfo=null,this.p=null,this.v=!1,this.N=s,this.SuffSyncInfo=null,this.I=null,this.C=!1,this.InitPackage(e),this.RenewSyncInfo(this.u,null),this.RenewSyncInfo(this.N,null)}AddStartSyncCallback(t){this.u.AddStartSyncCallback(t)}CallToNative(s,e,i=!1){let n={fn:s,a:e};return i?(this.I.push(n),this.C||(this.N.AddToQueue(this,this.SuffSyncInfo),this.C=!0)):(this.p.push(n),this.v||(this.u.AddToQueue(this,this.PrefSyncInfo),this.v=!0)),t.sRenderBridge.RequestSwap(),n}RequestAlterId(t,s=!1){s?this.N.RequestAlterId(t,this):this.u.RequestAlterId(t,this)}SuffCallToNative(t,s){return{fn:t,a:s}}AlterCallParams(t,s){t&&(t.a=s)}RenewSyncInfo(t,s){s||(s={}),this.v=!1,this.C=!1,t&&t==this.u&&(this.p=[],this.PrefSyncInfo={tl:this.p,...s}),t&&t==this.N&&(this.I=[],this.SuffSyncInfo={tl:this.I,...s})}InitPackage(t){}OnAlterId(t){}}let a=new r,l=new r;class o extends h{constructor(t){super(a,l,{id:t}),this.R=null,this.A=t}InitPackage(t){this.A=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.A})}NeedAlterId(t,s){this.R=t,super.RequestAlterId(this.A,s)}OnAlterId(t){this.A=t,this.R.TexId=t,this.R=null}}let u=new class extends h{constructor(){super(a,l)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};let c=new class{constructor(){this.O=[1]}AddData(t){return this.O.push(t),this.O.length-1}TakeArray(){const t=this.O;return this.O=[1],t}PickArray(){return this.O}GetSize(){return this.O.length}ResetForNextSwap(){this.O=[1]}};let d=1;class p{constructor(t,s,e=!1){this.P=0,this.k=s,this.TexId=t,this.F=!1,this.D=0,this.G=0,this._=null,this.B={},this.V={},this.J=e}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this.k.NeedAlterId(this,this.J)}RegisterLoadImageCallback(t,s,e){if(null==s)return 0;if(this.F)return s({width:this.D,height:this.G},e),0;{this.U();const t=d++,i=this,n=(n,r,h)=>{s({width:n,height:r,extra:h?JSON.parse(h):null},e),delete i.B[t]};this.B[t]=n;const r=c.AddData(n);return this.k.CallToNative(1,[t,r],this.J),t}}UnregisterLoadImageCallback(t){t>0&&void 0!==this.B[t]&&delete this.B[t]}RegisterUpdateImageCallback(t,s,e){if(null==s)return 0;const i=d++,n=this,r=(t,r,h,a)=>{n.D=t,n.G=r,s({width:t,height:r,token:h,extra:a?JSON.parse(a):null},e),delete n.V[i]};this.V[i]=r;const h=c.AddData(r);return this.k.CallToNative(9,[i,h],this.J),i}UnregisterUpdateImageCallback(t){t>0&&void 0!==this.V[t]&&delete this.V[t],this.k.CallToNative(10,[t],this.J)}DispatchCommand(s,e){this.k.CallToNative(3,[s,e],this.J),t.sRenderBridge.RequestSwap()}U(){if(null==this._){const t=this;this._=(s,e,i)=>{t.F=!0,t.D=s,t.G=e};const s=c.AddData(this._);this.k.CallToNative(1,[d++,s],this.J)}}EnableBackgroundLoad(){this.F||(this.U(),this.k.CallToNative(4,null,this.J))}DisableBackgroundLoad(){this.k.CallToNative(5,null,this.J)}RequestToUnload(){this.k.CallToNative(6,null,this.J)}DisableAutoRecycle(){this.k.CallToNative(7,null,this.J)}UpdateValue(t){return++this.P,this.k.CallToNative(8,[this.P,t],this.J),this.P}}class f extends p{constructor(t,s,e=!1){super(t,s,e),this.W=null}registerOnStart(t){this.q();let s=this.W,e=++s.IdGen;if(s.StartMapCount++,s.StartMapCount>0&&0==s.GlobalStartCallbackId){s.GlobalStartCallbackId=e;const t=()=>{for(let t in s.OnStartMap)s.OnStartMap[t]?.()},i=c.AddData(t);this.k.CallToNative(100,[s.GlobalStartCallbackId,i],this.J)}return s.OnStartMap[e]=t,e}unregisterOnStart(t){if(!this.W)return;let s=this.W;s.OnStartMap.hasOwnProperty(t)&&(s.StartMapCount--,delete s.OnStartMap[t]),0==s.StartMapCount&&0!=s.GlobalStartCallbackId&&(this.k.CallToNative(101,[s.GlobalStartCallbackId],this.J),s.GlobalStartCallbackId=0)}registerOnEnd(t){this.q();let s=this.W,e=++s.IdGen;if(s.EndMapCount++,s.EndMapCount>0&&0==s.GlobalEndCallbackId){s.GlobalEndCallbackId=e;const t=()=>{for(let t in s.OnEndMap)s.OnEndMap[t]?.()},i=c.AddData(t);this.k.CallToNative(102,[s.GlobalEndCallbackId,i],this.J)}return s.OnEndMap[e]=t,e}unregisterOnEnd(t){if(!this.W)return;let s=this.W;s.OnEndMap.hasOwnProperty(t)&&(s.EndMapCount--,delete s.OnEndMap[t]),0==s.EndMapCount&&0!=s.GlobalEndCallbackId&&(this.k.CallToNative(103,[s.GlobalEndCallbackId],this.J),s.GlobalEndCallbackId=0)}q(){this.W||(this.W={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class S extends f{constructor(t,s){super(t,s,!0)}}class y extends p{constructor(t,s){super(t,s,!1)}doCommand(s,e,i){const n=null!=i?c.AddData(i):0;this.k.CallToNative(200,[s,e,n],this.J),t.sRenderBridge.RequestSwap()}}let v=window.NativeGetIdGroupIntf();const w=10;class m{constructor(t){this.K=t,this.j=0,this.Y=0,this.X=new Array(w),this.$=0;for(let t=0;t<w;t++)this.X[t]={start:0,end:0,expired:!0}}genId(){this.X[this.j].expired&&this.Z();let t=this.X[this.j],s=t.start;return t.start++,t.start>t.end&&(t.expired=!0,this.j=(this.j+1)%w,this.$--),s}Z(){let t=20*(w-this.$);if(t>0){let s=v.GetIdArray(this.K,t);if(s){let t=JSON.parse(s);this.et(t[0],t[1])}}}et(t,s){let e=s-t+1,i=Math.floor(e/20),n=t;for(let t=0;t<i;t++){let t=this.X[this.Y];t.start=n,t.end=n+20-1,t.expired=!1,this.Y=(this.Y+1)%w,n=t.end+1}this.$+=i,this.$>w&&console.error(`team over size to ${this.$}`)}}let N=new class{constructor(){this.it=new m(0),this.nt=new m(1),this.rt=new m(2),this.ht=new m(3)}genViewId(){return this.it.genId()}genTextureId(){return this.nt.genId()}genAnimationId(){return this.rt.genId()}genSensorId(){return this.ht.genId()}};var x,g,I;!function(t){t.RGBA_8888="RGBA_8888",t.RGBA_4444="RGBA_4444",t.RGBA_5551="RGBA_5551",t.RGB_565="RGB_565",t.RGB_ETC1="RGB_ETC1",t.RGBA_ETC1="RGBA_ETC1"}(x||(x={})),function(t){t.L=1,t.M=0,t.Q=3,t.H=2}(g||(g={})),function(t){t.AUTO=0,t.SYNC=1,t.ASYNC=2}(I||(I={}));class C{constructor(){this.k=u}GetId(){return 0}GetColorTexture(t){let s=N.genTextureId();this.k.CallToNative(1,[t,s]);let e=new p(s,new o(s));return e.RequestSyncerAlterId(),e}GetImage(t,s,e){return this.GetImage2(t,s,null,null,e)}GetImage2(t,s,e,n=x.RGBA_8888,r="",h=!1){if(!t||0==t.length)return i("GetImage2, url is not setted!"),null;let a=N.genTextureId(),l=0,u=0;e&&(l=e.width,u=e.height),n||(n=x.RGBA_8888),r||(r="");let c=null!=h&&h;this.k.CallToNative(2,[t,l,u,n,r,c,a]);let d=new p(a,new o(a));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(t,s,e,i=I.AUTO,n=g.Q,r="#ffffff",h="#000000",a=-1){let l=N.genTextureId();return this.k.CallToNative(3,[t,s,e,n,r,h,a,i,l]),new p(l,new o(l))}GetDownloadTexture(t,s=null,e=!1,n=!1){if(console.log("ccht GetDownloadTexture",t,s,e,n),!t)return i("GetDownloadTexture, url is null!"),null;let r=N.genTextureId();return this.k.CallToNative(4,[t,s,e,n,r]),new p(r,new o(r))}GetDomProxyTexture(t){let s=N.genTextureId();return this.k.CallToNative(5,[t,s],!0),new S(s,new o(s))}GetCanvasTexture(t,s){let e=N.genTextureId();return this.k.CallToNative(6,[t,s,e],!1),new p(e,new o(e))}GetPluginTexture(t,s,e=!1){let i=N.genTextureId();return this.k.CallToNative(7,[t,s,e?1:0,i],!1),new p(i,new o(i))}GetCapturedTexture(){let t=N.genTextureId();return this.k.CallToNative(8,[t],!1),new p(t,new o(t))}GetImageProcessTexture(t){let s=N.genTextureId();return this.k.CallToNative(9,[t,s],!1),new y(s,new o(s))}}let R=new class{constructor(){this.lt=1}get count(){return this.lt}update(){this.lt<Number.MAX_SAFE_INTEGER?++this.lt:this.lt=1}},b=new r,A=new r;let O=new class extends h{constructor(){super(b,A)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}};class P extends h{constructor(t){super(b,A,{id:t}),this.ot=t}InitPackage(t){this.ot=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.ot})}}let T=new r,k=new r;class E extends h{constructor(t){super(T,k,{id:t}),this.ct=t}InitPackage(t){this.ct=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.ct})}}let F=new class extends h{constructor(){super(T,k)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}},D=new r;class G extends h{constructor(t){super(null,D,{id:t}),this.dt=t}InitPackage(t){this.dt=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.dt})}}let L=new class extends h{constructor(){super(null,D)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};var M=null,_=null;class B{constructor(){this.ft=0,this.yt={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this.vt=new Map,this.wt=this.Nt.bind(this),this.xt=[],this.It=!1,this.Ct={hdl:null},this.Rt=!0,this.bt=-1,this.At=!1,this.Ot=1,this.Rt=!1,this.Pt(),this.Tt=!1,this.kt=[],this.Et=1,this.Ft.OnScreenHide&&window.JsView?.onVisibilityChange(t=>{"hide"===t.status&&this.Ft.OnScreenHide()})}Pt(){void 0!==window.NativeSendImpactSensorSyncData&&window.NativeSendImpactSensorSyncData.bind(this.Ct),void 0!==window.NativeSetStepFpsSwitch&&(M=window.NativeSetStepFpsSwitch.bind(this.Ct)),void 0!==window.NativeSetGlobalConfig&&(_=window.NativeSetGlobalConfig.bind(this.Ct)),this.Ft=window.NativeGetRenderIntf(),this.Ft.RegisterSwapFunc(()=>{this.RequestSwap()}),this.Dt=this.Dt.bind(this),this.Ft.RegisterPreDomSyncFunc(()=>{this.Gt()}),this.Ft.RegisterOnScreenInfo(this.Lt.bind(this))}SetStepFpsSwitch(t){this.Rt?M&&M(t):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this.kt.push(()=>{this.SetStepFpsSwitch(t)}))}SetGlobalConfig(t){if(this.Rt){if(_){let s=JSON.stringify(t);console.log("SetGlobalConfig set with "+s),_(s),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this.kt.push(()=>{this.SetGlobalConfig(t)})}Mt(){if(this.kt.length>0){for(let t=0;t<this.kt.length;t++)this.kt[t]();this.kt=[]}}RequestSwap(){this.At?this.Et++:(this.At=!0,this.Et++,this.Ot++,this._t(this.Ot))}_t(t){let s=this,e=this.Et;Promise.resolve().then(()=>{e==s.Et?s.InstantPerformSwap():t==this.Ot&&s._t(t)})}NotifyNetTypeStatus(t,s){}EnableRequestSwap(t){this.Tt=t,this.Ft.EnableRequestSwap(t)}InstantPerformSwap(){this.At&&(this.At=!1,this.Ot++,this.Dt(!1))}Bt(t,s,e,i,n){let r=null,h=null,a=null,l=null,o=null;if(t.HasUpdate()&&(a=t.ReadSyncList()),s.HasUpdate()&&(h=s.ReadSyncList()),e.HasUpdate()&&(r=e.ReadSyncList()),i?.HasUpdate()&&(l=i.ReadSyncList()),null==r&&null==h&&null==a&&null==l||(o=this.Ft.SyncForgeJsCall(JSON.stringify({TexSync:a,AnimSync:h,ViewSync:r,SensorSync:l}),n)),o){let s;this.At=!1,s=JSON.parse(o).TexSyncRet,s&&this.Vt(t,s)}}Gt(){this.Jt()}Jt(){this.Bt(a,b,T,null,c.PickArray())}Dt(t){if(!this.Tt)return void(this.At=!1);R.update();let s=c.GetSize();if(this.Jt(),this.vt.size>0&&this.vt.forEach(this.wt),this.Jt(),this.Bt(l,A,k,D,c.PickArray()),s==c.GetSize())c.ResetForNextSwap();else{let t=c.GetSize();t>50&&console.warn("Warning: temp sync store kept with large size = "+t)}t=!!t,this.At=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this.Ft.DoRequestSwap(t)}GetScreenInfo(){return this.yt}SetForgeRtHandler(t){this.Ct.hdl=t,this.Rt=!0,this.Ft.SetForgeRtHandler(t),this.Mt()}InitScreenBuffer(t,s){isNaN(t)&&(t=1),isNaN(s)&&(s=1280);var e=s*t,i=e/16*9;this.yt.width=Math.floor(e),this.yt.height=Math.floor(i),this.yt.x=2/this.yt.width,this.yt.y=2/this.yt.height,this.yt.perspective=this.yt.x,this.yt.scaleRatio=t,this.yt.designedWidth=s}InitNativeScreenBuffer(){if(this.Rt){var t=JSON.stringify({displayScaleRatio:this.yt.scaleRatio,designedMapWidth:this.yt.designedWidth});this.Ft.InitScreenBuffer(t)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(t,s){this.Ft.SyncBackStatus(t,s)}TakeAndSyncBackStatus(){1==this.Ft.TakeAndSyncBackStatus()&&this.RequestSwap()}Lt(t,s,e,i,n){this.yt.width=t,this.yt.height=s,this.yt.x=e,this.yt.y=i,this.yt.perspective=n}Ut(t,s,e){const i=null!=e?this.Ft[e]:this.Ft;this.Rt?i[t](...s):(console.warn(`${t}(): API link status not ready, delay`),this.kt.push(()=>{i[t](...s)}))}HasPendingRenderBreak(){return!!this.Rt&&this.Ft.HasPendingRenderBreak()}FinishRenderBreak(t){this.Ut("FinishRenderBreak",[t])}AddWillSwapListener(t,s){this.vt.set(t,s)}AddSwappedOnceObserver(t){this.xt.push(t),this.It||(this.It=!0,this.Ut("AddSwappedOnceObserver",[()=>{this.It=!1;const t=this.xt;this.xt=[];for(let s=0;s<t.length;s++)t[s]()}]))}RemoveSwappedOnceObserver(t){const s=this.xt.indexOf(t);s>=0&&this.xt.splice(s,1)}ActiveComponent(t){this.Ut("ActiveComponent",[t])}ShutdownComponents(t){this.Ut("ShutdownComponents",[t])}GenStoreBufferId(){return++this.ft}SetPlatformMsgDisp(t){this.Wt=t}GetPlatformMsgDisp(){return this.Wt}GetTextToolsApi(){return this.Ft.TextToolApi}GetBufferStoreApi(){return this.Ft.BufferStoreApi}Nt(t){t()}Vt(t,s){let e;e=s.idAlter,e&&t.ProcAlterIds(e.proxy,e.real)}}class V{constructor(){this.Ht=!1,this.qt=0,this.Kt=!1,this.zt=0,this.jt=0,this.Yt=!1,this.Xt=!1,this.$t=0,this.Qt=0,this.Zt=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this.Zt&&(this.Yt=!0,this.ts())}SetTranslateDelay(t){V.sKeyTranslateDelay=t}CheckKey(t){if(!t.timeStamp||this.Ht)return!1;this.Kt=!0;const s=Date.now(),i=t.timeStamp;!this.Yt&&i-this.qt>3e3&&(this.zt=s,this.jt=i,this.qt=i);let n=s-this.zt;(n<0||n>5e3)&&(this.Zt?this.ts():(this.zt=s,this.jt=i),n=0);return n+this.jt-i>V.CONST_MAX_PASSING_GAP&&Math.abs(this.Qt-i)<V.CONST_MIN_VALID_KEY_GAP&&!t.repeat?(!this.Xt&&this.Yt&&(this.$t++,this.$t>50&&e("More than 50 keys are expired...")),!0):(this.Xt||(this.Xt=!0),this.Qt=i,!1)}toggleKeyGuard(){this.Ht=!this.Ht}IsActive(){return this.Kt}ts(){this.zt=Date.now(),this.jt=window.jRuntimeBridge.getSystemUptimeMillis()-V.sKeyTranslateDelay}}V.CONST_MAX_PASSING_GAP=20,V.CONST_MIN_VALID_KEY_GAP=180,V.sKeyTranslateDelay=5;let J,U=new V;class W{constructor(n,r,h){var a;if(this.ss=null,this.es=1280,this.ns=!1,this.rs=0,a=4,console.log.bind(console),a>0&&console.error.bind(console),a>1&&(s=console.error.bind(console)),a>2&&(e=console.warn.bind(console)),a>3&&(i=console.log.bind(console)),a>4&&console.debug.bind(console),this.hs=new C,this.ls=new B,t.sRenderBridge=this.ls,isNaN(h)&&(h=1280),this.es=h,this.ns=!1,this.us(n,r,h),this.cs={keyProc:null,keyUpProc:null,activityStateProc:null},this.ds(this.cs),this.ps(this.cs),this.fs=this.ls.InstantPerformSwap.bind(this.ls),null!=n){this.rs=n.canvasNativeHandle;for(let t in this.cs)n[t]=this.cs[t]}t.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this.hs}DelayedActivateCanvas(t){if(0==this.rs){this.rs=t.canvasNativeHandle,this.Ss(t);for(let s in this.cs)t[s]=this.cs[s];this.ls.InitNativeScreenBuffer(),this.ls.RequestSwap()}else s("Error: already activated")}GetCanvasHandler(){return this.rs}StartActivity(t){this.ss=t}us(t,s,e){this.Ss(t),this.ls.InitScreenBuffer(s,e),this.ls.InitNativeScreenBuffer()}Ss(t){null!=t&&(this.ls.SetForgeRtHandler(t.frtNativeHandle),t.renderBridge=this.ls,this.ls.EnableRequestSwap(!0))}ys(t){if(this.ns)return!0;var s=!0;if(this.ss){if(U.CheckKey(t))return console.log("keyEventGuard ignore keys"),!1;U.IsActive()&&this.ls.InstantPerformSwap(),s=!this.ss.DispatchKeyDown(t),this.ls.TakeAndSyncBackStatus()}return s}vs(t){if(this.ns)return!0;var s=!0;return this.ss&&(s=!this.ss.DispatchKeyUp(t),this.ls.TakeAndSyncBackStatus()),s}ds(t){t.keyProc=this.ys.bind(this),t.keyUpProc=this.vs.bind(this)}ps(t){let s=this;var e=function(t){var e=t.State;switch(console.log("ActivityStateListenerChanged, state:"+e),e){case"onActivityResumed":s.ls.EnableRequestSwap(!0),s.ls.RequestSwap(),s.ls.InstantPerformSwap();break;case"onActivityStopped":s.ls.EnableRequestSwap(!1)}}.bind(this);t.activityStateProc=e}}class H{constructor(){this.ws=null}Init(t){let s=1280,e=1;try{if(K){let t=K();"number"==typeof t.width&&(s=t.width),"number"==typeof t.displayScale&&(e=t.displayScale)}}catch(t){console.log("Note: DesignMap failed")}this.ws=new W(t,e,s),q?q(this.ws):console.error("FATAL: no found entry")}getActivityManager(){return this.ws}}let q=null,K=null;let z=100;class j{constructor(t){this.PageName=t,this.Ns=null,this.xs=null,this.SubPages=[],this.gs=null,this.ns=!1}OnRenderFrame(){s("OnRenderFrame() MUST override")}OnKeyDown(t){return!1}OnKeyUp(t){return!1}DispatchKeyDown(t){if(this.ns)return!0;let s=!1;return this.Ns&&(s=this.Ns.DispatchKeyDown(t)),s||(s=this.OnKeyDown(t)),s}OnCustomEvent(t){return!1}BubbleCustomEvent(t){this.OnCustomEvent(t)||this.gs&&this.gs.BubbleCustomEvent(t)}DispatchKeyUp(t){if(this.ns)return!0;let s=!1;return this.Ns&&(s=this.Ns.DispatchKeyUp(t)),s||(s=this.OnKeyUp(t)),s}PrintLastFocusPage(){let t="------"+this.PageName+"\n",s=this.gs;return s&&(t+=s.PrintLastFocusPage()),t}IsFocus(){return!this.gs||this.gs.Ns==this}Is(){return this.IsFocus()&&!this.Ns}SetParent(t){null!=t?(this.gs=t,t.SubPages.push(this)):n("ERROR: parent is null")}SetParentPage(t){this.SetParent(t)}OnRemoveFromTree(){if(this.gs=null,this.SubPages&&this.SubPages.length>0){for(let t of this.SubPages)t.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(t){t==this.Ns&&(this.Ns=null),t==this.xs&&(this.xs=null);for(let s=0;s<this.SubPages.length;s++)if(t==this.SubPages[s]){this.SubPages.splice(s,1);break}}ClearSubPages(){this.SubPages=[],this.Ns=null,this.xs=null}GetParentPage(){return this.gs}Focus(t=!1){if(this.IsFocus()){if(!t)return void i("requestFocus(): Already focused name="+this.PageName);if(this.Is())return void i("requestFocus(): Already focused name="+this.PageName)}if(this.gs){let s=[],e=this;for(;e.gs&&!e.IsFocus();)s.push(e),e=e.gs;let i,r=z++;i=t&&0==s.length?this.Ns:s[s.length-1].gs?.Ns;let h=[];for(;i;)h.push(i),i=i.Ns;for(let t=h.length-1;t>=0;t--)h[t].Cs(r);for(let t=s.length-1;t>=0;t--)s[t].Rs(r);if(t)this.xs=null;else{let t=s[0];for(;t.xs&&null==t.Ns;)t.xs.Rs(r),t=t.Ns,t||n("ERROR: focus chain is broken")}}}ReturnFocusToParent(){this.gs&&(this.IsFocus()&&this.gs.Focus(!0),this.gs.Ns==this&&(this.gs.Ns=null),this.gs.xs==this&&(this.gs.xs=null))}Rs(t){this.gs?(this.gs.Ns=this,this.gs.xs=this,this.OnFocus(t)):s("No dispatcher")}Cs(t){this.gs?this.gs.Ns==this?(this.gs.Ns=null,this.OnBlur(t)):e("Not focus yet, page name="+this.PageName):s("No dispacher")}GetFocusChild(){return this.Ns}OnFocus(t){e("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(t){e("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this.ns=!0}UnKeyLock(){this.ns=!1}}var Y;!function(t){t.VIEW_COMMAND=0,t.TEXTURE_COMMAND=1,t.ANIM_COMMAND=2,t.SYNC_COMMAND=3,t.APIC_PLAY=0,t.APIC_STOP=1,t.APIC_VISIBLE_CHANG=2,t.APIC_SHOW_FRAME=3,t.GET_BOUNDING_RECT=0,t.FILTER_VIEW_WAVE=1,t.TRANSLATE_FRAME_ALT_SPEED=0,t.FREE_MOVE_RUN_CMDPACKS=1,t.FREE_MOVE_FIRE_GLOBAL_NEXUS=2,t.EXE_DEFAULT=0,t.EXE_AFTER_RENDER=1}(Y||(Y={}));const X=(t,s)=>{let e=0,i=0,n=0;return isNaN(t)||(e|=1,i=t),isNaN(s)||(e|=2,n=s),{e:e,x:i,y:n}};var $,Q,Z;!function(t){t.ActEvent_ActFinish=1,t.ActEvent_Speed_X_Revert=2,t.ActEvent_Speed_Y_Revert=3,t.ActEvent_ActReject=4,t.ActEvent_ActDragStart=5,t.ActEvent_ActDragEnd=6,t.ActEvent_ActFlingStart=7,t.ActEvent_ActFlingProgress=8,t.ActEvent_ActFlingEnd=9,t.ActEvent_ActTouchDown=10,t.ActEvent_ActTouchRelease=11,t.ActEvent_ActFlingCancel=12,t.ActEvent_ActFlingDrop=13,t.ActEvent_ActMouseWheelScrollProgress=14,t.ActEvent_MovementSync=15}($||($={})),function(t){t.GroupType_ActionAssoc=10,t.GroupType_Fling=11,t.GroupType_Invalid_Ext=65535}(Q||(Q={})),function(t){t.FLING_ON_PROGRESS_INTERVAL=200}(Z||(Z={}));const tt=(t,s)=>{t.gtype=s.g,t.once=s.m?0:1;let e=s.s;e&&(t.name=e),t.brk=s.brk?1:0};const st=51;function et(t){return t?JSON.stringify(t.Package()):null}let it=new class{constructor(){this.k=O}CreateTranslate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("translate animation duration invalid="+n),n=0),this.k.CallToNative(1,[t,s,e,i,n,et(r),h])}CreateRotate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("rotate animation duration invalid="+n),n=0),this.k.CallToNative(2,[t,s,e.x,e.y,e.z,i.x,i.y,i.z,n,et(r),h])}CreateScale(t,s,e,i,n,r,h,a,l,o,u){l!=1/0&&null!=l||(console.warn("scale animation duration invalid="+l),l=0),this.k.CallToNative(3,[t,s,e,i,n,r,h,a,l,et(o),u])}CreateTranslateFrame(t,s,e,i,n,r,h,a){this.k.CallToNative(5,[t,s,e,i,!!n,r,h,a])}CreateCssKeyframe(t,s,e,i,n,r){s!=1/0&&null!=s||(console.warn("css animation duration invalid="+s),s=0),this.k.CallToNative(6,[t,s,et(e),i,n,r])}CreateFreeMoveAnimation(t,s,e,i){this.k.CallToNative(7,[t,s?c.AddData(s):0,e,i?1:0])}CreateShaderAnimation(t,s,e){this.k.CallToNative(8,[t,et(s),e])}};class nt{constructor(){this.AnimNativeId=N.genAnimationId(),this.k=new P(this.AnimNativeId),this.bs=null,this.As=null}SetAnimationListener(t){this.Os(t)}AddAnimationListener(t){this.bs&&t.AddInherit(this.bs),this.Os(t)}RemoveAnimationListener(){this.bs=null}Enable(t){this.k.CallToNative(2,[t])}EnableInfinite(){return this.k.CallToNative(3,null),this}SetRepeat(t){return this.k.CallToNative(5,[t]),this}EnableDelay(t){return this.k.CallToNative(4,[t]),this}SetStartPos(t){return t>=0&&t<=1?this.k.CallToNative(6,[t]):console.warn("Warning: SetStartPos() out of range"),this}Os(t){let s=!0;if(this.bs&&(s=this.bs.ListenerEnabledFlags==t.ListenerEnabledFlags),this.bs=t,null!=this.bs&&(null==this.As||!s)){let t=this;this.As=s=>{t.bs?.InvokeFromNativeForge(s)};let s=c.AddData(this.As);this.k.CallToNative(1,[s,this.bs.ListenerEnabledFlags])}}}var rt,ht;!function(t){t.ReleaseAfterEndCallback=1,t.KeepTransform=2,t.AckFinalProgress=4,t.AckRepeat=8,t.Reverse=16}(rt||(rt={})),function(t){t.AltSpeed=(t,s,e)=>{let i={S60:Math.floor(100*s/55)/100,T:e};t?.DispatchAnimCommand(Y.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(i))},t.RunFreeMoveCmdPacks=(t,s)=>{t?.DispatchAnimCommand(Y.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(s))},t.FireGlobalNexus=(t,s)=>{let e={nexus:t,etyp:s};window.JsvCode.ForgeHandles.RootView?.DispatchAnimCommand(Y.FREE_MOVE_FIRE_GLOBAL_NEXUS,JSON.stringify(e))}}(ht||(ht={}));class at{constructor(){this.Pacakge=this.Package.bind(this)}Package(){}Ps(t){return{T:t,St:null}}}class lt extends at{constructor(){super()}Package(){return this.Ps(0)}}class ot extends at{constructor(){super()}Package(){return this.Ps(1)}}class ut extends at{constructor(){super()}Package(){return this.Ps(2)}}class ct extends at{constructor(){super()}Package(){return this.Ps(5)}}class dt extends at{constructor(t,s,e,i,n){super(),this.Ts=!1,this.ks=t,this.Es=e,this.Fs=s,this.Ds=i,this.Gs=n}Package(){var t=this.Ps(3);return t.St={X1:this.ks,X2:this.Es,Y1:this.Fs,Y2:this.Ds,Dur:this.Gs},t}}class pt extends at{constructor(t,s,e){super(),this.Ls=t,this.Ms=s,this._s=e}Package(){var t=this.Ps(7);return t.St={In:this.Ls,Out:this.Ms,MS:this._s},t}}var ft;!function(t){var s;(s=t.Circular||(t.Circular={})).In=new lt,s.Out=new ot,s.InOut=new ut,s.Deceleration=new ct,t.str2Easing=function(s){if(!s||"string"!=typeof s)return null;if("ease-in"===s)return t.Circular.In;if("ease-out"===s)return t.Circular.Out;if("ease-in-out"===s)return t.Circular.InOut;if(-1!==s.indexOf("cubic-bezier")){const t=s.split("(")[1].split(")")[0].split(",");if(!(4!==t.length||isNaN(parseFloat(t[0]))||isNaN(parseFloat(t[1]))||isNaN(parseFloat(t[2]))||isNaN(parseFloat(t[3]))))return new dt(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),0)}else if(-1!==s.indexOf("jsv-ease")){const t=s.split("(")[1].split(")")[0].split(",");if(3===t.length&&!isNaN(parseFloat(t[0]))&&!isNaN(parseFloat(t[1]))&&!isNaN(parseFloat(t[2])))return new pt(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))}return null}}(ft||(ft={}));class St{constructor(){this.Bs="COMMON"}Type(){return this.Bs}ToSyncJsonObj(t){return t||(t={}),t.typ=this.Bs,t}}let yt=new class{constructor(){this.Vs={},this.Js=0}add(t){let s=t.view.ViewId;return this.Vs.hasOwnProperty(s)&&(this.Vs[s]=t),s}remove(t){this.Vs[t]&&delete this.Vs[t]}get(t){return this.Vs[t]}clear(){this.Vs={},this.Js=0}};class vt{constructor(){this.SensorId=N.genViewId(),this.Us=new G(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(t){L.CallToNative(1,[this.SensorId,t],!0)}Recycle(){this.Us.CallToNative(1,null,!0)}}class wt{constructor(t,s,e,i){this.Texture=t,this.MaskSetting=s,void 0===i&&(i=!0),this.HasAlpha=i}ToSyncJsonObj(t=void 0){return t||(t={}),t.texId=this.Texture?this.Texture.TexId:0,t.alpha=this.HasAlpha,this.MaskSetting?t.mask=this.MaskSetting.ToSyncJsonObj():t.mask=null,t}}var mt;!function(t){var s,e,i;(s=t.ControlType||(t.ControlType={})).DoKeepInRender=1,s.RecycleKeptView=2,(e=t.SyncedType||(t.SyncedType={})).Synced=0,e.NotSynced=1,e.RequestKeepInRender=2,e.OnKeepingInRender=3,e.RecycleKeeping=4,(i=t.TextureCoordAnchor||(t.TextureCoordAnchor={})).LeftTop=1,i.CenterTop=2,i.RightTop=3,i.LeftMiddle=4,i.Center=5,i.RightMiddle=6,i.LeftBottom=7,i.CenterBottom=8,i.RightBottom=9}(mt||(mt={}));let Nt=new class{constructor(){this.k=F}CreateNativeView(t,s,e){this.k.CallToNative(1,[t,s],e)}CreateJsRootView(t){this.k.CallToNative(2,[t])}CreateDomProxyView(t,s,e){this.k.CallToNative(3,[t,s,e?1:0],!0)}};class xt{constructor(t,s,e=!1){this.Visibility=void 0,this.k=new E(t),this.ViewId=t,this.TextureSetting=null,this.Ws=null,this.J=e,this.Hs=null,this.CreateView(s)}CreateView(t=void 0){}ResetTexture(t=null){if(!this.Ws){this.Ws=this.k.CallToNative(1,null,this.J);let t=this;this.k.AddStartSyncCallback(()=>{this.TextureSetting?t.k.AlterCallParams(t.Ws,[t.TextureSetting.ToSyncJsonObj()]):t.k.AlterCallParams(t.Ws,[null]),t.Ws=null})}this.TextureSetting=t}BindedPageBase(t){}SetVisibility(t){if("INHERIT"!==t&&void 0!==t||(t="VISIBLE"),this.Visibility!=t){this.Visibility=t;let s=0;switch(t){case"VISIBLE":s=1;break;case"GONE":s=2;break;case"HIDDEN":s=3;break;default:return void console.error("unknown visible type="+t)}this.k.CallToNative(2,[s],this.J)}}AddView(t,s){let e={x:0,y:0,width:0,height:0};s&&(e=this.qs(s)),this.k.CallToNative(3,[t.ViewId,s?1:0,e.x,e.y,e.width,e.height],this.J)}ClearViews(){this.k.CallToNative(4,null,this.J)}ResetTextureCssTransform(t,s){t=t||"",s=s||"",this.k.CallToNative(5,[t,s],this.J)}SetTextureCoord(t,s,e,i,n=mt.TextureCoordAnchor.Center){this.k.CallToNative(9,[t,s,e,i,n],this.J)}ResetLayoutParams(t){let s;null!=t?(s=this.qs(t),this.k.CallToNative(6,[s.x,s.y,s.width,s.height],this.J)):n("ResetLayoutParams(): new params is null")}qs(t){return{x:isNaN(t.x)?0:t.x,y:isNaN(t.y)?0:t.y,width:isNaN(t.width)?0:t.width,height:isNaN(t.height)?0:t.height}}GetBoundingClientRect(){return new Promise((t,s)=>{null!=this.Hs&&(this.Hs=null),this.Hs=e=>{null!=this.Hs&&(this.Hs=null);const i=JSON.parse(e);0==i.status?t(i.data):s(i.error)};const e=c.AddData(this.Hs);this.k.CallToNative(12,[e],this.J)})}StartAnimation(t,s,e){let i=t?t.AnimNativeId:0;this.k.CallToNative(7,[i,isNaN(e)?0:e],this.J)}StopAnimation(){this.k.CallToNative(8,null,this.J)}DispatchAnimCommand(t,s){this.k.CallToNative(13,[t,s],this.J)}StartTextureAnimation(t){let s=t?t.AnimNativeId:0;this.k.CallToNative(10,[s],this.J)}StopTextureAnimation(){this.k.CallToNative(11,null,this.J)}DragEnables(t){this.k.CallToNative(14,[t],this.J)}HoverEnables(t){this.k.CallToNative(20,[t],this.J)}MouseEnables(t){this.HoverEnables(t)}SetMouseWheelRate(t){this.k.CallToNative(22,[t],this.J)}SetTapListener(t=void 0){if(null!=t){const s=c.AddData(t);this.k.CallToNative(15,[s],this.J)}else this.k.CallToNative(15,[0],this.J)}SetHoverListener(t=void 0){if(null!=t){const s=c.AddData(t);this.k.CallToNative(21,[s],this.J)}else this.k.CallToNative(21,[0],this.J)}EnableAutoSize(){this.k.CallToNative(16,[],this.J)}RegisterFlexAssigned(t=void 0){if(null!=t){const s=c.AddData(t);this.k.CallToNative(17,[s],this.J)}else this.k.CallToNative(17,[0],this.J)}EnableVisibleTestRect(){this.k.CallToNative(18,[],this.J)}MarkFlexSizeFromChild(t){this.k.CallToNative(23,[t],this.J)}MarkFlexChildrenFromChild0(){this.k.CallToNative(24,null,this.J)}Capture2Texture(t,s=void 0,e=void 0){if(!t)return void console.error("Error: Capture2Texture need target texture");let i=t.GetTextureId();if(!s)return void console.error("Error: Capture2Texture need callback");const n=c.AddData(s),r=e?JSON.stringify(e):"";this.k.CallToNative(19,[i,n,r],this.J)}}class gt extends xt{constructor(t=null){!t||t instanceof wt||n("ERROR:LayoutView need TextureSetting as parameter"),super(N.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",t&&this.ResetTexture(t)}CreateView(t){Nt.CreateNativeView(this.ViewId,0,t.DomDepends)}}function It(t){let s=[];if(t instanceof Array)for(let e of t)e instanceof xt&&s.push(e.ViewId);return s}class Ct extends vt{constructor(t,s,e,i){super(),this.InitSet(t,s,e,i)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(t,s,e,i){let n=0;e&&(n=c.AddData(t=>{1==t?e.OnBeginContact?.():2==t&&e.OnEndContact?.()})),this.Us.CallToNative(20,[t.ViewId,s.ViewId,n,i?i.SensorId:0],!0)}}let Rt={StartTrace:(t,s,e,i)=>new Ct(t,s,e,i),Callback:class{constructor(t,s){this.OnBeginContact=t,this.OnEndContact=s}UpdateImpactCallback(t){this.OnBeginContact=t}UpdateLeaveCallback(t){this.OnEndContact=t}},AutoFroze:class extends vt{constructor(t,s){super(),this.InitSet(),this.Ks(It(t)),this.zs(It(s)),this.js()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this.Us.CallToNative(25,null,!0)}UpdatePreImpactList(t){this.Ks(It(t)),this.js()}UpdateOnImpactList(t){this.zs(It(t)),this.js()}Ks(t){this.Us.CallToNative(26,[...t],!0)}zs(t){this.Us.CallToNative(27,[...t],!0)}js(){this.Us.CallToNative(28,null,!0)}}};var bt;!function(t){t[t.NONE=0]="NONE",t[t.TEXT=1]="TEXT",t[t.PASSWORD=2]="PASSWORD",t[t.TEXT_AREA=3]="TEXT_AREA",t[t.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",t[t.SEARCH=5]="SEARCH",t[t.URL=6]="URL",t[t.EMAIL=7]="EMAIL",t[t.TELEPHONE=8]="TELEPHONE",t[t.NUMBER=9]="NUMBER"}(bt||(bt={}));var At,Ot;!function(t){var s;(s=t.UniformType||(t.UniformType={}))[s.FLOAT=1]="FLOAT"}(At||(At={})),function(t){var s,e;(s=t.Type||(t.Type={}))[s.GRAY_DOWN=1]="GRAY_DOWN",s[s.WAVE=2]="WAVE",(e=t.Wave||(t.Wave={}))[e.CIRCLE_WAVE=1]="CIRCLE_WAVE",e[e.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(Ot||(Ot={}));let Pt=0;class Tt{constructor(){this.sourceList=[]}addSource(t,s,e,i,n){i=i??{type:Ot.Wave.CIRCLE_WAVE},n=n??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const r=++Pt;let h=0,a=0,l=0;return i.type==Ot.Wave.RECTANGLE_WAVE&&(h=i.width,a=i.height,l=i.radius),this.sourceList.push(r,t,s,e,h,a,l,n.timeDecay,n.distanceDecay,n.speed,n.frequency,n.waveNum),r}getSourceList(){const t=this.sourceList;return this.sourceList=[],t}}class kt extends xt{constructor(t,s){super(N.genViewId(),{DomElementId:t,UseMaskView:s},!0),this.Visibility="VISIBLE"}CreateView(t){Nt.CreateDomProxyView(this.ViewId,t.DomElementId,t.UseMaskView)}RegisterOnProxyReady(t){t?.()}}function Et(t){return isNaN(t)?0:parseInt(t)}function Ft(t){return{fontFamily:t.fontFamily?t.fontFamily:Vt.sDefaultFont,fontSize:Et(t.fontSize),italic:"italic"===t.fontStyle,bold:"bold"===t.fontWeight,hasEmoji:1==t.JsvTextEmoji}}function Dt(){return t.sRenderBridge.GetTextToolsApi()}function Gt(t,s){let e=Ft(s);return Dt().GetTextWidth(t,JSON.stringify(e))}function Lt(t,s){let e=Ft(s);const i=Dt().GetOneLineTextDrawWidth(t,JSON.stringify(e)),n={totalWidth:i[0],sliceInfo:[]};for(let t=1;t<i.length;t+=3)n.sliceInfo.push({start:i[t],end:i[t+1],width:i[4]});return n}function Mt(t,s,e){const i={...Ft(s),maxWidth:e};return Dt().BreakLines(t,JSON.stringify(i))}function _t(t,s,e,i,n,r){let h;if(t>0)h=Dt().GetCursorPosition(t,s,null,null,null,1);else{let a=Ft(i),l=function(t){let s=Et(t.height),e=Et(t.lineHeight),i="string"==typeof t.wordWrap?t.wordWrap:"none";return"nowrap"==t.whiteSpace&&(i="none"),{width:Et(t.width),height:s,textAlign:"string"==typeof t.textAlign?t.textAlign:"left",lineHeight:0==e?s:e,wordWrap:i,textOverflow:"string"==typeof t.textOverflow?t.textOverflow:"clip"}}(n);h=Dt().GetCursorPosition(t,s,e,JSON.stringify(a),JSON.stringify(l),r?1:0)}return h}function Bt(t){Dt().RemoveCursorTextCache(t)}var Vt;!function(t){t.sDefaultFont="黑体",t.sDefaultFontSize=30,t.sDefaultFontColor="#FFFFFF",t.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",t.GetTextWidth=Gt,t.GetOneLineTextDrawWidth=Lt,t.GetCursorPosition=_t,t.RemoveCursorTextCache=Bt,t.BreakLines=Mt}(Vt||(Vt={}));let Jt=t;Jt.Run=function(t){return J=new H,J.Init(t),J},Jt.InitStarter=function(s,e){t.DesignMap=e,q=s,K=e},Jt.NewDomProxyView=function(t,s){return new kt(t,s)},Jt.sFrameCount=R,Jt.NativeConstant=Y,Jt.PageBase=j,Jt.ReactActivity=class extends j{constructor(t,s){super(t),this.hs=s.GetTextureManager()}GetTextureManager(){return this.hs}SetContentView(t,s){this.Ys=t,this.Xs=s}},Jt.ViewTextureMask=class extends St{constructor(t){super(),this.Bs="TEXTURE",this.ImageTexture=t}ToSyncJsonObj(t){return t||(t={}),t.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(t)}},Jt.ViewRoundCornerMask=class extends St{constructor(t,s,e,i){super(),this.Bs="CORNER",this.$s=t,this.Qs=isNaN(s)?t:s,this.Zs=isNaN(e)?t:e,this.te=isNaN(i)?t:i}ToSyncJsonObj(t){return t||(t={}),t.tl=this.$s,t.tr=this.Qs,t.bl=this.Zs,t.br=this.te,super.ToSyncJsonObj(t)}},Jt.sViewStore=yt,Jt.ViewInfo=class{constructor(t,s){this.view=t,this.layout_params=s}},Jt.LayoutView=gt,Jt.AutoStretchView=class extends gt{constructor(t=null){super(t)}CreateView(t){Nt.CreateNativeView(this.ViewId,12,t.DomDepends)}},Jt.EditControlView=class extends gt{constructor(s=null){super(s),this.se=null,this.ee=this.ie.bind(this),this.ne="_JscIme_"+this.ViewId,t.sRenderBridge.GetPlatformMsgDisp().subscribe(this.ne,this.ee)}CreateView(t){Nt.CreateNativeView(this.ViewId,5,t.DomDepends)}releaseResource(){t.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this.ne,this.ee)}setEditorStyle(t,s,e,i){this.k.CallToNative(5005,[t,s,e,i],this.J)}showIme(t,s,e,i,n){t!=bt.NONE?(void 0!==e&&null!=e||(e=s.length>0?s.length:0),e<0?e=0:e>s.length&&(e=s.length>0?s.length:0),this.k.CallToNative(5001,[t,encodeURIComponent(s),e,i,n],this.J)):console.log("showIme inputType error")}hideIme(){this.k.CallToNative(5002,null,this.J)}updateCursorOffset(t,s,e,i){this.k.CallToNative(5003,[t,s,e,i],this.J)}addImeEventListener(t){this.se=t}re(t){this.k.CallToNative(5006,[t],this.J)}ie(t){if(t){var s=JSON.parse(t);if("text"==s.type){var e=s.text;let t=s.selectStart,i=s.scrollLeft,n=s.scrollTop;this.se?.OnTextChanged(decodeURIComponent(e),t,i,n)}else if("vstatus"==s.type){let t=s.isVisible?1:0;this.re(t),this.se?.OnStatusChanged(t)}else if("action"==s.type){var i=s.action;this.se?.OnEditAction(i)}}else console.log("EditControlView","_ImeEventListener input_data error")}},Jt.FilterView=class extends gt{constructor(t=null,s){super(t),this.he=s??Ot.Type.GRAY_DOWN,this.k.CallToNative(10002,[this.he,[]],this.J)}CreateView(t){Nt.CreateNativeView(this.ViewId,10,t.DomDepends)}FilterSwitch(t){this.k.CallToNative(10001,[t],this.J)}AddWaveSourceList(t){if(this.he==Ot.Type.WAVE){const s={T:1,L:t.getSourceList()};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(t,s,e,i={type:Ot.Wave.CIRCLE_WAVE},n={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this.he==Ot.Type.WAVE){const r=new Tt,h=r.addSource(t,s,e,i,n);return this.AddWaveSourceList(r),h}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(t){if(this.he==Ot.Type.WAVE){const s={T:2,L:t instanceof Array?t:[t]};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(t,s){s&&this.k.CallToNative(10003,[t,s],this.J)}},Jt.FragShaderView=class extends gt{constructor(t=null){super(t)}CreateView(t){Nt.CreateNativeView(this.ViewId,11,t.DomDepends)}SetShaderInfo(t,s,e,i){const n={shaderStr:t,uniformParams:s,textureParams:e};let r=0;null!=i&&(r=c.AddData(i)),this.k.CallToNative(7001,[JSON.stringify(n),r],this.J)}},Jt.NativeSharedView=class extends gt{constructor(t){super(t),this.ae=window.JsvCoreApi.getJsContextId(),this.le=null,this.SetTrackId(this.ae+"_"+this.ViewId)}CreateView(t){Nt.CreateNativeView(this.ViewId,9,t.DomDepends)}GetTrackId(){return this.le}SetTrackId(t){this.le=t,this.k.CallToNative(10101,[this.le],this.J)}SetOverSize(t){this.k.CallToNative(10102,[isNaN(t)?0:t],this.J)}},Jt.NinePatchView=class extends gt{CreateView(t){Nt.CreateNativeView(this.ViewId,4,t.DomDepends)}SetRepeat(t,s){this.k.CallToNative(4001,[t,s],this.J)}SetPadding(t,s){this.k.CallToNative(4002,[t,s],this.J)}SetImageDspSize(t,s){this.k.CallToNative(4003,[t,s],this.J)}SetDesignMapWidth(t){this.k.CallToNative(4004,[t],this.J)}EnableAlphaMix(t){this.k.CallToNative(4005,[t.TexId],this.J)}},Jt.PreloadView=class extends gt{constructor(t=null){super(t)}CreateView(t){Nt.CreateNativeView(this.ViewId,7,t.DomDepends)}},Jt.SprayView=class extends gt{constructor(t=null){super(t),this.onStop=null}SetSprayInfo(t,s,e,i,n,r,h,a,l,o,u,c,d,p,f,S,y,v,w,m,N,x,g){this.k.CallToNative(6001,[t,s,e,i,n,r,h,a,l,o,u,c,d,p,!!f,!!S,!!y,v,w,m,N,x,g],this.J)}CreateView(t){Nt.CreateNativeView(this.ViewId,6,t.DomDepends)}Start(){this.k.CallToNative(6002,[],this.J)}Stop(t=!1){this.k.CallToNative(6003,[t],this.J)}RegisterOnStop(t){this.onStop=t}oe(t){try{if("onStop"===JSON.parse(t).type)this.onStop?.()}catch(t){console.error("SprayView onEvent error",t)}}RegisterEventListener(){const t=c.AddData(this.oe.bind(this));this.k.CallToNative(6004,[t])}},Jt.TextInputType=bt,Jt.FilterViewType=Ot,Jt.TextureSetting=wt,Jt.ExternalTextureSetting=wt,Jt.TextUtils=Vt,Jt.MetroWidgetBoxView=class extends gt{CreateView(t){Nt.CreateNativeView(this.ViewId,13,t.DomDepends)}SetEnable(t){this.k.CallToNative(10201,[t],this.J)}},Jt.MetroWidgetItemRootView=class extends gt{CreateView(t){Nt.CreateNativeView(this.ViewId,14,t.DomDepends)}SetIsFocus(t){this.k.CallToNative(10301,[t],this.J)}},Jt.VisibleSensor=class extends vt{constructor(t,s=null){super(),this.InitSet(t,s)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(t,s){let e=0;s&&(e=c.AddData((t,e,i,n)=>{s(1==t,1==e,1==i,1==n)})),this.Us.CallToNative(11,[t.ViewId,e],!0)}ResetArea(t){"number"!=typeof t.horizon&&(console.log("horizon not set, default to 1.0"),t.horizon=1),"number"!=typeof t.vertical&&(console.log("vertical not set, default to 1.0"),t.vertical=1),this.Us.CallToNative(12,[t.horizon,t.vertical],!0)}Enable(t){this.Us.CallToNative(13,[!!t],!0)}ResetContainer(t){let s;s=t?t.ViewId:0,this.Us.CallToNative(14,[s],!0)}},Jt.EnvBlockerSensor=class extends vt{constructor(t){super(),this.InitSet(t)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(t){this.Us.CallToNative(30,[t.ViewId],!0)}ResetTopGID(t){this.ue(0,t)}ResetBottomGID(t){this.ue(1,t)}ResetLeftGID(t){this.ue(2,t)}ResetRightGID(t){this.ue(3,t)}ue(t,s){this.Us.CallToNative(31,[t,isNaN(s)?0:parseInt(s)],!0)}Enable(t){this.Us.CallToNative(32,[t],!0)}},Jt.sImpactSensorManager=Rt,Jt.TextureInstantLoad=I,Jt.QRCodeLevel=g,Jt.ColorSpace=x,Jt.TextureManager=C,Jt.FreeMoveExternType=Q,Jt.AnimationListener=class{constructor(t,s,e){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=t,this.ce=t,t&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=s,this.pe=s,s&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=e,this.fe=e,e&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this.Se=null,this.InvokeAnimFinal=null,this.ye=null,this.ve=null,this.we=[]}OnStart(t){return this.InvokeAnimationStart=this.ce=t,t?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(t){return this.InvokeAnimationEnd=this.pe=t,t?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(t){return this.InvokeAnimRepeat=this.Se=t,t?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(t){return this.InvokeAnimFinal=this.ye=t,t?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(t){if(t){if(0==this.we.length){var s=this;this.InvokeAnimationStart=function(){s.ce&&s.ce();for(var t=0;t<s.we.length;t++)s.we[t].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(t){s.pe&&s.pe(t);for(var e=0;e<s.we.length;e++)s.we[e].InvokeAnimationEnd?.(t)},this.InvokeViewNoVisible=function(){s.fe&&s.fe();for(var t=0;t<s.we.length;t++)s.we[t].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(t){s.ye&&s.ye(t);for(var e=0;e<s.we.length;e++)s.we[e].InvokeAnimFinal?.(t)},this.InvokeAnimRepeat=function(t){s.Se&&s.Se(t);for(var e=0;e<s.we.length;e++)s.we[e].InvokeAnimRepeat?.(t)},this.ListenerEnabledFlags=31}this.we.push(t)}}InvokeFromNativeForge(t){switch(t.type){case"end":this.InvokeAnimationEnd?.(1==t.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(t.progress);break;case"repeat":this.InvokeAnimRepeat?.(t.timesCount)}}},Jt.AnimFireCommand=ht,Jt.AnimationEnable=rt,Jt.TranslateAnimation=class extends nt{constructor(t,s,e,i,n,r){super(),it.CreateTranslate(t,s,e,i,n,r,this.AnimNativeId)}},Jt.RotateAnimation=class extends nt{constructor(t,s,e,i,n,r){super(),it.CreateRotate(t,s,e,i,n,r,this.AnimNativeId)}},Jt.ScaleAnimation=class extends nt{constructor(t,s,e,i,n,r,h,a,l=200,o=200){super(),it.CreateScale(t,s,e,i,n,r,l,o,h,a,this.AnimNativeId)}},Jt.TranslateFrameAnimation=class extends nt{constructor(t,s,e,i,n,r){super();let h=Math.floor(100*e/55)/100;it.CreateTranslateFrame(t,s,h,h,i,n,r,this.AnimNativeId)}},Jt.CssKeyframeAnimation=class extends nt{constructor(t,s,e,i,n){super(),it.CreateCssKeyframe(t,s,e,i,n,this.AnimNativeId)}},Jt.ShaderAnimation=class extends nt{constructor(t,s){super(),it.CreateShaderAnimation(t,s,this.AnimNativeId)}},Jt.FreeMoveAnimation=class extends nt{constructor(t,s,e){super(),this.me=t,it.CreateFreeMoveAnimation(this.AnimNativeId,t,s,e)}},Jt.FreeMoveActEvtType=$,Jt.BezierEasing=dt,Jt.StepsEasing=class extends at{constructor(t,s){super(),this.Ne=t,this.he=s}Package(){var t=this.Ps(6);return t.St={S:this.Ne,T:this.he},t}},Jt.Easing=ft,Jt.FreeMoveCmdPackBuilder=class{static InitActCmdPack(t,s,e,i){return{t:1,cmds:i,tkn:isNaN(e)?0:e,spd:isNaN(t)?0:t,acc:isNaN(s)?0:s}}static InitStateCmdPack(t){return{t:2,cmd:t}}},Jt.FreeMoveConditionSet=class{static AppendSubCmd(t,s){const e="cmds";t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(t.hasOwnProperty(e)||(t[e]=[]),t[e]?.push(s))}static SetCmdList(t,s){s instanceof Array&&(t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):t.cmds=s)}static SetCmdPackList(t,s){s instanceof Array&&(t.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):t.cmdPacks=s)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(t,s,e,i,n){t.g=s??0,t.m=e??!1,t.s=i??null,t.brk=n}static ReachPosition(t,s,e){let i=X(t,s),n={subt:1,react:1,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static BoxPosition(t,s,e,i,n){let r=0,h=0,a=0,l=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(a=e,o|=4),isNaN(i)||(l=i,o|=8);let u={subt:1,react:7,de:o,lv:r,tv:h,rv:a,bv:l};return tt(u,n),u}static StartMove(t,s){return this.OnMovement(s,1,1,t)}static OnMovement(t,s,e,i){let n={subt:1,react:9,xv:s,yv:e,e:i};return tt(n,t),n}static OffsetPosition(t,s,e,i,n){let r=0,h=0,a=0,l=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(a=e,o|=4),isNaN(i)||(l=i,o|=8);let u={subt:1,react:8,de:o,lv:r,tv:h,rv:a,bv:l};return tt(u,n),u}static ReachSpeed(t,s,e){let i=X(t,s),n={subt:2,react:1,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static AcrossSpeed(t,s,e){let i=X(t,s),n={subt:2,react:2,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static SpeedAllBoundary(t,s,e,i,n){let r=0,h=0,a=0,l=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(e)||(a=e,o|=2),isNaN(s)||(h=s,o|=4),isNaN(i)||(l=i,o|=8);let u={subt:2,react:3,de:o,lv:r,rv:h,tv:a,bv:l};return tt(u,n),u}static TouchCount(t,s){let e={subt:5,react:2,tct:s};return tt(e,t),e}static OnNexusEvent(t,s,e){let i={subt:3,nexus:t,etyp:s};return tt(i,e),i}static OnDragStart(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActDragStart};return tt(e,t),e}static OnDragEnd(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActDragEnd};return tt(e,t),e}static OnTouchDown(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActTouchDown};return tt(e,t),e}static OnTouchRelease(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActTouchRelease};return tt(e,t),e}static OnFlingStart(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActFlingStart};return tt(e,t),e}static OnFlingProgress(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActFlingProgress};return tt(e,t),e}static OnMouseWheelScrollProgress(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActMouseWheelScrollProgress};return tt(e,t),e}static OnFlingEnd(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActFlingEnd};return tt(e,t),e}static OnFlingCancel(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActFlingCancel};return tt(e,t),e}static OnFlingDrop(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_ActFlingDrop};return tt(e,t),e}static OnHitBlock(t,s){let e={subt:4,blkGid:t};return tt(e,s),e}static OnNextTick(t,s){let e={subt:5,react:1,tgap:t};return s.m=!1,tt(e,s),e}static MovementSyncNexus(t,s){let e={subt:3,nexus:s,etyp:$.ActEvent_MovementSync};return tt(e,t),e}},Jt.FreeMoveActionBuilder=class{static SetSpeed(t,s){let e=X(t,s);return{typ:2,set:{xv:e.x,yv:e.y,xye:e.e}}}static ScaleSpeed(t,s){let e=X(t,s);return{typ:13,set:{xv:e.x,yv:e.y,xye:e.e}}}static SetAccel(t,s){let e=X(t,s);return{typ:7,set:{xye:e.e,xv:e.x,yv:e.y}}}static AltSpeed(t,s,e){if(!e)return null;let i=X(t,s);return{typ:5,set:{xv:i.x,yv:i.y,xye:i.e,tim:Math.floor(e)}}}static StopMoving(){return{typ:3}}static alignSpeed(){return{typ:12}}static BrakeToPos(t,s){let e=X(t,s);return{typ:4,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetArrowSpeed(t,s,e,i){let n=X(t,s),r=X(e,i);return{typ:6,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),xye1:r.e,xv1:r.x,yv1:r.y}}}static TeleportTo(t,s,e){let i=X(t,s);return{typ:8,set:{xye:i.e,xv:Math.floor(i.x),yv:Math.floor(i.y),isAbs:!e}}}static AckMovementSync(t,s,e,i,n,r){return{typ:10,set:{hstart:t,hend:s,vstart:e,vend:i,xye:n,st:r}}}},Jt.FreeMoveStateBuilder=class{static FireEcho(t){return{typ:52,set:{tkn:t}}}static FireNexusEvent(t,s){return isNaN(s)||0==s?null:{typ:55,set:{etyp:isNaN(t)?0:t,nexus:s}}}static NewCondition(t){return{typ:st,set:{sub:1,set:t}}}static DelActionAssocCondition(){return{typ:st,set:{sub:5}}}static RemoveAllCondtions(){return{typ:st,set:{sub:6}}}static RemoveByGroup(t){return{typ:st,set:{sub:4,gt:t}}}static RemoveByName(t){return{typ:st,set:{sub:7,sn:t}}}static ActiveCondition(t,s){return{typ:st,set:{sub:2,gt:isNaN(t)||t<=0?Q.GroupType_Invalid_Ext:t,sn:s}}}static DeactiveCondition(t,s){return{typ:st,set:{sub:3,gt:isNaN(t)||t<=0?Q.GroupType_Invalid_Ext:t,sn:s}}}static SetOffsetPos(t,s){let e=X(t,s);return{typ:53,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetAbsPos(t,s){let e=X(t,s);return{typ:54,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static AlignPosition(){return{typ:63}}static UpdateBaseOffset(t,s){let e=X(t,s);return{typ:64,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static TouchLockSwitch(t,s,e=-1){return{typ:59,set:{il:t,dir:s,ut:e}}}static SetTouchAttractChild(t){return{typ:60,set:{cid:t?t.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(t,s,e,i,n,r){return{typ:61,set:{hstart:s,hend:e,vstart:i,vend:n,xye:r,nexus:t}}}static StopMovementSync(){return{typ:62}}};var Ut={SetupEngineJs:async(t,s)=>{Jt.InitStarter(t,s)}};export{Ut as default};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var e=window.Forge;window.JsvCoreApi.setForgeJsHandle(e);class t{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")){let t=e.indexOf("(")+1,i=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,i).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=window.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==window.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=window.location.href;let e=window.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=window.location.origin+window.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let o=this.href,s=o.indexOf("#");s>0&&(this.hash=o.substring(s),o=o.substring(0,s));let n=o.indexOf("?");n>1&&(this.search=o.substring(n),o=o.substring(0,n));let r=o,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let h=a>1?r.substring(a+3):"";a=h.indexOf("/"),this.host=a>0?h.substring(0,a):"",this.pathname=a>=1?h.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=h),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class i{static SetBackgroundColor(t,i,o){const s=window.JsvCode.ForgeHandles.TextureManager.GetColorTextureCached(i);let n;o&&(n=new e.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight));const r=new e.ExternalTextureSetting(s,n);t.ResetTexture(r)}static SetBackgroundImage(i,o,s,n,r,a,h){let d,w={};if("string"==typeof o){const e=new t(o);if(e instanceof t==!1)throw Error("Bad Argument.",e);w.url=e.href}else"linear-gradient"==o?.type&&(w.gradient=o);if(w.gradient)if(w.gradient.colors?.length>2){const e=w.gradient.colors,t=[e[0],e[e.length-1]],i=e.slice(1,e.length-1);d=window.JsvCode.ForgeHandles.TextureManager.CreateLinearGradientTexture(t,i)}else 2==w.gradient.colors?.length?d=window.JsvCode.ForgeHandles.TextureManager.CreateMiniGradientTexture(!0,w.gradient.colors[0],w.gradient.colors[1],w.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",w.gradient.colors);else w.url&&(d=w.url.includes(".gif")||w.url.includes(".webp")?window.JsvCode.ForgeHandles.TextureManager.GetGifImage(w.url,!1,null,h):window.JsvCode.ForgeHandles.TextureManager.GetImage2(w.url,!1,r,a||e.ColorSpace.RGBA_8888));if(d){let t;s&&(t=new e.ViewRoundCornerMask(s.topLeft,s.topRight,s.bottomLeft,s.bottomRight));const o=new e.ExternalTextureSetting(d,t);if(i.ResetTexture(o),n){let e=d.RegisterLoadImageCallback(null,
|
|
1
|
+
/* eslint-disable */ if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var e=window.Forge;window.JsvCoreApi.setForgeJsHandle(e);class t{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")){let t=e.indexOf("(")+1,i=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,i).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=window.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==window.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=window.location.href;let e=window.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=window.location.origin+window.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let o=this.href,s=o.indexOf("#");s>0&&(this.hash=o.substring(s),o=o.substring(0,s));let n=o.indexOf("?");n>1&&(this.search=o.substring(n),o=o.substring(0,n));let r=o,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let h=a>1?r.substring(a+3):"";a=h.indexOf("/"),this.host=a>0?h.substring(0,a):"",this.pathname=a>=1?h.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=h),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class i{static SetBackgroundColor(t,i,o){const s=window.JsvCode.ForgeHandles.TextureManager.GetColorTextureCached(i);let n;o&&(n=new e.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight));const r=new e.ExternalTextureSetting(s,n);t.ResetTexture(r)}static SetBackgroundImage(i,o,s,n,r,a,h){let d,w={};if("string"==typeof o){const e=new t(o);if(e instanceof t==!1)throw Error("Bad Argument.",e);w.url=e.href}else"linear-gradient"==o?.type&&(w.gradient=o);if(w.gradient)if(w.gradient.colors?.length>2){const e=w.gradient.colors,t=[e[0],e[e.length-1]],i=e.slice(1,e.length-1);d=window.JsvCode.ForgeHandles.TextureManager.CreateLinearGradientTexture(t,i)}else 2==w.gradient.colors?.length?d=window.JsvCode.ForgeHandles.TextureManager.CreateMiniGradientTexture(!0,w.gradient.colors[0],w.gradient.colors[1],w.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",w.gradient.colors);else w.url&&(d=w.url.includes(".gif")||w.url.includes(".webp")?window.JsvCode.ForgeHandles.TextureManager.GetGifImage(w.url,!1,null,h):window.JsvCode.ForgeHandles.TextureManager.GetImage2(w.url,!1,r,a||e.ColorSpace.RGBA_8888));if(d){let t;s&&(t=new e.ViewRoundCornerMask(s.topLeft,s.topRight,s.bottomLeft,s.bottomRight));const o=new e.ExternalTextureSetting(d,t);if(i.ResetTexture(o),n){let e=d.RegisterLoadImageCallback(null,function(){n({width:d.Width,height:d.Height})});i.RegisterDetachCallback(()=>{d.UnregisterLoadImageCallback(e)})}}}static SetMaskedBackgroundImage(i,o,s,n){if("string"==typeof o&&(o=new t(o)),o instanceof t==!1)throw Error("Bad Argument.",o);if("string"==typeof s&&(s=new t(s)),s instanceof t==!1)throw Error("Bad Argument(MaskURL).",s);const r=window.JsvCode.ForgeHandles.TextureManager.GetImage2(o.href,!1,null,n||e.ColorSpace.RGBA_8888);if(r){const t=window.JsvCode.ForgeHandles.TextureManager.GetImage2(s.href,!1,null,e.ColorSpace.RGBA_8888),o=new e.ExternalTextureSetting(r,new e.ViewTextureMask(t));i.ResetTexture(o)}}}export{e as Forge,i as ForgeExtension};
|
|
2
2
|
|
|
@@ -10,6 +10,7 @@ const api_name_list = [
|
|
|
10
10
|
"EngineJs",
|
|
11
11
|
"UrlBuilder",
|
|
12
12
|
"Platform",
|
|
13
|
+
"ProcessType",
|
|
13
14
|
|
|
14
15
|
// apis
|
|
15
16
|
"loadRenderPlugin",
|
|
@@ -37,11 +38,15 @@ const api_name_list = [
|
|
|
37
38
|
"setAutoUriEncode",
|
|
38
39
|
"showUiCover",
|
|
39
40
|
"hideUiCover",
|
|
41
|
+
"AddSwappedOnceListener",
|
|
42
|
+
"RemoveSwappedOnceListener",
|
|
40
43
|
"simKeyEvent",
|
|
41
44
|
"reduceFps",
|
|
42
45
|
"enableFpsDisplay",
|
|
43
46
|
"addGlobalJsExceptionAck",
|
|
44
47
|
"removeGlobalJsExceptionAck",
|
|
48
|
+
"addModuleFailedAck",
|
|
49
|
+
"removeModuleFailedAck",
|
|
45
50
|
"toggleViewVisible",
|
|
46
51
|
"getScreenInfo",
|
|
47
52
|
"appendNetTraceHeaders",
|
|
@@ -49,7 +54,13 @@ const api_name_list = [
|
|
|
49
54
|
"setRenderGlobalConfig", // 原 setGlobalConfig
|
|
50
55
|
"setForgeJsHandle",
|
|
51
56
|
"logD",
|
|
52
|
-
"onMainTsDone"
|
|
57
|
+
"onMainTsDone",
|
|
58
|
+
"delayRemoveGLView",
|
|
59
|
+
"restoreGLView",
|
|
60
|
+
"setIdleFps",
|
|
61
|
+
"keepFpsHighPerf",
|
|
62
|
+
"setTextureMaxWaterLevel",
|
|
63
|
+
"base64ToLatinBytes"
|
|
53
64
|
];
|
|
54
65
|
|
|
55
66
|
export default function loadCoreApi() {
|