@shijiu/jsview 2.3.0 → 2.3.151-test.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-modules.min.js +1 -1
- package/dom/bin/{jsview-dom-browser-forge.1436.54c9.wasm → jsview-dom-browser-forge.1493.9a36.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-native.min.js +1 -1
- package/dom/target_core_revision.mjs +2 -2
- package/loader/jsv-core-api/wasm/core-api.js +2 -1
- package/package.json +1 -1
- package/tools/jsview-common.mjs +1 -0
- package/tools/jsview-post-build.mjs +33 -6
- package/tools/jsview-post-install.mjs +5 -0
|
@@ -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,d,u,v,m,f,g,p,w,y,T=window.Forge;window.JsvCoreApi.setForgeJsHandle(T);class N{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){N.PushLazyTask(N.TaskType.CreateElement,e,t)}static BindElementToRootView(e){N.PushLazyTask(N.TaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){N.PushLazyTask(N.TaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){N.PushLazyTask(N.TaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){N.PushLazyTask(N.TaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){N.PushLazyTask(N.TaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){N.PushLazyTask(N.TaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){N.PushLazyTask(N.TaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){N.PushLazyTask(N.TaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){N.PushLazyTask(N.TaskType.SetElementAttribute,e,t,s),N.LazyTaskSyncedListenerMap.has(e)&&N.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return N.RunSyncTask(N.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)),N.PushLazyTask(N.TaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){N.PushLazyTask(N.TaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){N.PushLazyTask(N.TaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){N.PushLazyTask(N.TaskType.SetStyleProperty,e,t,s),N.LazyTaskSyncedListenerMap.has(e)&&N.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return N.RunSyncTask(N.TaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){N.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){N.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==N.CachedLazyTaskList.length)return;const e=JSON.stringify(N.CachedLazyTaskList);N.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e),N.CachedLazyTaskAmount=0;for(const e of N.CachedSyncListenIdSet){const t=N.LazyTaskSyncedListenerMap.get(e);t?.()}N.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return N.RunSyncTask(N.TaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){N.PushLazyTask(N.TaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){N.PushLazyTask(N.TaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=N.RunSyncTask(N.TaskType.GetRelativePosition,e,t);return JSON.parse(s)}static SearchNextFocus(e,t){return N.RunSyncTask(N.TaskType.SearchNextFocus,e,t)}static GetLazyTaskAmount(){return 0}static RunSyncTask(e,t,...s){N.RequestSwapAllCachedTasks(),console.log("RunSyncTask()"+window.NativeMicroTime());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==N.TaskType.SetStyleProperty?i=2:e==N.TaskType.DeclareStyleSheets&&(i=3),N.CachedLazyTaskAmount+=i,N.CachedLazyTaskList.push([e,t,...s]),T.sRenderBridge?.RequestSwap()}}N.CachedLazyTaskAmount=0,N.CachedLazyTaskList=new Array,N.CachedSyncListenIdSet=new Set,N.LazyTaskSyncedListenerMap=new Map,N.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 D{}D.Dom=N,D.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class S{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}}S.UniqueId=0,S.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 E(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 I{static HasGetterMethod(e){switch(e){case I.Layout.Height:case I.Layout.Left:case I.Layout.Top:case I.Layout.Width:case I.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==I.Layout.Height?I.Layout.Height:e==I.Layout.Left?I.Layout.Left:e==I.Layout.Top?I.Layout.Top:e==I.Layout.Width?I.Layout.Width:e==I.Flex.FlexDirection?I.Flex.FlexDirection:e==I.Flex.FlexWrap?I.Flex.FlexWrap:e==I.Flex.JustifyContent?I.Flex.JustifyContent:e==I.Flex.AlignItems?I.Flex.AlignItems:e==I.Flex.AlignContent?I.Flex.AlignContent:e==I.Flex.AlignSelf?I.Flex.AlignSelf:e==I.Flex.FlexGrow?I.Flex.FlexGrow:e==I.Background.BackgroundColor?I.Background.BackgroundColor:e==I.Background.BackgroundImage?I.Background.BackgroundImage:e==I.Background.BorderRadius?I.Background.BorderRadius:e==I.Background.JsvImageBlendType?I.Background.JsvImageBlendType:e==I.Effect.BackfaceVisibility?I.Effect.BackfaceVisibility:e==I.Effect.BorderImage?I.Effect.BorderImage:e==I.Effect.BorderImageWidth?I.Effect.BorderImageWidth:e==I.Effect.BorderImageOutset?I.Effect.BorderImageOutset:e==I.Effect.Display?I.Effect.Display:e==I.Effect.ObjectFit?I.Effect.ObjectFit:e==I.Effect.Opacity?I.Effect.Opacity:e==I.Effect.Overflow?I.Effect.Overflow:e==I.Effect.Perspective?I.Effect.Perspective:e==I.Effect.PerspectiveOrigin?I.Effect.PerspectiveOrigin:e==I.Effect.Transform?I.Effect.Transform:e==I.Effect.TransformOrigin?I.Effect.TransformOrigin:e==I.Effect.TransformStyle?I.Effect.TransformStyle:e==I.Effect.Visibility?I.Effect.Visibility:e==I.Effect.ZIndex?I.Effect.ZIndex:e==I.Text.Color?I.Text.Color:e==I.Text.FontFamily?I.Text.FontFamily:e==I.Text.FontSize?I.Text.FontSize:e==I.Text.FontStyle?I.Text.FontStyle:e==I.Text.FontWeight?I.Text.FontWeight:e==I.Text.LineHeight?I.Text.LineHeight:e==I.Text.TextAlign?I.Text.TextAlign:e==I.Text.TextOverflow?I.Text.TextOverflow:e==I.Text.TextShadow?I.Text.TextShadow:e==I.Text.WebkitTextStroke?I.Text.WebkitTextStroke:e==I.Text.WhiteSpace?I.Text.WhiteSpace:e==I.Text.WordWrap?I.Text.WordWrap:e==I.Text.Direction?I.Text.Direction:e==I.Text.JsvTextEmoji?I.Text.JsvTextEmoji:e==I.Text.JsvTextLatex?I.Text.JsvTextLatex:e==I.Text.JsvTextAlignMinWidth?I.Text.JsvTextAlignMinWidth:e==I.Text.JsvTextVerticalAlign?I.Text.JsvTextVerticalAlign:e==I.Text.JsvTextLineAlign?I.Text.JsvTextLineAlign:e==I.Text.JsvTextInnerDirection?I.Text.JsvTextInnerDirection:e==I.Motion.Animation?I.Motion.Animation:e==I.Motion.Transition?I.Motion.Transition:e==I.Motion.AnimationFillMode?I.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}I.Layout=(E(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),I.Flex=(E(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),I.Background=(E(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),I.Effect=(E(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),I.Text=(E(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),I.Motion=(E(c=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),c.Animation="animation",c.Transition="transition",c.AnimationFillMode="animationFillMode",c);class x{constructor(e){let t=-1,s=null;null==e?t=x.DataType.Null:Number(e)===e&&e%1==0?t=x.DataType.Int32:Number(e)===e&&e%1!=0?t=x.DataType.Float:"string"==typeof e||e instanceof String?t=x.DataType.String:e instanceof x.AnimationImpl?t=x.DataType.Animation:e instanceof x.CornerImpl?t=x.DataType.Corner:e instanceof x.RectImpl?t=x.DataType.Rect:e instanceof x.TextShadowImpl?t=x.DataType.TextShadow:e instanceof x.WebkitTextStrokeImpl?t=x.DataType.WebkitTextStroke:e instanceof x.TransitionImpl?t=x.DataType.Transition:e instanceof x.BorderImageImpl&&(t=x.DataType.BorderImage),e!=x.InvalidInt32&&e!=x.InvalidFloat&&e!=x.InvalidPointer?s=e:(t=x.DataType.Null,s=null),this.data=new x.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case x.DataType.Null:return"";case x.DataType.Int32:case x.DataType.Float:return String(this.get());case x.DataType.String:e=this.get();break;case x.DataType.Animation:case x.DataType.Corner:case x.DataType.Rect:case x.DataType.TextShadow:case x.DataType.WebkitTextStroke:case x.DataType.Transition:case x.DataType.BorderImage:case x.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}}x.Base=class{constructor(e){this.rawValue=e}},x.AnimationImpl=class extends x.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},x.CornerImpl=class extends x.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},x.RectImpl=class extends x.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},x.TextShadowImpl=class extends x.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},x.WebkitTextStrokeImpl=class extends x.Base{constructor(e){super(e),this.length=0,this.color=void 0}},x.TransitionImpl=class extends x.Base{constructor(e){super(e),this.animationMap=new Map}},x.BorderImageImpl=class extends x.Base{constructor(e){super(e),this.source="",this.slice=null}},x.BackgroundImageImpl=(E(h=class extends x.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),x.DataType=(E(d=class{},"DataType"),d.Null=0,d.Int32=1,d.Float=2,d.String=3,d.Animation=4,d.Corner=5,d.Rect=6,d.TextShadow=7,d.WebkitTextStroke=8,d.Transition=9,d.BorderImage=10,d.BackgroundImage=11,d),x.InvalidInt32=Number.MIN_VALUE,x.InvalidFloat=Number.NaN,x.InvalidPointer=null,x.DataInfo=class{constructor(){this.value=null,this.index=-1}},E(u=class{},"Text"),u.Color="#000000",u.FontFamily="黑体",u.FontSize=10,u.FontStyle="normal",u.FontWeight="normal",u.LineHeight=0,u.TextAlign="start",u.TextOverflow="clip",u.TextShadow=null,u.WebkitTextStroke=null,u.WhiteSpace="normal",u.WordWrap="normal",u.Direction="ltr",u.JsvTextEmoji=0,u.JsvTextLatex=0,u.JsvTextAlignMinWidth=0,u.JsvTextVerticalAlign="top",u.JsvTextLineAlign="middle",u.JsvTextInnerDirection="unset",E(v=class{constructor(){this.height=x.InvalidInt32,this.left=x.InvalidInt32,this.top=x.InvalidInt32,this.width=x.InvalidInt32}},"Layout"),v.Name="layout",E(m=class{constructor(){this.flexDirection=x.InvalidInt32,this.flexWrap=x.InvalidInt32,this.justifyContent=x.InvalidInt32,this.alignItems=x.InvalidInt32,this.alignContent=x.InvalidInt32,this.alignSelf=x.InvalidInt32,this.flexGrow=x.InvalidFloat}},"Flex"),m.Name="flex",E(f=class{constructor(){this.backgroundColor=x.InvalidPointer,this.backgroundImage=x.InvalidPointer,this.borderRadius=x.InvalidPointer,this.JsvImageBlendType=x.InvalidInt32}},"Background"),f.Name="background",E(g=class{constructor(){this.backfaceVisibility=x.InvalidPointer,this.borderImage=x.InvalidPointer,this.borderImageWidth=x.InvalidPointer,this.borderImageOutset=x.InvalidPointer,this.display=x.InvalidPointer,this.objectFit=x.InvalidPointer,this.opacity=x.InvalidFloat,this.overflow=x.InvalidPointer,this.perspective=x.InvalidInt32,this.perspectiveOrigin=x.InvalidPointer,this.transform=x.InvalidPointer,this.transformOrigin=x.InvalidPointer,this.transformStyle=x.InvalidPointer,this.visibility=x.InvalidPointer,this.zIndex=x.InvalidInt32}},"Effect"),g.Name="effect",E(p=class{constructor(){this.color=x.InvalidPointer,this.fontFamily=x.InvalidPointer,this.fontSize=x.InvalidInt32,this.fontStyle=x.InvalidPointer,this.fontWeight=x.InvalidPointer,this.lineHeight=x.InvalidInt32,this.textAlign=x.InvalidPointer,this.textOverflow=x.InvalidPointer,this.textShadow=x.InvalidPointer,this.webkitTextStroke=x.InvalidPointer,this.whiteSpace=x.InvalidPointer,this.wordWrap=x.InvalidPointer,this.direction=x.InvalidPointer,this.jsvTextEmoji=x.InvalidInt32,this.jsvTextLatex=x.InvalidInt32,this.jsvTextAlignMinWidth=x.InvalidInt32,this.jsvTextVerticalAlign=x.InvalidPointer,this.jsvTextLineAlign=x.InvalidPointer,this.jsvTextInnerDirection=x.InvalidPointer}},"Text"),p.Name="text",E(w=class{constructor(){this.animation=x.InvalidPointer,this.transition=x.InvalidPointer,this.animationFillMode="none"}},"Motion"),w.Name="motion";class F{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),!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 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 k{static JsvDeclarePrototype(){for(let e in I){let t=I[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(k.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==I.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 F(t).href}else if(e==I.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new F(e[0]).href),t=e.join(" ")}else e==I.Effect.Display&&(this.cachedProps[e]=t);D.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==I.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=D.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class b extends t{constructor(e){super(e)}}!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"}(y||(y={}));class P extends C{static JsvEnableEventListener(){D.Dom.EnableEventListener((function(e,t,...s){let i=P.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!=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=S.GenerateId(),this.style=new k(this.jsvNativeId),D.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&&D.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),D.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),D.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=D.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=D.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?D.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?D.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&D.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&&D.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=S.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 y.Cancel:e.onCancel?.(s);break;case y.LongPress:e.onLongPress?.(s);break;case y.LongPressRelease:e.onLongPressRelease?.(s);break;case y.Click:e.onClick?.(s);break;case y.touchFirstStart:e.onTouchStart?.(s);break;case y.touchLastEnd:e.onTouchEnd?.(s);break;default:console.error("Error:onTap unknown type:"+t)}}))}jsvSetOnLazyTaskSyncedListener(e){D.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&&(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=T.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=T.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return D.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),D.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=P.JsvFindBackwardForgeView(t),D.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 P&&e.jsvNativeId>0&&(t=P.JsvFindBackwardForgeView(t),D.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(),D.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 L 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 M extends C{constructor(e){super(C.COMMENT_NODE),this.textContent=e}}class R extends P{constructor(){super(P.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},D.Dom.SetElementText(this.jsvNativeId,e)}}const j="FocusDebug",_="__AppRoot__";let O=1,A=!1,J=!1,B=!1,V=[];function W(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}function G(e,t){let s=W(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 K{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new z(!1,t))}enableFocusTrace(e){A=!0,J=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==_?"":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&&(s={askName:e,deepToChild:t,from:"setFocus",stack:J?new Error("simulate-stack").stack: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&&t instanceof U;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==_||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){if(U.sLastFocus){let e=U.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.")}}class z{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=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==_?"":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===_?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}_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)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?W(e):`NoFocus[focusSet:${this._FocusNodeName} notMountFocus:${this._FocusNameBeforeMount}]`}if(B){let i=this;return V.push((()=>{i.focusBeforeMount(e,t,s)})),!0}B=!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,n.Focus(!t);let e=n.GetFocusChild();for(;e;){let t=e.GetFocusChild();if(!t){this._FocusNodeName=e.BranchName;break}e=t}return A&&G(e??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,A&&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: 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{B=!1;let e=V.length;if(e>0){let t=O++;A&&console.log(j,`stash onFocus pop start(token=${t}) len=${e}`);let s=V;V=[];for(let t=0;t<e;t++)s[t]();A&&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 branch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class U extends T.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 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;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&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:J?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&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:J?new Error("simulate-stack").stack: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(){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&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:J?new Error("simulate-stack").stack:null,originFStack:"Mark2:"+W(this)},G(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]==_)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==_?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 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 $ extends t{constructor(e){super(e),this.keyCode=-1,this.key=-1,this.repeat=0,this.keyCode=-1,this.key=-1,this.repeat=0}}$.KeyCode={Enter:13,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};let q={};class X{constructor(e,t,s){this._AutoSearchFocus=!1,this._Element=s,q.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),q[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 $.KeyCode.ArrowLeft:case $.KeyCode.ArrowUp:case $.KeyCode.ArrowRight:case $.KeyCode.ArrowDown:const t=this.getHub().getCurrentFocusNode();if(t){const s=D.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){t=new F(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&D.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 Z 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 F(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 Q extends P{constructor(){super(P.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new F(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 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 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 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 oe extends C{constructor(){super(C.DOCUMENT_NODE),this.location=window.location,this.rootElement=new R,this.rootElement.ownerDocument=this,this.rootElement.id="root",D.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new M(e)}createElement(e){switch(e=e.toUpperCase()){case P.JsvTagName.Anchor:return new L;case P.JsvTagName.Div:return new R;case P.JsvTagName.Image:return new Y;case P.JsvTagName.Link:return new Z;case P.JsvTagName.Script:return new Q;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 Z||e instanceof Q)&&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}setHandles(e,t,s){this.TextureManager=e,this.RootActivity=s,this.RootView=t,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),D.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),D.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(),k.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=D.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=D.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ue),window.JsvCode.Dom.GetLazyTaskAmount||(window.JsvCode.Dom.GetLazyTaskAmount=D.Dom.GetLazyTaskAmount),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 fe{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 ge 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(){pe.DeclareDocument(),pe.DeclareOthers(),pe.DeclareAddition()}static DeclareDocument(){window.document=new ge}static DeclareOthers(){window.MutationObserver=fe,window.Element=P,window.SVGElement=te;let e=new F(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:F}}}class we{constructor(e){this.activity=new T.ReactActivity("NativeForgeActivity",e,null,null),this.init()}init(){console.log("create NativeForgeActivity.");let e=new T.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity);let t=null;T.DesignMap&&(t=T.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}),T.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{D.Dom.RequestSwapAllCachedTasks()}))}}class ye{constructor(e){this.activityManager=e;let t=new we(e);e.StartActivity(t.activity)}}window.jsvIsBrowserDebug=!1;const Te=window.JsvCode.NativePlatformDomBridge,Ne=window.JsvCode.NativePlatformMediaBridge;function De(){ve.EnsureGlobalEnv(Te,Ne),pe.DeclareGlobal(),me.I("Using JsView Native Environment.")}export{ye as ForgeAppClass,De 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,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};
|
|
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.S=!1,this.v=s,this.SuffSyncInfo=null,this.N=null,this.I=!1,this.InitPackage(e),this.RenewSyncInfo(this.u,null),this.RenewSyncInfo(this.v,null)}AddStartSyncCallback(t){this.u.AddStartSyncCallback(t)}CallToNative(s,e,i=!1){let n={fn:s,a:e};return i?(this.N.push(n),this.I||(this.v.AddToQueue(this,this.SuffSyncInfo),this.I=!0)):(this.p.push(n),this.S||(this.u.AddToQueue(this,this.PrefSyncInfo),this.S=!0)),t.sRenderBridge.RequestSwap(),n}RequestAlterId(t,s=!1){s?this.v.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.S=!1,this.I=!1,t&&t==this.u&&(this.p=[],this.PrefSyncInfo={tl:this.p,...s}),t&&t==this.v&&(this.N=[],this.SuffSyncInfo={tl:this.N,...s})}InitPackage(t){}OnAlterId(t){}}let l=new r,a=new r;class o extends h{constructor(t){super(l,a,{id:t}),this.R=null,this.C=t}InitPackage(t){this.C=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.C})}NeedAlterId(t,s){this.R=t,super.RequestAlterId(this.C,s)}OnAlterId(t){this.C=t,this.R.TexId=t,this.R=null}}let u=new class extends h{constructor(){super(l,a)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};let c=new class{constructor(){this.A=[1]}AddData(t){return this.A.push(t),this.A.length-1}TakeArray(){const t=this.A;return this.A=[1],t}PickArray(){return this.A}GetSize(){return this.A.length}ResetForNextSwap(){this.A=[1]}};let d=1;class p{constructor(t,s,e=!1){this.O=s,this.TexId=t,this.P=!1,this.k=0,this.D=0,this.G=null,this._={},this.F=e}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this.O.NeedAlterId(this,this.F)}RegisterLoadImageCallback(t,s,e){if(null==s)return 0;if(this.P)return s({width:this.k,height:this.D},e),0;{this.B();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.O.CallToNative(1,[t,r],this.F),t}}UnregisterLoadImageCallback(t){t>0&&void 0!==this._[t]&&delete this._[t]}DispatchCommand(s,e){this.O.CallToNative(3,[s,e],this.F),t.sRenderBridge.RequestSwap()}B(){if(null==this.G){const t=this;this.G=(s,e,i)=>{t.P=!0,t.k=s,t.D=e};const s=c.AddData(this.G);this.O.CallToNative(1,[d++,s],this.F)}}EnableBackgroundLoad(){this.P||(this.B(),this.O.CallToNative(4,null,this.F))}DisableBackgroundLoad(){this.O.CallToNative(5,null,this.F)}RequestToUnload(){this.O.CallToNative(6,null,this.F)}DisableAutoRecycle(){this.O.CallToNative(7,null,this.F)}}class f extends p{constructor(t,s,e=!1){super(t,s,e),this.V=null}registerOnStart(t){this.J();let s=this.V,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.O.CallToNative(10,[s.GlobalStartCallbackId,i],this.F)}return s.OnStartMap[e]=t,e}unregisterOnStart(t){if(!this.V)return;let s=this.V;s.OnStartMap.hasOwnProperty(t)&&s.StartMapCount--,0==s.StartMapCount&&0!=s.GlobalStartCallbackId&&(this.O.CallToNative(11,[s.GlobalStartCallbackId],this.F),s.GlobalStartCallbackId=0)}registerOnEnd(t){this.J();let s=this.V,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.O.CallToNative(12,[s.GlobalEndCallbackId,i],this.F)}return s.OnEndMap[e]=t,e}unregisterOnEnd(t){if(!this.V)return;let s=this.V;s.OnEndMap.hasOwnProperty(t)&&s.EndMapCount--,0==s.EndMapCount&&0!=s.GlobalEndCallbackId&&(this.O.CallToNative(13,[s.GlobalEndCallbackId],this.F),s.GlobalEndCallbackId=0)}J(){this.V||(this.V={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class y extends f{constructor(t,s){super(t,s,!0)}}let S=window.NativeGetIdGroupIntf();const v=10;class w{constructor(t){this.W=t,this.U=0,this.q=0,this.K=new Array(v),this.j=0;for(let t=0;t<v;t++)this.K[t]={start:0,end:0,expired:!0}}genId(){this.K[this.U].expired&&this.Y();let t=this.K[this.U],s=t.start;return t.start++,t.start>t.end&&(t.expired=!0,this.U=(this.U+1)%v,this.j--),s}Y(){let t=20*(v-this.j);if(t>0){let s=S.GetIdArray(this.W,t);if(s){let t=JSON.parse(s);this.X(t[0],t[1])}}}X(t,s){let e=s-t+1,i=Math.floor(e/20),n=t;for(let t=0;t<i;t++){let t=this.K[this.q];t.start=n,t.end=n+20-1,t.expired=!1,this.q=(this.q+1)%v,n=t.end+1}this.j+=i,this.j>v&&console.error(`team over size to ${this.j}`)}}let m=new class{constructor(){this.$=new w(0),this.Z=new w(1),this.et=new w(2),this.it=new w(3)}genViewId(){return this.$.genId()}genTextureId(){return this.Z.genId()}genAnimationId(){return this.et.genId()}genSensorId(){return this.it.genId()}};var N,x,g;!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}(x||(x={})),function(t){t.AUTO=0,t.SYNC=1,t.ASYNC=2}(g||(g={}));class I{constructor(){this.O=u}GetId(){return 0}GetColorTexture(t){let s=m.genTextureId();this.O.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 l=m.genTextureId(),a=0,u=0;e&&(a=e.width,u=e.height),n||(n=N.RGBA_8888),r||(r="");let c=null!=h&&h;this.O.CallToNative(2,[t,a,u,n,r,c,l]);let d=new p(l,new o(l));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(t,s,e,i=g.AUTO,n=x.Q,r="#ffffff",h="#000000",l=-1){let a=m.genTextureId();return this.O.CallToNative(3,[t,s,e,n,r,h,l,i,a]),new p(a,new o(a))}GetDownloadTexture(t,s,e){if(!t)return i("GetDownloadTexture, url is null!"),null;let n=m.genTextureId();return this.O.CallToNative(4,[t,s,e,n]),new p(n,new o(n))}GetDomProxyTexture(t){let s=m.genTextureId();return this.O.CallToNative(5,[t,s],!0),new y(s,new o(s))}GetCanvasTexture(t,s){let e=m.genTextureId();return this.O.CallToNative(6,[t,s,e],!1),new p(e,new o(e))}GetPluginTexture(t,s){let e=m.genTextureId();return this.O.CallToNative(7,[t,s,e],!1),new p(e,new o(e))}GetCapturedTexture(){let t=m.genTextureId();return this.O.CallToNative(8,[t],!1),new p(t,new o(t))}}let b=new class{constructor(){this.nt=1}get count(){return this.nt}update(){this.nt<Number.MAX_SAFE_INTEGER?++this.nt:this.nt=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.rt=t}InitPackage(t){this.rt=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.rt})}}let T=new r,E=new r;class P extends h{constructor(t){super(T,E,{id:t}),this.ht=t}InitPackage(t){this.ht=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.ht})}}let k=new class extends h{constructor(){super(T,E)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}},D=new r;class G extends h{constructor(t){super(null,D,{id:t}),this.lt=t}InitPackage(t){this.lt=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.lt})}}let L=new class extends h{constructor(){super(null,D)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};var _=null,F=null;class M{constructor(){this.ot={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.ct=new Map,this.dt=this.ft.bind(this),this.yt={hdl:null},this.St=!0,this.vt=-1,this.wt=!1,this.Nt=1,this.St=!1,this.xt(),this.It=!1,this.bt=[],this.Rt=1,this.Ct.OnScreenHide&&window.JsView?.onVisibilityChange((t=>{'{"status":"hide"}'===t&&this.Ct.OnScreenHide()}))}xt(){void 0!==global.NativeSendImpactSensorSyncData&&global.NativeSendImpactSensorSyncData.bind(this.yt),void 0!==global.NativeSetStepFpsSwitch&&(_=global.NativeSetStepFpsSwitch.bind(this.yt)),void 0!==global.NativeSetGlobalConfig&&(F=global.NativeSetGlobalConfig.bind(this.yt)),this.Ct=global.NativeGetRenderIntf(),this.Ct.RegisterSwapFunc((()=>{this.RequestSwap()})),this.At=this.At.bind(this),this.Ct.RegisterPreDomSyncFunc((()=>{this.Ot()})),this.Ct.RegisterOnScreenInfo(this.Tt.bind(this))}SetStepFpsSwitch(t){this.St?_&&_(t):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this.bt.push((()=>{this.SetStepFpsSwitch(t)})))}SetGlobalConfig(t){if(this.St){if(F){let s=JSON.stringify(t);console.log("SetGlobalConfig set with "+s),F(s),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this.bt.push((()=>{this.SetGlobalConfig(t)}))}Et(){if(this.bt.length>0){for(let t=0;t<this.bt.length;t++)this.bt[t]();this.bt=[]}}RequestSwap(){this.wt?this.Rt++:(this.wt=!0,this.Rt++,this.Nt++,this.Pt(this.Nt))}Pt(t){let s=this,e=this.Rt;Promise.resolve().then((()=>{e==s.Rt?s.InstantPerformSwap():t==this.Nt&&s.Pt(t)}))}NotifyNetTypeStatus(t,s){}EnableRequestSwap(t){this.It=t,this.Ct.EnableRequestSwap(t)}InstantPerformSwap(){this.wt&&(this.wt=!1,this.Nt++,this.At(!1))}kt(t,s,e,i,n){let r=null,h=null,l=null,a=null,o=null;if(t.HasUpdate()&&(l=t.ReadSyncList()),s.HasUpdate()&&(h=s.ReadSyncList()),e.HasUpdate()&&(r=e.ReadSyncList()),i?.HasUpdate()&&(a=i.ReadSyncList()),null==r&&null==h&&null==l&&null==a||(o=this.Ct.SyncForgeJsCall(JSON.stringify({TexSync:l,AnimSync:h,ViewSync:r,SensorSync:a}),n)),o){let s;this.wt=!1,s=JSON.parse(o).TexSyncRet,s&&this.Dt(t,s)}}Ot(){this.kt(l,R,T,null,c.PickArray())}At(t){if(!this.It)return void(this.wt=!1);b.update();let s=c.GetSize();if(this.kt(l,R,T,null,c.PickArray()),this.ct.size>0&&this.ct.forEach(this.dt),this.kt(a,C,E,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.wt=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this.Ct.DoRequestSwap(t)}GetScreenInfo(){return this.ot}SetForgeRtHandler(t){this.yt.hdl=t,this.St=!0,this.Ct.SetForgeRtHandler(t),this.Et()}InitScreenBuffer(t,s){isNaN(t)&&(t=1),isNaN(s)&&(s=1280);var e=s*t,i=e/16*9;this.ot.width=Math.floor(e),this.ot.height=Math.floor(i),this.ot.x=2/this.ot.width,this.ot.y=2/this.ot.height,this.ot.perspective=this.ot.x,this.ot.scaleRatio=t,this.ot.designedWidth=s}InitNativeScreenBuffer(){if(this.St){var t=JSON.stringify({displayScaleRatio:this.ot.scaleRatio,designedMapWidth:this.ot.designedWidth});this.Ct.InitScreenBuffer(t)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(t,s){this.Ct.SyncBackStatus(t,s)}TakeAndSyncBackStatus(){1==this.Ct.TakeAndSyncBackStatus()&&this.RequestSwap()}Tt(t,s,e,i,n){this.ot.width=t,this.ot.height=s,this.ot.x=e,this.ot.y=i,this.ot.perspective=n}HasPendingRenderBreak(){return!!this.St&&this.Ct.HasPendingRenderBreak()}FinishRenderBreak(t){this.St?this.Ct.FinishRenderBreak(t):(console.warn("FinishRenderBreak(): API link status no ready, delay"),this.bt.push((()=>{this.Ct.FinishRenderBreak(t)})))}AddWillSwapListener(t,s){this.ct.set(t,s)}AddSwappedOnceObserver(t){this.St?this.Ct.AddSwappedOnceObserver(t):(console.warn("AddSwappedOnceObserver(): API link status no ready, delay"),this.bt.push((()=>{this.Ct.AddSwappedOnceObserver(t)})))}ActiveComponent(t){this.St?this.Ct.ActiveComponent(t):(console.warn("ActiveComponent(): API link status no ready, delay"),this.bt.push((()=>{this.Ct.ActiveComponent(t)})))}ShutdownComponents(t){this.St?this.Ct.ShutdownComponents(t):(console.warn("ShutdownComponents(): API link status no ready, delay"),this.bt.push((()=>{this.Ct.ShutdownComponents(t)})))}SetPlatformMsgDisp(t){this.Gt=t}GetPlatformMsgDisp(){return this.Gt}GetTextToolsApi(){return this.Ct.TextToolApi}ft(t){t()}Dt(t,s){let e;e=s.idAlter,e&&t.ProcAlterIds(e.proxy,e.real)}}class B{constructor(){this.Lt=!1,this._t=0,this.Ft=!1,this.Mt=0,this.Bt=0,this.Vt=!1,this.Jt=!1,this.Wt=0,this.Ut=0,this.qt=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this.qt&&(this.Vt=!0,this.Ht())}SetTranslateDelay(t){B.sKeyTranslateDelay=t}CheckKey(t){if(!t.timeStamp||this.Lt)return!1;this.Ft=!0;const s=Date.now(),i=t.timeStamp;!this.Vt&&i-this._t>3e3&&(this.Mt=s,this.Bt=i,this._t=i);let n=s-this.Mt;(n<0||n>5e3)&&(this.qt?this.Ht():(this.Mt=s,this.Bt=i),n=0);return n+this.Bt-i>B.CONST_MAX_PASSING_GAP&&Math.abs(this.Ut-i)<B.CONST_MIN_VALID_KEY_GAP&&!t.repeat?(!this.Jt&&this.Vt&&(this.Wt++,this.Wt>50&&e("More than 50 keys are expired...")),!0):(this.Jt||(this.Jt=!0),this.Ut=i,!1)}toggleKeyGuard(){this.Lt=!this.Lt}IsActive(){return this.Ft}Ht(){this.Mt=Date.now(),this.Bt=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 l;if(this.Kt=null,this.zt=1280,this.jt=!1,this.Yt=0,l=4,console.log.bind(console),l>0&&console.error.bind(console),l>1&&(s=console.error.bind(console)),l>2&&(e=console.warn.bind(console)),l>3&&(i=console.log.bind(console)),l>4&&console.debug.bind(console),this.Xt=new I,this.Qt=new M,t.sRenderBridge=this.Qt,isNaN(h)&&(h=1280),this.zt=h,this.jt=!1,this.$t(n,r,h),this.Zt={keyProc:null,keyUpProc:null,activityStateProc:null},this.ts(this.Zt),this.ss(this.Zt),this.es=this.Qt.InstantPerformSwap.bind(this.Qt),null!=n){this.Yt=n.canvasNativeHandle;for(let t in this.Zt)n[t]=this.Zt[t]}t.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this.Xt}DelayedActivateCanvas(t){if(0==this.Yt){this.Yt=t.canvasNativeHandle,this.ns(t);for(let s in this.Zt)t[s]=this.Zt[s];this.Qt.InitNativeScreenBuffer(),this.Qt.RequestSwap()}else s("Error: already activated")}GetCanvasHandler(){return this.Yt}StartActivity(t){this.Kt=t}$t(t,s,e){this.ns(t),this.Qt.InitScreenBuffer(s,e),this.Qt.InitNativeScreenBuffer()}ns(t){null!=t&&(this.Qt.SetForgeRtHandler(t.frtNativeHandle),t.renderBridge=this.Qt,this.Qt.EnableRequestSwap(!0))}rs(t){if(this.jt)return!0;var s=!0;if(this.Kt){if(J.CheckKey(t))return console.log("keyEventGuard ignore keys"),!1;J.IsActive()&&this.Qt.InstantPerformSwap(),s=!this.Kt.DispatchKeyDown(t),this.Qt.TakeAndSyncBackStatus()}return s}hs(t){if(this.jt)return!0;var s=!0;return this.Kt&&(s=!this.Kt.DispatchKeyUp(t),this.Qt.TakeAndSyncBackStatus()),s}ts(t){t.keyProc=this.rs.bind(this),t.keyUpProc=this.hs.bind(this)}ss(t){let s=this;var e=function(t){var e=t.State;switch(console.log("ActivityStateListenerChanged, state:"+e),e){case"onActivityResumed":s.Qt.EnableRequestSwap(!0),s.Qt.InstantPerformSwap();break;case"onActivityPaused":s.Qt.EnableRequestSwap(!1)}}.bind(this);t.activityStateProc=e}}class U{constructor(){this.ls=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.ls=new W(t,e,s),q?q(this.ls):console.error("FATAL: no found entry")}getActivityManager(){return this.ls}}let q=null,H=null;class K{constructor(t){this.PageName=t,this.us=null,this.cs=null,this.SubPages=[],this.ds=null,this.jt=!1}OnRenderFrame(){s("OnRenderFrame() MUST override")}OnKeyDown(t){return!1}OnKeyUp(t){return!1}DispatchKeyDown(t){if(this.jt)return!0;let s=!1;return this.us&&(s=this.us.DispatchKeyDown(t)),s||(s=this.OnKeyDown(t)),s}OnCustomEvent(t){return!1}BubbleCustomEvent(t){this.OnCustomEvent(t)||this.ds&&this.ds.BubbleCustomEvent(t)}DispatchKeyUp(t){if(this.jt)return!0;let s=!1;return this.us&&(s=this.us.DispatchKeyUp(t)),s||(s=this.OnKeyUp(t)),s}PrintLastFocusPage(){let t="------"+this.PageName+"\n",s=this.ds;return s&&(t+=s.PrintLastFocusPage()),t}IsFocus(){return!this.ds||this.ds.us==this}ps(){return this.IsFocus()&&!this.us}SetParent(t){null!=t?(this.ds=t,t.SubPages.push(this)):n("ERROR: parent is null")}SetParentPage(t){this.SetParent(t)}OnRemoveFromTree(){if(this.ds=null,this.SubPages&&this.SubPages.length>0){for(let t of this.SubPages)t.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(t){t==this.us&&(this.us=null),t==this.cs&&(this.cs=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.us=null,this.cs=null}GetParentPage(){return this.ds}Focus(t=!1){if(this.IsFocus()){if(!t)return void i("requestFocus(): Already focused name="+this.PageName);if(this.ps())return void i("requestFocus(): Already focused name="+this.PageName)}if(this.ds){let s,e=[],i=this;for(;i.ds&&!i.IsFocus();)e.push(i),i=i.ds;s=t&&0==e.length?this.us:e[e.length-1].ds?.us;let r=[];for(;s;)r.push(s),s=s.us;for(let t=r.length-1;t>=0;t--)r[t].fs();for(let t=e.length-1;t>=0;t--)e[t].ys();if(t)this.cs=null;else{let t=e[0];for(;t.cs&&null==t.us;)t.cs.ys(),t=t.us,t||n("ERROR: focus chain is broken")}}}ReturnFocusToParent(){this.ds&&(this.IsFocus()&&this.ds.Focus(!0),this.ds.us==this&&(this.ds.us=null),this.ds.cs==this&&(this.ds.cs=null))}ys(){this.ds?(this.ds.us=this,this.ds.cs=this,this.OnFocus()):s("No dispatcher")}fs(){this.ds?this.ds.us==this?(this.ds.us=null,this.OnBlur()):e("Not focus yet, page name="+this.PageName):s("No dispacher")}GetFocusChild(){return this.us}OnFocus(){e("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){e("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this.jt=!0}UnKeyLock(){this.jt=!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.O=A}CreateTranslate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("translate animation duration invalid="+n),n=0),this.O.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.O.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,l,a,o,u){a!=1/0&&null!=a||(console.warn("scale animation duration invalid="+a),a=0),this.O.CallToNative(3,[t,s,e,i,n,r,h,l,a,tt(o),u])}CreateTranslateFrame(t,s,e,i,n,r,h,l){this.O.CallToNative(5,[t,s,e,i,!!n,r,h,l])}CreateCssKeyframe(t,s,e,i,n,r){s!=1/0&&null!=s||(console.warn("css animation duration invalid="+s),s=0),this.O.CallToNative(6,[t,s,e,i,n,r])}CreateFreeMoveAnimation(t,s,e,i){this.O.CallToNative(7,[t,s?c.AddData(s):0,e,i?1:0])}CreateShaderAnimation(t,s,e){this.O.CallToNative(8,[t,s,e])}};class et{constructor(){this.AnimNativeId=m.genAnimationId(),this.O=new O(this.AnimNativeId),this.Ss=null,this.vs=null}SetAnimationListener(t){this.ws(t)}AddAnimationListener(t){this.Ss&&t.AddInherit(this.Ss),this.ws(t)}RemoveAnimationListener(){this.Ss=null}Enable(t){this.O.CallToNative(2,[t])}EnableInfinite(){return this.O.CallToNative(3,null),this}SetRepeat(t){return this.O.CallToNative(5,[t]),this}EnableDelay(t){return this.O.CallToNative(4,[t]),this}SetStartPos(t){return t>=0&&t<=1?this.O.CallToNative(6,[t]):console.warn("Warning: SetStartPos() out of range"),this}ws(t){let s=!0;if(this.Ss&&(s=this.Ss.ListenerEnabledFlags==t.ListenerEnabledFlags),this.Ss=t,null!=this.Ss&&(null==this.vs||!s)){let t=this;this.vs=s=>{t.Ss?.InvokeFromNativeForge(s)};let s=c.AddData(this.vs);this.O.CallToNative(1,[s,this.Ss.ListenerEnabledFlags])}}}var it,nt;!function(t){t.ReleaseAfterEndCallback=1,t.KeepTransform=2,t.AckFinalProgress=4,t.AckRepeat=8}(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.Ns="COMMON"}Type(){return this.Ns}ToSyncJsonObj(t){return t||(t={}),t.typ=this.Ns,t}}let ht=new class{constructor(){this.xs={},this.gs=0}add(t){let s=t.view.ViewId;return this.xs.hasOwnProperty(s)&&(this.xs[s]=t),s}remove(t){this.xs[t]&&delete this.xs[t]}get(t){return this.xs[t]}clear(){this.xs={},this.gs=0}};class lt{constructor(){this.SensorId=m.genViewId(),this.Is=new G(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(t){L.CallToNative(1,[this.SensorId,t],!0)}Recycle(){this.Is.CallToNative(1,null,!0)}}class at{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 ot;!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}(ot||(ot={}));let ut=new class{constructor(){this.O=k}CreateNativeView(t,s,e){this.O.CallToNative(1,[t,s],e)}CreateJsRootView(t){this.O.CallToNative(2,[t])}CreateDomProxyView(t,s,e){this.O.CallToNative(3,[t,s,e?1:0],!0)}};class ct{constructor(t,s,e=!1){this.Visibility=void 0,this.O=new P(t),this.ViewId=t,this.TextureSetting=null,this.bs=null,this.F=e,this.Rs=null,this.CreateView(s)}CreateView(t=void 0){}ResetTexture(t=null){if(!this.bs){this.bs=this.O.CallToNative(1,null,this.F);let t=this;this.O.AddStartSyncCallback((()=>{this.TextureSetting?t.O.AlterCallParams(t.bs,[t.TextureSetting.ToSyncJsonObj()]):t.O.AlterCallParams(t.bs,[null]),t.bs=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.O.CallToNative(2,[s],this.F)}}AddView(t,s){let e={x:0,y:0,width:0,height:0};s&&(e=this.Cs(s)),this.O.CallToNative(3,[t.ViewId,s?1:0,e.x,e.y,e.width,e.height],this.F)}ClearViews(){this.O.CallToNative(4,null,this.F)}ResetTextureCssTransform(t,s){t=t||"",s=s||"",this.O.CallToNative(5,[t,s],this.F)}SetTextureCoord(t,s,e,i,n=ot.TextureCoordAnchor.Center){this.O.CallToNative(9,[t,s,e,i,n],this.F)}ResetLayoutParams(t){let s;null!=t?(s=this.Cs(t),this.O.CallToNative(6,[s.x,s.y,s.width,s.height],this.F)):n("ResetLayoutParams(): new params is null")}Cs(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.Rs&&(this.Rs=null),this.Rs=e=>{null!=this.Rs&&(this.Rs=null);const i=JSON.parse(e);0==i.status?t(i.data):s(i.error)};const e=c.AddData(this.Rs);this.O.CallToNative(12,[e],this.F)}))}StartAnimation(t,s,e){let i=t?t.AnimNativeId:0;this.O.CallToNative(7,[i,isNaN(e)?0:e],this.F)}StopAnimation(){this.O.CallToNative(8,null,this.F)}DispatchAnimCommand(t,s){this.O.CallToNative(13,[t,s],this.F)}StartTextureAnimation(t){let s=t?t.AnimNativeId:0;this.O.CallToNative(10,[s],this.F)}StopTextureAnimation(){this.O.CallToNative(11,null,this.F)}DragEnables(t){this.O.CallToNative(14,[t],this.F)}SetTapListener(t=void 0){if(null!=t){const s=c.AddData(t);this.O.CallToNative(15,[s],this.F)}else this.O.CallToNative(15,[0],this.F)}EnableAutoSize(){this.O.CallToNative(16,[],this.F)}RegisterFlexAssigned(t=void 0){if(null!=t){const s=c.AddData(t);this.O.CallToNative(17,[s],this.F)}else this.O.CallToNative(17,[0],this.F)}EnableVisibleTestRect(){this.O.CallToNative(18,[],this.F)}Capture2Texture(t,s=void 0){if(!t)return void console.error("Error: Capture2Texture need target texture");let e=t.GetTextureId();if(!s)return void console.error("Error: Capture2Texture need callback");const i=c.AddData(s);this.O.CallToNative(19,[e,i],this.F)}}class dt extends ct{constructor(t=null){!t||t instanceof at||n("ERROR:LayoutView need TextureSetting as parameter"),super(m.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",t&&this.ResetTexture(t)}CreateView(t){ut.CreateNativeView(this.ViewId,0,t.DomDepends)}}function pt(t){let s=[];if(t instanceof Array)for(let e of t)e instanceof ct&&s.push(e.ViewId);return s}class ft extends lt{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.Is.CallToNative(20,[t.ViewId,s.ViewId,n,i?i.SensorId:0],!0)}}let yt={StartTrace:(t,s,e,i)=>new ft(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 lt{constructor(t,s){super(),this.InitSet(),this.As(pt(t)),this.Os(pt(s)),this.Ts()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this.Is.CallToNative(25,null,!0)}UpdatePreImpactList(t){this.As(pt(t)),this.Ts()}UpdateOnImpactList(t){this.Os(pt(t)),this.Ts()}As(t){this.Is.CallToNative(26,[...t],!0)}Os(t){this.Is.CallToNative(27,[...t],!0)}Ts(){this.Is.CallToNative(28,null,!0)}}};var St;!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"}(St||(St={}));var vt,wt;!function(t){var s;(s=t.UniformType||(t.UniformType={}))[s.FLOAT=1]="FLOAT"}(vt||(vt={})),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"}(wt||(wt={}));let mt=0;class Nt{constructor(){this.sourceList=[]}addSource(t,s,e,i,n){i=i??{type:wt.Wave.CIRCLE_WAVE},n=n??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const r=++mt;let h=0,l=0,a=0;return i.type==wt.Wave.RECTANGLE_WAVE&&(h=i.width,l=i.height,a=i.radius),this.sourceList.push(r,t,s,e,h,l,a,n.timeDecay,n.distanceDecay,n.speed,n.frequency,n.waveNum),r}getSourceList(){const t=this.sourceList;return this.sourceList=[],t}}class xt extends ct{constructor(t,s){super(m.genViewId(),{DomElementId:t,UseMaskView:s},!0),this.Visibility="VISIBLE"}CreateView(t){ut.CreateDomProxyView(this.ViewId,t.DomElementId,t.UseMaskView)}RegisterOnProxyReady(t){t?.()}}function gt(t){return isNaN(t)?0:parseInt(t)}function It(t){return{fontFamily:t.fontFamily?t.fontFamily:Tt.sDefaultFont,fontSize:gt(t.fontSize),italic:"italic"===t.fontStyle,bold:"bold"===t.fontWeight,hasEmoji:1==t.JsvTextEmoji}}function bt(){return t.sRenderBridge.GetTextToolsApi()}function Rt(t,s){let e=It(s);return bt().GetTextWidth(t,JSON.stringify(e))}function Ct(t,s){let e=It(s);const i=bt().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 At(t,s,e,i,n,r){let h;if(t>0)h=bt().GetCursorPosition(t,s,null,null,null,1);else{let l=It(i),a=function(t){let s=gt(t.height),e=gt(t.lineHeight),i="string"==typeof t.wordWrap?t.wordWrap:"none";return"nowrap"==t.whiteSpace&&(i="none"),{width:gt(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=bt().GetCursorPosition(t,s,e,JSON.stringify(l),JSON.stringify(a),r?1:0)}return h}function Ot(t){bt().RemoveCursorTextCache(t)}var Tt;!function(t){t.sDefaultFont="黑体",t.sDefaultFontSize=30,t.sDefaultFontColor="#FFFFFF",t.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",t.GetTextWidth=Rt,t.GetOneLineTextDrawWidth=Ct,t.GetCursorPosition=At,t.RemoveCursorTextCache=Ot}(Tt||(Tt={}));let Et=t;Et.Run=function(t){return V=new U,V.Init(t),V},Et.InitStarter=function(s,e){t.DesignMap=e,q=s,H=e},Et.NewDomProxyView=function(t,s){return new xt(t,s)},Et.sFrameCount=b,Et.NativeConstant=z,Et.PageBase=K,Et.ReactActivity=class extends K{constructor(t,s){super(t),this.Xt=s.GetTextureManager()}GetTextureManager(){return this.Xt}SetContentView(t,s){this.Es=t,this.Ps=s}},Et.ViewTextureMask=class extends rt{constructor(t){super(),this.Ns="TEXTURE",this.ImageTexture=t}ToSyncJsonObj(t){return t||(t={}),t.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(t)}},Et.ViewRoundCornerMask=class extends rt{constructor(t,s,e,i){super(),this.Ns="CORNER",this.ks=t,this.Ds=isNaN(s)?t:s,this.Gs=isNaN(e)?t:e,this.Ls=isNaN(i)?t:i}ToSyncJsonObj(t){return t||(t={}),t.tl=this.ks,t.tr=this.Ds,t.bl=this.Gs,t.br=this.Ls,super.ToSyncJsonObj(t)}},Et.sViewStore=ht,Et.ViewInfo=class{constructor(t,s){this.view=t,this.layout_params=s}},Et.LayoutView=dt,Et.AutoStretchView=class extends dt{constructor(t=null){super(t)}CreateView(t){ut.CreateNativeView(this.ViewId,12,t.DomDepends)}},Et.EditControlView=class extends dt{constructor(s=null){super(s),this._s=null,this.Fs=this.Ms.bind(this),this.Bs="_JscIme_"+this.ViewId,t.sRenderBridge.GetPlatformMsgDisp().subscribe(this.Bs,this.Fs)}CreateView(t){ut.CreateNativeView(this.ViewId,5,t.DomDepends)}releaseResource(){t.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this.Bs,this.Fs)}setEditorStyle(t,s,e,i){this.O.CallToNative(5005,[t,s,e,i],this.F)}showIme(t,s,e,i,n){t!=St.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.O.CallToNative(5001,[t,encodeURIComponent(s),e,i,n],this.F)):console.log("showIme inputType error")}hideIme(){this.O.CallToNative(5002,null,this.F)}updateCursorOffset(t,s,e,i){this.O.CallToNative(5003,[t,s,e,i],this.F)}addImeEventListener(t){this._s=t}Vs(t){this.O.CallToNative(5006,[t],this.F)}Ms(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._s?.OnTextChanged(decodeURIComponent(e),t,i,n)}else if("vstatus"==s.type){let t=s.isVisible?1:0;this.Vs(t),this._s?.OnStatusChanged(t)}else if("action"==s.type){var i=s.action;this._s?.OnEditAction(i)}}else console.log("EditControlView","_ImeEventListener input_data error")}},Et.FilterView=class extends dt{constructor(t=null,s){super(t),this.Js=s??wt.Type.GRAY_DOWN,this.O.CallToNative(10002,[this.Js,[]],this.F)}CreateView(t){ut.CreateNativeView(this.ViewId,10,t.DomDepends)}FilterSwitch(t){this.O.CallToNative(10001,[t],this.F)}AddWaveSourceList(t){if(this.Js==wt.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:wt.Wave.CIRCLE_WAVE},n={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this.Js==wt.Type.WAVE){const r=new Nt,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.Js==wt.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.O.CallToNative(10003,[t,s],this.F)}},Et.FragShaderView=class extends dt{constructor(t=null){super(t)}CreateView(t){ut.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.O.CallToNative(7001,[JSON.stringify(n),r],this.F)}},Et.NativeSharedView=class extends dt{constructor(t){super(t),this.Ws=window.JsView?window.JsView.getJsContextId():0,this.Us=null,this.SetTrackId(this.Ws+"_"+this.ViewId)}CreateView(t){ut.CreateNativeView(this.ViewId,9,t.DomDepends)}GetTrackId(){return this.Us}SetTrackId(t){this.Us=t,this.O.CallToNative(10101,[this.Us],this.F)}SetOverSize(t){this.O.CallToNative(10102,[isNaN(t)?0:t],this.F)}},Et.NinePatchView=class extends dt{CreateView(t){ut.CreateNativeView(this.ViewId,4,t.DomDepends)}SetRepeat(t,s){this.O.CallToNative(4001,[t,s],this.F)}SetPadding(t,s){this.O.CallToNative(4002,[t,s],this.F)}SetImageDspSize(t,s){this.O.CallToNative(4003,[t,s],this.F)}SetDesignMapWidth(t){this.O.CallToNative(4004,[t],this.F)}EnableAlphaMix(t){this.O.CallToNative(4005,[t.TexId],this.F)}},Et.PreloadView=class extends dt{constructor(t=null){super(t)}CreateView(t){ut.CreateNativeView(this.ViewId,7,t.DomDepends)}},Et.SprayView=class extends dt{constructor(t=null){super(t),this.onStop=null}SetSprayInfo(t,s,e,i,n,r,h,l,a,o,u,c,d,p,f,y,S,v,w,m,N,x,g){this.O.CallToNative(6001,[t,s,e,i,n,r,h,l,a,o,u,c,d,p,!!f,!!y,!!S,v,w,m,N,x,g],this.F)}CreateView(t){ut.CreateNativeView(this.ViewId,6,t.DomDepends)}Start(){this.O.CallToNative(6002,[],this.F)}Stop(t=!1){this.O.CallToNative(6003,[t],this.F)}RegisterOnStop(t){this.onStop=t}qs(t){try{if("onStop"===JSON.parse(t).type)this.onStop?.()}catch(t){console.error("SprayView onEvent error",t)}}RegisterEventListener(){const t=c.AddData(this.qs.bind(this));this.O.CallToNative(6004,[t])}},Et.TextInputType=St,Et.FilterViewType=wt,Et.TextureSetting=at,Et.ExternalTextureSetting=at,Et.TextUtils=Tt,Et.VisibleSensor=class extends lt{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.Is.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.Is.CallToNative(12,[t.horizon,t.vertical],!0)}Enable(t){this.Is.CallToNative(13,[!!t],!0)}ResetContainer(t){let s;s=t?t.ViewId:0,this.Is.CallToNative(14,[s],!0)}},Et.EnvBlockerSensor=class extends lt{constructor(t){super(),this.InitSet(t)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(t){this.Is.CallToNative(30,[t.ViewId],!0)}ResetTopGID(t){this.Hs(0,t)}ResetBottomGID(t){this.Hs(1,t)}ResetLeftGID(t){this.Hs(2,t)}ResetRightGID(t){this.Hs(3,t)}Hs(t,s){this.Is.CallToNative(31,[t,isNaN(s)?0:parseInt(s)],!0)}Enable(t){this.Is.CallToNative(32,[t],!0)}},Et.sImpactSensorManager=yt,Et.TextureInstantLoad=g,Et.QRCodeLevel=x,Et.ColorSpace=N,Et.TextureManager=I,Et.FreeMoveExternType=X,Et.AnimationListener=class{constructor(t,s,e){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=t,this.Ks=t,t&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=s,this.zs=s,s&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=e,this.js=e,e&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this.Ys=null,this.InvokeAnimFinal=null,this.Xs=null,this.Qs=null,this.$s=[]}OnStart(t){return this.InvokeAnimationStart=this.Ks=t,t?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(t){return this.InvokeAnimationEnd=this.zs=t,t?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(t){return this.InvokeAnimRepeat=this.Ys=t,t?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(t){return this.InvokeAnimFinal=this.Xs=t,t?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(t){if(t){if(0==this.$s.length){var s=this;this.InvokeAnimationStart=function(){s.Ks&&s.Ks();for(var t=0;t<s.$s.length;t++)s.$s[t].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(t){s.zs&&s.zs(t);for(var e=0;e<s.$s.length;e++)s.$s[e].InvokeAnimationEnd?.(t)},this.InvokeViewNoVisible=function(){s.js&&s.js();for(var t=0;t<s.$s.length;t++)s.$s[t].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(t){s.Xs&&s.Xs(t);for(var e=0;e<s.$s.length;e++)s.$s[e].InvokeAnimFinal?.(t)},this.InvokeAnimRepeat=function(t){s.Ys&&s.Ys(t);for(var e=0;e<s.$s.length;e++)s.$s[e].InvokeAnimRepeat?.(t)},this.ListenerEnabledFlags=31}this.$s.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)}}},Et.AnimFireCommand=nt,Et.AnimationEnable=it,Et.TranslateAnimation=class extends et{constructor(t,s,e,i,n,r){super(),st.CreateTranslate(t,s,e,i,n,r,this.AnimNativeId)}},Et.RotateAnimation=class extends et{constructor(t,s,e,i,n,r){super(),st.CreateRotate(t,s,e,i,n,r,this.AnimNativeId)}},Et.ScaleAnimation=class extends et{constructor(t,s,e,i,n,r,h,l,a=200,o=200){super(),st.CreateScale(t,s,e,i,n,r,a,o,h,l,this.AnimNativeId)}},Et.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)}},Et.CssKeyframeAnimation=class extends et{constructor(t,s,e,i,n){super(),st.CreateCssKeyframe(t,s,e,i,n,this.AnimNativeId)}},Et.ShaderAnimation=class extends et{constructor(t,s){super(),st.CreateShaderAnimation(t,s,this.AnimNativeId)}},Et.FreeMoveAnimation=class extends et{constructor(t,s,e){super(),this.Zs=t,st.CreateFreeMoveAnimation(this.AnimNativeId,t,s,e)}},Et.FreeMoveActEvtType=Y,Et.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}}},Et.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,l=0,a=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(l=e,o|=4),isNaN(i)||(a=i,o|=8);let u={subt:1,react:7,de:o,lv:r,tv:h,rv:l,bv:a};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,l=0,a=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(l=e,o|=4),isNaN(i)||(a=i,o|=8);let u={subt:1,react:8,de:o,lv:r,tv:h,rv:l,bv:a};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}},Et.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}}}},Et.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 Pt={SetupEngineJs:async(t,s)=>{Et.InitStarter(t,s)}};export{Pt 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.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};
|
|
2
2
|
|
|
@@ -190,7 +190,7 @@ export default class WasmCoreApis {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
setRenderGlobalConfig(json) {
|
|
193
|
-
this._ForgeHandle?.SetGlobalConfig(json);
|
|
193
|
+
this._ForgeHandle?.sRenderBridge.SetGlobalConfig(json);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
setForgeJsHandle(forgeHandle) {
|
|
@@ -201,6 +201,7 @@ export default class WasmCoreApis {
|
|
|
201
201
|
console.log("onMainTsDone...");
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
// tag参数中以空格隔开每个tag
|
|
204
205
|
enableConsoleTag(tag) {
|
|
205
206
|
this.WasmExt.ForgeLogRef?.EnableTag(tag);
|
|
206
207
|
this.WasmExt.JseLogRef?.EnableTag(tag);
|
package/package.json
CHANGED
package/tools/jsview-common.mjs
CHANGED
|
@@ -240,6 +240,7 @@ function getOptions(framework)
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
+
options.distJsvConfigFile = path.resolve(options.distDir, 'jsv-config.json');
|
|
243
244
|
options.distJsvListFile = path.resolve(options.distDir, 'jsv-list.json');
|
|
244
245
|
options.distJsvInfoFile = path.resolve(options.distDir, 'jsv-info.json');
|
|
245
246
|
options.distJsIndexFile = path.resolve(options.distDir, 'index.html');
|